25 Commits
Author SHA1 Message Date
NyakoFox 4b9f26bf81 Solve render recaching issues
Past solutions were just "recache the screen textures under these known
circumstances" where whenever things OUTSIDE of those known
circumstances happened, the issue would reoccur.

I recently learned about an SDL event, `SDL_RENDER_TARGETS_RESET`,
which is for this exact problem. I ripped out all of the other places
`Screen::recacheTextures()` was called, and just slotted it in there,
and it worked perfectly.

...well, the old behavior worked perfectly; but the old behavior was
flawed as well, because it only checked for "ingame_titlemode" (if
you're in the main menu during gameplay) and forgot to check for the
map screen... plus, it didn't ever regenerate the minimap in custom
levels, which is another "persistant" render target.

Hopefully, this is the last time we'll ever have to think about this
one. I'm certainly sick of it.

This should 100% be backported into 2.4, as the bug occurs there as
well.
2026-04-12 09:09:49 -04:00
NyakoFox 6ed72297da Clamp editor mouse coordinates
The editor has never clamped mouse bounds, and instead relied on SDL to
return clamped mouse coordinates. Unfortunately, in #1140, this detail
was missed, and the behavior changed, allowing the cursor to leave the
bounds of the screen.

This isn't much of a problem most of the time because anything that
uses position as array indeces has bounds checks. Unfortunately,
placing entities outside of a room's bounds leads to entities you can't
ever touch ever again without modifying the level externally. This is
the worst with checkpoints, as pressing Enter in a room will now take
you to the out-of-bounds checkpoint, causing you to immediately wrap to
another room.

This fix should be backported to 2.4, as the issue can lead to level
files which need manual editing to fix!
2026-04-12 09:09:43 -04:00
NyakoFox cf66323721 Make sure special roomnames have enough text
There's another crash, which is indexing out of bounds if there's
not enough text. This adds simple bounds checks for them.
2026-02-16 11:43:24 -05:00
NyakoFox b708b8911c Fix empty roomnames potentially crashing the game
TinyXML2 seems to sometimes return NULL when an element has either no
text or whitespace, instead of returning an empty string. Why it does
this, I'm not sure, but I have recently learned from Dav999 that it
will crash the game. Great.
2026-02-16 11:43:17 -05:00
leo60228 30bdb47f80 Don't overwrite existing CMAKE_EXE_LINKER_FLAGS 2026-01-24 18:57:31 -05:00
Ethan Lee f22ae5fbf5 CMake: Use rpath, not runpath 2025-07-05 18:07:45 -04:00
Ethan Lee 529ff46eb2 2.4.3 2025-06-19 12:17:27 -04:00
Dav999 c9ad49a050 Fix vertical position of Comms Relay textbox
Fixes #1242.

Turns out it was a really simple fix - the X positions were good, but
the Y positions were always at the top of the screen regardless of the
height of the textbox. Now they're vertically centered respective to
the speaker.
2025-06-15 21:15:27 -04:00
Dav999 f4788a38de Update SheenBidi to 2.9.0
This fixes our problem with Valgrind reporting a jump based on an
uninitialized value; see https://github.com/Tehreer/SheenBidi/issues/19

Just to be sure nothing unexpected happens, I tested that this doesn't
cause any changes in behavior by outputting bidi-transformed versions
of all strings in strings.xml to a file for both our Arabic and Persian
localizations before and after the update, and confirming that the
files are the same.
2025-06-11 15:28:23 -04:00
Ethan Lee aa9fa04d86 CI: Update from CentOS 7 to Steam Linux Runtime 3.0 2025-06-08 22:51:59 -04:00
Dav999 a3c8d43f93 Apply translations for 2.4 strings
This includes translations that were missing translations, with varying
extent between different languages, for the following things:
- "X mode is enabled" in-game warnings
- "Press {button} to freeze/unfreeze gameplay" for the level debugger
- Some credits strings for the post-2.4.0 extra Spanish options, the
  PT_BR proofread, and Persian
- The recent gamepad menu changes (#1229)

Furthermore:
- "TAB" (used in the level debugger string) is now a separate string
  instead of being hardcoded, because some languages needed it
  translated
- Added missing arrows to Arabic/Persian font (needed for the gamepad
  menu, and also a translator menu actually)
2025-06-08 17:06:04 -04:00
NyakoFox cd785316b6 Fix mouse coordinates being wrong on HiDPI displays
When writing the initial stretch mode code, the existence of HiDPI
displays completely slipped my mind -- or at least I didn't realize
that they'd be a problem.

We implement scaling modes ourselves, so transforming the mouse
coordinates to our 320x240 viewport is done manually. Unfortunately,
that code did not take into account HiDPI scaling whatsoever, meaning
that all of the math which assumes the window size and the renderer
size is wrong.

To fix this, we use `SDL_GetWindowSizeInPixels` and `SDL_GetWindow` to
find the scaling factor, and then apply that to the mouse coordinates
to get the mouse coordinates in the pixel-space instead, and then we do
all of our normal logic after.

Due to our usage of `SDL_GetWindowSizeInPixels`, this bumps the minimum
SDL version to 2.26.0.

Closes #1235.
2025-05-03 15:15:38 -04:00
Dav999 53bb45e01d Sync new gamepad strings into all language files
Also including all the localizations I already have right now.
2025-05-03 14:09:30 -04:00
Dav999 3320ee5962 Add check for converting negative SDL_GameControllerButton to glyph
A SDL_GameControllerButton below 0 is out of array bounds, so that
should trip the assert and return GLYPH_UNKNOWN just like when the
value is too high.
2025-05-03 14:09:30 -04:00
Dav999 f715897fdd Add confirmation and removal to bindings menu
This makes the following improvements to the gamepad bindings menu:

- The menu now shows a hint that you can press a button while any of
  the bind options are selected (or that you can navigate away from
  those options)
- Instead of button presses immediately setting a binding, they now
  ask for confirmation: press the same button a second time to confirm
- You can now remove a binding, the same way you add it (this has the
  same type of confirmation)
- This menu used to be inconsistent with pretty much every other menu
  in the game by showing a permanent title and description for the menu
  itself ("Game Pad", "Change controller options.") rather than showing
  a title and description for the currently selected option.
  This inconsistency is now fixed.
2025-05-03 14:09:30 -04:00
Dav999 1fc02463e8 Update name of Arabic/Persian font
The level font menu now shows both names, since the font is used for
both Arabic and Persian.
2025-05-02 22:32:29 -04:00
Dav999 6ed20aad06 Add new strings for Persian
New strings were delivered already today, so let's add them immediately
in this PR so we have a little less on our checklist later!
2025-05-02 22:32:29 -04:00
Dav999 3930f89247 Fix save summary sometimes getting misordered in Arabic
The Persian localizers noticed an issue where the translation for
"Dimension VVVVVV, 12:34:56" would become "VVVVVV, 12:34:56 noisnemiD",
rather than "12:34:56 ,VVVVVV noisnemiD" as expected. This was fixed
for Persian but the same issue also affected Arabic, so I added a
RIGHT-TO-LEFT MARK (U+200F) to fix it there as well.
2025-05-02 22:32:29 -04:00
Dav999 5dd2270139 Sync language files
This adds "Persian" to all the languages, and brings the Persian files
up-to-date (mainly removing outdated strings and adding some late 2.4
stuff that we'll contact all translators for soon)
2025-05-02 22:32:29 -04:00
Dav999 b921ffbedc Add Persian to credits screen 2025-05-02 22:32:29 -04:00
Dav999 ed2e5bf73e Add files for Persian localization
A bit overdue since this was delivered a few weeks ago (oops),
but here it is!

Thanks to Amir Arzani and Masoud Varaste.
2025-05-02 22:32:28 -04:00
Dav999 4deba1a3a8 Change name of Silesian option (part 2)
Turns out there was a little miscommunication with the translator -
they said the option needed to say "Ślōnsko" but were only talking
about correcting the first word, where I thought the whole thing needed
to be replaced.
2025-02-18 10:38:04 -05:00
Dav999 3b78251e47 Change name of Silesian option by request of translator
Our Silesian translator asked for "Ślonsko godka" to be changed to
"Ślōnsko".
2025-02-05 11:05:18 -05:00
Dav999 e72d59de56 Fix squeak and save spam in gamepad menu
If you push a button to set a controller binding, you may either hear
one Viridian squeak, two Viridian squeaks (a louder one), or Viridian
doesn't stop squeaking until you let go of the button. While you hear
the continuous squeaking, your save file is also repeatedly saved.

There are two small bugs at play here:
- the squeak is actually played in two different places at the same
  time (both in titleinput() whenever a button is pressed, and in
  updatebuttonmappings() when a mapping is succesfully changed)
- titleinput() doesn't register that a button is held down and applies
  the button (and saves to file) every frame for as long as the button
  is held

This commit fixes both these issues. Now a single button press always
causes one squeak, and only if the bindings actually changed. Your save
file is also no longer saved repeatedly from holding down the button.
2024-12-22 15:53:27 -05:00
NyakoFox 25dd9d56ad Make 0-length gravity lines invisible again 2024-11-17 11:46:55 -05:00
112 changed files with 1608 additions and 3415 deletions
+81
View File
@@ -0,0 +1,81 @@
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.28.5
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.28.5/SDL2-2.28.5.aar -DpomFile=build-android-prefab/prefab-2.28.5/SDL2-2.28.5.pom
- name: Build
run: |
cd ${SRC_DIR_PATH}
./gradlew build
+33 -40
View File
@@ -20,14 +20,6 @@ on:
- "third_party/**" - "third_party/**"
- ".github/workflows/ci.yml" - ".github/workflows/ci.yml"
permissions:
contents: read
statuses: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env: env:
SRC_DIR_PATH: desktop_version SRC_DIR_PATH: desktop_version
@@ -40,31 +32,19 @@ jobs:
env: env:
CXXFLAGS: -I/usr/local/include/SDL2 CXXFLAGS: -I/usr/local/include/SDL2
LDFLAGS: -L/usr/local/lib LDFLAGS: -L/usr/local/lib
HOMEBREW_NO_ENV_HINTS: 1 # Suppress brew update hints
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v1
with: with:
submodules: true 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
- name: Install dependencies - name: Install dependencies
if: steps.cache-brew.outputs.cache-hit != 'true'
run: brew install ninja sdl2 run: brew install ninja sdl2
- name: CMake configure (default version) - name: CMake configure (default version)
run: | run: |
mkdir -p ${SRC_DIR_PATH}/build && cd ${SRC_DIR_PATH}/build mkdir ${SRC_DIR_PATH}/build && cd ${SRC_DIR_PATH}/build
cmake -G Ninja .. cmake -GNinja ..
- name: Build (default version) - name: Build (default version)
run: ninja -C ${SRC_DIR_PATH}/build run: ninja -C ${SRC_DIR_PATH}/build
@@ -90,30 +70,31 @@ jobs:
container: registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest container: registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v1
with: with:
submodules: true submodules: true
- name: CMake configure (default version) - name: CMake configure (default version)
run: | run: |
mkdir -p ${SRC_DIR_PATH}/build && cd ${SRC_DIR_PATH}/build mkdir ${SRC_DIR_PATH}/build && cd ${SRC_DIR_PATH}/build
cmake -G Ninja .. cmake ..
- name: Build (default version) - name: Build (default version)
run: ninja -C ${SRC_DIR_PATH}/build run: make -j $(nproc) -C ${SRC_DIR_PATH}/build
- name: CMake configure (official) - name: CMake configure (official)
run: | run: |
cd ${SRC_DIR_PATH}/build cd ${SRC_DIR_PATH}/build
cmake -G Ninja -DOFFICIAL_BUILD=ON .. cmake -DOFFICIAL_BUILD=ON ..
- name: Build (official) - name: Build (official)
run: ninja -C ${SRC_DIR_PATH}/build run: |
make -j $(nproc) -C ${SRC_DIR_PATH}/build
- name: CMake configure (M&P) - name: CMake configure (M&P)
run: | run: |
cd ${SRC_DIR_PATH}/build cd ${SRC_DIR_PATH}/build
cmake -G Ninja -DOFFICIAL_BUILD=OFF -DMAKEANDPLAY=ON .. cmake -DOFFICIAL_BUILD=OFF -DMAKEANDPLAY=ON ..
- name: Build (M&P) - name: Build (M&P)
run: ninja -C ${SRC_DIR_PATH}/build run: make -j $(nproc) -C ${SRC_DIR_PATH}/build
build-win: build-win:
name: Build (windows-latest) name: Build (windows-latest)
@@ -121,10 +102,10 @@ jobs:
runs-on: windows-latest runs-on: windows-latest
env: env:
SDL_VERSION: 3.4.0 SDL_VERSION: 2.26.0
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v1
with: with:
submodules: true submodules: true
@@ -134,23 +115,35 @@ jobs:
env: env:
cache-name: cache-sdl cache-name: cache-sdl
with: with:
path: C:\SDL3-* path: C:\SDL2-*
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.SDL_VERSION }} key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.SDL_VERSION }}
- if: ${{ steps.cache-windows-sdl.outputs.cache-hit != 'true' }} - if: ${{ steps.cache-windows-sdl.outputs.cache-hit != 'true' }}
name: Download SDL if not cached name: Download SDL if not cached
run: | run: |
Invoke-WebRequest "https://github.com/libsdl-org/SDL/releases/download/release-$env:SDL_VERSION/SDL3-devel-$env:SDL_VERSION-VC.zip" -OutFile C:\SDL.zip 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:\ Expand-Archive C:\SDL.zip -DestinationPath C:\
- name: CMake initial configure/generate - name: Cache build folder for this CMakeLists.txt
id: cache-windows-build-folder
uses: actions/cache@v3
env:
cache-name: cache-windows-build-folder-VS2022
with:
path: |
desktop_version/build
desktop_version/CMakeLists.txt
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('desktop_version/CMakeLists.txt') }}-SDL${{ env.SDL_VERSION }}
- if: ${{ steps.cache-windows-build-folder.outputs.cache-hit != 'true' }}
name: CMake initial configure/generate
run: | run: |
mkdir $env:SRC_DIR_PATH/build mkdir $env:SRC_DIR_PATH/build
cd $env:SRC_DIR_PATH/build cd $env:SRC_DIR_PATH/build
$env:LDFLAGS = "/LIBPATH:C:\SDL3-$env:SDL_VERSION\lib\x86 " $env:LDFLAGS = "/LIBPATH:C:\SDL2-$env:SDL_VERSION\lib\x86 "
cmake -G "Visual Studio 18 2026" -A Win32 ` cmake -G "Visual Studio 17 2022" -A Win32 `
-DSDL3_INCLUDE_DIRS="C:\SDL3-$env:SDL_VERSION\include" ` -DSDL2_INCLUDE_DIRS="C:\SDL2-$env:SDL_VERSION\include" `
-DSDL3_LIBRARIES="SDL3" .. -DSDL2_LIBRARIES="SDL2;SDL2main" ..
- name: CMake configure (default version) - name: CMake configure (default version)
run: | run: |
-2
View File
@@ -21,7 +21,5 @@ Last updated on January 23rd, 2024.
| 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)| | 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)| | 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) | | 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) | | 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/) | | 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/) |
| Super Gravitron for the Pebble smart watch | [Eli Weiss](https://www.eli-weiss.com/) | Port of Super Gravitron for the Pebble smart watch, based on VVVVVV source code. | Cannot distribute the original levels. | [github](https://github.com/eliwss0/super-gravitron-pebble), [pebble appstore](https://apps.repebble.com/30755d3528b34509bb0b5107) |
+1 -1
View File
@@ -4,7 +4,7 @@ This is the source code to VVVVVV, the 2010 indie game by [Terry Cavanagh](http:
The source code for the desktop version is in [this folder](desktop_version). The source code for the desktop version is in [this folder](desktop_version).
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. VVVVVV is still commerically 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. Discussion about VVVVVV updates mainly happens on the "unofficial" [VVVVVV discord](https://discord.gg/Zf7Nzea), in the `vvvvvv-code` channel.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 287 KiB

@@ -1,14 +0,0 @@
{
"images" : [
{
"filename" : "AppIcon.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -1,6 +0,0 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
+69 -116
View File
@@ -3,8 +3,6 @@
cmake_minimum_required(VERSION 2.8.12...3.5) cmake_minimum_required(VERSION 2.8.12...3.5)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# CMake Options # CMake Options
option(ENABLE_WARNINGS "Enable compilation warnings" ON) option(ENABLE_WARNINGS "Enable compilation warnings" ON)
option(ENABLE_WERROR "Treat compilation warnings as errors" OFF) option(ENABLE_WERROR "Treat compilation warnings as errors" OFF)
@@ -18,20 +16,16 @@ 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) option(MAKEANDPLAY "Compile a version of the game without the main campaign (provided for convenience; consider modifying MakeAndPlay.h instead" OFF)
option(WINXP "Compile with Windows XP support. You must set your toolkit version to v141_xp for this to work." OFF) if(OFFICIAL_BUILD AND NOT MAKEANDPLAY)
set(STEAM ON)
if(OFFICIAL_BUILD) set(GOG ON)
set(WINXP ON)
if(NOT MAKEANDPLAY)
set(STEAM ON)
set(GOG ON)
endif()
endif() 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) 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)
# Architecture Flags # Architecture Flags
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") if(APPLE)
# Wow, Apple is a huge jerk these days huh? # 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) 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(NOT CMAKE_OSX_SYSROOT)
@@ -44,8 +38,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9) set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9)
link_directories(/usr/local/lib) link_directories(/usr/local/lib)
add_compile_options(-Werror=partial-availability) 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
endif() endif()
project(VVVVVV) project(VVVVVV)
@@ -56,19 +48,16 @@ endif()
# RPATH # RPATH
if(NOT WIN32) if(NOT WIN32)
if(CMAKE_SYSTEM_NAME STREQUAL "iOS") if(APPLE)
set(BIN_RPATH "@executable_path/Frameworks") set(BIN_LIBROOT "osx")
elseif(APPLE)
set(BIN_RPATH "@executable_path/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 "${CMAKE_EXE_LINKER_FLAGS} -Wl,--disable-new-dtags")
else() else()
SET(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} "-Wl,--disable-new-dtags") set(BIN_LIBROOT "lib")
set(BIN_RPATH "\$ORIGIN/lib")
if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
# Naming quirk for backward compatibility
SET(BIN_RPATH "\$ORIGIN/lib64")
else()
SET(BIN_RPATH "\$ORIGIN/lib${CMAKE_SYSTEM_PROCESSOR}")
endif()
endif() endif()
set(CMAKE_SKIP_BUILD_RPATH TRUE) set(CMAKE_SKIP_BUILD_RPATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
@@ -132,7 +121,7 @@ set(VVV_C_SRC
src/VFormat.c src/VFormat.c
src/Vlogging.c src/Vlogging.c
src/Xoshiro.c src/Xoshiro.c
../third_party/physfs/extras/physfssdl3.c ../third_party/physfs/extras/physfsrwops.c
) )
if(STEAM) if(STEAM)
list(APPEND VVV_C_SRC src/SteamNetwork.c) list(APPEND VVV_C_SRC src/SteamNetwork.c)
@@ -140,9 +129,6 @@ endif()
if(GOG) if(GOG)
list(APPEND VVV_C_SRC src/GOGNetwork.c) list(APPEND VVV_C_SRC src/GOGNetwork.c)
endif() 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}) set(VVV_SRC ${VVV_CXX_SRC} ${VVV_C_SRC})
@@ -151,30 +137,6 @@ if(WIN32)
add_executable(VVVVVV WIN32 ${VVV_SRC} icon.rc) add_executable(VVVVVV WIN32 ${VVV_SRC} icon.rc)
elseif(ANDROID) elseif(ANDROID)
add_library(VVVVVV SHARED ${VVV_SRC}) 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()
else() else()
add_executable(VVVVVV ${VVV_SRC}) add_executable(VVVVVV ${VVV_SRC})
endif() endif()
@@ -226,7 +188,7 @@ set(FAUDIO_SRC
../third_party/FAudio/src/FAudio_internal.c ../third_party/FAudio/src/FAudio_internal.c
../third_party/FAudio/src/FAudio_internal_simd.c ../third_party/FAudio/src/FAudio_internal_simd.c
../third_party/FAudio/src/FAudio_operationset.c ../third_party/FAudio/src/FAudio_operationset.c
../third_party/FAudio/src/FAudio_platform_sdl3.c ../third_party/FAudio/src/FAudio_platform_sdl2.c
) )
set(PFS_SRC set(PFS_SRC
../third_party/physfs/src/physfs.c ../third_party/physfs/src/physfs.c
@@ -246,7 +208,6 @@ if(APPLE)
set(PFS_SRC ${PFS_SRC} ../third_party/physfs/src/physfs_platform_apple.m) set(PFS_SRC ${PFS_SRC} ../third_party/physfs/src/physfs_platform_apple.m)
endif() endif()
set(PNG_SRC src/lodepng_wrapper.c) set(PNG_SRC src/lodepng_wrapper.c)
set(PNG_DEF -DLODEPNG_NO_COMPILE_ALLOCATORS -DLODEPNG_NO_COMPILE_DISK)
set(CHM_SRC ../third_party/c-hashmap/map.c) set(CHM_SRC ../third_party/c-hashmap/map.c)
set(SBIDI_SRC ../third_party/SheenBidi/Source/SheenBidi.c) set(SBIDI_SRC ../third_party/SheenBidi/Source/SheenBidi.c)
@@ -320,15 +281,17 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(VVVVVV PRIVATE -Wno-c99-extensions) target_compile_options(VVVVVV PRIVATE -Wno-c99-extensions)
endif() endif()
# Set standards version, disable exceptions and RTTI
if(MSVC) if(MSVC)
# MSVC doesn't have /std:c99 or /std:c++98 switches! # MSVC doesn't have /std:c99 or /std:c++98 switches!
# MSVC does not officially support disabling exceptions, # MSVC does not officially support disabling exceptions,
# so this is as far as we are willing to go to disable them. # 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(REGEX REPLACE "/EH[a-z]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set_source_files_properties(${VVV_CXX_SRC} PROPERTIES COMPILE_FLAGS /EHsc)
# Disable RTTI
string(REPLACE "/GR" "" 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-") set_source_files_properties(${VVV_CXX_SRC} PROPERTIES COMPILE_FLAGS /GR-)
if(MSVC_VERSION GREATER 1900) if(MSVC_VERSION GREATER 1900)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /utf-8") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /utf-8")
@@ -339,15 +302,29 @@ else()
set_source_files_properties(${VVV_C_SRC} PROPERTIES COMPILE_FLAGS -std=c99) set_source_files_properties(${VVV_C_SRC} PROPERTIES COMPILE_FLAGS -std=c99)
string(REGEX REPLACE "-std=[a-z0-9+]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") string(REGEX REPLACE "-std=[a-z0-9+]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set_source_files_properties(${VVV_CXX_SRC} PROPERTIES COMPILE_FLAGS -std=c++98)
# Disable exceptions
string(REPLACE "-fexceptions" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") string(REPLACE "-fexceptions" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set_source_files_properties(${VVV_CXX_SRC} PROPERTIES COMPILE_FLAGS -fno-exceptions)
# Disable RTTI
string(REPLACE "-frtti" "" 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") set_source_files_properties(${VVV_CXX_SRC} PROPERTIES COMPILE_FLAGS -fno-rtti)
# Dependencies (as needed) # Dependencies (as needed)
set_source_files_properties(${FAUDIO_SRC} PROPERTIES COMPILE_FLAGS -std=c99) set_source_files_properties(${FAUDIO_SRC} PROPERTIES COMPILE_FLAGS -std=c99)
set_source_files_properties(${CHM_SRC} PROPERTIES COMPILE_FLAGS -std=c99) set_source_files_properties(${CHM_SRC} PROPERTIES COMPILE_FLAGS -std=c99)
endif() 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(c-hashmap-static STATIC ${CHM_SRC})
add_library(sheenbidi-static STATIC ${SBIDI_SRC}) add_library(sheenbidi-static STATIC ${SBIDI_SRC})
@@ -360,43 +337,28 @@ target_include_directories(sheenbidi-static PRIVATE
) )
if(BUNDLE_DEPENDENCIES) if(BUNDLE_DEPENDENCIES)
list(APPEND STATIC_LIBRARIES lodepng-static physfs-static tinyxml2-static c-hashmap-static faudio-static sheenbidi-static) list(APPEND STATIC_LIBRARIES physfs-static tinyxml2-static lodepng-static c-hashmap-static faudio-static sheenbidi-static)
else() else()
list(APPEND STATIC_LIBRARIES c-hashmap-static sheenbidi-static) list(APPEND STATIC_LIBRARIES lodepng-static c-hashmap-static sheenbidi-static)
endif() endif()
if(BUNDLE_DEPENDENCIES) if(BUNDLE_DEPENDENCIES)
add_library(lodepng-static STATIC ${PNG_SRC})
target_compile_definitions(lodepng-static PRIVATE ${PNG_DEF})
add_library(tinyxml2-static STATIC ${XML2_SRC}) add_library(tinyxml2-static STATIC ${XML2_SRC})
add_library(physfs-static STATIC ${PFS_SRC}) add_library(physfs-static STATIC ${PFS_SRC})
target_compile_definitions(physfs-static PRIVATE target_compile_definitions(physfs-static PRIVATE
-DPHYSFS_SUPPORTS_DEFAULT=0 -DPHYSFS_SUPPORTS_ZIP=1 -DPHYSFS_SUPPORTS_DEFAULT=0 -DPHYSFS_SUPPORTS_ZIP=1
) )
if(MSVC AND WINXP)
target_compile_definitions(physfs-static PRIVATE -D_WIN32_WINNT=0x0501)
endif()
add_library(faudio-static STATIC ${FAUDIO_SRC}) add_library(faudio-static STATIC ${FAUDIO_SRC})
target_include_directories( target_include_directories(
faudio-static PRIVATE faudio-static PRIVATE
../third_party/FAudio/include ../third_party/FAudio/include
) )
# Disable FAudio debug stuff in release mode. This needs a generator expression for CMake reasons(TM) # Disable FAudio debug stuff in release mode. This needs a generator expression for CMake reasons(TM)
target_compile_definitions(faudio-static target_compile_definitions(faudio-static PRIVATE $<$<CONFIG:Release>:FAUDIO_DISABLE_DEBUGCONFIGURATION>)
PRIVATE
$<$<CONFIG:Release>:FAUDIO_DISABLE_DEBUGCONFIGURATION>
-DFAUDIO_SDL3_PLATFORM
)
target_link_libraries(VVVVVV PUBLIC ${STATIC_LIBRARIES}) target_link_libraries(VVVVVV ${STATIC_LIBRARIES})
else() else()
target_compile_definitions(VVVVVV PRIVATE target_link_libraries(VVVVVV ${STATIC_LIBRARIES} physfs tinyxml2 FAudio)
${PNG_DEF}
-DSYSTEM_LODEPNG
)
target_link_libraries(VVVVVV PUBLIC ${STATIC_LIBRARIES} physfs tinyxml2 FAudio lodepng)
endif() endif()
@@ -449,54 +411,45 @@ foreach(static_library IN LISTS STATIC_LIBRARIES)
endforeach(static_library) endforeach(static_library)
# SDL3 Dependency (Detection pulled from FAudio) # SDL2 Dependency (Detection pulled from FAudio)
if(DEFINED SDL3_INCLUDE_DIRS AND DEFINED SDL3_LIBRARIES) if(DEFINED SDL2_INCLUDE_DIRS AND DEFINED SDL2_LIBRARIES)
message(STATUS "Using pre-defined SDL3 variables SDL3_INCLUDE_DIRS and SDL3_LIBRARIES") message(STATUS "Using pre-defined SDL2 variables SDL2_INCLUDE_DIRS and SDL2_LIBRARIES")
target_include_directories(VVVVVV SYSTEM PRIVATE "$<BUILD_INTERFACE:${SDL3_INCLUDE_DIRS}>") target_include_directories(VVVVVV SYSTEM PRIVATE "$<BUILD_INTERFACE:${SDL2_INCLUDE_DIRS}>")
target_link_libraries(VVVVVV PUBLIC ${SDL3_LIBRARIES}) target_link_libraries(VVVVVV ${SDL2_LIBRARIES})
if(BUNDLE_DEPENDENCIES) if(BUNDLE_DEPENDENCIES)
target_include_directories(faudio-static SYSTEM PRIVATE "$<BUILD_INTERFACE:${SDL3_INCLUDE_DIRS}>") target_include_directories(faudio-static SYSTEM PRIVATE "$<BUILD_INTERFACE:${SDL2_INCLUDE_DIRS}>")
target_link_libraries(faudio-static ${SDL3_LIBRARIES}) target_link_libraries(faudio-static ${SDL2_LIBRARIES})
endif() endif()
elseif (EMSCRIPTEN) elseif (EMSCRIPTEN)
message(STATUS "Using Emscripten SDL3") message(STATUS "Using Emscripten SDL2")
target_compile_options(VVVVVV PUBLIC -sUSE_SDL=3) target_compile_options(VVVVVV PUBLIC -sUSE_SDL=2)
target_link_libraries(VVVVVV PUBLIC -sUSE_SDL=3) target_link_libraries(VVVVVV -sUSE_SDL=2)
if(BUNDLE_DEPENDENCIES) if(BUNDLE_DEPENDENCIES)
target_compile_options(faudio-static PUBLIC -sUSE_SDL=3) target_compile_options(faudio-static PUBLIC -sUSE_SDL=2)
target_link_libraries(faudio-static PUBLIC -sUSE_SDL=3) target_link_libraries(faudio-static -sUSE_SDL=2)
endif() endif()
elseif(DEFINED SDL3_FRAMEWORK)
message(STATUS "Using pre-defined SDL3 variable SDL3_FRAMEWORK")
target_include_directories(VVVVVV SYSTEM PRIVATE "$<BUILD_INTERFACE:${SDL3_FRAMEWORK}/Headers>")
target_link_libraries(VVVVVV PUBLIC ${SDL3_FRAMEWORK})
if(BUNDLE_DEPENDENCIES)
target_include_directories(faudio-static SYSTEM PRIVATE "$<BUILD_INTERFACE:${SDL3_FRAMEWORK}/Headers>")
target_link_libraries(faudio-static PUBLIC ${SDL3_FRAMEWORK})
endif()
set_target_properties(VVVVVV PROPERTIES XCODE_EMBED_FRAMEWORKS ${SDL3_FRAMEWORK})
else() else()
# Only try to autodetect if both SDL3 variables aren't explicitly set # Only try to autodetect if both SDL2 variables aren't explicitly set
find_package(SDL3 CONFIG) find_package(SDL2 CONFIG)
if(TARGET SDL3::SDL3) if(TARGET SDL2::SDL2)
message(STATUS "Using TARGET SDL3::SDL3") message(STATUS "Using TARGET SDL2::SDL2")
target_link_libraries(VVVVVV PUBLIC SDL3::SDL3) target_link_libraries(VVVVVV SDL2::SDL2)
if(BUNDLE_DEPENDENCIES) if(BUNDLE_DEPENDENCIES)
target_link_libraries(faudio-static PUBLIC SDL3::SDL3) target_link_libraries(faudio-static SDL2::SDL2)
endif() endif()
elseif(TARGET SDL3) elseif(TARGET SDL2)
message(STATUS "Using TARGET SDL3") message(STATUS "Using TARGET SDL2")
target_link_libraries(VVVVVV PUBLIC SDL3) target_link_libraries(VVVVVV SDL2)
if(BUNDLE_DEPENDENCIES) if(BUNDLE_DEPENDENCIES)
target_link_libraries(faudio-static PUBLIC SDL3) target_link_libraries(faudio-static SDL2)
endif() endif()
else() else()
message(STATUS "No TARGET SDL3::SDL3, or SDL3, using variables") message(STATUS "No TARGET SDL2::SDL2, or SDL2, using variables")
target_include_directories(VVVVVV SYSTEM PRIVATE "$<BUILD_INTERFACE:${SDL3_INCLUDE_DIRS}>") target_include_directories(VVVVVV SYSTEM PRIVATE "$<BUILD_INTERFACE:${SDL2_INCLUDE_DIRS}>")
target_link_libraries(VVVVVV PUBLIC ${SDL3_LIBRARIES}) target_link_libraries(VVVVVV ${SDL2_LIBRARIES})
if(BUNDLE_DEPENDENCIES) if(BUNDLE_DEPENDENCIES)
target_include_directories(faudio-static SYSTEM PRIVATE "$<BUILD_INTERFACE:${SDL3_INCLUDE_DIRS}>") target_include_directories(faudio-static SYSTEM PRIVATE "$<BUILD_INTERFACE:${SDL2_INCLUDE_DIRS}>")
target_link_libraries(faudio-static PUBLIC ${SDL3_LIBRARIES}) target_link_libraries(faudio-static ${SDL2_LIBRARIES})
endif() endif()
endif() endif()
endif() endif()
@@ -505,15 +458,15 @@ endif()
if(APPLE) if(APPLE)
find_library(FOUNDATION NAMES Foundation) find_library(FOUNDATION NAMES Foundation)
find_library(IOKIT NAMES IOKit) find_library(IOKIT NAMES IOKit)
target_link_libraries(VVVVVV PUBLIC objc ${IOKIT} ${FOUNDATION}) target_link_libraries(VVVVVV objc ${IOKIT} ${FOUNDATION})
endif() endif()
# But hey, also some Haiku crap # But hey, also some Haiku crap
if(HAIKU) if(HAIKU)
find_library(BE_LIBRARY be) find_library(BE_LIBRARY be)
find_library(ROOT_LIBRARY root) find_library(ROOT_LIBRARY root)
target_link_libraries(VVVVVV PUBLIC ${BE_LIBRARY} ${ROOT_LIBRARY}) target_link_libraries(VVVVVV ${BE_LIBRARY} ${ROOT_LIBRARY})
endif() endif()
if(EMSCRIPTEN) if(EMSCRIPTEN)
# 256MB is enough for everybody # 256MB is enough for everybody
target_link_libraries(VVVVVV PUBLIC -sFORCE_FILESYSTEM=1 -sTOTAL_MEMORY=256MB) target_link_libraries(VVVVVV -sFORCE_FILESYSTEM=1 -sTOTAL_MEMORY=256MB)
endif() endif()
+22 -17
View File
@@ -1,26 +1,31 @@
FROM rockylinux:9 FROM centos:7
# run first to improve caching (other things update more often than SDL3) # run first to improve caching (other things update more often than SDL2)
WORKDIR /tmp WORKDIR /tmp
RUN curl -LJO https://github.com/libsdl-org/SDL/releases/download/release-3.4.12/SDL3-3.4.12.tar.gz RUN curl -LJO https://github.com/libsdl-org/SDL/releases/download/release-2.24.0/SDL2-2.24.0.tar.gz
RUN tar -xf SDL3-3.4.12.tar.gz RUN tar -xf SDL2-2.24.0.tar.gz
RUN mkdir SDL3-3.4.12/build RUN mkdir SDL2-2.24.0/build
# add EPEL (for SDL2)
RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# install dependencies # install dependencies
RUN dnf --assumeyes upgrade --refresh RUN yum -y install \
RUN dnf --assumeyes group install development # used below
RUN dnf --assumeyes install cmake yum-utils \
RUN dnf --assumeyes install libX11-devel libICE-devel libSM-devel \ # VVVVVV dependencies
libXScrnSaver-devel libXext-devel libXft-devel libXi-devel \ gcc-c++ cmake make
libXinerama-devel libXmu-devel libXp-devel libXpm-devel \
libXrandr-devel libXrender-devel libXt-devel libXtst-devel \
libXv-devel libXxf86dga-devel libxkbcommon-devel libXcursor-devel
WORKDIR /tmp/SDL3-3.4.12/build RUN yum-builddep -y SDL2
RUN cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ..
RUN cmake --build . --target install -- -j $(nproc) RUN yum clean all
WORKDIR /tmp/SDL2-2.24.0/build
RUN ../configure
RUN make -j $(nproc)
RUN make install
WORKDIR /tmp WORKDIR /tmp
RUN rm -rf SDL3-3.4.12.tar.gz SDL3-3.4.12/ RUN rm -rf SDL2-2.24.0.tar.gz SDL2-2.24.0/
WORKDIR / WORKDIR /
-8
View File
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIFileSharingEnabled</key>
<true/>
</dict>
</plist>
+5 -5
View File
@@ -10,18 +10,18 @@ How to Build
------------ ------------
The recommended way is to install Android Studio and Maven. These instructions are for The recommended way is to install Android Studio and Maven. These instructions are for
SDL 2.30.8; adapt your SDL version accordingly. SDL 2.28.5; adapt your SDL version accordingly.
1. Place a copy of `data.zip` in `desktop_version/VVVVVV-android/app/src/main/assets/`. 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.) (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 2. Obtain the SDL 2.28.5 Maven package. As of writing, SDL currently does not publish
Maven packages, so here is one way to obtain them (other methods are possible): Maven packages, so here is one way to obtain them (other methods are possible):
1. Download the SDL 2.30.8 source code. 1. Download the SDL 2.28.5 source code.
2. Run the `build-scripts/android-prefab.sh` script in the SDL repository. 2. Run the `build-scripts/android-prefab.sh` script in the SDL repository.
3. After building, run `mvn install:install-file 3. After building, run `mvn install:install-file
-Dfile=build-android-prefab/prefab-2.30.8/SDL2-2.30.8.aar -Dfile=build-android-prefab/prefab-2.28.5/SDL2-2.28.5.aar
-DpomFile=build-android-prefab/prefab-2.30.8/SDL2-2.30.8.pom` to install it to -DpomFile=build-android-prefab/prefab-2.28.5/SDL2-2.28.5.pom` to install it to
Maven Local. Maven Local.
3. Open the `desktop_version/VVVVVV-android/` folder in Android Studio. 3. Open the `desktop_version/VVVVVV-android/` folder in Android Studio.
@@ -14,8 +14,8 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 29 minSdkVersion 29
targetSdkVersion 34 targetSdkVersion 34
versionCode 20005000 versionCode 20004000
versionName "2.5" versionName "2.4"
applicationId "air.com.distractionware.vvvvvvmobile" applicationId "air.com.distractionware.vvvvvvmobile"
externalNativeBuild { externalNativeBuild {
cmake { cmake {
@@ -110,5 +110,5 @@ dependencies {
implementation 'org.jetbrains:annotations:15.0' implementation 'org.jetbrains:annotations:15.0'
implementation 'androidx.core:core:1.10.1' implementation 'androidx.core:core:1.10.1'
implementation 'androidx.exifinterface:exifinterface:1.3.6' implementation 'androidx.exifinterface:exifinterface:1.3.6'
implementation 'org.libsdl.android:SDL2:2.30.8' implementation 'org.libsdl.android:SDL2:2.28.5'
} }
-8
View File
@@ -246,11 +246,6 @@
<string english="Lets you see through what is behind the name at the bottom of the screen." translation="وضوح رؤية ما وراء اسم الغرفة أسفل الشاشة." explanation="" max="38*3" max_local="38*3"/> <string english="Lets you see through what is behind the name at the bottom of the screen." translation="وضوح رؤية ما وراء اسم الغرفة أسفل الشاشة." explanation="" max="38*3" max_local="38*3"/>
<string english="Room name background is TRANSLUCENT" translation="خلفية اسم الغرفة شفافة" explanation="" max="38*2" max_local="38*2"/> <string english="Room name background is TRANSLUCENT" translation="خلفية اسم الغرفة شفافة" explanation="" max="38*2" max_local="38*2"/>
<string english="Room name background is OPAQUE" translation="خلفية اسم الغرفة ليست شفافة" explanation="" max="38*2" max_local="38*2"/> <string english="Room name background is OPAQUE" translation="خلفية اسم الغرفة ليست شفافة" explanation="" max="38*2" max_local="38*2"/>
<string english="checkpoint saving" translation="تخزين نقطة الحفظ" explanation="menu option"/>
<string english="Checkpoint Saving" translation="تخزين نقطة الحفظ" explanation="title, makes checkpoints save the game" max="20" max_local="20"/>
<string english="Toggle if checkpoints should save the game." translation="تفعيل تخزين التقدم عند كل نقطة حفظ." explanation="" max="38*3" max_local="38*3"/>
<string english="Checkpoint saving is OFF" translation="نقاط الحفظ لا تخزن التقدم" explanation="makes checkpoints save the game" max="38*2" max_local="38*2"/>
<string english="Checkpoint saving is ON" translation="نقاط الحفظ تخزن التقدم" explanation="makes checkpoints save the game" max="38*2" max_local="38*2"/>
<string english="speedrun options" translation="إعدادات التختيم السريع" explanation="menu option"/> <string english="speedrun options" translation="إعدادات التختيم السريع" explanation="menu option"/>
<string english="Speedrunner Options" translation="إعدادات التختيم السريع" explanation="title" max="20" max_local="20"/> <string english="Speedrunner Options" translation="إعدادات التختيم السريع" explanation="title" max="20" max_local="20"/>
<string english="Access some advanced settings that might be of interest to speedrunners." translation="دخول إعدادات متقدمة قد تحظى باهتمام <string english="Access some advanced settings that might be of interest to speedrunners." translation="دخول إعدادات متقدمة قد تحظى باهتمام
@@ -645,9 +640,6 @@
<string english="Tileset Colour Changed" translation="تغير لون مجموعة الخلايا" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3" max_local="38*3"/> <string english="Tileset Colour Changed" translation="تغير لون مجموعة الخلايا" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3" max_local="38*3"/>
<string english="Enemy Type Changed" translation="تغير نوع الأعداء" explanation="level editor, user changed enemy appearance for the room" max="38*3" max_local="38*3"/> <string english="Enemy Type Changed" translation="تغير نوع الأعداء" explanation="level editor, user changed enemy appearance for the room" max="38*3" max_local="38*3"/>
<string english="Platform speed is now {speed}" translation="تغيرت سرعة المنصات إلى {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3" max_local="38*3"/> <string english="Platform speed is now {speed}" translation="تغيرت سرعة المنصات إلى {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3" max_local="38*3"/>
<string english="Enemy speed is now {speed}" translation="تغيرت سرعة الأعداء إلى {speed}" explanation="level editor, user changed speed of enemies for the room" max="38*3" max_local="38*3"/>
<string english="ERROR: Nothing to undo" translation="" explanation="level editor, user tried to undo with nothing to undo" max="38*3" max_local="38*3"/>
<string english="ERROR: Nothing to redo" translation="" explanation="level editor, user tried to redo with nothing to redo" max="38*3" max_local="38*3"/>
<string english="Reloaded resources" translation="أعيد فتح ملفات الموارد" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3" max_local="38*3"/> <string english="Reloaded resources" translation="أعيد فتح ملفات الموارد" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3" max_local="38*3"/>
<string english="ERROR: Invalid format" translation="خطأ: صيغة المكتوب غير مناسبة" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3" max_local="38*3"/> <string english="ERROR: Invalid format" translation="خطأ: صيغة المكتوب غير مناسبة" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3" max_local="38*3"/>
<string english="Loaded map: {filename}.vvvvvv" translation="فتحت الغرفة: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3" max_local="38*3"/> <string english="Loaded map: {filename}.vvvvvv" translation="فتحت الغرفة: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3" max_local="38*3"/>
-8
View File
@@ -242,11 +242,6 @@
<string english="Lets you see through what is behind the name at the bottom of the screen." translation="Permet veure què hi ha darrere del nom a la part inferior de la pantalla." explanation="" max="38*3"/> <string english="Lets you see through what is behind the name at the bottom of the screen." translation="Permet veure què hi ha darrere del nom a la part inferior de la pantalla." explanation="" max="38*3"/>
<string english="Room name background is TRANSLUCENT" translation="El fons del nom de sala és TRANSLÚCID" explanation="" max="38*2"/> <string english="Room name background is TRANSLUCENT" translation="El fons del nom de sala és TRANSLÚCID" explanation="" max="38*2"/>
<string english="Room name background is OPAQUE" translation="El fons del nom de sala és OPAC" explanation="" max="38*2"/> <string english="Room name background is OPAQUE" translation="El fons del nom de sala és OPAC" explanation="" max="38*2"/>
<string english="checkpoint saving" translation="desa als punts de control" explanation="menu option"/>
<string english="Checkpoint Saving" translation="Desa als punts" explanation="title, makes checkpoints save the game" max="20"/>
<string english="Toggle if checkpoints should save the game." translation="Activa o desactiva que es desi la partida als punts de control." explanation="" max="38*3"/>
<string english="Checkpoint saving is OFF" translation="Desat als punts de control DESACTIVAT" explanation="makes checkpoints save the game" max="38*2"/>
<string english="Checkpoint saving is ON" translation="Desat als punts de control ACTIVAT" explanation="makes checkpoints save the game" max="38*2"/>
<string english="speedrun options" translation="opcions per a speedruns" explanation="menu option"/> <string english="speedrun options" translation="opcions per a speedruns" explanation="menu option"/>
<string english="Speedrunner Options" translation="Speedruns" explanation="title" max="20"/> <string english="Speedrunner Options" translation="Speedruns" explanation="title" max="20"/>
<string english="Access some advanced settings that might be of interest to speedrunners." translation="Accedeix a opcions avançades que poden ser d’interès per als speedrunners." explanation="description for speedrunner options" max="38*5"/> <string english="Access some advanced settings that might be of interest to speedrunners." translation="Accedeix a opcions avançades que poden ser d’interès per als speedrunners." explanation="description for speedrunner options" max="38*5"/>
@@ -637,9 +632,6 @@
<string english="Tileset Colour Changed" translation="S’ha canviat el color|del conjunt de peces" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/> <string english="Tileset Colour Changed" translation="S’ha canviat el color|del conjunt de peces" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/>
<string english="Enemy Type Changed" translation="S’ha canviat el tipus d’enemic" explanation="level editor, user changed enemy appearance for the room" max="38*3"/> <string english="Enemy Type Changed" translation="S’ha canviat el tipus d’enemic" explanation="level editor, user changed enemy appearance for the room" max="38*3"/>
<string english="Platform speed is now {speed}" translation="La velocitat de les plataformes és ara {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/> <string english="Platform speed is now {speed}" translation="La velocitat de les plataformes és ara {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/>
<string english="Enemy speed is now {speed}" translation="La velocitat dels enemics és ara {speed}" explanation="level editor, user changed speed of enemies for the room" max="38*3"/>
<string english="ERROR: Nothing to undo" translation="" explanation="level editor, user tried to undo with nothing to undo" max="38*3"/>
<string english="ERROR: Nothing to redo" translation="" explanation="level editor, user tried to redo with nothing to redo" max="38*3"/>
<string english="Reloaded resources" translation="S’han recarregat els recursos" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/> <string english="Reloaded resources" translation="S’han recarregat els recursos" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/>
<string english="ERROR: Invalid format" translation="ERROR: Format invàlid" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/> <string english="ERROR: Invalid format" translation="ERROR: Format invàlid" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/>
<string english="Loaded map: {filename}.vvvvvv" translation="S’ha obert el mapa: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/> <string english="Loaded map: {filename}.vvvvvv" translation="S’ha obert el mapa: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/>
-8
View File
@@ -242,11 +242,6 @@
<string english="Lets you see through what is behind the name at the bottom of the screen." translation="Yn gadael i chi weld trwy&apos;r hyn sydd y tu ôl i&apos;r enw ar waelod y sgrin." explanation="" max="38*3"/> <string english="Lets you see through what is behind the name at the bottom of the screen." translation="Yn gadael i chi weld trwy&apos;r hyn sydd y tu ôl i&apos;r enw ar waelod y sgrin." explanation="" max="38*3"/>
<string english="Room name background is TRANSLUCENT" translation="Mae cefndir enw ystafell yn TRYLOYW" explanation="" max="38*2"/> <string english="Room name background is TRANSLUCENT" translation="Mae cefndir enw ystafell yn TRYLOYW" explanation="" max="38*2"/>
<string english="Room name background is OPAQUE" translation="Mae cefndir enw ystafell yn DI-DRAIDD" explanation="" max="38*2"/> <string english="Room name background is OPAQUE" translation="Mae cefndir enw ystafell yn DI-DRAIDD" explanation="" max="38*2"/>
<string english="checkpoint saving" translation="siecbwyntiau yn arbed" explanation="menu option"/>
<string english="Checkpoint Saving" translation="Arbed-Awto" explanation="title, makes checkpoints save the game" max="20"/>
<string english="Toggle if checkpoints should save the game." translation="Toglwch os dylai siecbwynt arbed y gêm." explanation="" max="38*3"/>
<string english="Checkpoint saving is OFF" translation="Siecbwyntiau yn arbed wedi&apos;i DDIFFODD" explanation="makes checkpoints save the game" max="38*2"/>
<string english="Checkpoint saving is ON" translation="Siecbwyntiau yn arbed YMLAEN" explanation="makes checkpoints save the game" max="38*2"/>
<string english="speedrun options" translation="opsiynau rhediad-gwib" explanation="menu option"/> <string english="speedrun options" translation="opsiynau rhediad-gwib" explanation="menu option"/>
<string english="Speedrunner Options" translation="Opsiynau Rhedwr-Gwib" explanation="title" max="20"/> <string english="Speedrunner Options" translation="Opsiynau Rhedwr-Gwib" explanation="title" max="20"/>
<string english="Access some advanced settings that might be of interest to speedrunners." translation="Cyrchwch rai gosodiadau uwch a allai fod o ddiddordeb i redwyr cyflym ." explanation="description for speedrunner options" max="38*5"/> <string english="Access some advanced settings that might be of interest to speedrunners." translation="Cyrchwch rai gosodiadau uwch a allai fod o ddiddordeb i redwyr cyflym ." explanation="description for speedrunner options" max="38*5"/>
@@ -637,9 +632,6 @@
<string english="Tileset Colour Changed" translation="Lliw Set Teil wedi&apos;i Newid" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/> <string english="Tileset Colour Changed" translation="Lliw Set Teil wedi&apos;i Newid" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/>
<string english="Enemy Type Changed" translation="Newidiodd Math y Gelyn" explanation="level editor, user changed enemy appearance for the room" max="38*3"/> <string english="Enemy Type Changed" translation="Newidiodd Math y Gelyn" explanation="level editor, user changed enemy appearance for the room" max="38*3"/>
<string english="Platform speed is now {speed}" translation="Cyflymder llwyfan yw {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/> <string english="Platform speed is now {speed}" translation="Cyflymder llwyfan yw {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/>
<string english="Enemy speed is now {speed}" translation="Cyflymder y gelyn yw {speed}" explanation="level editor, user changed speed of enemies for the room" max="38*3"/>
<string english="ERROR: Nothing to undo" translation="" explanation="level editor, user tried to undo with nothing to undo" max="38*3"/>
<string english="ERROR: Nothing to redo" translation="" explanation="level editor, user tried to redo with nothing to redo" max="38*3"/>
<string english="Reloaded resources" translation="Adnoddau wedi&apos;u hail-lwytho" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/> <string english="Reloaded resources" translation="Adnoddau wedi&apos;u hail-lwytho" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/>
<string english="ERROR: Invalid format" translation="GWALL: Fformat annilys" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/> <string english="ERROR: Invalid format" translation="GWALL: Fformat annilys" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/>
<string english="Loaded map: {filename}.vvvvvv" translation="Map wedi&apos;i lwytho: {filename}.vvvvv" explanation="successfully loaded level file" max="38*3"/> <string english="Loaded map: {filename}.vvvvvv" translation="Map wedi&apos;i lwytho: {filename}.vvvvv" explanation="successfully loaded level file" max="38*3"/>
-8
View File
@@ -242,11 +242,6 @@
<string english="Lets you see through what is behind the name at the bottom of the screen." translation="Lässt dich sehen, was sich hinter dem Namen am unteren Rand des Bildschirms verbirgt." explanation="" max="38*3"/> <string english="Lets you see through what is behind the name at the bottom of the screen." translation="Lässt dich sehen, was sich hinter dem Namen am unteren Rand des Bildschirms verbirgt." explanation="" max="38*3"/>
<string english="Room name background is TRANSLUCENT" translation="Raumnamen-Hintergrund ist DURCHSICHTIG" explanation="" max="38*2"/> <string english="Room name background is TRANSLUCENT" translation="Raumnamen-Hintergrund ist DURCHSICHTIG" explanation="" max="38*2"/>
<string english="Room name background is OPAQUE" translation="Raumnamen-Hintergrund ist UNDURCHSICHTIG" explanation="" max="38*2"/> <string english="Room name background is OPAQUE" translation="Raumnamen-Hintergrund ist UNDURCHSICHTIG" explanation="" max="38*2"/>
<string english="checkpoint saving" translation="checkpoint-speichern" explanation="menu option"/>
<string english="Checkpoint Saving" translation="Checkpoint-Speichern" explanation="title, makes checkpoints save the game" max="20"/>
<string english="Toggle if checkpoints should save the game." translation="Schalte ein, wenn Checkpoints das Spiel speichern sollen." explanation="" max="38*3"/>
<string english="Checkpoint saving is OFF" translation="Checkpoint-Speichern ist AUS" explanation="makes checkpoints save the game" max="38*2"/>
<string english="Checkpoint saving is ON" translation="Checkpoint-Speichern ist EIN" explanation="makes checkpoints save the game" max="38*2"/>
<string english="speedrun options" translation="speedrunner-optionen" explanation="menu option"/> <string english="speedrun options" translation="speedrunner-optionen" explanation="menu option"/>
<string english="Speedrunner Options" translation="Speedrunner-Optionen" explanation="title" max="20"/> <string english="Speedrunner Options" translation="Speedrunner-Optionen" explanation="title" max="20"/>
<string english="Access some advanced settings that might be of interest to speedrunners." translation="Greife auf erweiterte Einstellungen zu, die für Speedrunner interessant sind." explanation="description for speedrunner options" max="38*5"/> <string english="Access some advanced settings that might be of interest to speedrunners." translation="Greife auf erweiterte Einstellungen zu, die für Speedrunner interessant sind." explanation="description for speedrunner options" max="38*5"/>
@@ -637,9 +632,6 @@
<string english="Tileset Colour Changed" translation="Tileset-Farbe geändert" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/> <string english="Tileset Colour Changed" translation="Tileset-Farbe geändert" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/>
<string english="Enemy Type Changed" translation="Feindtyp geändert" explanation="level editor, user changed enemy appearance for the room" max="38*3"/> <string english="Enemy Type Changed" translation="Feindtyp geändert" explanation="level editor, user changed enemy appearance for the room" max="38*3"/>
<string english="Platform speed is now {speed}" translation="Plattformgeschwindigkeit ist jetzt {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/> <string english="Platform speed is now {speed}" translation="Plattformgeschwindigkeit ist jetzt {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/>
<string english="Enemy speed is now {speed}" translation="Feindgeschwindigkeit ist jetzt {speed}" explanation="level editor, user changed speed of enemies for the room" max="38*3"/>
<string english="ERROR: Nothing to undo" translation="" explanation="level editor, user tried to undo with nothing to undo" max="38*3"/>
<string english="ERROR: Nothing to redo" translation="" explanation="level editor, user tried to redo with nothing to redo" max="38*3"/>
<string english="Reloaded resources" translation="Ressourcen neu geladen" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/> <string english="Reloaded resources" translation="Ressourcen neu geladen" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/>
<string english="ERROR: Invalid format" translation="FEHLER: ungültiges Format" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/> <string english="ERROR: Invalid format" translation="FEHLER: ungültiges Format" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/>
<string english="Loaded map: {filename}.vvvvvv" translation="Karte geladen: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/> <string english="Loaded map: {filename}.vvvvvv" translation="Karte geladen: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/>
-8
View File
@@ -242,11 +242,6 @@
<string english="Lets you see through what is behind the name at the bottom of the screen." translation="" explanation="" max="38*3"/> <string english="Lets you see through what is behind the name at the bottom of the screen." translation="" explanation="" max="38*3"/>
<string english="Room name background is TRANSLUCENT" translation="" explanation="" max="38*2"/> <string english="Room name background is TRANSLUCENT" translation="" explanation="" max="38*2"/>
<string english="Room name background is OPAQUE" translation="" explanation="" max="38*2"/> <string english="Room name background is OPAQUE" translation="" explanation="" max="38*2"/>
<string english="checkpoint saving" translation="" explanation="menu option"/>
<string english="Checkpoint Saving" translation="" explanation="title, makes checkpoints save the game" max="20"/>
<string english="Toggle if checkpoints should save the game." translation="" explanation="" max="38*3"/>
<string english="Checkpoint saving is OFF" translation="" explanation="makes checkpoints save the game" max="38*2"/>
<string english="Checkpoint saving is ON" translation="" explanation="makes checkpoints save the game" max="38*2"/>
<string english="speedrun options" translation="" explanation="menu option"/> <string english="speedrun options" translation="" explanation="menu option"/>
<string english="Speedrunner Options" translation="" explanation="title" max="20"/> <string english="Speedrunner Options" translation="" explanation="title" max="20"/>
<string english="Access some advanced settings that might be of interest to speedrunners." translation="" explanation="description for speedrunner options" max="38*5"/> <string english="Access some advanced settings that might be of interest to speedrunners." translation="" explanation="description for speedrunner options" max="38*5"/>
@@ -637,9 +632,6 @@
<string english="Tileset Colour Changed" translation="" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/> <string english="Tileset Colour Changed" translation="" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/>
<string english="Enemy Type Changed" translation="" explanation="level editor, user changed enemy appearance for the room" max="38*3"/> <string english="Enemy Type Changed" translation="" explanation="level editor, user changed enemy appearance for the room" max="38*3"/>
<string english="Platform speed is now {speed}" translation="" explanation="level editor, user changed speed of platforms for the room" max="38*3"/> <string english="Platform speed is now {speed}" translation="" explanation="level editor, user changed speed of platforms for the room" max="38*3"/>
<string english="Enemy speed is now {speed}" translation="" explanation="level editor, user changed speed of enemies for the room" max="38*3"/>
<string english="ERROR: Nothing to undo" translation="" explanation="level editor, user tried to undo with nothing to undo" max="38*3"/>
<string english="ERROR: Nothing to redo" translation="" explanation="level editor, user tried to redo with nothing to redo" max="38*3"/>
<string english="Reloaded resources" translation="" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/> <string english="Reloaded resources" translation="" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/>
<string english="ERROR: Invalid format" translation="" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/> <string english="ERROR: Invalid format" translation="" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/>
<string english="Loaded map: {filename}.vvvvvv" translation="" explanation="successfully loaded level file" max="38*3"/> <string english="Loaded map: {filename}.vvvvvv" translation="" explanation="successfully loaded level file" max="38*3"/>
+1 -9
View File
@@ -242,11 +242,6 @@
<string english="Lets you see through what is behind the name at the bottom of the screen." translation="Ebligi vidi tion, kio estas malantaŭ la nomo ĉe la ekranmalsupro" explanation="" max="38*3"/> <string english="Lets you see through what is behind the name at the bottom of the screen." translation="Ebligi vidi tion, kio estas malantaŭ la nomo ĉe la ekranmalsupro" explanation="" max="38*3"/>
<string english="Room name background is TRANSLUCENT" translation="Ĉambronoma fono estas TRAVIDEBLA" explanation="" max="38*2"/> <string english="Room name background is TRANSLUCENT" translation="Ĉambronoma fono estas TRAVIDEBLA" explanation="" max="38*2"/>
<string english="Room name background is OPAQUE" translation="Ĉambronoma fono estas NETRAVIDEBLA" explanation="" max="38*2"/> <string english="Room name background is OPAQUE" translation="Ĉambronoma fono estas NETRAVIDEBLA" explanation="" max="38*2"/>
<string english="checkpoint saving" translation="konserveja konduto" explanation="menu option"/>
<string english="Checkpoint Saving" translation="Konserveja konduto" explanation="title, makes checkpoints save the game" max="20"/>
<string english="Toggle if checkpoints should save the game." translation="Baskuligi ĉu la ludo aŭtomate konserviĝu ĉe konservejoj." explanation="" max="38*3"/>
<string english="Checkpoint saving is OFF" translation="Aŭtomata konservado estas MALŜALTA" explanation="makes checkpoints save the game" max="38*2"/>
<string english="Checkpoint saving is ON" translation="Aŭtomata konservado estas ŜALTA" explanation="makes checkpoints save the game" max="38*2"/>
<string english="speedrun options" translation="opcioj de kurludado" explanation="menu option"/> <string english="speedrun options" translation="opcioj de kurludado" explanation="menu option"/>
<string english="Speedrunner Options" translation="Kurludaj opcioj" explanation="title" max="20"/> <string english="Speedrunner Options" translation="Kurludaj opcioj" explanation="title" max="20"/>
<string english="Access some advanced settings that might be of interest to speedrunners." translation="Iuj altnivelaj agordoj, utilaj por kurludistoj." explanation="description for speedrunner options" max="38*5"/> <string english="Access some advanced settings that might be of interest to speedrunners." translation="Iuj altnivelaj agordoj, utilaj por kurludistoj." explanation="description for speedrunner options" max="38*5"/>
@@ -466,7 +461,7 @@
<string english="New Trophy!" translation="Nova trofeo!" explanation="" max="20"/> <string english="New Trophy!" translation="Nova trofeo!" explanation="" max="20"/>
<string english="[Press {button} to stop]" translation="[Premu {button} por eliri]" explanation="stop super gravitron" max="40"/> <string english="[Press {button} to stop]" translation="[Premu {button} por eliri]" explanation="stop super gravitron" max="40"/>
<string english="SUPER GRAVITRON" translation="SUPERGRAVITRONO" explanation="" max="20"/> <string english="SUPER GRAVITRON" translation="SUPERGRAVITRONO" explanation="" max="20"/>
<string english="SUPER GRAVITRON HIGHSCORE" translation="REKORDO DE SUPERGRAVITRONO" explanation="" max="38*4"/> <string english="SUPER GRAVITRON HIGHSCORE" translation="ALTPOENTARO DE SUPERGRAVITRONO" explanation="" max="38*4"/>
<string english="MAP" translation="MAPO" explanation="in-game menu" max="8"/> <string english="MAP" translation="MAPO" explanation="in-game menu" max="8"/>
<string english="GRAV" translation="GRAV" explanation="in-game menu, Gravitron" max="8"/> <string english="GRAV" translation="GRAV" explanation="in-game menu, Gravitron" max="8"/>
<string english="SHIP" translation="ŜIPO" explanation="in-game menu, spaceship" max="8"/> <string english="SHIP" translation="ŜIPO" explanation="in-game menu, spaceship" max="8"/>
@@ -637,9 +632,6 @@
<string english="Tileset Colour Changed" translation="Kahelara koloro ŝanĝiĝis" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/> <string english="Tileset Colour Changed" translation="Kahelara koloro ŝanĝiĝis" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/>
<string english="Enemy Type Changed" translation="Malamika tipo ŝanĝiĝis" explanation="level editor, user changed enemy appearance for the room" max="38*3"/> <string english="Enemy Type Changed" translation="Malamika tipo ŝanĝiĝis" explanation="level editor, user changed enemy appearance for the room" max="38*3"/>
<string english="Platform speed is now {speed}" translation="Platforma rapido nun estas {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/> <string english="Platform speed is now {speed}" translation="Platforma rapido nun estas {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/>
<string english="Enemy speed is now {speed}" translation="Malamika rapido nun estas {speed}" explanation="level editor, user changed speed of enemies for the room" max="38*3"/>
<string english="ERROR: Nothing to undo" translation="" explanation="level editor, user tried to undo with nothing to undo" max="38*3"/>
<string english="ERROR: Nothing to redo" translation="" explanation="level editor, user tried to redo with nothing to redo" max="38*3"/>
<string english="Reloaded resources" translation="Resursoj reŝargiĝis" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/> <string english="Reloaded resources" translation="Resursoj reŝargiĝis" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/>
<string english="ERROR: Invalid format" translation="ERARO: malĝusta formo" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/> <string english="ERROR: Invalid format" translation="ERARO: malĝusta formo" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/>
<string english="Loaded map: {filename}.vvvvvv" translation="Ŝargiĝis mapo: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/> <string english="Loaded map: {filename}.vvvvvv" translation="Ŝargiĝis mapo: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/>
-8
View File
@@ -242,11 +242,6 @@
<string english="Lets you see through what is behind the name at the bottom of the screen." translation="Permite ver qué hay detrás del nombre que aparece en la parte baja de la pantalla." explanation="" max="38*3"/> <string english="Lets you see through what is behind the name at the bottom of the screen." translation="Permite ver qué hay detrás del nombre que aparece en la parte baja de la pantalla." explanation="" max="38*3"/>
<string english="Room name background is TRANSLUCENT" translation="El fondo de los nombres de sala es TRASLÚCIDO" explanation="" max="38*2"/> <string english="Room name background is TRANSLUCENT" translation="El fondo de los nombres de sala es TRASLÚCIDO" explanation="" max="38*2"/>
<string english="Room name background is OPAQUE" translation="El fondo de los nombres de sala es OPACO" explanation="" max="38*2"/> <string english="Room name background is OPAQUE" translation="El fondo de los nombres de sala es OPACO" explanation="" max="38*2"/>
<string english="checkpoint saving" translation="guardar punt. cont." explanation="menu option"/>
<string english="Checkpoint Saving" translation="Guardar punt. cont." explanation="title, makes checkpoints save the game" max="20"/>
<string english="Toggle if checkpoints should save the game." translation="Se activa para guardar partida en puntos de control." explanation="" max="38*3"/>
<string english="Checkpoint saving is OFF" translation="Guardar punt. cont. desact." explanation="makes checkpoints save the game" max="38*2"/>
<string english="Checkpoint saving is ON" translation="Guardar punt. cont. activado" explanation="makes checkpoints save the game" max="38*2"/>
<string english="speedrun options" translation="opciones de speedrun" explanation="menu option"/> <string english="speedrun options" translation="opciones de speedrun" explanation="menu option"/>
<string english="Speedrunner Options" translation="Opciones de speedrun" explanation="title" max="20"/> <string english="Speedrunner Options" translation="Opciones de speedrun" explanation="title" max="20"/>
<string english="Access some advanced settings that might be of interest to speedrunners." translation="Accede a opciones avanzadas que podrían interesar a quienes hacen speedrun." explanation="description for speedrunner options" max="38*5"/> <string english="Access some advanced settings that might be of interest to speedrunners." translation="Accede a opciones avanzadas que podrían interesar a quienes hacen speedrun." explanation="description for speedrunner options" max="38*5"/>
@@ -637,9 +632,6 @@
<string english="Tileset Colour Changed" translation="Color de casillas cambiado" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/> <string english="Tileset Colour Changed" translation="Color de casillas cambiado" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/>
<string english="Enemy Type Changed" translation="Tipo de enemigo cambiado" explanation="level editor, user changed enemy appearance for the room" max="38*3"/> <string english="Enemy Type Changed" translation="Tipo de enemigo cambiado" explanation="level editor, user changed enemy appearance for the room" max="38*3"/>
<string english="Platform speed is now {speed}" translation="La velocidad plataforma es {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/> <string english="Platform speed is now {speed}" translation="La velocidad plataforma es {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/>
<string english="Enemy speed is now {speed}" translation="Velocidad del enemigo en {speed}" explanation="level editor, user changed speed of enemies for the room" max="38*3"/>
<string english="ERROR: Nothing to undo" translation="" explanation="level editor, user tried to undo with nothing to undo" max="38*3"/>
<string english="ERROR: Nothing to redo" translation="" explanation="level editor, user tried to redo with nothing to redo" max="38*3"/>
<string english="Reloaded resources" translation="Recursos recargados" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/> <string english="Reloaded resources" translation="Recursos recargados" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/>
<string english="ERROR: Invalid format" translation="ERROR: Formato no válido" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/> <string english="ERROR: Invalid format" translation="ERROR: Formato no válido" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/>
<string english="Loaded map: {filename}.vvvvvv" translation="Mapa cargado: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/> <string english="Loaded map: {filename}.vvvvvv" translation="Mapa cargado: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/>
-8
View File
@@ -242,11 +242,6 @@
<string english="Lets you see through what is behind the name at the bottom of the screen." translation="Permite ver qué hay detrás del nombre que aparece en la parte inferior de la pantalla." explanation="" max="38*3"/> <string english="Lets you see through what is behind the name at the bottom of the screen." translation="Permite ver qué hay detrás del nombre que aparece en la parte inferior de la pantalla." explanation="" max="38*3"/>
<string english="Room name background is TRANSLUCENT" translation="El fondo de los nombres de sala es TRASLÚCIDO" explanation="" max="38*2"/> <string english="Room name background is TRANSLUCENT" translation="El fondo de los nombres de sala es TRASLÚCIDO" explanation="" max="38*2"/>
<string english="Room name background is OPAQUE" translation="El fondo de los nombres de sala es OPACO" explanation="" max="38*2"/> <string english="Room name background is OPAQUE" translation="El fondo de los nombres de sala es OPACO" explanation="" max="38*2"/>
<string english="checkpoint saving" translation="guardando punto de control" explanation="menu option"/>
<string english="Checkpoint Saving" translation="Guardando p. control" explanation="title, makes checkpoints save the game" max="20"/>
<string english="Toggle if checkpoints should save the game." translation="Actívalo para que los puntos de control guarden la partida." explanation="" max="38*3"/>
<string english="Checkpoint saving is OFF" translation="El guardado en puntos de control está DESACTIVADO" explanation="makes checkpoints save the game" max="38*2"/>
<string english="Checkpoint saving is ON" translation="El guardado en puntos de control está ACTIVADO" explanation="makes checkpoints save the game" max="38*2"/>
<string english="speedrun options" translation="opciones de speedrun" explanation="menu option"/> <string english="speedrun options" translation="opciones de speedrun" explanation="menu option"/>
<string english="Speedrunner Options" translation="Opciones de speedrun" explanation="title" max="20"/> <string english="Speedrunner Options" translation="Opciones de speedrun" explanation="title" max="20"/>
<string english="Access some advanced settings that might be of interest to speedrunners." translation="Accede a opciones avanzadas que podrían interesarte si haces speedrun." explanation="description for speedrunner options" max="38*5"/> <string english="Access some advanced settings that might be of interest to speedrunners." translation="Accede a opciones avanzadas que podrían interesarte si haces speedrun." explanation="description for speedrunner options" max="38*5"/>
@@ -637,9 +632,6 @@
<string english="Tileset Colour Changed" translation="Color de casillas cambiado" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/> <string english="Tileset Colour Changed" translation="Color de casillas cambiado" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/>
<string english="Enemy Type Changed" translation="Tipo de enemigo cambiado" explanation="level editor, user changed enemy appearance for the room" max="38*3"/> <string english="Enemy Type Changed" translation="Tipo de enemigo cambiado" explanation="level editor, user changed enemy appearance for the room" max="38*3"/>
<string english="Platform speed is now {speed}" translation="Velocidad de las plataformas: {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/> <string english="Platform speed is now {speed}" translation="Velocidad de las plataformas: {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/>
<string english="Enemy speed is now {speed}" translation="Velocidad de los enemigos: {speed}" explanation="level editor, user changed speed of enemies for the room" max="38*3"/>
<string english="ERROR: Nothing to undo" translation="" explanation="level editor, user tried to undo with nothing to undo" max="38*3"/>
<string english="ERROR: Nothing to redo" translation="" explanation="level editor, user tried to redo with nothing to redo" max="38*3"/>
<string english="Reloaded resources" translation="Recursos recargados" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/> <string english="Reloaded resources" translation="Recursos recargados" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/>
<string english="ERROR: Invalid format" translation="ERROR: Formato no válido" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/> <string english="ERROR: Invalid format" translation="ERROR: Formato no válido" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/>
<string english="Loaded map: {filename}.vvvvvv" translation="Mapa cargado: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/> <string english="Loaded map: {filename}.vvvvvv" translation="Mapa cargado: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/>
-8
View File
@@ -242,11 +242,6 @@
<string english="Lets you see through what is behind the name at the bottom of the screen." translation="Te permite ver qué hay atrás del nombre que aparece en la parte inferior de la pantalla." explanation="" max="38*3"/> <string english="Lets you see through what is behind the name at the bottom of the screen." translation="Te permite ver qué hay atrás del nombre que aparece en la parte inferior de la pantalla." explanation="" max="38*3"/>
<string english="Room name background is TRANSLUCENT" translation="El fondo de los nombres de sala es TRASLÚCIDO" explanation="" max="38*2"/> <string english="Room name background is TRANSLUCENT" translation="El fondo de los nombres de sala es TRASLÚCIDO" explanation="" max="38*2"/>
<string english="Room name background is OPAQUE" translation="El fondo de los nombres de sala es OPACO" explanation="" max="38*2"/> <string english="Room name background is OPAQUE" translation="El fondo de los nombres de sala es OPACO" explanation="" max="38*2"/>
<string english="checkpoint saving" translation="guardando punto de control" explanation="menu option"/>
<string english="Checkpoint Saving" translation="Guardando p. control" explanation="title, makes checkpoints save the game" max="20"/>
<string english="Toggle if checkpoints should save the game." translation="Activalo para que los puntos de control guarden la partida." explanation="" max="38*3"/>
<string english="Checkpoint saving is OFF" translation="El guardado en puntos de control está DESACTIVADO" explanation="makes checkpoints save the game" max="38*2"/>
<string english="Checkpoint saving is ON" translation="El guardado en puntos de control está ACTIVADO" explanation="makes checkpoints save the game" max="38*2"/>
<string english="speedrun options" translation="opciones de speedrun" explanation="menu option"/> <string english="speedrun options" translation="opciones de speedrun" explanation="menu option"/>
<string english="Speedrunner Options" translation="Opciones de speedrun" explanation="title" max="20"/> <string english="Speedrunner Options" translation="Opciones de speedrun" explanation="title" max="20"/>
<string english="Access some advanced settings that might be of interest to speedrunners." translation="Entrá a opciones avanzadas que podrían interesarte si hacés speedrun." explanation="description for speedrunner options" max="38*5"/> <string english="Access some advanced settings that might be of interest to speedrunners." translation="Entrá a opciones avanzadas que podrían interesarte si hacés speedrun." explanation="description for speedrunner options" max="38*5"/>
@@ -637,9 +632,6 @@
<string english="Tileset Colour Changed" translation="Color de casillas cambiado" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/> <string english="Tileset Colour Changed" translation="Color de casillas cambiado" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/>
<string english="Enemy Type Changed" translation="Tipo de enemigo cambiado" explanation="level editor, user changed enemy appearance for the room" max="38*3"/> <string english="Enemy Type Changed" translation="Tipo de enemigo cambiado" explanation="level editor, user changed enemy appearance for the room" max="38*3"/>
<string english="Platform speed is now {speed}" translation="Velocidad de las plataformas: {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/> <string english="Platform speed is now {speed}" translation="Velocidad de las plataformas: {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/>
<string english="Enemy speed is now {speed}" translation="Velocidad de los enemigos: {speed}" explanation="level editor, user changed speed of enemies for the room" max="38*3"/>
<string english="ERROR: Nothing to undo" translation="" explanation="level editor, user tried to undo with nothing to undo" max="38*3"/>
<string english="ERROR: Nothing to redo" translation="" explanation="level editor, user tried to redo with nothing to redo" max="38*3"/>
<string english="Reloaded resources" translation="Recursos recargados" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/> <string english="Reloaded resources" translation="Recursos recargados" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/>
<string english="ERROR: Invalid format" translation="ERROR: Formato no válido" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/> <string english="ERROR: Invalid format" translation="ERROR: Formato no válido" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/>
<string english="Loaded map: {filename}.vvvvvv" translation="Mapa cargado: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/> <string english="Loaded map: {filename}.vvvvvv" translation="Mapa cargado: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/>
-2
View File
@@ -638,8 +638,6 @@
<string english="Enemy Type Changed" translation="نوع دشمن تغییر کرد" explanation="level editor, user changed enemy appearance for the room" max="38*3" max_local="38*3"/> <string english="Enemy Type Changed" translation="نوع دشمن تغییر کرد" explanation="level editor, user changed enemy appearance for the room" max="38*3" max_local="38*3"/>
<string english="Platform speed is now {speed}" translation="سرعت سکو اکنون برابر با {speed} است" explanation="level editor, user changed speed of platforms for the room" max="38*3" max_local="38*3"/> <string english="Platform speed is now {speed}" translation="سرعت سکو اکنون برابر با {speed} است" explanation="level editor, user changed speed of platforms for the room" max="38*3" max_local="38*3"/>
<string english="Enemy speed is now {speed}" translation="سرعت دشمن اکنون برابر با {speed} است" explanation="level editor, user changed speed of enemies for the room" max="38*3" max_local="38*3"/> <string english="Enemy speed is now {speed}" translation="سرعت دشمن اکنون برابر با {speed} است" explanation="level editor, user changed speed of enemies for the room" max="38*3" max_local="38*3"/>
<string english="ERROR: Nothing to undo" translation="" explanation="level editor, user tried to undo with nothing to undo" max="38*3" max_local="38*3"/>
<string english="ERROR: Nothing to redo" translation="" explanation="level editor, user tried to redo with nothing to redo" max="38*3" max_local="38*3"/>
<string english="Reloaded resources" translation="بارگذاری مجدد منابع" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3" max_local="38*3"/> <string english="Reloaded resources" translation="بارگذاری مجدد منابع" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3" max_local="38*3"/>
<string english="ERROR: Invalid format" translation="خطا: فرمت اشتباه" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3" max_local="38*3"/> <string english="ERROR: Invalid format" translation="خطا: فرمت اشتباه" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3" max_local="38*3"/>
<string english="Loaded map: {filename}.vvvvvv" translation="نقشه‌ی بارگذاری شده {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3" max_local="38*3"/> <string english="Loaded map: {filename}.vvvvvv" translation="نقشه‌ی بارگذاری شده {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3" max_local="38*3"/>
-8
View File
@@ -242,11 +242,6 @@
<string english="Lets you see through what is behind the name at the bottom of the screen." translation="Vous permet de voir ce qui se|trouve derrière le nom affiché|en bas de l&apos;écran." explanation="" max="38*3"/> <string english="Lets you see through what is behind the name at the bottom of the screen." translation="Vous permet de voir ce qui se|trouve derrière le nom affiché|en bas de l&apos;écran." explanation="" max="38*3"/>
<string english="Room name background is TRANSLUCENT" translation="Fond de nom des salles TRANSPARENT" explanation="" max="38*2"/> <string english="Room name background is TRANSLUCENT" translation="Fond de nom des salles TRANSPARENT" explanation="" max="38*2"/>
<string english="Room name background is OPAQUE" translation="Fond de nom des salles OPAQUE" explanation="" max="38*2"/> <string english="Room name background is OPAQUE" translation="Fond de nom des salles OPAQUE" explanation="" max="38*2"/>
<string english="checkpoint saving" translation="sauvegarde aux points de contrôle" explanation="menu option"/>
<string english="Checkpoint Saving" translation="Sauvegarde auto" explanation="title, makes checkpoints save the game" max="20"/>
<string english="Toggle if checkpoints should save the game." translation="Active ou non la sauvegarde aux points de contrôle" explanation="" max="38*3"/>
<string english="Checkpoint saving is OFF" translation="Sauvegarde auto DÉSACTIVÉE" explanation="makes checkpoints save the game" max="38*2"/>
<string english="Checkpoint saving is ON" translation="Sauvegarde auto ACTIVÉE" explanation="makes checkpoints save the game" max="38*2"/>
<string english="speedrun options" translation="options de speedrun" explanation="menu option"/> <string english="speedrun options" translation="options de speedrun" explanation="menu option"/>
<string english="Speedrunner Options" translation="Options de speedrun" explanation="title" max="20"/> <string english="Speedrunner Options" translation="Options de speedrun" explanation="title" max="20"/>
<string english="Access some advanced settings that might be of interest to speedrunners." translation="Accédez à des paramètres|avancés susceptibles d&apos;intéresser|les speedrunners." explanation="description for speedrunner options" max="38*5"/> <string english="Access some advanced settings that might be of interest to speedrunners." translation="Accédez à des paramètres|avancés susceptibles d&apos;intéresser|les speedrunners." explanation="description for speedrunner options" max="38*5"/>
@@ -637,9 +632,6 @@
<string english="Tileset Colour Changed" translation="Couleur des tuiles modifiée" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/> <string english="Tileset Colour Changed" translation="Couleur des tuiles modifiée" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/>
<string english="Enemy Type Changed" translation="Type d&apos;ennemis modifié" explanation="level editor, user changed enemy appearance for the room" max="38*3"/> <string english="Enemy Type Changed" translation="Type d&apos;ennemis modifié" explanation="level editor, user changed enemy appearance for the room" max="38*3"/>
<string english="Platform speed is now {speed}" translation="Vitesse des plateformes réglée sur {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/> <string english="Platform speed is now {speed}" translation="Vitesse des plateformes réglée sur {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/>
<string english="Enemy speed is now {speed}" translation="Vitesse des ennemis réglée sur {speed}" explanation="level editor, user changed speed of enemies for the room" max="38*3"/>
<string english="ERROR: Nothing to undo" translation="" explanation="level editor, user tried to undo with nothing to undo" max="38*3"/>
<string english="ERROR: Nothing to redo" translation="" explanation="level editor, user tried to redo with nothing to redo" max="38*3"/>
<string english="Reloaded resources" translation="Recharger les ressources" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/> <string english="Reloaded resources" translation="Recharger les ressources" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/>
<string english="ERROR: Invalid format" translation="ERREUR : format invalide" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/> <string english="ERROR: Invalid format" translation="ERREUR : format invalide" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/>
<string english="Loaded map: {filename}.vvvvvv" translation="Carte chargée : {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/> <string english="Loaded map: {filename}.vvvvvv" translation="Carte chargée : {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/>
-8
View File
@@ -243,11 +243,6 @@ Déan cóip chúltaca, ar eagla na heagla." explanation="translation maintenance
<string english="Lets you see through what is behind the name at the bottom of the screen." translation="Beidh tú in ann a fheiceáil céard atá taobh thiar den ainm ag bun an scáileáin." explanation="" max="38*3"/> <string english="Lets you see through what is behind the name at the bottom of the screen." translation="Beidh tú in ann a fheiceáil céard atá taobh thiar den ainm ag bun an scáileáin." explanation="" max="38*3"/>
<string english="Room name background is TRANSLUCENT" translation="Cúlra Ainmneacha na Seomraí: TRÉSHOILSEACH" explanation="" max="38*2"/> <string english="Room name background is TRANSLUCENT" translation="Cúlra Ainmneacha na Seomraí: TRÉSHOILSEACH" explanation="" max="38*2"/>
<string english="Room name background is OPAQUE" translation="Cúlra Ainmneacha na Seomraí: TEIMHNEACH" explanation="" max="38*2"/> <string english="Room name background is OPAQUE" translation="Cúlra Ainmneacha na Seomraí: TEIMHNEACH" explanation="" max="38*2"/>
<string english="checkpoint saving" translation="ceadaigh &apos;sábháil seicphointí&apos;" explanation="menu option"/>
<string english="Checkpoint Saving" translation="Sábháil seicphointí" explanation="title, makes checkpoints save the game" max="20"/>
<string english="Toggle if checkpoints should save the game." translation="Roghnaigh an sábhálfar seicphointí an chluiche " explanation="" max="38*3"/>
<string english="Checkpoint saving is OFF" translation="Tá sábháil seicphointí AS FEIDHM" explanation="makes checkpoints save the game" max="38*2"/>
<string english="Checkpoint saving is ON" translation="Tá sábháil seicphointí I bhFEIDHM" explanation="makes checkpoints save the game" max="38*2"/>
<string english="speedrun options" translation="socruithe sciuirde" explanation="menu option"/> <string english="speedrun options" translation="socruithe sciuirde" explanation="menu option"/>
<string english="Speedrunner Options" translation="Socruithe Sciuirde" explanation="title" max="20"/> <string english="Speedrunner Options" translation="Socruithe Sciuirde" explanation="title" max="20"/>
<string english="Access some advanced settings that might be of interest to speedrunners." translation="Socruithe breise a bhaineann le sciuirdeanna." explanation="description for speedrunner options" max="38*5"/> <string english="Access some advanced settings that might be of interest to speedrunners." translation="Socruithe breise a bhaineann le sciuirdeanna." explanation="description for speedrunner options" max="38*5"/>
@@ -639,9 +634,6 @@ Déan cóip chúltaca, ar eagla na heagla." explanation="translation maintenance
<string english="Tileset Colour Changed" translation="Athraíodh Dath na dTíleanna" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/> <string english="Tileset Colour Changed" translation="Athraíodh Dath na dTíleanna" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/>
<string english="Enemy Type Changed" translation="Athraíodh Cineál Naimhde" explanation="level editor, user changed enemy appearance for the room" max="38*3"/> <string english="Enemy Type Changed" translation="Athraíodh Cineál Naimhde" explanation="level editor, user changed enemy appearance for the room" max="38*3"/>
<string english="Platform speed is now {speed}" translation="Luas na n-ardán {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/> <string english="Platform speed is now {speed}" translation="Luas na n-ardán {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/>
<string english="Enemy speed is now {speed}" translation="Luas na naimhde {speed}" explanation="level editor, user changed speed of enemies for the room" max="38*3"/>
<string english="ERROR: Nothing to undo" translation="" explanation="level editor, user tried to undo with nothing to undo" max="38*3"/>
<string english="ERROR: Nothing to redo" translation="" explanation="level editor, user tried to redo with nothing to redo" max="38*3"/>
<string english="Reloaded resources" translation="Athlódáladh acmhainní" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/> <string english="Reloaded resources" translation="Athlódáladh acmhainní" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/>
<string english="ERROR: Invalid format" translation="EARRÁID: Formáid Neamhbhailí" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/> <string english="ERROR: Invalid format" translation="EARRÁID: Formáid Neamhbhailí" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/>
<string english="Loaded map: {filename}.vvvvvv" translation="Mapa lódáilte: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/> <string english="Loaded map: {filename}.vvvvvv" translation="Mapa lódáilte: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/>
-8
View File
@@ -242,11 +242,6 @@
<string english="Lets you see through what is behind the name at the bottom of the screen." translation="Consente di vedere dietro il nome nella parte bassa dello schermo." explanation="" max="38*3"/> <string english="Lets you see through what is behind the name at the bottom of the screen." translation="Consente di vedere dietro il nome nella parte bassa dello schermo." explanation="" max="38*3"/>
<string english="Room name background is TRANSLUCENT" translation="Lo sfondo del nome della stanza è TRASPARENTE" explanation="" max="38*2"/> <string english="Room name background is TRANSLUCENT" translation="Lo sfondo del nome della stanza è TRASPARENTE" explanation="" max="38*2"/>
<string english="Room name background is OPAQUE" translation="Lo sfondo del nome della stanza è OPACO" explanation="" max="38*2"/> <string english="Room name background is OPAQUE" translation="Lo sfondo del nome della stanza è OPACO" explanation="" max="38*2"/>
<string english="checkpoint saving" translation="salvataggio ai checkpoint" explanation="menu option"/>
<string english="Checkpoint Saving" translation="Salva ai checkpoint" explanation="title, makes checkpoints save the game" max="20"/>
<string english="Toggle if checkpoints should save the game." translation="Attiva/disattiva il salvataggio della partita ai checkpoint" explanation="" max="38*3"/>
<string english="Checkpoint saving is OFF" translation="Salvataggio ai checkpoint: NO" explanation="makes checkpoints save the game" max="38*2"/>
<string english="Checkpoint saving is ON" translation="Salvataggio ai checkpoint: SÌ" explanation="makes checkpoints save the game" max="38*2"/>
<string english="speedrun options" translation="opzioni speedrun" explanation="menu option"/> <string english="speedrun options" translation="opzioni speedrun" explanation="menu option"/>
<string english="Speedrunner Options" translation="Opzioni speedrunner" explanation="title" max="20"/> <string english="Speedrunner Options" translation="Opzioni speedrunner" explanation="title" max="20"/>
<string english="Access some advanced settings that might be of interest to speedrunners." translation="Accedi ad alcune impostazioni avanzate di interesse per gli speedrunner." explanation="description for speedrunner options" max="38*5"/> <string english="Access some advanced settings that might be of interest to speedrunners." translation="Accedi ad alcune impostazioni avanzate di interesse per gli speedrunner." explanation="description for speedrunner options" max="38*5"/>
@@ -637,9 +632,6 @@
<string english="Tileset Colour Changed" translation="Colore set di caselle cambiato" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/> <string english="Tileset Colour Changed" translation="Colore set di caselle cambiato" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/>
<string english="Enemy Type Changed" translation="Tipo di nemico cambiato" explanation="level editor, user changed enemy appearance for the room" max="38*3"/> <string english="Enemy Type Changed" translation="Tipo di nemico cambiato" explanation="level editor, user changed enemy appearance for the room" max="38*3"/>
<string english="Platform speed is now {speed}" translation="La velocità piattaforma ora è {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/> <string english="Platform speed is now {speed}" translation="La velocità piattaforma ora è {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/>
<string english="Enemy speed is now {speed}" translation="La velocità dei nemici è ora {speed}" explanation="level editor, user changed speed of enemies for the room" max="38*3"/>
<string english="ERROR: Nothing to undo" translation="" explanation="level editor, user tried to undo with nothing to undo" max="38*3"/>
<string english="ERROR: Nothing to redo" translation="" explanation="level editor, user tried to redo with nothing to redo" max="38*3"/>
<string english="Reloaded resources" translation="Risorse ricaricate" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/> <string english="Reloaded resources" translation="Risorse ricaricate" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/>
<string english="ERROR: Invalid format" translation="ERRORE: Formato non valido" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/> <string english="ERROR: Invalid format" translation="ERRORE: Formato non valido" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/>
<string english="Loaded map: {filename}.vvvvvv" translation="Mappa caricata: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/> <string english="Loaded map: {filename}.vvvvvv" translation="Mappa caricata: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/>
-8
View File
@@ -256,11 +256,6 @@ Escキーを押すと表示を終了する。" explanation="" max="38*6" max_loc
<string english="Lets you see through what is behind the name at the bottom of the screen." translation="画面下部に表示されるルームタイトルの背景を半透明にする。" explanation="" max="38*3" max_local="38*2"/> <string english="Lets you see through what is behind the name at the bottom of the screen." translation="画面下部に表示されるルームタイトルの背景を半透明にする。" explanation="" max="38*3" max_local="38*2"/>
<string english="Room name background is TRANSLUCENT" translation="現在の設定: 半透明" explanation="" max="38*2" max_local="38*1"/> <string english="Room name background is TRANSLUCENT" translation="現在の設定: 半透明" explanation="" max="38*2" max_local="38*1"/>
<string english="Room name background is OPAQUE" translation="現在の設定: 不透明" explanation="" max="38*2" max_local="38*1"/> <string english="Room name background is OPAQUE" translation="現在の設定: 不透明" explanation="" max="38*2" max_local="38*1"/>
<string english="checkpoint saving" translation="チェックポイントでセーブ" explanation="menu option"/>
<string english="Checkpoint Saving" translation="チェックポイントでセーブ" explanation="title, makes checkpoints save the game" max="20" max_local="20"/>
<string english="Toggle if checkpoints should save the game." translation="チェックポイント通過時にゲームを自動セーブするかを切り替える。" explanation="" max="38*3" max_local="38*2"/>
<string english="Checkpoint saving is OFF" translation="現在の設定: OFF" explanation="makes checkpoints save the game" max="38*2" max_local="38*1"/>
<string english="Checkpoint saving is ON" translation="現在の設定: ON" explanation="makes checkpoints save the game" max="38*2" max_local="38*1"/>
<string english="speedrun options" translation="RTA用設定" explanation="menu option"/> <string english="speedrun options" translation="RTA用設定" explanation="menu option"/>
<string english="Speedrunner Options" translation="RTA用設定" explanation="title" max="20" max_local="20"/> <string english="Speedrunner Options" translation="RTA用設定" explanation="title" max="20" max_local="20"/>
<string english="Access some advanced settings that might be of interest to speedrunners." translation="RTA/スピードランで役に立つ設定を変更する。" explanation="description for speedrunner options" max="38*5" max_local="38*4"/> <string english="Access some advanced settings that might be of interest to speedrunners." translation="RTA/スピードランで役に立つ設定を変更する。" explanation="description for speedrunner options" max="38*5" max_local="38*4"/>
@@ -673,9 +668,6 @@ Steam Deckには対応していません。" explanation="" max="38*5" max_local
<string english="Tileset Colour Changed" translation="タイルセットのカラーを変更しました" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3" max_local="38*2"/> <string english="Tileset Colour Changed" translation="タイルセットのカラーを変更しました" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3" max_local="38*2"/>
<string english="Enemy Type Changed" translation="敵の種類を変更しました" explanation="level editor, user changed enemy appearance for the room" max="38*3" max_local="38*2"/> <string english="Enemy Type Changed" translation="敵の種類を変更しました" explanation="level editor, user changed enemy appearance for the room" max="38*3" max_local="38*2"/>
<string english="Platform speed is now {speed}" translation="プラットフォームの速度を {speed} に変更しました" explanation="level editor, user changed speed of platforms for the room" max="38*3" max_local="38*2"/> <string english="Platform speed is now {speed}" translation="プラットフォームの速度を {speed} に変更しました" explanation="level editor, user changed speed of platforms for the room" max="38*3" max_local="38*2"/>
<string english="Enemy speed is now {speed}" translation="敵のスピードを {speed} に変更しました" explanation="level editor, user changed speed of enemies for the room" max="38*3" max_local="38*2"/>
<string english="ERROR: Nothing to undo" translation="" explanation="level editor, user tried to undo with nothing to undo" max="38*3" max_local="38*2"/>
<string english="ERROR: Nothing to redo" translation="" explanation="level editor, user tried to redo with nothing to redo" max="38*3" max_local="38*2"/>
<string english="Reloaded resources" translation="リソースを再読み込みしました" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3" max_local="38*2"/> <string english="Reloaded resources" translation="リソースを再読み込みしました" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3" max_local="38*2"/>
<string english="ERROR: Invalid format" translation="エラー: 無効な記述形式" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3" max_local="38*2"/> <string english="ERROR: Invalid format" translation="エラー: 無効な記述形式" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3" max_local="38*2"/>
<string english="Loaded map: {filename}.vvvvvv" translation="{filename}.vvvvvv をロードしました" explanation="successfully loaded level file" max="38*3" max_local="38*2"/> <string english="Loaded map: {filename}.vvvvvv" translation="{filename}.vvvvvv をロードしました" explanation="successfully loaded level file" max="38*3" max_local="38*2"/>
-8
View File
@@ -242,11 +242,6 @@
<string english="Lets you see through what is behind the name at the bottom of the screen." translation="화면 아래에 있는 이름 뒤쪽에 있는 것을 볼 수 있게 합니다." explanation="" max="38*3" max_local="30*3"/> <string english="Lets you see through what is behind the name at the bottom of the screen." translation="화면 아래에 있는 이름 뒤쪽에 있는 것을 볼 수 있게 합니다." explanation="" max="38*3" max_local="30*3"/>
<string english="Room name background is TRANSLUCENT" translation="방 이름 배경 투명" explanation="" max="38*2" max_local="30*2"/> <string english="Room name background is TRANSLUCENT" translation="방 이름 배경 투명" explanation="" max="38*2" max_local="30*2"/>
<string english="Room name background is OPAQUE" translation="방 이름 배경 불투명" explanation="" max="38*2" max_local="30*2"/> <string english="Room name background is OPAQUE" translation="방 이름 배경 불투명" explanation="" max="38*2" max_local="30*2"/>
<string english="checkpoint saving" translation="체크포인트 저장" explanation="menu option"/>
<string english="Checkpoint Saving" translation="체크포인트 저장" explanation="title, makes checkpoints save the game" max="20" max_local="16"/>
<string english="Toggle if checkpoints should save the game." translation="체크포인트 저장 기능을 켜거나 끕니다." explanation="" max="38*3" max_local="30*3"/>
<string english="Checkpoint saving is OFF" translation="체크포인트 저장 꺼짐" explanation="makes checkpoints save the game" max="38*2" max_local="30*2"/>
<string english="Checkpoint saving is ON" translation="체크포인트 저장 켜짐" explanation="makes checkpoints save the game" max="38*2" max_local="30*2"/>
<string english="speedrun options" translation="스피드런 설정" explanation="menu option"/> <string english="speedrun options" translation="스피드런 설정" explanation="menu option"/>
<string english="Speedrunner Options" translation="스피드런 설정" explanation="title" max="20" max_local="16"/> <string english="Speedrunner Options" translation="스피드런 설정" explanation="title" max="20" max_local="16"/>
<string english="Access some advanced settings that might be of interest to speedrunners." translation="스피드런을 하는 유저들에게 흥미가 갈만한 고급 설정에 진입합니다." explanation="description for speedrunner options" max="38*5" max_local="30*5"/> <string english="Access some advanced settings that might be of interest to speedrunners." translation="스피드런을 하는 유저들에게 흥미가 갈만한 고급 설정에 진입합니다." explanation="description for speedrunner options" max="38*5" max_local="30*5"/>
@@ -637,9 +632,6 @@
<string english="Tileset Colour Changed" translation="타일셋 색 변경됨" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3" max_local="30*3"/> <string english="Tileset Colour Changed" translation="타일셋 색 변경됨" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3" max_local="30*3"/>
<string english="Enemy Type Changed" translation="적 종류 변경됨" explanation="level editor, user changed enemy appearance for the room" max="38*3" max_local="30*3"/> <string english="Enemy Type Changed" translation="적 종류 변경됨" explanation="level editor, user changed enemy appearance for the room" max="38*3" max_local="30*3"/>
<string english="Platform speed is now {speed}" translation="플랫폼 속도 현재 {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3" max_local="30*3"/> <string english="Platform speed is now {speed}" translation="플랫폼 속도 현재 {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3" max_local="30*3"/>
<string english="Enemy speed is now {speed}" translation="적의 속도 현재 {speed}" explanation="level editor, user changed speed of enemies for the room" max="38*3" max_local="30*3"/>
<string english="ERROR: Nothing to undo" translation="" explanation="level editor, user tried to undo with nothing to undo" max="38*3" max_local="30*3"/>
<string english="ERROR: Nothing to redo" translation="" explanation="level editor, user tried to redo with nothing to redo" max="38*3" max_local="30*3"/>
<string english="Reloaded resources" translation="자원 다시 불러오기" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3" max_local="30*3"/> <string english="Reloaded resources" translation="자원 다시 불러오기" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3" max_local="30*3"/>
<string english="ERROR: Invalid format" translation="오류: 이용 불가능한 포맷" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3" max_local="30*3"/> <string english="ERROR: Invalid format" translation="오류: 이용 불가능한 포맷" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3" max_local="30*3"/>
<string english="Loaded map: {filename}.vvvvvv" translation="불러온 지도: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3" max_local="30*3"/> <string english="Loaded map: {filename}.vvvvvv" translation="불러온 지도: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3" max_local="30*3"/>
-8
View File
@@ -242,11 +242,6 @@
<string english="Lets you see through what is behind the name at the bottom of the screen." translation="Laat zien wat er achter de naam van een kamer zit onder in beeld." explanation="" max="38*3"/> <string english="Lets you see through what is behind the name at the bottom of the screen." translation="Laat zien wat er achter de naam van een kamer zit onder in beeld." explanation="" max="38*3"/>
<string english="Room name background is TRANSLUCENT" translation="Kamernaamachtergrond is DOORZICHTIG" explanation="" max="38*2"/> <string english="Room name background is TRANSLUCENT" translation="Kamernaamachtergrond is DOORZICHTIG" explanation="" max="38*2"/>
<string english="Room name background is OPAQUE" translation="Kamernaamachtergrond is ONDOORZICHTIG" explanation="" max="38*2"/> <string english="Room name background is OPAQUE" translation="Kamernaamachtergrond is ONDOORZICHTIG" explanation="" max="38*2"/>
<string english="checkpoint saving" translation="opslaan bij checkpoints" explanation="menu option"/>
<string english="Checkpoint Saving" translation="Checkpoint-opslaan" explanation="title, makes checkpoints save the game" max="20"/>
<string english="Toggle if checkpoints should save the game." translation="Bepaal of checkpoints het spel op moeten slaan." explanation="" max="38*3"/>
<string english="Checkpoint saving is OFF" translation="Opslaan bij checkpoints staat UIT" explanation="makes checkpoints save the game" max="38*2"/>
<string english="Checkpoint saving is ON" translation="Opslaan bij checkpoints staat AAN" explanation="makes checkpoints save the game" max="38*2"/>
<string english="speedrun options" translation="speedrunopties" explanation="menu option"/> <string english="speedrun options" translation="speedrunopties" explanation="menu option"/>
<string english="Speedrunner Options" translation="Speedrunopties" explanation="title" max="20"/> <string english="Speedrunner Options" translation="Speedrunopties" explanation="title" max="20"/>
<string english="Access some advanced settings that might be of interest to speedrunners." translation="Een aantal geavanceerde instellingen die interessant kunnen zijn voor speedrunners." explanation="description for speedrunner options" max="38*5"/> <string english="Access some advanced settings that might be of interest to speedrunners." translation="Een aantal geavanceerde instellingen die interessant kunnen zijn voor speedrunners." explanation="description for speedrunner options" max="38*5"/>
@@ -637,9 +632,6 @@
<string english="Tileset Colour Changed" translation="Tilesetkleur aangepast" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/> <string english="Tileset Colour Changed" translation="Tilesetkleur aangepast" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/>
<string english="Enemy Type Changed" translation="Vijandtype aangepast" explanation="level editor, user changed enemy appearance for the room" max="38*3"/> <string english="Enemy Type Changed" translation="Vijandtype aangepast" explanation="level editor, user changed enemy appearance for the room" max="38*3"/>
<string english="Platform speed is now {speed}" translation="Platformsnelheid is nu {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/> <string english="Platform speed is now {speed}" translation="Platformsnelheid is nu {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/>
<string english="Enemy speed is now {speed}" translation="Vijandsnelheid is nu {speed}" explanation="level editor, user changed speed of enemies for the room" max="38*3"/>
<string english="ERROR: Nothing to undo" translation="" explanation="level editor, user tried to undo with nothing to undo" max="38*3"/>
<string english="ERROR: Nothing to redo" translation="" explanation="level editor, user tried to redo with nothing to redo" max="38*3"/>
<string english="Reloaded resources" translation="Bronnen opnieuw geladen" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/> <string english="Reloaded resources" translation="Bronnen opnieuw geladen" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/>
<string english="ERROR: Invalid format" translation="FOUT: Ongeldig formaat" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/> <string english="ERROR: Invalid format" translation="FOUT: Ongeldig formaat" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/>
<string english="Loaded map: {filename}.vvvvvv" translation="Level geladen: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/> <string english="Loaded map: {filename}.vvvvvv" translation="Level geladen: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/>
-8
View File
@@ -242,11 +242,6 @@
<string english="Lets you see through what is behind the name at the bottom of the screen." translation="Pozwala widzieć przestrzeń za nazwami pokoi." explanation="" max="38*3"/> <string english="Lets you see through what is behind the name at the bottom of the screen." translation="Pozwala widzieć przestrzeń za nazwami pokoi." explanation="" max="38*3"/>
<string english="Room name background is TRANSLUCENT" translation="Tło za nazwami jest PRZEZROCZYSTE" explanation="" max="38*2"/> <string english="Room name background is TRANSLUCENT" translation="Tło za nazwami jest PRZEZROCZYSTE" explanation="" max="38*2"/>
<string english="Room name background is OPAQUE" translation="Tło za nazwami jest NIEPRZEZROCZYSTE" explanation="" max="38*2"/> <string english="Room name background is OPAQUE" translation="Tło za nazwami jest NIEPRZEZROCZYSTE" explanation="" max="38*2"/>
<string english="checkpoint saving" translation="zapis przy punktach przywrócenia" explanation="menu option"/>
<string english="Checkpoint Saving" translation="Punkty Przywrócenia" explanation="title, makes checkpoints save the game" max="20"/>
<string english="Toggle if checkpoints should save the game." translation="Ustaw, czy gra będzie zapisywana poprzez punkty przywrócenia." explanation="" max="38*3"/>
<string english="Checkpoint saving is OFF" translation="Zapis przy punktach przywrócenia jest WYŁĄCZONY" explanation="makes checkpoints save the game" max="38*2"/>
<string english="Checkpoint saving is ON" translation="Zapis przy punktach przywrócenia jest WŁĄCZONY" explanation="makes checkpoints save the game" max="38*2"/>
<string english="speedrun options" translation="opcje dla speedrunnerów" explanation="menu option"/> <string english="speedrun options" translation="opcje dla speedrunnerów" explanation="menu option"/>
<string english="Speedrunner Options" translation="Opcje Speedrunnerów" explanation="title" max="20"/> <string english="Speedrunner Options" translation="Opcje Speedrunnerów" explanation="title" max="20"/>
<string english="Access some advanced settings that might be of interest to speedrunners." translation="Zaawansowane ustawienia|do speedrunnerów." explanation="description for speedrunner options" max="38*5"/> <string english="Access some advanced settings that might be of interest to speedrunners." translation="Zaawansowane ustawienia|do speedrunnerów." explanation="description for speedrunner options" max="38*5"/>
@@ -637,9 +632,6 @@
<string english="Tileset Colour Changed" translation="Zmieniono Kolor Klocków" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/> <string english="Tileset Colour Changed" translation="Zmieniono Kolor Klocków" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/>
<string english="Enemy Type Changed" translation="Zmieniono Typ Wroga" explanation="level editor, user changed enemy appearance for the room" max="38*3"/> <string english="Enemy Type Changed" translation="Zmieniono Typ Wroga" explanation="level editor, user changed enemy appearance for the room" max="38*3"/>
<string english="Platform speed is now {speed}" translation="Prędkość platformy: {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/> <string english="Platform speed is now {speed}" translation="Prędkość platformy: {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/>
<string english="Enemy speed is now {speed}" translation="Prędkość przeciwników: {speed}" explanation="level editor, user changed speed of enemies for the room" max="38*3"/>
<string english="ERROR: Nothing to undo" translation="" explanation="level editor, user tried to undo with nothing to undo" max="38*3"/>
<string english="ERROR: Nothing to redo" translation="" explanation="level editor, user tried to redo with nothing to redo" max="38*3"/>
<string english="Reloaded resources" translation="Załadowano zasoby ponownie" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/> <string english="Reloaded resources" translation="Załadowano zasoby ponownie" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/>
<string english="ERROR: Invalid format" translation="BŁĄD: Niewłaściwy format" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/> <string english="ERROR: Invalid format" translation="BŁĄD: Niewłaściwy format" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/>
<string english="Loaded map: {filename}.vvvvvv" translation="Wczytano poziom: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/> <string english="Loaded map: {filename}.vvvvvv" translation="Wczytano poziom: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/>
-8
View File
@@ -242,11 +242,6 @@
<string english="Lets you see through what is behind the name at the bottom of the screen." translation="Permite ver o que está por trás do nome na parte inferior da tela." explanation="" max="38*3"/> <string english="Lets you see through what is behind the name at the bottom of the screen." translation="Permite ver o que está por trás do nome na parte inferior da tela." explanation="" max="38*3"/>
<string english="Room name background is TRANSLUCENT" translation="O plano de fundo do nome da sala está TRANSLÚCIDO" explanation="" max="38*2"/> <string english="Room name background is TRANSLUCENT" translation="O plano de fundo do nome da sala está TRANSLÚCIDO" explanation="" max="38*2"/>
<string english="Room name background is OPAQUE" translation="O plano de fundo do nome da sala está OPACO" explanation="" max="38*2"/> <string english="Room name background is OPAQUE" translation="O plano de fundo do nome da sala está OPACO" explanation="" max="38*2"/>
<string english="checkpoint saving" translation="salvamento automático" explanation="menu option"/>
<string english="Checkpoint Saving" translation="Salvamento auto" explanation="title, makes checkpoints save the game" max="20"/>
<string english="Toggle if checkpoints should save the game." translation="Selecione se deseja que o jogo tenha pontos de salvamento." explanation="" max="38*3"/>
<string english="Checkpoint saving is OFF" translation="Salvamento automático está DESLIGADO." explanation="makes checkpoints save the game" max="38*2"/>
<string english="Checkpoint saving is ON" translation="Salvamento automático está LIGADO." explanation="makes checkpoints save the game" max="38*2"/>
<string english="speedrun options" translation="opções de speedrun" explanation="menu option"/> <string english="speedrun options" translation="opções de speedrun" explanation="menu option"/>
<string english="Speedrunner Options" translation="Opções de speedrun" explanation="title" max="20"/> <string english="Speedrunner Options" translation="Opções de speedrun" explanation="title" max="20"/>
<string english="Access some advanced settings that might be of interest to speedrunners." translation="Acessa algumas configurações avançadas que podem interessar aos speedrunners." explanation="description for speedrunner options" max="38*5"/> <string english="Access some advanced settings that might be of interest to speedrunners." translation="Acessa algumas configurações avançadas que podem interessar aos speedrunners." explanation="description for speedrunner options" max="38*5"/>
@@ -637,9 +632,6 @@
<string english="Tileset Colour Changed" translation="A cor do conjunto de blocos foi alterada" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/> <string english="Tileset Colour Changed" translation="A cor do conjunto de blocos foi alterada" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/>
<string english="Enemy Type Changed" translation="O tipo de inimigo foi alterado" explanation="level editor, user changed enemy appearance for the room" max="38*3"/> <string english="Enemy Type Changed" translation="O tipo de inimigo foi alterado" explanation="level editor, user changed enemy appearance for the room" max="38*3"/>
<string english="Platform speed is now {speed}" translation="A velocidade da plataforma agora é {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/> <string english="Platform speed is now {speed}" translation="A velocidade da plataforma agora é {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/>
<string english="Enemy speed is now {speed}" translation="A velocidade do inimigo agora é {speed}" explanation="level editor, user changed speed of enemies for the room" max="38*3"/>
<string english="ERROR: Nothing to undo" translation="" explanation="level editor, user tried to undo with nothing to undo" max="38*3"/>
<string english="ERROR: Nothing to redo" translation="" explanation="level editor, user tried to redo with nothing to redo" max="38*3"/>
<string english="Reloaded resources" translation="Recursos recarregados" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/> <string english="Reloaded resources" translation="Recursos recarregados" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/>
<string english="ERROR: Invalid format" translation="ERRO: formato inválido" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/> <string english="ERROR: Invalid format" translation="ERRO: formato inválido" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/>
<string english="Loaded map: {filename}.vvvvvv" translation="Mapa carregado: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/> <string english="Loaded map: {filename}.vvvvvv" translation="Mapa carregado: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/>
-8
View File
@@ -242,11 +242,6 @@
<string english="Lets you see through what is behind the name at the bottom of the screen." translation="Define se é possível ver o que está por detrás do nome das salas na parte inferior do ecrã." explanation="" max="38*3"/> <string english="Lets you see through what is behind the name at the bottom of the screen." translation="Define se é possível ver o que está por detrás do nome das salas na parte inferior do ecrã." explanation="" max="38*3"/>
<string english="Room name background is TRANSLUCENT" translation="Fundo do nome da sala: TRANSPARENTE" explanation="" max="38*2"/> <string english="Room name background is TRANSLUCENT" translation="Fundo do nome da sala: TRANSPARENTE" explanation="" max="38*2"/>
<string english="Room name background is OPAQUE" translation="Fundo do nome da sala: OPACO" explanation="" max="38*2"/> <string english="Room name background is OPAQUE" translation="Fundo do nome da sala: OPACO" explanation="" max="38*2"/>
<string english="checkpoint saving" translation="guardar nos pontos de controlo" explanation="menu option"/>
<string english="Checkpoint Saving" translation="Guardar nos pontos" explanation="title, makes checkpoints save the game" max="20"/>
<string english="Toggle if checkpoints should save the game." translation="Liga/desliga a função de guardar nos pontos de controlo." explanation="" max="38*3"/>
<string english="Checkpoint saving is OFF" translation="Guardar nos pontos de controlo NÃO" explanation="makes checkpoints save the game" max="38*2"/>
<string english="Checkpoint saving is ON" translation="Guardar nos pontos de controlo SIM" explanation="makes checkpoints save the game" max="38*2"/>
<string english="speedrun options" translation="opções de corrida" explanation="menu option"/> <string english="speedrun options" translation="opções de corrida" explanation="menu option"/>
<string english="Speedrunner Options" translation="Corrida" explanation="title" max="20"/> <string english="Speedrunner Options" translation="Corrida" explanation="title" max="20"/>
<string english="Access some advanced settings that might be of interest to speedrunners." translation="Acede a definições avançadas que poderão ser úteis a quem quiser fazer corridas." explanation="description for speedrunner options" max="38*5"/> <string english="Access some advanced settings that might be of interest to speedrunners." translation="Acede a definições avançadas que poderão ser úteis a quem quiser fazer corridas." explanation="description for speedrunner options" max="38*5"/>
@@ -637,9 +632,6 @@
<string english="Tileset Colour Changed" translation="Cor de padrão alterada" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/> <string english="Tileset Colour Changed" translation="Cor de padrão alterada" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/>
<string english="Enemy Type Changed" translation="Tipo de inimigo alterado" explanation="level editor, user changed enemy appearance for the room" max="38*3"/> <string english="Enemy Type Changed" translation="Tipo de inimigo alterado" explanation="level editor, user changed enemy appearance for the room" max="38*3"/>
<string english="Platform speed is now {speed}" translation="Velocidade atual da plataforma: {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/> <string english="Platform speed is now {speed}" translation="Velocidade atual da plataforma: {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/>
<string english="Enemy speed is now {speed}" translation="Velocidade dos inimigos: {speed}" explanation="level editor, user changed speed of enemies for the room" max="38*3"/>
<string english="ERROR: Nothing to undo" translation="" explanation="level editor, user tried to undo with nothing to undo" max="38*3"/>
<string english="ERROR: Nothing to redo" translation="" explanation="level editor, user tried to redo with nothing to redo" max="38*3"/>
<string english="Reloaded resources" translation="Recursos recarregados" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/> <string english="Reloaded resources" translation="Recursos recarregados" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/>
<string english="ERROR: Invalid format" translation="ERRO: Formato inválido" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/> <string english="ERROR: Invalid format" translation="ERRO: Formato inválido" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/>
<string english="Loaded map: {filename}.vvvvvv" translation="Mapa carregado: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/> <string english="Loaded map: {filename}.vvvvvv" translation="Mapa carregado: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/>
-8
View File
@@ -242,11 +242,6 @@
<string english="Lets you see through what is behind the name at the bottom of the screen." translation="Позволяет вам увидеть, что находится позади названий комнат внизу экрана." explanation="" max="38*3"/> <string english="Lets you see through what is behind the name at the bottom of the screen." translation="Позволяет вам увидеть, что находится позади названий комнат внизу экрана." explanation="" max="38*3"/>
<string english="Room name background is TRANSLUCENT" translation="Фон названий комнат ПРОЗРАЧНЫЙ" explanation="" max="38*2"/> <string english="Room name background is TRANSLUCENT" translation="Фон названий комнат ПРОЗРАЧНЫЙ" explanation="" max="38*2"/>
<string english="Room name background is OPAQUE" translation="Фон названий комнат НЕПРОЗРАЧНЫЙ" explanation="" max="38*2"/> <string english="Room name background is OPAQUE" translation="Фон названий комнат НЕПРОЗРАЧНЫЙ" explanation="" max="38*2"/>
<string english="checkpoint saving" translation="сохранение на точках" explanation="menu option"/>
<string english="Checkpoint Saving" translation="Сохранение на точках" explanation="title, makes checkpoints save the game" max="20"/>
<string english="Toggle if checkpoints should save the game." translation="Выберите, должны ли точки сохранения автоматически сохранять игру." explanation="" max="38*3"/>
<string english="Checkpoint saving is OFF" translation="Сохранение на точках ОТКЛЮЧЕНО" explanation="makes checkpoints save the game" max="38*2"/>
<string english="Checkpoint saving is ON" translation="Сохранение на точках ВКЛЮЧЕНО" explanation="makes checkpoints save the game" max="38*2"/>
<string english="speedrun options" translation="настройки спидрана" explanation="menu option"/> <string english="speedrun options" translation="настройки спидрана" explanation="menu option"/>
<string english="Speedrunner Options" translation="Для спидранеров" explanation="title" max="20"/> <string english="Speedrunner Options" translation="Для спидранеров" explanation="title" max="20"/>
<string english="Access some advanced settings that might be of interest to speedrunners." translation="Просмотрите расширенные настройки, которые могут быть полезны спидранерам." explanation="description for speedrunner options" max="38*5"/> <string english="Access some advanced settings that might be of interest to speedrunners." translation="Просмотрите расширенные настройки, которые могут быть полезны спидранерам." explanation="description for speedrunner options" max="38*5"/>
@@ -662,9 +657,6 @@
<string english="Tileset Colour Changed" translation="Цвет плиток изменён" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/> <string english="Tileset Colour Changed" translation="Цвет плиток изменён" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/>
<string english="Enemy Type Changed" translation="Тип врагов изменён" explanation="level editor, user changed enemy appearance for the room" max="38*3"/> <string english="Enemy Type Changed" translation="Тип врагов изменён" explanation="level editor, user changed enemy appearance for the room" max="38*3"/>
<string english="Platform speed is now {speed}" translation="Установлена скорость платформ {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/> <string english="Platform speed is now {speed}" translation="Установлена скорость платформ {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/>
<string english="Enemy speed is now {speed}" translation="Установлена скорость врагов {speed}" explanation="level editor, user changed speed of enemies for the room" max="38*3"/>
<string english="ERROR: Nothing to undo" translation="" explanation="level editor, user tried to undo with nothing to undo" max="38*3"/>
<string english="ERROR: Nothing to redo" translation="" explanation="level editor, user tried to redo with nothing to redo" max="38*3"/>
<string english="Reloaded resources" translation="Ресурсы перезагружены" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/> <string english="Reloaded resources" translation="Ресурсы перезагружены" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/>
<string english="ERROR: Invalid format" translation="ОШИБКА: Недопустимый формат" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/> <string english="ERROR: Invalid format" translation="ОШИБКА: Недопустимый формат" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/>
<string english="Loaded map: {filename}.vvvvvv" translation="Карта загружена: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/> <string english="Loaded map: {filename}.vvvvvv" translation="Карта загружена: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/>
-8
View File
@@ -242,11 +242,6 @@
<string english="Lets you see through what is behind the name at the bottom of the screen." translation="Dozwŏlo widzieć, co je za mianami izbōw." explanation="" max="38*3"/> <string english="Lets you see through what is behind the name at the bottom of the screen." translation="Dozwŏlo widzieć, co je za mianami izbōw." explanation="" max="38*3"/>
<string english="Room name background is TRANSLUCENT" translation="Tło za mianami je PRZEZDZIYRNE" explanation="" max="38*2"/> <string english="Room name background is TRANSLUCENT" translation="Tło za mianami je PRZEZDZIYRNE" explanation="" max="38*2"/>
<string english="Room name background is OPAQUE" translation="Tło za mianami je NIYPRZEZDZIYRNE" explanation="" max="38*2"/> <string english="Room name background is OPAQUE" translation="Tło za mianami je NIYPRZEZDZIYRNE" explanation="" max="38*2"/>
<string english="checkpoint saving" translation="zapis ôd pōnktōw przywrōcynio" explanation="menu option"/>
<string english="Checkpoint Saving" translation="Pōnkty Przywrōcynio" explanation="title, makes checkpoints save the game" max="20"/>
<string english="Toggle if checkpoints should save the game." translation="Nasztaluj, eli szpil bydzie zachowywany bez pōnkty przywrōcynio." explanation="" max="38*3"/>
<string english="Checkpoint saving is OFF" translation="Zapis ôd pōnktōw przywrōcynio je WYŁŌNCZŌNY" explanation="makes checkpoints save the game" max="38*2"/>
<string english="Checkpoint saving is ON" translation="Zapis ôd pōnktōw przywrōcynio je ZAŁŌNCZŌNY" explanation="makes checkpoints save the game" max="38*2"/>
<string english="speedrun options" translation="ôpcyje do speedrunnerōw" explanation="menu option"/> <string english="speedrun options" translation="ôpcyje do speedrunnerōw" explanation="menu option"/>
<string english="Speedrunner Options" translation="Ôpcyje Speedrunnerōw" explanation="title" max="20"/> <string english="Speedrunner Options" translation="Ôpcyje Speedrunnerōw" explanation="title" max="20"/>
<string english="Access some advanced settings that might be of interest to speedrunners." translation="Zaawansowane sztalowania|do speedrunnerōw." explanation="description for speedrunner options" max="38*5"/> <string english="Access some advanced settings that might be of interest to speedrunners." translation="Zaawansowane sztalowania|do speedrunnerōw." explanation="description for speedrunner options" max="38*5"/>
@@ -637,9 +632,6 @@
<string english="Tileset Colour Changed" translation="Zmiyniōno Farba Klockōw" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/> <string english="Tileset Colour Changed" translation="Zmiyniōno Farba Klockōw" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/>
<string english="Enemy Type Changed" translation="Zmiyniōno Zorta Niyprzŏciela" explanation="level editor, user changed enemy appearance for the room" max="38*3"/> <string english="Enemy Type Changed" translation="Zmiyniōno Zorta Niyprzŏciela" explanation="level editor, user changed enemy appearance for the room" max="38*3"/>
<string english="Platform speed is now {speed}" translation="Gibkoś platformy: {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/> <string english="Platform speed is now {speed}" translation="Gibkoś platformy: {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/>
<string english="Enemy speed is now {speed}" translation="Gibkoś ôpacznikōw: {speed}" explanation="level editor, user changed speed of enemies for the room" max="38*3"/>
<string english="ERROR: Nothing to undo" translation="" explanation="level editor, user tried to undo with nothing to undo" max="38*3"/>
<string english="ERROR: Nothing to redo" translation="" explanation="level editor, user tried to redo with nothing to redo" max="38*3"/>
<string english="Reloaded resources" translation="Nafolowano zasoby drugi rŏz" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/> <string english="Reloaded resources" translation="Nafolowano zasoby drugi rŏz" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/>
<string english="ERROR: Invalid format" translation="FELER: Felerny format" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/> <string english="ERROR: Invalid format" translation="FELER: Felerny format" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/>
<string english="Loaded map: {filename}.vvvvvv" translation="Nafolowano poziōm: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/> <string english="Loaded map: {filename}.vvvvvv" translation="Nafolowano poziōm: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/>
-8
View File
@@ -242,11 +242,6 @@
<string english="Lets you see through what is behind the name at the bottom of the screen." translation="Ekranın altında oda adı yazılı olan|panelin arkasını görmeni sağlar." explanation="" max="38*3"/> <string english="Lets you see through what is behind the name at the bottom of the screen." translation="Ekranın altında oda adı yazılı olan|panelin arkasını görmeni sağlar." explanation="" max="38*3"/>
<string english="Room name background is TRANSLUCENT" translation="Oda adı arka planı SAYDAM" explanation="" max="38*2"/> <string english="Room name background is TRANSLUCENT" translation="Oda adı arka planı SAYDAM" explanation="" max="38*2"/>
<string english="Room name background is OPAQUE" translation="Oda adı arka planı OPAK" explanation="" max="38*2"/> <string english="Room name background is OPAQUE" translation="Oda adı arka planı OPAK" explanation="" max="38*2"/>
<string english="checkpoint saving" translation="kayıt noktasında kayıt" explanation="menu option"/>
<string english="Checkpoint Saving" translation="K. Noktasında Kayıt" explanation="title, makes checkpoints save the game" max="20"/>
<string english="Toggle if checkpoints should save the game." translation="Kayıt noktaları oyunu kaydetsin/kaydetmesin." explanation="" max="38*3"/>
<string english="Checkpoint saving is OFF" translation="K. noktası kaydı KAPALI" explanation="makes checkpoints save the game" max="38*2"/>
<string english="Checkpoint saving is ON" translation="K. noktası kaydı AÇIK" explanation="makes checkpoints save the game" max="38*2"/>
<string english="speedrun options" translation="speedrun seçenekleri" explanation="menu option"/> <string english="speedrun options" translation="speedrun seçenekleri" explanation="menu option"/>
<string english="Speedrunner Options" translation="Speedrun Seçenekleri" explanation="title" max="20"/> <string english="Speedrunner Options" translation="Speedrun Seçenekleri" explanation="title" max="20"/>
<string english="Access some advanced settings that might be of interest to speedrunners." translation="Speedrun seven oyunculara yönelik bazı gelişmiş seçeneklere eriş." explanation="description for speedrunner options" max="38*5"/> <string english="Access some advanced settings that might be of interest to speedrunners." translation="Speedrun seven oyunculara yönelik bazı gelişmiş seçeneklere eriş." explanation="description for speedrunner options" max="38*5"/>
@@ -637,9 +632,6 @@
<string english="Tileset Colour Changed" translation="Kare Renkleri Değişti" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/> <string english="Tileset Colour Changed" translation="Kare Renkleri Değişti" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/>
<string english="Enemy Type Changed" translation="Düşman Türü Değişti" explanation="level editor, user changed enemy appearance for the room" max="38*3"/> <string english="Enemy Type Changed" translation="Düşman Türü Değişti" explanation="level editor, user changed enemy appearance for the room" max="38*3"/>
<string english="Platform speed is now {speed}" translation="Platform hızı: {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/> <string english="Platform speed is now {speed}" translation="Platform hızı: {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/>
<string english="Enemy speed is now {speed}" translation="Şu anki düşman hızı: {speed}" explanation="level editor, user changed speed of enemies for the room" max="38*3"/>
<string english="ERROR: Nothing to undo" translation="" explanation="level editor, user tried to undo with nothing to undo" max="38*3"/>
<string english="ERROR: Nothing to redo" translation="" explanation="level editor, user tried to redo with nothing to redo" max="38*3"/>
<string english="Reloaded resources" translation="Kaynaklar tekrar yüklendi" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/> <string english="Reloaded resources" translation="Kaynaklar tekrar yüklendi" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/>
<string english="ERROR: Invalid format" translation="HATA: Geçersiz format" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/> <string english="ERROR: Invalid format" translation="HATA: Geçersiz format" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/>
<string english="Loaded map: {filename}.vvvvvv" translation="Yüklenen harita: {dosyaadi}.vvvvvv" explanation="successfully loaded level file" max="38*3"/> <string english="Loaded map: {filename}.vvvvvv" translation="Yüklenen harita: {dosyaadi}.vvvvvv" explanation="successfully loaded level file" max="38*3"/>
-8
View File
@@ -242,11 +242,6 @@
<string english="Lets you see through what is behind the name at the bottom of the screen." translation="Дозволяє побачити те, що розташовано за назвою внизу екрана." explanation="" max="38*3"/> <string english="Lets you see through what is behind the name at the bottom of the screen." translation="Дозволяє побачити те, що розташовано за назвою внизу екрана." explanation="" max="38*3"/>
<string english="Room name background is TRANSLUCENT" translation="Тло назв кімнат ПРОЗОРЕ" explanation="" max="38*2"/> <string english="Room name background is TRANSLUCENT" translation="Тло назв кімнат ПРОЗОРЕ" explanation="" max="38*2"/>
<string english="Room name background is OPAQUE" translation="Тло назв кімнат НЕПРОЗОРЕ" explanation="" max="38*2"/> <string english="Room name background is OPAQUE" translation="Тло назв кімнат НЕПРОЗОРЕ" explanation="" max="38*2"/>
<string english="checkpoint saving" translation="збереження в чекпоінтах" explanation="menu option"/>
<string english="Checkpoint Saving" translation="Чекпоінт. Збереження" explanation="title, makes checkpoints save the game" max="20"/>
<string english="Toggle if checkpoints should save the game." translation="Увімкніть для збереження гри в чекпоінтах" explanation="" max="38*3"/>
<string english="Checkpoint saving is OFF" translation="Збереження в чекпоінтах ВИМК." explanation="makes checkpoints save the game" max="38*2"/>
<string english="Checkpoint saving is ON" translation="Збереження в чекпоінтах УВІМК." explanation="makes checkpoints save the game" max="38*2"/>
<string english="speedrun options" translation="швидкісна гра" explanation="menu option"/> <string english="speedrun options" translation="швидкісна гра" explanation="menu option"/>
<string english="Speedrunner Options" translation="Швидкісна гра" explanation="title" max="20"/> <string english="Speedrunner Options" translation="Швидкісна гра" explanation="title" max="20"/>
<string english="Access some advanced settings that might be of interest to speedrunners." translation="Додаткові налаштування, що можуть бути корисні для швидкісного проходження." explanation="description for speedrunner options" max="38*5"/> <string english="Access some advanced settings that might be of interest to speedrunners." translation="Додаткові налаштування, що можуть бути корисні для швидкісного проходження." explanation="description for speedrunner options" max="38*5"/>
@@ -637,9 +632,6 @@
<string english="Tileset Colour Changed" translation="Колір набору плиток змінено" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/> <string english="Tileset Colour Changed" translation="Колір набору плиток змінено" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3"/>
<string english="Enemy Type Changed" translation="Тип ворога змінено" explanation="level editor, user changed enemy appearance for the room" max="38*3"/> <string english="Enemy Type Changed" translation="Тип ворога змінено" explanation="level editor, user changed enemy appearance for the room" max="38*3"/>
<string english="Platform speed is now {speed}" translation="Тепер швидкість платформи {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/> <string english="Platform speed is now {speed}" translation="Тепер швидкість платформи {speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3"/>
<string english="Enemy speed is now {speed}" translation="Тепер швидкість ворога {speed}" explanation="level editor, user changed speed of enemies for the room" max="38*3"/>
<string english="ERROR: Nothing to undo" translation="" explanation="level editor, user tried to undo with nothing to undo" max="38*3"/>
<string english="ERROR: Nothing to redo" translation="" explanation="level editor, user tried to redo with nothing to redo" max="38*3"/>
<string english="Reloaded resources" translation="Ресурси перезавантажено" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/> <string english="Reloaded resources" translation="Ресурси перезавантажено" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3"/>
<string english="ERROR: Invalid format" translation="ПОМИЛКА: Неприпустимий формат" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/> <string english="ERROR: Invalid format" translation="ПОМИЛКА: Неприпустимий формат" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3"/>
<string english="Loaded map: {filename}.vvvvvv" translation="Завантажено мапу: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/> <string english="Loaded map: {filename}.vvvvvv" translation="Завантажено мапу: {filename}.vvvvvv" explanation="successfully loaded level file" max="38*3"/>
-8
View File
@@ -248,11 +248,6 @@
<string english="Lets you see through what is behind the name at the bottom of the screen." translation="让你可以看见屏幕底端房间名后面的背景。" explanation="" max="38*3" max_local="25*2"/> <string english="Lets you see through what is behind the name at the bottom of the screen." translation="让你可以看见屏幕底端房间名后面的背景。" explanation="" max="38*3" max_local="25*2"/>
<string english="Room name background is TRANSLUCENT" translation="房间名背景 透明" explanation="" max="38*2" max_local="25*1"/> <string english="Room name background is TRANSLUCENT" translation="房间名背景 透明" explanation="" max="38*2" max_local="25*1"/>
<string english="Room name background is OPAQUE" translation="房间名背景 不透明" explanation="" max="38*2" max_local="25*1"/> <string english="Room name background is OPAQUE" translation="房间名背景 不透明" explanation="" max="38*2" max_local="25*1"/>
<string english="checkpoint saving" translation="检查点保存" explanation="menu option"/>
<string english="Checkpoint Saving" translation="检查点保存" explanation="title, makes checkpoints save the game" max="20" max_local="13"/>
<string english="Toggle if checkpoints should save the game." translation="设置检查点是否可以保存游戏。" explanation="" max="38*3" max_local="25*2"/>
<string english="Checkpoint saving is OFF" translation="检查点保存已关闭" explanation="makes checkpoints save the game" max="38*2" max_local="25*1"/>
<string english="Checkpoint saving is ON" translation="检查点保存已开启" explanation="makes checkpoints save the game" max="38*2" max_local="25*1"/>
<string english="speedrun options" translation="竞速选项" explanation="menu option"/> <string english="speedrun options" translation="竞速选项" explanation="menu option"/>
<string english="Speedrunner Options" translation="竞速玩家选项" explanation="title" max="20" max_local="13"/> <string english="Speedrunner Options" translation="竞速玩家选项" explanation="title" max="20" max_local="13"/>
<string english="Access some advanced settings that might be of interest to speedrunners." translation="竞速玩家可能会感兴趣的一些高级设定。" explanation="description for speedrunner options" max="38*5" max_local="25*4"/> <string english="Access some advanced settings that might be of interest to speedrunners." translation="竞速玩家可能会感兴趣的一些高级设定。" explanation="description for speedrunner options" max="38*5" max_local="25*4"/>
@@ -647,9 +642,6 @@
<string english="Tileset Colour Changed" translation="Tileset颜色已改变" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3" max_local="25*2"/> <string english="Tileset Colour Changed" translation="Tileset颜色已改变" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3" max_local="25*2"/>
<string english="Enemy Type Changed" translation="敌人类型已改变" explanation="level editor, user changed enemy appearance for the room" max="38*3" max_local="25*2"/> <string english="Enemy Type Changed" translation="敌人类型已改变" explanation="level editor, user changed enemy appearance for the room" max="38*3" max_local="25*2"/>
<string english="Platform speed is now {speed}" translation="平台速度现在为{speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3" max_local="25*2"/> <string english="Platform speed is now {speed}" translation="平台速度现在为{speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3" max_local="25*2"/>
<string english="Enemy speed is now {speed}" translation="敌人速度现在为{speed}" explanation="level editor, user changed speed of enemies for the room" max="38*3" max_local="25*2"/>
<string english="ERROR: Nothing to undo" translation="" explanation="level editor, user tried to undo with nothing to undo" max="38*3" max_local="25*2"/>
<string english="ERROR: Nothing to redo" translation="" explanation="level editor, user tried to redo with nothing to redo" max="38*3" max_local="25*2"/>
<string english="Reloaded resources" translation="资源已重新载入" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3" max_local="25*2"/> <string english="Reloaded resources" translation="资源已重新载入" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3" max_local="25*2"/>
<string english="ERROR: Invalid format" translation="错误:格式不符合" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3" max_local="25*2"/> <string english="ERROR: Invalid format" translation="错误:格式不符合" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3" max_local="25*2"/>
<string english="Loaded map: {filename}.vvvvvv" translation="已载入地图:{filename}.vvvvvv" explanation="successfully loaded level file" max="38*3" max_local="25*2"/> <string english="Loaded map: {filename}.vvvvvv" translation="已载入地图:{filename}.vvvvvv" explanation="successfully loaded level file" max="38*3" max_local="25*2"/>
-8
View File
@@ -248,11 +248,6 @@
<string english="Lets you see through what is behind the name at the bottom of the screen." translation="讓你可以看見屏幕底端房間名後面的背景。" explanation="" max="38*3" max_local="25*2"/> <string english="Lets you see through what is behind the name at the bottom of the screen." translation="讓你可以看見屏幕底端房間名後面的背景。" explanation="" max="38*3" max_local="25*2"/>
<string english="Room name background is TRANSLUCENT" translation="房間名背景 透明" explanation="" max="38*2" max_local="25*1"/> <string english="Room name background is TRANSLUCENT" translation="房間名背景 透明" explanation="" max="38*2" max_local="25*1"/>
<string english="Room name background is OPAQUE" translation="房間名背景 不透明" explanation="" max="38*2" max_local="25*1"/> <string english="Room name background is OPAQUE" translation="房間名背景 不透明" explanation="" max="38*2" max_local="25*1"/>
<string english="checkpoint saving" translation="檢查點保存" explanation="menu option"/>
<string english="Checkpoint Saving" translation="檢查點保存" explanation="title, makes checkpoints save the game" max="20" max_local="13"/>
<string english="Toggle if checkpoints should save the game." translation="設置檢查點是否可以保存遊戲。" explanation="" max="38*3" max_local="25*2"/>
<string english="Checkpoint saving is OFF" translation="檢查點保存已關閉" explanation="makes checkpoints save the game" max="38*2" max_local="25*1"/>
<string english="Checkpoint saving is ON" translation="檢查點保存已開啟" explanation="makes checkpoints save the game" max="38*2" max_local="25*1"/>
<string english="speedrun options" translation="競速選項" explanation="menu option"/> <string english="speedrun options" translation="競速選項" explanation="menu option"/>
<string english="Speedrunner Options" translation="競速玩家選項" explanation="title" max="20" max_local="13"/> <string english="Speedrunner Options" translation="競速玩家選項" explanation="title" max="20" max_local="13"/>
<string english="Access some advanced settings that might be of interest to speedrunners." translation="競速玩家可能會感興趣的一些高級設定。" explanation="description for speedrunner options" max="38*5" max_local="25*4"/> <string english="Access some advanced settings that might be of interest to speedrunners." translation="競速玩家可能會感興趣的一些高級設定。" explanation="description for speedrunner options" max="38*5" max_local="25*4"/>
@@ -647,9 +642,6 @@
<string english="Tileset Colour Changed" translation="Tileset 顏色已改變" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3" max_local="25*2"/> <string english="Tileset Colour Changed" translation="Tileset 顏色已改變" explanation="level editor, user changed the tileset colour/variant of the room" max="38*3" max_local="25*2"/>
<string english="Enemy Type Changed" translation="敵人類型已改變" explanation="level editor, user changed enemy appearance for the room" max="38*3" max_local="25*2"/> <string english="Enemy Type Changed" translation="敵人類型已改變" explanation="level editor, user changed enemy appearance for the room" max="38*3" max_local="25*2"/>
<string english="Platform speed is now {speed}" translation="平臺速度現在為{speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3" max_local="25*2"/> <string english="Platform speed is now {speed}" translation="平臺速度現在為{speed}" explanation="level editor, user changed speed of platforms for the room" max="38*3" max_local="25*2"/>
<string english="Enemy speed is now {speed}" translation="敵人速度現在爲{speed}" explanation="level editor, user changed speed of enemies for the room" max="38*3" max_local="25*2"/>
<string english="ERROR: Nothing to undo" translation="" explanation="level editor, user tried to undo with nothing to undo" max="38*3" max_local="25*2"/>
<string english="ERROR: Nothing to redo" translation="" explanation="level editor, user tried to redo with nothing to redo" max="38*3" max_local="25*2"/>
<string english="Reloaded resources" translation="資源已重新載入" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3" max_local="25*2"/> <string english="Reloaded resources" translation="資源已重新載入" explanation="level editor, reloaded graphics assets/resources, music and sound effects" max="38*3" max_local="25*2"/>
<string english="ERROR: Invalid format" translation="錯誤:格式不符合" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3" max_local="25*2"/> <string english="ERROR: Invalid format" translation="錯誤:格式不符合" explanation="user was supposed to enter something like `12,12`, but entered `as@df`" max="38*3" max_local="25*2"/>
<string english="Loaded map: {filename}.vvvvvv" translation="已載入地圖:{filename}.vvvvvv" explanation="successfully loaded level file" max="38*3" max_local="25*2"/> <string english="Loaded map: {filename}.vvvvvv" translation="已載入地圖:{filename}.vvvvvv" explanation="successfully loaded level file" max="38*3" max_local="25*2"/>
+1 -1
View File
@@ -1,6 +1,6 @@
#include "BinaryBlob.h" #include "BinaryBlob.h"
#include <SDL3/SDL.h> #include <SDL.h>
#ifdef VVV_COMPILEMUSIC #ifdef VVV_COMPILEMUSIC
#include <stdio.h> #include <stdio.h>
#endif #endif
+1 -1
View File
@@ -1,6 +1,6 @@
#include "BlockV.h" #include "BlockV.h"
#include <SDL3/SDL_stdinc.h> #include <SDL_stdinc.h>
#include "Script.h" #include "Script.h"
#include "Font.h" #include "Font.h"
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef BLOCKV_H #ifndef BLOCKV_H
#define BLOCKV_H #define BLOCKV_H
#include <SDL3/SDL.h> #include <SDL.h>
#include <stdint.h> #include <stdint.h>
#include <string> #include <string>
+14 -14
View File
@@ -1,6 +1,6 @@
#include "ButtonGlyphs.h" #include "ButtonGlyphs.h"
#include <SDL3/SDL.h> #include <SDL.h>
#include "Game.h" #include "Game.h"
#include "Localization.h" #include "Localization.h"
@@ -96,7 +96,7 @@ ButtonGlyphLayout;
/* SDL provides Xbox buttons, we'd like to show the correct /* SDL provides Xbox buttons, we'd like to show the correct
* (controller-specific) glyphs or labels for those... */ * (controller-specific) glyphs or labels for those... */
static const char* glyph_layout[LAYOUT_TOTAL][SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER + 1] = { static const char* glyph_layout[LAYOUT_TOTAL][SDL_CONTROLLER_BUTTON_RIGHTSHOULDER + 1] = {
{ // NINTENDO_SWITCH_PRO { // NINTENDO_SWITCH_PRO
glyph[GLYPH_NINTENDO_DECK_B], glyph[GLYPH_NINTENDO_DECK_A], glyph[GLYPH_NINTENDO_DECK_B], glyph[GLYPH_NINTENDO_DECK_A],
glyph[GLYPH_NINTENDO_DECK_Y], glyph[GLYPH_NINTENDO_DECK_X], glyph[GLYPH_NINTENDO_DECK_Y], glyph[GLYPH_NINTENDO_DECK_X],
@@ -178,10 +178,10 @@ bool BUTTONGLYPHS_keyboard_is_available(void)
return true; return true;
} }
#if defined(SDL_PLATFORM_ANDROID) || TARGET_OS_IPHONE #ifdef __ANDROID__
return false; return false;
#else #else
return !SDL_GetHintBoolean("SteamDeck", false); return !SDL_GetHintBoolean("SteamDeck", SDL_FALSE);
#endif #endif
} }
@@ -197,10 +197,10 @@ void BUTTONGLYPHS_keyboard_set_active(bool active)
keyboard_is_active = active; keyboard_is_active = active;
} }
void BUTTONGLYPHS_update_layout(SDL_Gamepad *c) void BUTTONGLYPHS_update_layout(SDL_GameController *c)
{ {
Uint16 vendor = SDL_GetGamepadVendor(c); Uint16 vendor = SDL_GameControllerGetVendor(c);
Uint16 product = SDL_GetGamepadProduct(c); Uint16 product = SDL_GameControllerGetProduct(c);
if (vendor == 0x054c) if (vendor == 0x054c)
{ {
@@ -210,10 +210,10 @@ void BUTTONGLYPHS_update_layout(SDL_Gamepad *c)
{ {
/* Steam Virtual Gamepads can hypothetically tell us that the physical /* Steam Virtual Gamepads can hypothetically tell us that the physical
* device is a PlayStation controller, so try to catch that scenario */ * device is a PlayStation controller, so try to catch that scenario */
SDL_GamepadType gct = SDL_GetGamepadType(c); SDL_GameControllerType gct = SDL_GameControllerGetType(c);
if ( gct == SDL_GAMEPAD_TYPE_PS3 || if ( gct == SDL_CONTROLLER_TYPE_PS3 ||
gct == SDL_GAMEPAD_TYPE_PS4 || gct == SDL_CONTROLLER_TYPE_PS4 ||
gct == SDL_GAMEPAD_TYPE_PS5 ) gct == SDL_CONTROLLER_TYPE_PS5 )
{ {
layout = LAYOUT_PLAYSTATION; layout = LAYOUT_PLAYSTATION;
} }
@@ -272,9 +272,9 @@ const char* BUTTONGLYPHS_get_wasd_text(void)
return loc::gettext("Press left/right to move"); return loc::gettext("Press left/right to move");
} }
const char* BUTTONGLYPHS_sdlbutton_to_glyph(const SDL_GamepadButton button) const char* BUTTONGLYPHS_sdlbutton_to_glyph(const SDL_GameControllerButton button)
{ {
if (button < 0 || button > SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER) if (button < 0 || button > SDL_CONTROLLER_BUTTON_RIGHTSHOULDER)
{ {
SDL_assert(0 && "Unhandled button!"); SDL_assert(0 && "Unhandled button!");
return glyph[GLYPH_UNKNOWN]; return glyph[GLYPH_UNKNOWN];
@@ -284,7 +284,7 @@ const char* BUTTONGLYPHS_sdlbutton_to_glyph(const SDL_GamepadButton button)
} }
static const char* glyph_for_vector( static const char* glyph_for_vector(
const std::vector<SDL_GamepadButton>& buttons, const std::vector<SDL_GameControllerButton>& buttons,
const int index const int index
) { ) {
if (index < 0 || index >= (int) buttons.size()) if (index < 0 || index >= (int) buttons.size())
+3 -3
View File
@@ -1,7 +1,7 @@
#ifndef BUTTONGLYPHS_H #ifndef BUTTONGLYPHS_H
#define BUTTONGLYPHS_H #define BUTTONGLYPHS_H
#include <SDL3/SDL.h> #include <SDL.h>
#include <stdbool.h> #include <stdbool.h>
#include "ActionSets.h" #include "ActionSets.h"
@@ -17,10 +17,10 @@ bool BUTTONGLYPHS_keyboard_is_available(void);
bool BUTTONGLYPHS_keyboard_is_active(void); bool BUTTONGLYPHS_keyboard_is_active(void);
void BUTTONGLYPHS_keyboard_set_active(bool active); void BUTTONGLYPHS_keyboard_set_active(bool active);
void BUTTONGLYPHS_update_layout(SDL_Gamepad *c); void BUTTONGLYPHS_update_layout(SDL_GameController *c);
const char* BUTTONGLYPHS_get_wasd_text(void); const char* BUTTONGLYPHS_get_wasd_text(void);
const char* BUTTONGLYPHS_sdlbutton_to_glyph(SDL_GamepadButton button); const char* BUTTONGLYPHS_sdlbutton_to_glyph(SDL_GameControllerButton button);
const char* BUTTONGLYPHS_get_button(ActionSet actionset, Action action, int binding); const char* BUTTONGLYPHS_get_button(ActionSet actionset, Action action, int binding);
char* BUTTONGLYPHS_get_all_gamepad_buttons( char* BUTTONGLYPHS_get_all_gamepad_buttons(
+1 -1
View File
@@ -1,6 +1,6 @@
#include "CWrappers.h" #include "CWrappers.h"
#include <SDL3/SDL.h> #include <SDL.h>
#include "Graphics.h" #include "Graphics.h"
#include "GraphicsUtil.h" #include "GraphicsUtil.h"
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef CWRAPPERS_H #ifndef CWRAPPERS_H
#define CWRAPPERS_H #define CWRAPPERS_H
#include <SDL3/SDL_surface.h> #include <SDL_surface.h>
#include <stdint.h> #include <stdint.h>
#ifdef __cplusplus #ifdef __cplusplus
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef CREDITS_H #ifndef CREDITS_H
#define CREDITS_H #define CREDITS_H
#include <SDL3/SDL.h> #include <SDL.h>
namespace Credits { namespace Credits {
+38 -40
View File
@@ -57,7 +57,6 @@ RoomProperty::RoomProperty(void)
enemyx2=320; enemyx2=320;
enemyy2=240; enemyy2=240;
enemytype=0; enemytype=0;
enemyv=0;
directmode=0; directmode=0;
} }
@@ -390,7 +389,6 @@ void customlevelclass::reset(void)
roomproperties[i+(j*maxwidth)].enemyx2=320; roomproperties[i+(j*maxwidth)].enemyx2=320;
roomproperties[i+(j*maxwidth)].enemyy2=240; roomproperties[i+(j*maxwidth)].enemyy2=240;
roomproperties[i+(j*maxwidth)].enemytype=0; roomproperties[i+(j*maxwidth)].enemytype=0;
roomproperties[i+(j*maxwidth)].enemyv=0;
roomproperties[i+(j*maxwidth)].directmode=0; roomproperties[i+(j*maxwidth)].directmode=0;
} }
} }
@@ -404,8 +402,6 @@ void customlevelclass::reset(void)
script.textbox_colours.clear(); script.textbox_colours.clear();
script.add_default_colours(); script.add_default_colours();
map.specialroomnames.clear(); map.specialroomnames.clear();
player_colour = 0;
} }
const int* customlevelclass::loadlevel( int rxi, int ryi ) const int* customlevelclass::loadlevel( int rxi, int ryi )
@@ -1268,7 +1264,6 @@ bool customlevelclass::load(std::string _path)
edLevelClassElement->QueryIntAttribute("enemyx2", &roomproperties[i].enemyx2); edLevelClassElement->QueryIntAttribute("enemyx2", &roomproperties[i].enemyx2);
edLevelClassElement->QueryIntAttribute("enemyy2", &roomproperties[i].enemyy2); edLevelClassElement->QueryIntAttribute("enemyy2", &roomproperties[i].enemyy2);
edLevelClassElement->QueryIntAttribute("enemytype", &roomproperties[i].enemytype); edLevelClassElement->QueryIntAttribute("enemytype", &roomproperties[i].enemytype);
edLevelClassElement->QueryIntAttribute("enemyv", &roomproperties[i].enemyv);
edLevelClassElement->QueryIntAttribute("directmode", &roomproperties[i].directmode); edLevelClassElement->QueryIntAttribute("directmode", &roomproperties[i].directmode);
edLevelClassElement->QueryIntAttribute("warpdir", &roomproperties[i].warpdir); edLevelClassElement->QueryIntAttribute("warpdir", &roomproperties[i].warpdir);
@@ -1337,7 +1332,7 @@ next:
if (name != NULL) if (name != NULL)
{ {
SDL_Color colour; SDL_Colour colour;
colour.r = r; colour.r = r;
colour.g = g; colour.g = g;
colour.b = b; colour.b = b;
@@ -1424,12 +1419,6 @@ next:
map.specialroomnames.push_back(name); map.specialroomnames.push_back(name);
} }
} }
if (SDL_strcmp(pKey, "PlayerColour") == 0)
{
player_colour = help.Int(pText);
game.savecolour = player_colour;
}
} }
if (mapwidth < maxwidth) if (mapwidth < maxwidth)
@@ -1664,7 +1653,6 @@ bool customlevelclass::save(const std::string& _path)
roompropertyElement->SetAttribute( "enemyx2", roomproperties[i].enemyx2); roompropertyElement->SetAttribute( "enemyx2", roomproperties[i].enemyx2);
roompropertyElement->SetAttribute( "enemyy2", roomproperties[i].enemyy2); roompropertyElement->SetAttribute( "enemyy2", roomproperties[i].enemyy2);
roompropertyElement->SetAttribute( "enemytype", roomproperties[i].enemytype); roompropertyElement->SetAttribute( "enemytype", roomproperties[i].enemytype);
roompropertyElement->SetAttribute( "enemyv", roomproperties[i].enemyv);
roompropertyElement->SetAttribute( "directmode", roomproperties[i].directmode); roompropertyElement->SetAttribute( "directmode", roomproperties[i].directmode);
roompropertyElement->SetAttribute( "warpdir", roomproperties[i].warpdir); roompropertyElement->SetAttribute( "warpdir", roomproperties[i].warpdir);
@@ -1693,27 +1681,40 @@ bool customlevelclass::save(const std::string& _path)
} }
xml::update_tag(data, "script", scriptString.c_str()); 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); return FILESYSTEM_saveTiXml2Document(newpath.c_str(), doc);
} }
void customlevelclass::generatecustomminimap(void) void customlevelclass::generatecustomminimap(void)
{ {
const MapRenderData data = map.get_render_data(); map.customzoom = 1;
if (mapwidth <= 10 && mapheight <= 10)
{
map.customzoom = 2;
}
if (mapwidth <= 5 && mapheight <= 5)
{
map.customzoom = 4;
}
// Set minimap offsets
switch (map.customzoom)
{
case 4:
map.custommmxoff = 24 * (5 - mapwidth);
map.custommmyoff = 18 * (5 - mapheight);
break;
case 2:
map.custommmxoff = 12 * (10 - mapwidth);
map.custommmyoff = 9 * (10 - mapheight);
break;
default:
map.custommmxoff = 6 * (20 - mapwidth);
map.custommmyoff = int(4.5 * (20 - mapheight));
break;
}
map.custommmxsize = 240 - (map.custommmxoff * 2);
map.custommmysize = 180 - (map.custommmyoff * 2);
// Start drawing the minimap // Start drawing the minimap
@@ -1722,22 +1723,22 @@ void customlevelclass::generatecustomminimap(void)
graphics.clear(); graphics.clear();
// Scan over the map size // Scan over the map size
for (int j2 = data.starty; j2 < data.starty + data.height; j2++) for (int j2 = 0; j2 < mapheight; j2++)
{ {
for (int i2 = data.startx; i2 < data.startx + data.width; i2++) for (int i2 = 0; i2 < mapwidth; i2++)
{ {
std::vector<SDL_FPoint> dark_points; std::vector<SDL_Point> dark_points;
std::vector<SDL_FPoint> light_points; std::vector<SDL_Point> light_points;
bool dark = getroomprop(i2, j2)->tileset == 1; bool dark = getroomprop(i2, j2)->tileset == 1;
// Ok, now scan over each square // Ok, now scan over each square
for (int j = 0; j < 9 * data.zoom; j++) for (int j = 0; j < 9 * map.customzoom; j++)
{ {
for (int i = 0; i < 12 * data.zoom; i++) for (int i = 0; i < 12 * map.customzoom; i++)
{ {
int tile; int tile;
switch (data.zoom) switch (map.customzoom)
{ {
case 4: case 4:
tile = absfree( tile = absfree(
@@ -1762,10 +1763,7 @@ void customlevelclass::generatecustomminimap(void)
if (tile >= 1) if (tile >= 1)
{ {
// Add this pixel // Add this pixel
SDL_FPoint point = { SDL_Point point = { (i2 * 12 * map.customzoom) + i, (j2 * 9 * map.customzoom) + j };
static_cast<float>(((i2 - data.startx) * 12 * data.zoom) + i),
static_cast<float>(((j2 - data.starty) * 9 * data.zoom) + j)
};
if (dark) if (dark)
{ {
dark_points.push_back(point); dark_points.push_back(point);
+1 -4
View File
@@ -1,7 +1,7 @@
#ifndef CUSTOMLEVELS_H #ifndef CUSTOMLEVELS_H
#define CUSTOMLEVELS_H #define CUSTOMLEVELS_H
#include <SDL3/SDL.h> #include <SDL.h>
#include <string> #include <string>
#include <vector> #include <vector>
@@ -31,7 +31,6 @@ public:
FOREACH_PROP(enemyx2, int) \ FOREACH_PROP(enemyx2, int) \
FOREACH_PROP(enemyy2, int) \ FOREACH_PROP(enemyy2, int) \
FOREACH_PROP(enemytype, int) \ FOREACH_PROP(enemytype, int) \
FOREACH_PROP(enemyv, int) \
FOREACH_PROP(directmode, int) FOREACH_PROP(directmode, int)
class RoomProperty class RoomProperty
@@ -170,8 +169,6 @@ public:
SDL_Color getonewaycol(int rx, int ry); SDL_Color getonewaycol(int rx, int ry);
SDL_Color getonewaycol(void); SDL_Color getonewaycol(void);
bool onewaycol_override; bool onewaycol_override;
int player_colour;
}; };
bool translate_title(const std::string& title); bool translate_title(const std::string& title);
+1 -1
View File
@@ -1,6 +1,6 @@
#include "DeferCallbacks.h" #include "DeferCallbacks.h"
#include <SDL3/SDL.h> #include <SDL.h>
/* Callbacks to be deferred to the end of each sequence of gamestate functions /* Callbacks to be deferred to the end of each sequence of gamestate functions
* in main. Useful for fixing frame-flicker glitches when doing a state * in main. Useful for fixing frame-flicker glitches when doing a state
+73 -441
View File
@@ -41,13 +41,13 @@ editorclass::editorclass(void)
register_tool(EditorTool_MOVING_PLATFORMS, "Moving Platforms", "8", SDLK_8, false); register_tool(EditorTool_MOVING_PLATFORMS, "Moving Platforms", "8", SDLK_8, false);
register_tool(EditorTool_ENEMIES, "Enemies", "9", SDLK_9, false); register_tool(EditorTool_ENEMIES, "Enemies", "9", SDLK_9, false);
register_tool(EditorTool_GRAVITY_LINES, "Gravity Lines", "0", SDLK_0, false); register_tool(EditorTool_GRAVITY_LINES, "Gravity Lines", "0", SDLK_0, false);
register_tool(EditorTool_ROOMTEXT, "Roomtext", "R", SDLK_R, false); register_tool(EditorTool_ROOMTEXT, "Roomtext", "R", SDLK_r, false);
register_tool(EditorTool_TERMINALS, "Terminals", "T", SDLK_T, false); register_tool(EditorTool_TERMINALS, "Terminals", "T", SDLK_t, false);
register_tool(EditorTool_SCRIPTS, "Script Boxes", "Y", SDLK_Y, 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_TOKENS, "Warp Tokens", "U", SDLK_u, false);
register_tool(EditorTool_WARP_LINES, "Warp Lines", "I", SDLK_I, false); register_tool(EditorTool_WARP_LINES, "Warp Lines", "I", SDLK_i, false);
register_tool(EditorTool_CREWMATES, "Crewmates", "O", SDLK_O, false); register_tool(EditorTool_CREWMATES, "Crewmates", "O", SDLK_o, false);
register_tool(EditorTool_START_POINT, "Start Point", "P", SDLK_P, false); register_tool(EditorTool_START_POINT, "Start Point", "P", SDLK_p, false);
static const short basic[] = { static const short basic[] = {
121, 121, 121, 121, 121, 121, 121, 160, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 160, 121, 121, 121, 121, 121, 121, 121,
@@ -412,11 +412,6 @@ void editorclass::reset(void)
state = EditorState_DRAW; state = EditorState_DRAW;
substate = EditorSubState_MAIN; substate = EditorSubState_MAIN;
undo_buffer.clear();
redo_buffer.clear();
placing_tiles = false;
} }
void editorclass::show_note(const char* text) void editorclass::show_note(const char* text)
@@ -425,7 +420,7 @@ void editorclass::show_note(const char* text)
note = text; note = text;
} }
void editorclass::register_tool(EditorTools tool, const char* name, const char* keychar, const SDL_Keycode key, const bool shift) void editorclass::register_tool(EditorTools tool, const char* name, const char* keychar, const SDL_KeyCode key, const bool shift)
{ {
tool_names[tool] = name; tool_names[tool] = name;
tool_key_chars[tool] = keychar; tool_key_chars[tool] = keychar;
@@ -1053,11 +1048,11 @@ static void draw_entities(void)
if (entity->p1 == 0) // Facing right if (entity->p1 == 0) // Facing right
{ {
graphics.draw_sprite(x - 4, y, 0, graphics.getcol(cl.player_colour)); graphics.draw_sprite(x - 4, y, 0, graphics.col_crewcyan);
} }
else // Non-zero is facing left else // Non-zero is facing left
{ {
graphics.draw_sprite(x - 4, y, 3, graphics.getcol(cl.player_colour)); graphics.draw_sprite(x - 4, y, 3, graphics.col_crewcyan);
} }
graphics.draw_rect(x, y, 16, 24, graphics.getRGB(255, 255, 164)); graphics.draw_rect(x, y, 16, 24, graphics.getRGB(255, 255, 164));
@@ -1313,35 +1308,35 @@ static void draw_cursor(void)
{ {
top_left = false; top_left = false;
bottom_left = false; bottom_left = false;
SDL_RenderLine(gameScreen.m_renderer, x * 8, y * 8, x * 8, y * 8 + 7); SDL_RenderDrawLine(gameScreen.m_renderer, x * 8, y * 8, x * 8, y * 8 + 7);
} }
if (!check_point(connected, x + 1, y)) if (!check_point(connected, x + 1, y))
{ {
top_right = false; top_right = false;
bottom_right = false; bottom_right = false;
SDL_RenderLine(gameScreen.m_renderer, x * 8 + 7, y * 8, x * 8 + 7, y * 8 + 7); SDL_RenderDrawLine(gameScreen.m_renderer, x * 8 + 7, y * 8, x * 8 + 7, y * 8 + 7);
} }
if (!check_point(connected, x, y - 1)) if (!check_point(connected, x, y - 1))
{ {
top_left = false; top_left = false;
top_right = false; top_right = false;
SDL_RenderLine(gameScreen.m_renderer, x * 8, y * 8, x * 8 + 7, y * 8); SDL_RenderDrawLine(gameScreen.m_renderer, x * 8, y * 8, x * 8 + 7, y * 8);
} }
if (!check_point(connected, x, y + 1)) if (!check_point(connected, x, y + 1))
{ {
bottom_left = false; bottom_left = false;
bottom_right = false; bottom_right = false;
SDL_RenderLine(gameScreen.m_renderer, x * 8, y * 8 + 7, x * 8 + 7, y * 8 + 7); 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) if (!check_point(connected, x - 1, y - 1) && top_left)
SDL_RenderPoint(gameScreen.m_renderer, x * 8, y * 8); SDL_RenderDrawPoint(gameScreen.m_renderer, x * 8, y * 8);
if (!check_point(connected, x - 1, y + 1) && top_right) if (!check_point(connected, x - 1, y + 1) && top_right)
SDL_RenderPoint(gameScreen.m_renderer, x * 8, y * 8 + 7); SDL_RenderDrawPoint(gameScreen.m_renderer, x * 8, y * 8 + 7);
if (!check_point(connected, x + 1, y - 1) && bottom_left) if (!check_point(connected, x + 1, y - 1) && bottom_left)
SDL_RenderPoint(gameScreen.m_renderer, x * 8 + 7, y * 8); SDL_RenderDrawPoint(gameScreen.m_renderer, x * 8 + 7, y * 8);
if (!check_point(connected, x + 1, y + 1) && bottom_right) if (!check_point(connected, x + 1, y + 1) && bottom_right)
SDL_RenderPoint(gameScreen.m_renderer, x * 8 + 7, y * 8 + 7); 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.b_modifier) graphics.draw_rect(x, 0, 8, 240, blue); // Vertical
@@ -1414,7 +1409,7 @@ static void draw_tile_drawer(int tileset)
int texturewidth; int texturewidth;
int textureheight; int textureheight;
if (!graphics.query_texture(graphics.grphx.im_tiles, NULL, NULL, &texturewidth, &textureheight)) if (graphics.query_texture(graphics.grphx.im_tiles, NULL, NULL, &texturewidth, &textureheight) != 0)
{ {
return; return;
} }
@@ -1964,8 +1959,6 @@ void editorrenderfixed(void)
const RoomProperty* const room = cl.getroomprop(ed.levx, ed.levy); const RoomProperty* const room = cl.getroomprop(ed.levx, ed.levy);
graphics.updatetitlecolours(); graphics.updatetitlecolours();
graphics.trinketcolset = false;
game.customcol = cl.getlevelcol(room->tileset, room->tilecol) + 1; game.customcol = cl.getlevelcol(room->tileset, room->tilecol) + 1;
ed.entcol = cl.getenemycol(game.customcol); ed.entcol = cl.getenemycol(game.customcol);
@@ -2267,29 +2260,11 @@ void editorclass::add_entity(int rx, int ry, int xp, int yp, int tp, int p1, int
entity.p6 = p6; entity.p6 = p6;
entity.scriptname = ""; entity.scriptname = "";
EditorUndoInfo info;
info.room_x = rx;
info.room_y = ry;
info.type = EditorUndoType_ENTITY_ADDED;
info.entity = entity;
info.entity_id = customentities.size();
undo_buffer.push_back(info);
redo_buffer.clear();
customentities.push_back(entity); customentities.push_back(entity);
} }
void editorclass::remove_entity(int t) void editorclass::remove_entity(int t)
{ {
EditorUndoInfo info;
info.room_x = levx;
info.room_y = levy;
info.type = EditorUndoType_ENTITY_REMOVED;
info.entity_id = t;
info.entity = customentities[t];
undo_buffer.push_back(info);
redo_buffer.clear();
customentities.erase(customentities.begin() + t); customentities.erase(customentities.begin() + t);
} }
@@ -2307,86 +2282,6 @@ int editorclass::get_entity_at(int rx, int ry, int xp, int yp)
return -1; return -1;
} }
static void update_old_tiles()
{
extern editorclass ed;
for (int i = 0; i < SCREEN_WIDTH_TILES * SCREEN_HEIGHT_TILES; i++)
{
ed.old_tiles[i] = ed.get_tile(i % SCREEN_WIDTH_TILES, i / SCREEN_WIDTH_TILES);
}
}
static void commit_entity(int id)
{
// We're gonna modify an entity, so save the old version
extern editorclass ed;
EditorUndoInfo info;
info.room_x = ed.levx;
info.room_y = ed.levy;
info.type = EditorUndoType_ENTITY_MODIFIED;
info.entity_id = id;
info.entity = customentities[id];
ed.undo_buffer.push_back(info);
ed.redo_buffer.clear();
}
static void commit_tiles()
{
// We either let go of the mouse button, or we switched rooms, so we need to commit the tiles to the undo buffer
extern editorclass ed;
EditorUndoInfo info;
info.room_x = ed.levx;
info.room_y = ed.levy;
info.type = EditorUndoType_TILES;
SDL_memcpy(info.tiles, ed.old_tiles, sizeof(ed.old_tiles));
ed.undo_buffer.push_back(info);
ed.redo_buffer.clear();
}
static void commit_roomdata_change()
{
extern editorclass ed;
EditorUndoInfo info;
info.room_x = ed.levx;
info.room_y = ed.levy;
info.type = EditorUndoType_ROOMDATA;
info.room_data = *cl.getroomprop(ed.levx, ed.levy);
ed.undo_buffer.push_back(info);
ed.redo_buffer.clear();
}
static void commit_roomdata_tiles_change()
{
extern editorclass ed;
EditorUndoInfo info;
info.room_x = ed.levx;
info.room_y = ed.levy;
info.type = EditorUndoType_ROOMDATA_TILES;
update_old_tiles();
SDL_memcpy(info.tiles, ed.old_tiles, sizeof(ed.old_tiles));
info.room_data = *cl.getroomprop(ed.levx, ed.levy);
ed.undo_buffer.push_back(info);
ed.redo_buffer.clear();
}
static void uncommit()
{
extern editorclass ed;
ed.undo_buffer.pop_back();
}
static void set_tile_interpolated(const int x1, const int x2, const int y1, const int y2, const int tile) static void set_tile_interpolated(const int x1, const int x2, const int y1, const int y2, const int tile)
{ {
extern editorclass ed; extern editorclass ed;
@@ -2521,19 +2416,9 @@ void editorclass::tool_remove()
{ {
case EditorTool_WALLS: case EditorTool_WALLS:
case EditorTool_BACKING: case EditorTool_BACKING:
if (!placing_tiles)
{
placing_tiles = true;
update_old_tiles();
}
handle_tile_placement(0); handle_tile_placement(0);
break; break;
case EditorTool_SPIKES: case EditorTool_SPIKES:
if (!placing_tiles)
{
placing_tiles = true;
update_old_tiles();
}
set_tile_interpolated(old_tilex, tilex, old_tiley, tiley, 0); set_tile_interpolated(old_tilex, tilex, old_tiley, tiley, 0);
break; break;
default: default:
@@ -2561,13 +2446,11 @@ void editorclass::entity_clicked(const int index)
{ {
case 1: case 1:
// Enemies // Enemies
commit_entity(index);
entity->p1 = (entity->p1 + 1) % 4; entity->p1 = (entity->p1 + 1) % 4;
break; break;
case 2: case 2:
{ {
// Moving Platforms and Conveyors // Moving Platforms and Conveyors
commit_entity(index);
const bool conveyor = entity->p1 >= 5; const bool conveyor = entity->p1 >= 5;
entity->p1++; entity->p1++;
if (conveyor) if (conveyor)
@@ -2583,7 +2466,6 @@ void editorclass::entity_clicked(const int index)
case 10: case 10:
// Checkpoints // Checkpoints
// If it's not textured as a checkpoint, then just leave it be // If it's not textured as a checkpoint, then just leave it be
commit_entity(index);
if (entity->p1 == 0 || entity->p1 == 1) if (entity->p1 == 0 || entity->p1 == 1)
{ {
entity->p1 = (entity->p1 + 1) % 2; entity->p1 = (entity->p1 + 1) % 2;
@@ -2592,34 +2474,27 @@ void editorclass::entity_clicked(const int index)
case 11: case 11:
case 16: case 16:
// Gravity Lines, Start Point // Gravity Lines, Start Point
commit_entity(index);
entity->p1 = (entity->p1 + 1) % 2; entity->p1 = (entity->p1 + 1) % 2;
break; break;
case 15: case 15:
// Crewmates // Crewmates
commit_entity(index);
entity->p1 = (entity->p1 + 1) % 6; entity->p1 = (entity->p1 + 1) % 6;
break; break;
case 17: case 17:
// Roomtext // Roomtext
commit_entity(index);
get_input_line(TEXT_ROOMTEXT, "Enter roomtext:", &entity->scriptname); get_input_line(TEXT_ROOMTEXT, "Enter roomtext:", &entity->scriptname);
text_entity = index; text_entity = index;
break; break;
case 18: case 18:
// Terminals // Terminals
commit_entity(index);
if (entity->p1 == 0 || entity->p1 == 1) if (entity->p1 == 0 || entity->p1 == 1)
{ {
// Flip the terminal, but if it's not textured as a terminal leave it alone // Flip the terminal, but if it's not textured as a terminal leave it alone
entity->p1 = (entity->p1 + 1) % 2; entity->p1 = (entity->p1 + 1) % 2;
} }
get_input_line(TEXT_SCRIPT, "Enter script name:", &entity->scriptname); SDL_FALLTHROUGH;
text_entity = index;
break;
case 19: case 19:
// Script Boxes (and terminals) // Script Boxes (and terminals)
commit_entity(index);
get_input_line(TEXT_SCRIPT, "Enter script name:", &entity->scriptname); get_input_line(TEXT_SCRIPT, "Enter script name:", &entity->scriptname);
text_entity = index; text_entity = index;
break; break;
@@ -2642,12 +2517,6 @@ void editorclass::tool_place()
{ {
int tile = 0; int tile = 0;
if (!placing_tiles)
{
placing_tiles = true;
update_old_tiles();
}
if (cl.getroomprop(levx, levy)->directmode >= 1) if (cl.getroomprop(levx, levy)->directmode >= 1)
{ {
tile = direct_mode_tile; tile = direct_mode_tile;
@@ -2665,12 +2534,6 @@ void editorclass::tool_place()
break; break;
} }
case EditorTool_SPIKES: case EditorTool_SPIKES:
if (!placing_tiles)
{
placing_tiles = true;
update_old_tiles();
}
set_tile_interpolated(old_tilex, tilex, old_tiley, tiley, 8); set_tile_interpolated(old_tilex, tilex, old_tiley, tiley, 8);
break; break;
case EditorTool_TRINKETS: case EditorTool_TRINKETS:
@@ -2771,22 +2634,17 @@ void editorclass::tool_place()
} }
break; break;
case EditorTool_START_POINT: case EditorTool_START_POINT:
lclickdelay = 1; //If there is another start point, destroy it
//If there is another start point, move it instead
for (size_t i = 0; i < customentities.size(); i++) for (size_t i = 0; i < customentities.size(); i++)
{ {
if (customentities[i].t == 16) if (customentities[i].t == 16)
{ {
commit_entity(i); remove_entity(i);
customentities[i].rx = levx; i--;
customentities[i].ry = levy;
customentities[i].x = tilex;
customentities[i].y = tiley;
customentities[i].p1 = 0;
return;
} }
} }
add_entity(levx, levy, tilex, tiley, 16, 0); add_entity(levx, levy, tilex, tiley, 16, 0);
lclickdelay = 1;
break; break;
default: default:
break; break;
@@ -3139,25 +2997,21 @@ static void handle_draw_input()
{ {
if (key.keymap[SDLK_F1]) if (key.keymap[SDLK_F1])
{ {
commit_roomdata_tiles_change();
ed.switch_tileset(shift_down); ed.switch_tileset(shift_down);
ed.keydelay = 6; ed.keydelay = 6;
} }
if (key.keymap[SDLK_F2]) if (key.keymap[SDLK_F2])
{ {
commit_roomdata_tiles_change();
ed.switch_tilecol(shift_down); ed.switch_tilecol(shift_down);
ed.keydelay = 6; ed.keydelay = 6;
} }
if (key.keymap[SDLK_F3]) if (key.keymap[SDLK_F3])
{ {
commit_roomdata_change();
ed.switch_enemy(shift_down); ed.switch_enemy(shift_down);
ed.keydelay = 6; ed.keydelay = 6;
} }
if (key.keymap[SDLK_F4]) if (key.keymap[SDLK_F4])
{ {
commit_roomdata_change();
ed.keydelay = 6; ed.keydelay = 6;
ed.substate = EditorSubState_DRAW_BOX; ed.substate = EditorSubState_DRAW_BOX;
ed.box_corner = BoxCorner_FIRST; ed.box_corner = BoxCorner_FIRST;
@@ -3165,7 +3019,6 @@ static void handle_draw_input()
} }
if (key.keymap[SDLK_F5]) if (key.keymap[SDLK_F5])
{ {
commit_roomdata_change();
ed.keydelay = 6; ed.keydelay = 6;
ed.substate = EditorSubState_DRAW_BOX; ed.substate = EditorSubState_DRAW_BOX;
ed.box_corner = BoxCorner_FIRST; ed.box_corner = BoxCorner_FIRST;
@@ -3173,7 +3026,6 @@ static void handle_draw_input()
} }
if (key.keymap[SDLK_F10]) if (key.keymap[SDLK_F10])
{ {
commit_roomdata_tiles_change();
if (cl.getroomprop(ed.levx, ed.levy)->directmode == 1) if (cl.getroomprop(ed.levx, ed.levy)->directmode == 1)
{ {
cl.setroomdirectmode(ed.levx, ed.levy, 0); cl.setroomdirectmode(ed.levx, ed.levy, 0);
@@ -3201,20 +3053,18 @@ static void handle_draw_input()
} }
} }
if (key.keymap[SDLK_W]) if (key.keymap[SDLK_w])
{ {
commit_roomdata_change();
ed.switch_warpdir(shift_down); ed.switch_warpdir(shift_down);
ed.keydelay = 6; ed.keydelay = 6;
} }
if (key.keymap[SDLK_E]) if (key.keymap[SDLK_e])
{ {
commit_roomdata_change();
ed.keydelay = 6; ed.keydelay = 6;
ed.get_input_line(TEXT_ROOMNAME, "Enter new room name:", const_cast<std::string*>(&(cl.getroomprop(ed.levx, ed.levy)->roomname))); ed.get_input_line(TEXT_ROOMNAME, "Enter new room name:", const_cast<std::string*>(&(cl.getroomprop(ed.levx, ed.levy)->roomname)));
game.mapheld = true; game.mapheld = true;
} }
if (key.keymap[SDLK_G]) if (key.keymap[SDLK_g])
{ {
ed.keydelay = 6; ed.keydelay = 6;
ed.get_input_line(TEXT_GOTOROOM, "Enter room coordinates x,y:", NULL); ed.get_input_line(TEXT_GOTOROOM, "Enter room coordinates x,y:", NULL);
@@ -3222,47 +3072,36 @@ static void handle_draw_input()
} }
//Save and load //Save and load
if (key.keymap[SDLK_S]) if (key.keymap[SDLK_s])
{ {
ed.keydelay = 6; ed.keydelay = 6;
ed.get_input_line(TEXT_SAVE, "Enter map filename to save as:", &(ed.filename)); ed.get_input_line(TEXT_SAVE, "Enter map filename to save as:", &(ed.filename));
game.mapheld = true; game.mapheld = true;
} }
if (key.keymap[SDLK_L]) if (key.keymap[SDLK_l])
{ {
ed.keydelay = 6; ed.keydelay = 6;
ed.get_input_line(TEXT_LOAD, "Enter map filename to load:", &(ed.filename)); ed.get_input_line(TEXT_LOAD, "Enter map filename to load:", &(ed.filename));
game.mapheld = true; game.mapheld = true;
} }
ed.f_modifier = key.keymap[SDLK_F]; ed.f_modifier = key.keymap[SDLK_f];
ed.h_modifier = key.keymap[SDLK_H]; ed.h_modifier = key.keymap[SDLK_h];
ed.v_modifier = key.keymap[SDLK_V]; ed.v_modifier = key.keymap[SDLK_v];
ed.b_modifier = key.keymap[SDLK_B]; ed.b_modifier = key.keymap[SDLK_b];
ed.c_modifier = key.keymap[SDLK_C]; ed.c_modifier = key.keymap[SDLK_c];
ed.x_modifier = key.keymap[SDLK_X]; ed.x_modifier = key.keymap[SDLK_x];
ed.z_modifier = key.keymap[SDLK_Z]; ed.z_modifier = key.keymap[SDLK_z];
const int room = ed.levx + ed.levy * cl.maxwidth; const int room = ed.levx + ed.levy * cl.maxwidth;
const int plat_speed = cl.roomproperties[room].platv; 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 (key.keymap[SDLK_COMMA])
{ {
commit_roomdata_change(); if (key.keymap[SDLK_LCTRL] || key.keymap[SDLK_RCTRL])
if (ctrl)
{ {
if (shift) cl.roomproperties[room].platv = plat_speed - 1;
{
cl.roomproperties[room].enemyv = enemy_speed - 1;
}
else
{
cl.roomproperties[room].platv = plat_speed - 1;
}
} }
else else
{ {
@@ -3272,17 +3111,9 @@ static void handle_draw_input()
} }
else if (key.keymap[SDLK_PERIOD]) else if (key.keymap[SDLK_PERIOD])
{ {
commit_roomdata_change(); if (key.keymap[SDLK_LCTRL] || key.keymap[SDLK_RCTRL])
if (ctrl)
{ {
if (shift) cl.roomproperties[room].platv = plat_speed + 1;
{
cl.roomproperties[room].enemyv = enemy_speed + 1;
}
else
{
cl.roomproperties[room].platv = plat_speed + 1;
}
} }
else else
{ {
@@ -3303,18 +3134,6 @@ static void handle_draw_input()
ed.show_note(buffer); 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]) if (key.keymap[SDLK_SPACE])
{ {
ed.toolbox_open = !ed.toolbox_open; ed.toolbox_open = !ed.toolbox_open;
@@ -3344,127 +3163,6 @@ void editorclass::get_input_line(const enum TextMode mode, const std::string& pr
old_entity_text = key.keybuffer; old_entity_text = key.keybuffer;
} }
static void handle_undo(const bool undo)
{
extern editorclass ed;
std::vector<EditorUndoInfo>* buffer = undo ? &ed.undo_buffer : &ed.redo_buffer;
if (buffer->size() == 0)
{
ed.show_note(undo ? loc::gettext("ERROR: Nothing to undo") : loc::gettext("ERROR: Nothing to redo"));
return;
}
EditorUndoInfo info = buffer->back();
buffer->pop_back();
ed.levx = info.room_x;
ed.levy = info.room_y;
ed.updatetiles = true;
ed.changeroom = true;
graphics.backgrounddrawn = false;
graphics.foregrounddrawn = false;
EditorUndoInfo new_info;
new_info.room_x = info.room_x;
new_info.room_y = info.room_y;
new_info.type = info.type;
switch (info.type)
{
case EditorUndoType_TILES:
for (size_t i = 0; i < SCREEN_WIDTH_TILES * SCREEN_HEIGHT_TILES; i++)
{
const int x = i % SCREEN_WIDTH_TILES;
const int y = i / SCREEN_WIDTH_TILES;
ed.old_tiles[i] = ed.get_tile(x, y);
cl.settile(ed.levx, ed.levy, x, y, info.tiles[i]);
}
SDL_memcpy(new_info.tiles, ed.old_tiles, sizeof(ed.old_tiles));
break;
case EditorUndoType_ENTITY_ADDED:
// Remove the entity
if (!INBOUNDS_VEC(info.entity_id, customentities))
{
// Not sure how this would happen, but we should just consume it...
return;
}
new_info.type = EditorUndoType_ENTITY_REMOVED;
new_info.entity = customentities[info.entity_id];
new_info.entity_id = info.entity_id;
customentities.erase(customentities.begin() + info.entity_id);
break;
case EditorUndoType_ENTITY_REMOVED:
// Add the entity back
customentities.insert(customentities.begin() + info.entity_id, info.entity);
new_info.type = EditorUndoType_ENTITY_ADDED;
new_info.entity_id = info.entity_id;
new_info.entity = info.entity;
break;
case EditorUndoType_ENTITY_MODIFIED:
// Restore the entity
if (!INBOUNDS_VEC(info.entity_id, customentities))
{
return;
}
new_info.entity = customentities[info.entity_id];
new_info.entity_id = info.entity_id;
customentities[info.entity_id] = info.entity;
break;
case EditorUndoType_ROOMDATA:
new_info.room_data = cl.roomproperties[info.room_x + info.room_y * cl.maxwidth];
cl.roomproperties[info.room_x + info.room_y * cl.maxwidth] = info.room_data;
graphics.backgrounddrawn = false;
break;
case EditorUndoType_ROOMDATA_TILES:
// Restore the room data
for (size_t i = 0; i < SCREEN_WIDTH_TILES * SCREEN_HEIGHT_TILES; i++)
{
const int x = i % SCREEN_WIDTH_TILES;
const int y = i / SCREEN_WIDTH_TILES;
ed.old_tiles[i] = ed.get_tile(x, y);
cl.settile(ed.levx, ed.levy, x, y, info.tiles[i]);
}
SDL_memcpy(new_info.tiles, ed.old_tiles, sizeof(ed.old_tiles));
new_info.room_data = cl.roomproperties[info.room_x + info.room_y * cl.maxwidth];
cl.roomproperties[info.room_x + info.room_y * cl.maxwidth] = info.room_data;
graphics.backgrounddrawn = false;
graphics.foregrounddrawn = false;
ed.updatetiles = true;
break;
case EditorUndoType_LEVEL_SIZE:
// Restore the level size
new_info.level_width = cl.mapwidth;
new_info.level_height = cl.mapheight;
cl.mapwidth = info.level_width;
cl.mapheight = info.level_height;
break;
}
if (undo)
{
ed.redo_buffer.push_back(new_info);
}
else
{
ed.undo_buffer.push_back(new_info);
}
}
void editorinput(void) void editorinput(void)
{ {
extern editorclass ed; extern editorclass ed;
@@ -3474,22 +3172,16 @@ void editorinput(void)
return; return;
} }
bool undo_pressed = false;
bool redo_pressed = false;
bool shift_down = key.keymap[SDLK_LSHIFT] || key.keymap[SDLK_RSHIFT];
bool ctrl_down = key.keymap[SDLK_LCTRL] || key.keymap[SDLK_RCTRL];
ed.old_tilex = ed.tilex; ed.old_tilex = ed.tilex;
ed.old_tiley = ed.tiley; ed.old_tiley = ed.tiley;
ed.tilex = SDL_clamp(key.mousex, 0, SCREEN_WIDTH_PIXELS - 1) / 8; ed.tilex = SDL_clamp(key.mousex, 0, SCREEN_WIDTH_PIXELS - 1) / 8;
ed.tiley = SDL_clamp(key.mousey, 0, SCREEN_HEIGHT_PIXELS - 1) / 8; ed.tiley = SDL_clamp(key.mousey, 0, SCREEN_HEIGHT_PIXELS - 1) / 8;
bool up_pressed = key.isDown(SDLK_UP) || key.isDown(SDL_GAMEPAD_BUTTON_DPAD_UP); bool up_pressed = key.isDown(SDLK_UP) || key.isDown(SDL_CONTROLLER_BUTTON_DPAD_UP);
bool down_pressed = key.isDown(SDLK_DOWN) || key.isDown(SDL_GAMEPAD_BUTTON_DPAD_DOWN); bool down_pressed = key.isDown(SDLK_DOWN) || key.isDown(SDL_CONTROLLER_BUTTON_DPAD_DOWN);
bool left_pressed = key.isDown(SDLK_LEFT) || key.isDown(SDL_GAMEPAD_BUTTON_DPAD_LEFT); bool left_pressed = key.isDown(SDLK_LEFT) || key.isDown(SDL_CONTROLLER_BUTTON_DPAD_LEFT);
bool right_pressed = key.isDown(SDLK_RIGHT) || key.isDown(SDL_GAMEPAD_BUTTON_DPAD_RIGHT); bool right_pressed = key.isDown(SDLK_RIGHT) || key.isDown(SDL_CONTROLLER_BUTTON_DPAD_RIGHT);
game.press_left = false; game.press_left = false;
game.press_right = false; game.press_right = false;
@@ -3505,23 +3197,11 @@ void editorinput(void)
{ {
game.press_right = true; game.press_right = true;
} }
if ((key.isDown(KEYBOARD_z) && !ctrl_down) || key.isDown(KEYBOARD_SPACE) || key.isDown(KEYBOARD_v) || key.isDown(game.controllerButton_flip)) if (key.isDown(KEYBOARD_z) || key.isDown(KEYBOARD_SPACE) || key.isDown(KEYBOARD_v) || key.isDown(game.controllerButton_flip))
{ {
game.press_action = true; game.press_action = true;
}; };
if (key.isDown(KEYBOARD_z) && ctrl_down && (ed.keydelay == 0))
{
ed.keydelay = 6;
undo_pressed = true;
}
if (key.isDown(SDLK_Y) && ctrl_down && (ed.keydelay == 0))
{
ed.keydelay = 6;
redo_pressed = true;
}
if (key.keymap[SDLK_F9] && (ed.keydelay == 0)) { if (key.keymap[SDLK_F9] && (ed.keydelay == 0)) {
ed.keydelay = 30; ed.keydelay = 30;
ed.show_note(loc::gettext("Reloaded resources")); ed.show_note(loc::gettext("Reloaded resources"));
@@ -3552,6 +3232,9 @@ void editorinput(void)
game.mapheld = false; 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) // Do different things depending on the current state (and substate)
switch (ed.state) switch (ed.state)
{ {
@@ -3560,16 +3243,6 @@ void editorinput(void)
switch (ed.substate) switch (ed.substate)
{ {
case EditorSubState_MAIN: case EditorSubState_MAIN:
if (undo_pressed)
{
handle_undo(true);
}
if (redo_pressed)
{
handle_undo(false);
}
if (escape_pressed) if (escape_pressed)
{ {
// We're just in draw mode, so go to the settings menu // We're just in draw mode, so go to the settings menu
@@ -3604,7 +3277,7 @@ void editorinput(void)
bool tiles1 = (cl.getroomprop(ed.levx, ed.levy)->tileset == 0); 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)) if (graphics.query_texture(tiles1 ? graphics.grphx.im_tiles : graphics.grphx.im_tiles2, NULL, NULL, &texturewidth, &textureheight) != 0)
return; return;
const int numtiles = (int)(texturewidth / 8) * (textureheight / 8); const int numtiles = (int)(texturewidth / 8) * (textureheight / 8);
@@ -3618,8 +3291,6 @@ void editorinput(void)
} }
else if (shift_down) else if (shift_down)
{ {
int old_width = cl.mapwidth;
int old_height = cl.mapheight;
if (up_pressed) cl.mapheight--; if (up_pressed) cl.mapheight--;
if (down_pressed) cl.mapheight++; if (down_pressed) cl.mapheight++;
@@ -3629,48 +3300,26 @@ void editorinput(void)
cl.mapwidth = SDL_clamp(cl.mapwidth, 1, cl.maxwidth); cl.mapwidth = SDL_clamp(cl.mapwidth, 1, cl.maxwidth);
cl.mapheight = SDL_clamp(cl.mapheight, 1, cl.maxheight); cl.mapheight = SDL_clamp(cl.mapheight, 1, cl.maxheight);
if (old_width != cl.mapwidth || old_height != cl.mapheight) ed.updatetiles = true;
{ ed.changeroom = true;
ed.updatetiles = true; graphics.backgrounddrawn = false;
ed.changeroom = true; graphics.foregrounddrawn = false;
graphics.backgrounddrawn = false;
graphics.foregrounddrawn = false;
ed.levx = POS_MOD(ed.levx, cl.mapwidth); ed.levx = POS_MOD(ed.levx, cl.mapwidth);
ed.levy = POS_MOD(ed.levy, cl.mapheight); ed.levy = POS_MOD(ed.levy, cl.mapheight);
char buffer[3 * SCREEN_WIDTH_CHARS + 1]; char buffer[3 * SCREEN_WIDTH_CHARS + 1];
vformat_buf( vformat_buf(
buffer, sizeof(buffer), buffer, sizeof(buffer),
loc::gettext("Mapsize is now [{width},{height}]"), loc::gettext("Mapsize is now [{width},{height}]"),
"width:int, height:int", "width:int, height:int",
cl.mapwidth, cl.mapheight cl.mapwidth, cl.mapheight
); );
ed.show_note(buffer); ed.show_note(buffer);
EditorUndoInfo info;
info.type = EditorUndoType_LEVEL_SIZE;
info.level_width = old_width;
info.level_height = old_height;
info.room_x = ed.levx;
info.room_y = ed.levy;
ed.undo_buffer.push_back(info);
ed.redo_buffer.clear();
}
} }
else else
{ {
if (ed.placing_tiles)
{
// We were in the middle of placing tiles. Commit it, since we're done with the previous room.
commit_tiles();
// Must be done after every tile commit, as it's responsible for the "old tiles" cache
ed.placing_tiles = false;
}
ed.updatetiles = true; ed.updatetiles = true;
ed.changeroom = true; ed.changeroom = true;
graphics.backgrounddrawn = false; graphics.backgrounddrawn = false;
@@ -3692,26 +3341,19 @@ void editorinput(void)
} }
// Mouse input // Mouse input
if (key.leftbutton && ed.lclickdelay == 0)
{
ed.tool_place();
}
else if (!key.leftbutton)
{
ed.lclickdelay = 0;
}
if (key.rightbutton) if (key.rightbutton)
{ {
ed.tool_remove(); ed.tool_remove();
} }
else
{
if (key.leftbutton && ed.lclickdelay == 0)
{
ed.tool_place();
}
else if (!key.leftbutton)
{
ed.lclickdelay = 0;
if (ed.placing_tiles)
{
commit_tiles();
ed.placing_tiles = false;
}
}
}
if (key.middlebutton) if (key.middlebutton)
{ {
@@ -3863,24 +3505,14 @@ void editorinput(void)
if (escape_pressed) if (escape_pressed)
{ {
// Escape was pressed, cancel text entry // Cancel it, and remove the enemy it's tied to if necessary
key.disabletextentry(); key.disabletextentry();
if (ed.current_text_mode >= FIRST_ENTTEXT && ed.current_text_mode <= LAST_ENTTEXT) if (ed.current_text_mode >= FIRST_ENTTEXT && ed.current_text_mode <= LAST_ENTTEXT)
{ {
*ed.current_text_ptr = ed.old_entity_text; *ed.current_text_ptr = ed.old_entity_text;
// Looks like we're giving an entity text for the first time, so cancelling should remove the entity
if (ed.old_entity_text == "") if (ed.old_entity_text == "")
{ {
// Remove it.
ed.remove_entity(ed.text_entity); ed.remove_entity(ed.text_entity);
// We have to uncommit twice here; once to prevent saving the "remove entity" action...
uncommit();
// ...and once more to undo the "add entity" action we're cancelling
uncommit();
} }
} }
+3 -35
View File
@@ -5,7 +5,7 @@
#include "CustomLevels.h" #include "CustomLevels.h"
#include <map> #include <map>
#include <SDL3/SDL.h> #include <SDL.h>
#include <string> #include <string>
#include <vector> #include <vector>
@@ -133,33 +133,6 @@ struct GhostInfo
int frame; // .drawframe int frame; // .drawframe
}; };
enum EditorUndoTypes
{
EditorUndoType_TILES, // Tiles modified
EditorUndoType_ROOMDATA, // Room data modified
EditorUndoType_ROOMDATA_TILES, // Room data modified (and stores tiles)
EditorUndoType_ENTITY_ADDED, // Entity added
EditorUndoType_ENTITY_REMOVED, // Entity removed
EditorUndoType_ENTITY_MODIFIED, // Entity properties modified
EditorUndoType_LEVEL_SIZE // Level size modified
};
struct EditorUndoInfo
{
EditorUndoTypes type;
int tiles[SCREEN_WIDTH_TILES * SCREEN_HEIGHT_TILES];
int room_x;
int room_y;
EditorTilesets tileset;
int tilecol;
int entity_id;
CustomEntity entity;
RoomProperty room_data;
int level_width;
int level_height;
};
class editorclass class editorclass
{ {
public: public:
@@ -171,7 +144,7 @@ public:
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, 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_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 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 draw_tool(EditorTools tool, int x, int y);
@@ -230,7 +203,7 @@ public:
const char* tool_names[NUM_EditorTools]; const char* tool_names[NUM_EditorTools];
const char* tool_key_chars[NUM_EditorTools]; const char* tool_key_chars[NUM_EditorTools];
SDL_Keycode tool_keys[NUM_EditorTools]; SDL_KeyCode tool_keys[NUM_EditorTools];
bool tool_requires_shift[NUM_EditorTools]; bool tool_requires_shift[NUM_EditorTools];
EditorTools current_tool; EditorTools current_tool;
@@ -309,11 +282,6 @@ public:
std::vector<GhostInfo> ghosts; std::vector<GhostInfo> ghosts;
int current_ghosts; int current_ghosts;
std::vector<EditorUndoInfo> undo_buffer;
std::vector<EditorUndoInfo> redo_buffer;
bool placing_tiles;
int old_tiles[SCREEN_WIDTH_TILES * SCREEN_HEIGHT_TILES];
}; };
void editorrender(void); void editorrender(void);
+61 -68
View File
@@ -11,14 +11,14 @@ entclass::entclass(void)
void entclass::clear(void) void entclass::clear(void)
{ {
invis = false; invis = false;
type = EntityType_PLAYER; type = 0;
size = 0; size = 0;
tile = 0; tile = 0;
rule = 0; rule = 0;
state = 0; state = 0;
statedelay = 0; statedelay = 0;
life = 0; life = 0;
colour = EntityColour_CREW_CYAN; colour = 0;
para = 0; para = 0;
behave = 0; behave = 0;
animate = 0; animate = 0;
@@ -108,7 +108,7 @@ void entclass::setenemy( int t )
case 0: case 0:
tile = 60; tile = 60;
animate = 2; animate = 2;
colour = EntityColour_ENEMY_RED; colour = 6;
behave = 10; behave = 10;
w = 32; w = 32;
h = 32; h = 32;
@@ -119,7 +119,7 @@ void entclass::setenemy( int t )
lerpoldyp += 10; lerpoldyp += 10;
tile = 63; tile = 63;
animate = 100; //LIES animate = 100; //LIES
colour = EntityColour_ENEMY_RED; colour = 6;
behave = 11; behave = 11;
para = 9; //destroyed when outside para = 9; //destroyed when outside
x1 = -200; x1 = -200;
@@ -132,7 +132,7 @@ void entclass::setenemy( int t )
case 2: case 2:
tile = 62; tile = 62;
animate = 100; animate = 100;
colour = EntityColour_ENEMY_RED; colour = 6;
behave = -1; behave = -1;
w = 32; w = 32;
h = 32; h = 32;
@@ -147,7 +147,7 @@ void entclass::setenemy( int t )
tile = 72; tile = 72;
animate = 3; animate = 3;
size = 9; size = 9;
colour = EntityColour_ENEMY_RED; colour = 6;
behave = 12; behave = 12;
w = 64; w = 64;
h = 40; h = 40;
@@ -161,7 +161,7 @@ void entclass::setenemy( int t )
lerpoldyp -= 4; lerpoldyp -= 4;
tile = 76; tile = 76;
animate = 100; // Clouds animate = 100; // Clouds
colour = EntityColour_ENEMY_RED; colour = 6;
behave = 13; behave = 13;
para = -6; //destroyed when outside para = -6; //destroyed when outside
x2 = 400; x2 = 400;
@@ -173,7 +173,7 @@ void entclass::setenemy( int t )
case 2: case 2:
tile = 77; tile = 77;
animate = 100; animate = 100;
colour = EntityColour_ENEMY_RED; colour = 6;
behave = -1; behave = -1;
w = 32; w = 32;
h = 16; h = 16;
@@ -195,32 +195,32 @@ void entclass::setenemyroom( int rx, int ry )
//Space Station 1 //Space Station 1
case rn(12, 3): //Security Drone case rn(12, 3): //Security Drone
tile = 36; tile = 36;
colour = EntityColour_ENEMY_PINK; colour = 8;
animate = 1; animate = 1;
break; break;
case rn(13, 3): //Wavelengths case rn(13, 3): //Wavelengths
tile = 32; tile = 32;
colour = EntityColour_ENEMY_GREEN; colour = 7;
animate = 1; animate = 1;
w = 32; w = 32;
break; break;
case rn(15, 3): //Traffic case rn(15, 3): //Traffic
tile = 28; tile = 28;
colour = EntityColour_ENEMY_RED; colour = 6;
animate = 1; animate = 1;
w = 22; w = 22;
h = 32; h = 32;
break; break;
case rn(12, 5): //The Yes Men case rn(12, 5): //The Yes Men
tile = 40; tile = 40;
colour = EntityColour_ENEMY_YELLOW; colour = 9;
animate = 1; animate = 1;
w = 20; w = 20;
h = 20; h = 20;
break; break;
case rn(13, 6): //Hunchbacked Guards case rn(13, 6): //Hunchbacked Guards
tile = 44; tile = 44;
colour = EntityColour_ENEMY_PINK; colour = 8;
animate = 1; animate = 1;
w = 16; w = 16;
h = 20; h = 20;
@@ -231,7 +231,7 @@ void entclass::setenemyroom( int rx, int ry )
{ {
//transmittor //transmittor
tile = 104; tile = 104;
colour = EntityColour_INACTIVE_ENTITY; colour = 4;
animate = 7; animate = 7;
w = 16; w = 16;
h = 16; h = 16;
@@ -244,7 +244,7 @@ void entclass::setenemyroom( int rx, int ry )
{ {
//radar dish //radar dish
tile =124; tile =124;
colour = EntityColour_INACTIVE_ENTITY; colour = 4;
animate = 6; animate = 6;
w = 32; w = 32;
h = 32; h = 32;
@@ -260,37 +260,37 @@ void entclass::setenemyroom( int rx, int ry )
//The Lab //The Lab
case rn(4, 0): case rn(4, 0):
tile = 78; tile = 78;
colour = EntityColour_ENEMY_GREEN; colour = 7;
animate = 1; animate = 1;
w = 16; w = 16;
h = 16; h = 16;
break; break;
case rn(2, 0): case rn(2, 0):
tile = 88; tile = 88;
colour = EntityColour_ENEMY_CYAN; colour = 11;
animate = 1; animate = 1;
w = 16; w = 16;
h = 16; h = 16;
break; break;
//Space Station 2 //Space Station 2
case rn(14, 11): case rn(14, 11):
colour = EntityColour_ENEMY_ORANGE; colour = 17;
break; //Lies break; //Lies
case rn(16, 11): case rn(16, 11):
colour = EntityColour_ENEMY_PINK; colour = 8;
break; //Lies break; //Lies
case rn(13, 10): case rn(13, 10):
colour = EntityColour_ENEMY_CYAN; colour = 11;
break; //Factory break; //Factory
case rn(13, 9): case rn(13, 9):
colour = EntityColour_ENEMY_YELLOW; colour = 9;
break; //Factory break; //Factory
case rn(13, 8): case rn(13, 8):
colour = EntityColour_ENEMY_PINK; colour = 8;
break; //Factory break; //Factory
case rn(11, 13): //Truth case rn(11, 13): //Truth
tile = 64; tile = 64;
colour = EntityColour_ENEMY_GREEN; colour = 7;
animate = 100; animate = 100;
w = 44; w = 44;
h = 10; h = 10;
@@ -298,7 +298,7 @@ void entclass::setenemyroom( int rx, int ry )
break; break;
case rn(17, 7): //Brass sent us under the top case rn(17, 7): //Brass sent us under the top
tile =82; tile =82;
colour = EntityColour_ENEMY_PINK; colour = 8;
animate = 5; animate = 5;
w = 28; w = 28;
h = 32; h = 32;
@@ -306,42 +306,42 @@ void entclass::setenemyroom( int rx, int ry )
break; break;
case rn(10, 7): // (deception) case rn(10, 7): // (deception)
tile = 92; tile = 92;
colour = EntityColour_ENEMY_RED; colour = 6;
animate = 1; animate = 1;
w = 16; w = 16;
h = 16; h = 16;
break; break;
case rn(14, 13): // (chose poorly) case rn(14, 13): // (chose poorly)
tile = 56; tile = 56;
colour = EntityColour_ENEMY_RED; colour = 6;
animate = 1; animate = 1;
w = 15; w = 15;
h = 24; h = 24;
break; break;
case rn(13, 12): // (backsliders) case rn(13, 12): // (backsliders)
tile = 164; tile = 164;
colour = EntityColour_ENEMY_GREEN; colour = 7;
animate = 1; animate = 1;
w = 16; w = 16;
h = 16; h = 16;
break; break;
case rn(14, 8): // (wheel of fortune room) case rn(14, 8): // (wheel of fortune room)
tile = 116; tile = 116;
colour = EntityColour_ENEMY_BLUE; colour = 12;
animate = 1; animate = 1;
w = 32; w = 32;
h = 32; h = 32;
break; break;
case rn(16, 9): // (seeing dollar signs) case rn(16, 9): // (seeing dollar signs)
tile = 68; tile = 68;
colour = EntityColour_ENEMY_GREEN; colour = 7;
animate = 1; animate = 1;
w = 16; w = 16;
h = 16; h = 16;
break; break;
case rn(16, 7): // (tomb of mad carew) case rn(16, 7): // (tomb of mad carew)
tile = 106; tile = 106;
colour = EntityColour_ENEMY_GREEN; colour = 7;
animate = 2; animate = 2;
w = 24; w = 24;
h = 25; h = 25;
@@ -349,7 +349,7 @@ void entclass::setenemyroom( int rx, int ry )
//Warp Zone //Warp Zone
case rn(15, 2): // (numbers) case rn(15, 2): // (numbers)
tile = 100; tile = 100;
colour = EntityColour_ENEMY_RED; colour = 6;
animate = 1; animate = 1;
w = 32; w = 32;
h = 14; h = 14;
@@ -358,7 +358,7 @@ void entclass::setenemyroom( int rx, int ry )
break; break;
case rn(16, 2): // (Manequins) case rn(16, 2): // (Manequins)
tile = 52; tile = 52;
colour = EntityColour_ENEMY_GREEN; colour = 7;
animate = 5; animate = 5;
w = 16; w = 16;
h = 25; h = 25;
@@ -367,28 +367,28 @@ void entclass::setenemyroom( int rx, int ry )
break; break;
case rn(18, 0): // (Obey) case rn(18, 0): // (Obey)
tile = 51; tile = 51;
colour = EntityColour_ENEMY_CYAN; colour = 11;
animate = 100; animate = 100;
w = 30; w = 30;
h = 14; h = 14;
break; break;
case rn(19, 1): // Ascending and Descending case rn(19, 1): // Ascending and Descending
tile = 48; tile = 48;
colour = EntityColour_ENEMY_YELLOW; colour = 9;
animate = 5; animate = 5;
w = 16; w = 16;
h = 16; h = 16;
break; break;
case rn(19, 2): // Shockwave Rider case rn(19, 2): // Shockwave Rider
tile = 176; tile = 176;
colour = EntityColour_ENEMY_RED; colour = 6;
animate = 1; animate = 1;
w = 16; w = 16;
h = 16; h = 16;
break; break;
case rn(18, 3): // Mind the gap case rn(18, 3): // Mind the gap
tile = 168; tile = 168;
colour = EntityColour_ENEMY_GREEN; colour = 7;
animate = 1; animate = 1;
w = 16; w = 16;
h = 16; h = 16;
@@ -397,7 +397,7 @@ void entclass::setenemyroom( int rx, int ry )
if (yp ==96) if (yp ==96)
{ {
tile = 160; tile = 160;
colour = EntityColour_ENEMY_PINK; colour = 8;
animate = 1; animate = 1;
w = 16; w = 16;
h = 16; h = 16;
@@ -405,7 +405,7 @@ void entclass::setenemyroom( int rx, int ry )
else else
{ {
tile = 156; tile = 156;
colour = EntityColour_ENEMY_PINK; colour = 8;
animate = 1; animate = 1;
w = 16; w = 16;
h = 16; h = 16;
@@ -413,14 +413,14 @@ void entclass::setenemyroom( int rx, int ry )
break; break;
case rn(16, 0): // I love you case rn(16, 0): // I love you
tile = 112; tile = 112;
colour = EntityColour_ENEMY_PINK; colour = 8;
animate = 5; animate = 5;
w = 16; w = 16;
h = 16; h = 16;
break; break;
case rn(14, 2): // That's why I have to kill you case rn(14, 2): // That's why I have to kill you
tile = 114; tile = 114;
colour = EntityColour_ENEMY_RED; colour = 6;
animate = 5; animate = 5;
w = 16; w = 16;
h = 16; h = 16;
@@ -430,7 +430,7 @@ void entclass::setenemyroom( int rx, int ry )
if (xp ==88) if (xp ==88)
{ {
tile = 54+12; tile = 54+12;
colour = EntityColour_ENEMY_BLUE; colour = 12;
animate = 100; animate = 100;
w = 60; w = 60;
h = 16; h = 16;
@@ -439,7 +439,7 @@ void entclass::setenemyroom( int rx, int ry )
else else
{ {
tile = 54; tile = 54;
colour = EntityColour_ENEMY_BLUE; colour = 12;
animate = 100; animate = 100;
w = 60; w = 60;
h = 16; h = 16;
@@ -449,62 +449,62 @@ void entclass::setenemyroom( int rx, int ry )
//Final level //Final level
case rn(50-100, 53-100): //The Yes Men case rn(50-100, 53-100): //The Yes Men
tile = 40; tile = 40;
colour = EntityColour_ENEMY_YELLOW; colour = 9;
animate = 1; animate = 1;
w = 20; w = 20;
h = 20; h = 20;
break; break;
case rn(48-100, 51-100): //Wavelengths case rn(48-100, 51-100): //Wavelengths
tile = 32; tile = 32;
colour = EntityColour_ENEMY_GREEN; colour = 7;
animate = 1; animate = 1;
w = 32; w = 32;
break; break;
case rn(43-100,52-100): // Ascending and Descending case rn(43-100,52-100): // Ascending and Descending
tile = 48; tile = 48;
colour = EntityColour_ENEMY_YELLOW; colour = 9;
animate = 5; animate = 5;
w = 16; w = 16;
h = 16; h = 16;
break; break;
case rn(46-100,51-100): //kids his age case rn(46-100,51-100): //kids his age
tile = 88; tile = 88;
colour = EntityColour_ENEMY_CYAN; colour = 11;
animate = 1; animate = 1;
w = 16; w = 16;
h = 16; h = 16;
break; break;
case rn(43-100,51-100): // Mind the gap case rn(43-100,51-100): // Mind the gap
tile = 168; tile = 168;
colour = EntityColour_ENEMY_GREEN; colour = 7;
animate = 1; animate = 1;
w = 16; w = 16;
h = 16; h = 16;
break; break;
case rn(44-100,51-100): // vertigo? case rn(44-100,51-100): // vertigo?
tile = 172; tile = 172;
colour = EntityColour_ENEMY_GREEN; colour = 7;
animate = 100; animate = 100;
w = 32; w = 32;
h = 32; h = 32;
break; break;
case rn(44-100,52-100): // (backsliders) case rn(44-100,52-100): // (backsliders)
tile = 164; tile = 164;
colour = EntityColour_ENEMY_GREEN; colour = 7;
animate = 1; animate = 1;
w = 16; w = 16;
h = 16; h = 16;
break; break;
case rn(43-100, 56-100): //Intermission 1 case rn(43-100, 56-100): //Intermission 1
tile = 88; tile = 88;
colour = EntityColour_ENEMY_GRAVITRON; colour = 21;
animate = 1; animate = 1;
w = 16; w = 16;
h = 16; h = 16;
break; break;
case rn(45-100, 56-100): //Intermission 1 case rn(45-100, 56-100): //Intermission 1
tile = 88; tile = 88;
colour = EntityColour_ENEMY_GRAVITRON; colour = 21;
animate = 1; animate = 1;
w = 16; w = 16;
h = 16; h = 16;
@@ -515,7 +515,7 @@ void entclass::setenemyroom( int rx, int ry )
case rn(11, 8): case rn(11, 8):
case rn(12, 8): case rn(12, 8):
tile = 0; tile = 0;
colour = EntityColour_TELEPORTER_FLASHING; colour = 102;
animate = 0; animate = 0;
w = 464; w = 464;
h = 320; h = 320;
@@ -613,24 +613,17 @@ void entclass::updatecolour(void)
switch (size) switch (size)
{ {
case 0: // Sprites case 0: // Sprites
case 3: // Big chunky pixels!
case 4: // Small pickups
case 7: // Teleporter case 7: // Teleporter
case 9: // Really Big Sprite! (2x2) case 9: // Really Big Sprite! (2x2)
case 10: // 2x1 Sprite case 10: // 2x1 Sprite
case 13: // Special for epilogue: huge hero! case 13: // Special for epilogue: huge hero!
realcol = graphics.getcol(colour); realcol = graphics.getcol(colour);
break; break;
case 5: // Horizontal gravity line case 3: // Big chunky pixels!
case 6: // Vertical gravity line realcol = graphics.bigchunkygetcol(colour);
if (life == 0) break;
{ case 4: // Small pickups
realcol = graphics.getcol(colour); realcol = graphics.huetilegetcol();
}
else
{
realcol = graphics.getcol(24);
}
break; break;
case 11: // The fucking elephant case 11: // The fucking elephant
if (game.noflashingmode) if (game.noflashingmode)
@@ -657,8 +650,8 @@ void entclass::updatecolour(void)
bool entclass::ishumanoid(void) bool entclass::ishumanoid(void)
{ {
return type == EntityType_PLAYER return type == 0
|| type == EntityType_CREWMATE || type == 12
|| type == EntityType_SUPERCREWMATE || type == 14
|| type == EntityType_COLLECTABLE_CREWMATE; || type == 55;
} }
+3 -33
View File
@@ -1,38 +1,10 @@
#ifndef ENT_H #ifndef ENT_H
#define ENT_H #define ENT_H
#include <SDL3/SDL.h> #include <SDL.h>
#define rn( rx, ry) ((rx) + ((ry) * 100)) #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
};
class entclass class entclass
{ {
public: public:
@@ -54,13 +26,11 @@ public:
public: public:
//Fundamentals //Fundamentals
bool invis; bool invis;
EntityType type; int type, size, tile, rule;
int size, tile, rule;
int state, statedelay; int state, statedelay;
int behave, animate; int behave, animate;
float para; float para;
int life; int life, colour;
int colour; // As out-of-bounds colours are allowed, this should be an int instead of an EnemyColour.
//Position and velocity //Position and velocity
int oldxp, oldyp; int oldxp, oldyp;
File diff suppressed because it is too large Load Diff
+18 -6
View File
@@ -1,14 +1,14 @@
#ifndef ENTITY_H #ifndef ENTITY_H
#define ENTITY_H #define ENTITY_H
#include <SDL3/SDL.h> #include <SDL.h>
#include <string> #include <string>
#include <vector> #include <vector>
#include "BlockV.h"
#include "Ent.h"
#include "Game.h"
#include "Maths.h" #include "Maths.h"
#include "Ent.h"
#include "BlockV.h"
#include "Game.h"
enum enum
{ {
@@ -20,6 +20,18 @@ enum
ACTIVITY = 5 ACTIVITY = 5
}; };
enum
{
CYAN = 0,
PURPLE = 20,
YELLOW = 14,
RED = 15,
GREEN = 13,
BLUE = 16,
GRAY = 19,
TELEPORTER = 102
};
class entityclass class entityclass
{ {
public: public:
@@ -44,7 +56,7 @@ public:
createblock(DAMAGE, 312, -8, 16, 260); createblock(DAMAGE, 312, -8, 16, 260);
} }
int swncolour(int t); int swncolour(int t );
void swnenemiescol(int t); void swnenemiescol(int t);
@@ -94,7 +106,7 @@ public:
int getlineat(int t); int getlineat(int t);
int getcrewman(int t); int getcrewman(int t, int fallback = 0);
int getcustomcrewman(int t); int getcustomcrewman(int t);
int getteleporter(void); int getteleporter(void);
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef VVV_EXIT_H #ifndef VVV_EXIT_H
#define VVV_EXIT_H #define VVV_EXIT_H
#include <SDL3/SDL_stdinc.h> #include <SDL_stdinc.h>
SDL_NORETURN void VVV_exit(const int exit_code); SDL_NORETURN void VVV_exit(const int exit_code);
+24 -65
View File
@@ -1,8 +1,7 @@
#include "FileSystemUtils.h" #include "FileSystemUtils.h"
#include <physfs.h> #include <physfs.h>
#include <physfssdl3.h> #include <SDL.h>
#include <SDL3/SDL.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <tinyxml2.h> #include <tinyxml2.h>
@@ -31,12 +30,12 @@ static int mkdir(char* path, int mode)
MultiByteToWideChar(CP_UTF8, 0, path, -1, utf16_path, MAX_PATH); MultiByteToWideChar(CP_UTF8, 0, path, -1, utf16_path, MAX_PATH);
return CreateDirectoryW(utf16_path, NULL); return CreateDirectoryW(utf16_path, NULL);
} }
#elif defined(SDL_PLATFORM_EMSCRIPTEN) #elif defined(__EMSCRIPTEN__)
#include <limits.h> #include <limits.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <emscripten.h> #include <emscripten.h>
#define MAX_PATH PATH_MAX #define MAX_PATH PATH_MAX
#elif defined(SDL_PLATFORM_LINUX) || defined(SDL_PLATFORM_APPLE) || defined(SDL_PLATFORM_FREEBSD) || defined(SDL_PLATFORM_OPENBSD) || defined(SDL_PLATFORM_HAIKU) || defined(__DragonFly__) || defined(SDL_PLATFORM_UNIX) #elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__HAIKU__) || defined(__DragonFly__) || defined(__unix__)
#include <limits.h> #include <limits.h>
#include <sys/stat.h> #include <sys/stat.h>
#define MAX_PATH PATH_MAX #define MAX_PATH PATH_MAX
@@ -45,7 +44,7 @@ static int mkdir(char* path, int mode)
static bool isInit = false; static bool isInit = false;
static const char* pathSep = NULL; static const char* pathSep = NULL;
static const char* basePath = NULL; static char* basePath = NULL;
static char writeDir[MAX_PATH] = {'\0'}; static char writeDir[MAX_PATH] = {'\0'};
static char saveDir[MAX_PATH] = {'\0'}; static char saveDir[MAX_PATH] = {'\0'};
static char levelDir[MAX_PATH] = {'\0'}; static char levelDir[MAX_PATH] = {'\0'};
@@ -78,7 +77,7 @@ static const PHYSFS_Allocator allocator = {
SDL_free SDL_free
}; };
#ifndef SDL_PLATFORM_ANDROID #ifndef __ANDROID__
static bool mount_pre_datazip( static bool mount_pre_datazip(
char* out_path, char* out_path,
const char* real_dirname, const char* real_dirname,
@@ -188,10 +187,10 @@ int FILESYSTEM_init(char *argvZero, char* baseDir, char *assetsPath, char* langD
PHYSFS_setAllocator(&allocator); PHYSFS_setAllocator(&allocator);
// Yes, this is actually how you're supposed to use PhysFS on Android. // Yes, this is actually how you're supposed to use PhysFS on Android.
#ifdef SDL_PLATFORM_ANDROID #ifdef __ANDROID__
PHYSFS_AndroidInit androidInit; PHYSFS_AndroidInit androidInit;
androidInit.jnienv = SDL_GetAndroidJNIEnv(); androidInit.jnienv = SDL_AndroidGetJNIEnv();
androidInit.context = SDL_GetAndroidActivity(); androidInit.context = SDL_AndroidGetActivity();
argvZero = (char*) &androidInit; argvZero = (char*) &androidInit;
#endif #endif
@@ -292,7 +291,7 @@ int FILESYSTEM_init(char *argvZero, char* baseDir, char *assetsPath, char* langD
basePath = SDL_strdup("./"); basePath = SDL_strdup("./");
} }
#ifdef SDL_PLATFORM_ANDROID #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. // 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)) if (!PHYSFS_mount(PHYSFS_getBaseDir(), "/apk", 1))
{ {
@@ -334,41 +333,21 @@ int FILESYSTEM_init(char *argvZero, char* baseDir, char *assetsPath, char* langD
vlog_error("You do not have data.zip!"); vlog_error("You do not have data.zip!");
vlog_error("Grab it from your purchased copy of the game,"); vlog_error("Grab it from your purchased copy of the game,");
vlog_error("or get it from the free Make and Play Edition."); vlog_error("or get it from the free Make and Play Edition.");
vlog_error("https://thelettervsixtim.es/makeandplay/");
SDL_MessageBoxData messagebox;
messagebox.flags = SDL_MESSAGEBOX_ERROR;
messagebox.window = NULL;
messagebox.title = "data.zip missing!";
messagebox.message = "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.";
messagebox.numbuttons = 2;
SDL_MessageBoxButtonData buttons[2];
buttons[0].flags = SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT;
buttons[0].flags |= SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT;
buttons[0].buttonID = 0;
buttons[0].text = "OK";
buttons[1].flags = 0;
buttons[1].buttonID = 1;
buttons[1].text = "Open Download Page";
messagebox.buttons = buttons;
messagebox.colorScheme = NULL;
int clicked = 0;
SDL_ShowMessageBox(&messagebox, &clicked);
if (clicked == 1)
{
SDL_OpenURL("https://thelettervsixtim.es/makeandplay/");
}
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); VVV_exit(1);
return 0; return 0;
} }
SDL_snprintf(output, sizeof(output), "%s%s", basePath, "gamecontrollerdb.txt"); SDL_snprintf(output, sizeof(output), "%s%s", basePath, "gamecontrollerdb.txt");
if (SDL_AddGamepadMappingsFromFile(output) < 0) if (SDL_GameControllerAddMappingsFromFile(output) < 0)
{ {
vlog_info("gamecontrollerdb.txt not found!"); vlog_info("gamecontrollerdb.txt not found!");
} }
@@ -392,6 +371,7 @@ void FILESYSTEM_deinit(void)
PHYSFS_deinit(); PHYSFS_deinit();
} }
VVV_free(stdin_buffer); VVV_free(stdin_buffer);
VVV_free(basePath);
isInit = false; isInit = false;
} }
@@ -959,14 +939,6 @@ fail:
} }
} }
SDL_IOStream* FILESYSTEM_loadAssetRWops(const char* name)
{
char path[MAX_PATH];
getMountedPath(path, sizeof(path), name);
return PHYSFSSDL3_openRead(path);
}
void FILESYSTEM_loadAssetToMemory( void FILESYSTEM_loadAssetToMemory(
const char* name, const char* name,
unsigned char** mem, unsigned char** mem,
@@ -1119,7 +1091,7 @@ bool FILESYSTEM_saveTiXml2Document(const char *name, tinyxml2::XMLDocument& doc,
PHYSFS_writeBytes(handle, printer.CStr(), printer.CStrSize() - 1); // subtract one because CStrSize includes terminating null PHYSFS_writeBytes(handle, printer.CStr(), printer.CStrSize() - 1); // subtract one because CStrSize includes terminating null
PHYSFS_close(handle); PHYSFS_close(handle);
#ifdef SDL_PLATFORM_EMSCRIPTEN #ifdef __EMSCRIPTEN__
if (sync) if (sync)
{ {
EM_ASM(FS.syncfs(false, function(err) EM_ASM(FS.syncfs(false, function(err)
@@ -1347,8 +1319,8 @@ static int PLATFORM_getOSDirectory(char* output, const size_t output_size)
SDL_strlcat(output, "\\VVVVVV\\", MAX_PATH); SDL_strlcat(output, "\\VVVVVV\\", MAX_PATH);
mkdir(output, 0777); mkdir(output, 0777);
return 1; return 1;
#elif defined(SDL_PLATFORM_ANDROID) #elif defined(__ANDROID__)
const char* externalStoragePath = SDL_GetAndroidExternalStoragePath(); const char* externalStoragePath = SDL_AndroidGetExternalStoragePath();
if (externalStoragePath == NULL) if (externalStoragePath == NULL)
{ {
vlog_error( vlog_error(
@@ -1359,19 +1331,6 @@ static int PLATFORM_getOSDirectory(char* output, const size_t output_size)
} }
SDL_snprintf(output, output_size, "%s/", externalStoragePath); SDL_snprintf(output, output_size, "%s/", externalStoragePath);
return 1; 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;
#else #else
const char* prefDir = PHYSFS_getPrefDir("distractionware", "VVVVVV"); const char* prefDir = PHYSFS_getPrefDir("distractionware", "VVVVVV");
if (prefDir == NULL) if (prefDir == NULL)
@@ -1392,7 +1351,7 @@ bool FILESYSTEM_openDirectoryEnabled(void)
return !gameScreen.isForcedFullscreen(); return !gameScreen.isForcedFullscreen();
} }
#if defined(SDL_PLATFORM_EMSCRIPTEN) #if defined(__EMSCRIPTEN__)
bool FILESYSTEM_openDirectory(const char *dname) bool FILESYSTEM_openDirectory(const char *dname)
{ {
return false; return false;
@@ -1402,7 +1361,7 @@ bool FILESYSTEM_openDirectory(const char *dname)
{ {
char url[MAX_PATH]; char url[MAX_PATH];
SDL_snprintf(url, sizeof(url), "file://%s", dname); SDL_snprintf(url, sizeof(url), "file://%s", dname);
if (!SDL_OpenURL(url)) if (SDL_OpenURL(url) == -1)
{ {
vlog_error("Error opening directory: %s", SDL_GetError()); vlog_error("Error opening directory: %s", SDL_GetError());
return false; return false;
-3
View File
@@ -5,7 +5,6 @@
class binaryBlob; class binaryBlob;
#include <stddef.h> #include <stddef.h>
#include <SDL3/SDL.h>
// Forward declaration, including the entirety of tinyxml2.h across all files this file is included in is unnecessary // Forward declaration, including the entirety of tinyxml2.h across all files this file is included in is unnecessary
namespace tinyxml2 { class XMLDocument; } namespace tinyxml2 { class XMLDocument; }
@@ -36,8 +35,6 @@ bool FILESYSTEM_areAssetsInSameRealDir(const char* filenameA, const char* filena
bool FILESYSTEM_saveFile(const char* name, const unsigned char* data, size_t len); bool FILESYSTEM_saveFile(const char* name, const unsigned char* data, size_t len);
void FILESYSTEM_loadFileToMemory(const char *name, unsigned char **mem, void FILESYSTEM_loadFileToMemory(const char *name, unsigned char **mem,
size_t *len); size_t *len);
SDL_IOStream* FILESYSTEM_loadAssetRWops(const char* name);
void FILESYSTEM_loadAssetToMemory( void FILESYSTEM_loadAssetToMemory(
const char* name, const char* name,
unsigned char** mem, unsigned char** mem,
+1 -1
View File
@@ -438,7 +438,7 @@ static uint8_t load_font(FontContainer* container, const char* name)
add_glyphinfo(f, codepoint, codepoint); add_glyphinfo(f, codepoint, codepoint);
} }
VVV_freefunc(SDL_DestroySurface, temp_surface); VVV_freefunc(SDL_FreeSurface, temp_surface);
} }
} }
+1 -1
View File
@@ -26,7 +26,7 @@
#ifndef FONT_H #ifndef FONT_H
#define FONT_H #define FONT_H
#include <SDL3/SDL.h> #include <SDL.h>
#include <stdint.h> #include <stdint.h>
#include <string> #include <string>
+1 -1
View File
@@ -1,6 +1,6 @@
#include "FontBidi.h" #include "FontBidi.h"
#include <SDL3/SDL.h> #include <SDL.h>
#include <SheenBidi/SheenBidi.h> #include <SheenBidi/SheenBidi.h>
#include "Alloc.h" #include "Alloc.h"
+61 -201
View File
@@ -34,76 +34,76 @@
#include "Vlogging.h" #include "Vlogging.h"
#include "XMLUtils.h" #include "XMLUtils.h"
static bool GetButtonFromString(const char *pText, SDL_GamepadButton *button) static bool GetButtonFromString(const char *pText, SDL_GameControllerButton *button)
{ {
if (*pText == '0' || if (*pText == '0' ||
*pText == 'a' || *pText == 'a' ||
*pText == 'A') *pText == 'A')
{ {
*button = SDL_GAMEPAD_BUTTON_SOUTH; *button = SDL_CONTROLLER_BUTTON_A;
return true; return true;
} }
if (SDL_strcmp(pText, "1") == 0 || if (SDL_strcmp(pText, "1") == 0 ||
*pText == 'b' || *pText == 'b' ||
*pText == 'B') *pText == 'B')
{ {
*button = SDL_GAMEPAD_BUTTON_EAST; *button = SDL_CONTROLLER_BUTTON_B;
return true; return true;
} }
if (*pText == '2' || if (*pText == '2' ||
*pText == 'x' || *pText == 'x' ||
*pText == 'X') *pText == 'X')
{ {
*button = SDL_GAMEPAD_BUTTON_WEST; *button = SDL_CONTROLLER_BUTTON_X;
return true; return true;
} }
if (*pText == '3' || if (*pText == '3' ||
*pText == 'y' || *pText == 'y' ||
*pText == 'Y') *pText == 'Y')
{ {
*button = SDL_GAMEPAD_BUTTON_NORTH; *button = SDL_CONTROLLER_BUTTON_Y;
return true; return true;
} }
if (*pText == '4' || if (*pText == '4' ||
SDL_strcasecmp(pText, "BACK") == 0) SDL_strcasecmp(pText, "BACK") == 0)
{ {
*button = SDL_GAMEPAD_BUTTON_BACK; *button = SDL_CONTROLLER_BUTTON_BACK;
return true; return true;
} }
if (*pText == '5' || if (*pText == '5' ||
SDL_strcasecmp(pText, "GUIDE") == 0) SDL_strcasecmp(pText, "GUIDE") == 0)
{ {
*button = SDL_GAMEPAD_BUTTON_GUIDE; *button = SDL_CONTROLLER_BUTTON_GUIDE;
return true; return true;
} }
if (*pText == '6' || if (*pText == '6' ||
SDL_strcasecmp(pText, "START") == 0) SDL_strcasecmp(pText, "START") == 0)
{ {
*button = SDL_GAMEPAD_BUTTON_START; *button = SDL_CONTROLLER_BUTTON_START;
return true; return true;
} }
if (*pText == '7' || if (*pText == '7' ||
SDL_strcasecmp(pText, "LS") == 0) SDL_strcasecmp(pText, "LS") == 0)
{ {
*button = SDL_GAMEPAD_BUTTON_LEFT_STICK; *button = SDL_CONTROLLER_BUTTON_LEFTSTICK;
return true; return true;
} }
if (*pText == '8' || if (*pText == '8' ||
SDL_strcasecmp(pText, "RS") == 0) SDL_strcasecmp(pText, "RS") == 0)
{ {
*button = SDL_GAMEPAD_BUTTON_RIGHT_STICK; *button = SDL_CONTROLLER_BUTTON_RIGHTSTICK;
return true; return true;
} }
if (*pText == '9' || if (*pText == '9' ||
SDL_strcasecmp(pText, "LB") == 0) SDL_strcasecmp(pText, "LB") == 0)
{ {
*button = SDL_GAMEPAD_BUTTON_LEFT_SHOULDER; *button = SDL_CONTROLLER_BUTTON_LEFTSHOULDER;
return true; return true;
} }
if (SDL_strcmp(pText, "10") == 0 || if (SDL_strcmp(pText, "10") == 0 ||
SDL_strcasecmp(pText, "RB") == 0) SDL_strcasecmp(pText, "RB") == 0)
{ {
*button = SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER; *button = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER;
return true; return true;
} }
return false; return false;
@@ -146,7 +146,7 @@ void Game::init(void)
prevroomy = 0; prevroomy = 0;
saverx = 0; saverx = 0;
savery = 0; savery = 0;
savecolour = EntityColour_CREW_CYAN; savecolour = 0;
mutebutton = 0; mutebutton = 0;
muted = false; muted = false;
@@ -225,7 +225,6 @@ void Game::init(void)
ndmresulthardestroom_x = hardestroom_x; ndmresulthardestroom_x = hardestroom_x;
ndmresulthardestroom_y = hardestroom_y; ndmresulthardestroom_y = hardestroom_y;
ndmresulthardestroom_specialname = false; ndmresulthardestroom_specialname = false;
nodeatheligible = false;
customcol=0; customcol=0;
@@ -254,7 +253,7 @@ void Game::init(void)
levelpage=0; levelpage=0;
playcustomlevel=0; playcustomlevel=0;
gpmenu_lastbutton = SDL_GAMEPAD_BUTTON_INVALID; gpmenu_lastbutton = SDL_CONTROLLER_BUTTON_INVALID;
gpmenu_confirming = false; gpmenu_confirming = false;
gpmenu_showremove = false; gpmenu_showremove = false;
@@ -381,12 +380,6 @@ void Game::init(void)
screenshot_border_timer = 0; screenshot_border_timer = 0;
screenshot_saved_success = false; screenshot_saved_success = false;
#if defined(SDL_PLATFORM_ANDROID) || TARGET_OS_IPHONE
checkpoint_saving = true;
#else
checkpoint_saving = false;
#endif
setdefaultcontrollerbuttons(); setdefaultcontrollerbuttons();
} }
@@ -394,23 +387,23 @@ void Game::setdefaultcontrollerbuttons(void)
{ {
if (controllerButton_flip.size() < 1) if (controllerButton_flip.size() < 1)
{ {
controllerButton_flip.push_back(SDL_GAMEPAD_BUTTON_SOUTH); controllerButton_flip.push_back(SDL_CONTROLLER_BUTTON_A);
} }
if (controllerButton_map.size() < 1) if (controllerButton_map.size() < 1)
{ {
controllerButton_map.push_back(SDL_GAMEPAD_BUTTON_NORTH); controllerButton_map.push_back(SDL_CONTROLLER_BUTTON_Y);
} }
if (controllerButton_esc.size() < 1) if (controllerButton_esc.size() < 1)
{ {
controllerButton_esc.push_back(SDL_GAMEPAD_BUTTON_EAST); controllerButton_esc.push_back(SDL_CONTROLLER_BUTTON_B);
} }
if (controllerButton_restart.size() < 1) if (controllerButton_restart.size() < 1)
{ {
controllerButton_restart.push_back(SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER); controllerButton_restart.push_back(SDL_CONTROLLER_BUTTON_RIGHTSHOULDER);
} }
if (controllerButton_interact.size() < 1) if (controllerButton_interact.size() < 1)
{ {
controllerButton_interact.push_back(SDL_GAMEPAD_BUTTON_WEST); controllerButton_interact.push_back(SDL_CONTROLLER_BUTTON_X);
} }
/* If one of the arrays was empty, and others weren't, we might now have conflicts... /* If one of the arrays was empty, and others weren't, we might now have conflicts...
@@ -832,7 +825,7 @@ static void savetele_textbox_success(textboxclass* THIS)
THIS->pad(3, 3); THIS->pad(3, 3);
} }
static void save_textbox_fail(textboxclass* THIS) static void savetele_textbox_fail(textboxclass* THIS)
{ {
THIS->lines.clear(); THIS->lines.clear();
THIS->lines.push_back(loc::gettext("ERROR: Could not save game!")); THIS->lines.push_back(loc::gettext("ERROR: Could not save game!"));
@@ -840,31 +833,6 @@ static void save_textbox_fail(textboxclass* THIS)
THIS->pad(1, 1); 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) void Game::savetele_textbox(void)
{ {
if (inspecial() || map.custommode) if (inspecial() || map.custommode)
@@ -882,7 +850,11 @@ void Game::savetele_textbox(void)
} }
else else
{ {
show_save_fail(); graphics.createtextboxflipme("", -1, 12, TEXT_COLOUR("red"));
graphics.textboxprintflags(PR_FONT_INTERFACE);
graphics.textboxcenterx();
graphics.textboxtimer(50);
graphics.textboxtranslate(TEXTTRANSLATE_FUNCTION, savetele_textbox_fail);
} }
graphics.textboxapplyposition(); graphics.textboxapplyposition();
} }
@@ -2567,7 +2539,7 @@ void Game::updatestate(void)
int i = obj.getplayer(); int i = obj.getplayer();
if (INBOUNDS_VEC(i, obj.entities)) if (INBOUNDS_VEC(i, obj.entities))
{ {
obj.entities[i].colour = EntityColour_CREW_CYAN; obj.entities[i].colour = 0;
obj.entities[i].invis = false; obj.entities[i].invis = false;
int j = obj.getteleporter(); int j = obj.getteleporter();
@@ -2588,7 +2560,7 @@ void Game::updatestate(void)
if (INBOUNDS_VEC(i, obj.entities)) if (INBOUNDS_VEC(i, obj.entities))
{ {
obj.entities[i].tile = 1; obj.entities[i].tile = 1;
obj.entities[i].colour = EntityColour_TELEPORTER_ACTIVE; obj.entities[i].colour = 101;
} }
break; break;
} }
@@ -2761,7 +2733,7 @@ void Game::updatestate(void)
int i = obj.getplayer(); int i = obj.getplayer();
if (INBOUNDS_VEC(i, obj.entities)) if (INBOUNDS_VEC(i, obj.entities))
{ {
obj.entities[i].colour = EntityColour_CREW_CYAN; obj.entities[i].colour = 0;
obj.entities[i].invis = true; obj.entities[i].invis = true;
} }
@@ -2775,7 +2747,7 @@ void Game::updatestate(void)
if (INBOUNDS_VEC(i, obj.entities)) if (INBOUNDS_VEC(i, obj.entities))
{ {
obj.entities[i].tile = 1; obj.entities[i].tile = 1;
obj.entities[i].colour = EntityColour_TELEPORTER_INACTIVE; obj.entities[i].colour = 100;
} }
break; break;
} }
@@ -3344,14 +3316,11 @@ void Game::updatestate(void)
} }
} }
if (nodeathmode || nodeatheligible)
{
unlockAchievement("vvvvvvmaster"); //bloody hell
unlocknum(UnlockTrophy_NODEATHMODE_COMPLETE);
}
if (nodeathmode) if (nodeathmode)
{ {
unlockAchievement("vvvvvvmaster"); //bloody hell
unlocknum(UnlockTrophy_NODEATHMODE_COMPLETE);
setstate(3520); setstate(3520);
setstatedelay(0); setstatedelay(0);
} }
@@ -3369,7 +3338,7 @@ void Game::updatestate(void)
int i = obj.getplayer(); int i = obj.getplayer();
if (INBOUNDS_VEC(i, obj.entities)) if (INBOUNDS_VEC(i, obj.entities))
{ {
obj.entities[i].colour = EntityColour_TELEPORTER_FLASHING; obj.entities[i].colour = 102;
} }
incstate(); incstate();
@@ -3411,7 +3380,7 @@ void Game::updatestate(void)
int i = obj.getplayer(); int i = obj.getplayer();
if (INBOUNDS_VEC(i, obj.entities)) if (INBOUNDS_VEC(i, obj.entities))
{ {
obj.entities[i].colour = EntityColour_CREW_CYAN; obj.entities[i].colour = 0;
obj.entities[i].invis = true; obj.entities[i].invis = true;
} }
@@ -3496,7 +3465,7 @@ void Game::updatestate(void)
int i = obj.getplayer(); int i = obj.getplayer();
if (INBOUNDS_VEC(i, obj.entities)) if (INBOUNDS_VEC(i, obj.entities))
{ {
obj.entities[i].colour = EntityColour_CREW_CYAN; obj.entities[i].colour = 0;
obj.entities[i].invis = true; obj.entities[i].invis = true;
} }
@@ -3504,7 +3473,7 @@ void Game::updatestate(void)
if(INBOUNDS_VEC(i, obj.entities)) if(INBOUNDS_VEC(i, obj.entities))
{ {
obj.entities[i].tile = 1; obj.entities[i].tile = 1;
obj.entities[i].colour = EntityColour_TELEPORTER_INACTIVE; obj.entities[i].colour = 100;
} }
break; break;
} }
@@ -3548,9 +3517,9 @@ void Game::updatestate(void)
obj.entities[i].lerpoldxp = obj.entities[i].xp; obj.entities[i].lerpoldxp = obj.entities[i].xp;
obj.entities[i].lerpoldyp = obj.entities[i].yp; obj.entities[i].lerpoldyp = obj.entities[i].yp;
obj.entities[j].tile = 2; 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].invis = false;
obj.entities[i].dir = 1; obj.entities[i].dir = 1;
@@ -3679,9 +3648,9 @@ void Game::updatestate(void)
obj.entities[i].lerpoldxp = obj.entities[i].xp; obj.entities[i].lerpoldxp = obj.entities[i].xp;
obj.entities[i].lerpoldyp = obj.entities[i].yp; obj.entities[i].lerpoldyp = obj.entities[i].yp;
obj.entities[j].tile = 2; 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].invis = false;
obj.entities[i].dir = 1; obj.entities[i].dir = 1;
@@ -3792,9 +3761,9 @@ void Game::updatestate(void)
obj.entities[i].lerpoldxp = obj.entities[i].xp; obj.entities[i].lerpoldxp = obj.entities[i].xp;
obj.entities[i].lerpoldyp = obj.entities[i].yp; obj.entities[i].lerpoldyp = obj.entities[i].yp;
obj.entities[j].tile = 2; 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].invis = false;
obj.entities[i].dir = 0; obj.entities[i].dir = 0;
@@ -3905,9 +3874,9 @@ void Game::updatestate(void)
obj.entities[i].lerpoldxp = obj.entities[i].xp; obj.entities[i].lerpoldxp = obj.entities[i].xp;
obj.entities[i].lerpoldyp = obj.entities[i].yp; obj.entities[i].lerpoldyp = obj.entities[i].yp;
obj.entities[j].tile = 2; 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].invis = false;
obj.entities[i].dir = 1; obj.entities[i].dir = 1;
@@ -4023,9 +3992,9 @@ void Game::updatestate(void)
obj.entities[i].lerpoldxp = obj.entities[i].xp; obj.entities[i].lerpoldxp = obj.entities[i].xp;
obj.entities[i].lerpoldyp = obj.entities[i].yp; obj.entities[i].lerpoldyp = obj.entities[i].yp;
obj.entities[j].tile = 2; 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].invis = false;
obj.entities[i].dir = 1; obj.entities[i].dir = 1;
@@ -4141,9 +4110,9 @@ void Game::updatestate(void)
obj.entities[i].lerpoldxp = obj.entities[i].xp; obj.entities[i].lerpoldxp = obj.entities[i].xp;
obj.entities[i].lerpoldyp = obj.entities[i].yp; obj.entities[i].lerpoldyp = obj.entities[i].yp;
obj.entities[j].tile = 2; 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].invis = false;
obj.entities[i].dir = 0; obj.entities[i].dir = 0;
@@ -4257,7 +4226,7 @@ void Game::updatestate(void)
obj.entities[i].lerpoldxp = obj.entities[i].xp; obj.entities[i].lerpoldxp = obj.entities[i].xp;
obj.entities[i].lerpoldyp = obj.entities[i].yp; obj.entities[i].lerpoldyp = obj.entities[i].yp;
obj.entities[j].tile = 2; 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].invis = false;
obj.entities[i].dir = 1; obj.entities[i].dir = 1;
@@ -4370,9 +4339,9 @@ void Game::updatestate(void)
obj.entities[i].lerpoldxp = obj.entities[i].xp; obj.entities[i].lerpoldxp = obj.entities[i].xp;
obj.entities[i].lerpoldyp = obj.entities[i].yp; obj.entities[i].lerpoldyp = obj.entities[i].yp;
obj.entities[j].tile = 2; 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].invis = false;
obj.entities[i].dir = 1; obj.entities[i].dir = 1;
@@ -4483,9 +4452,9 @@ void Game::updatestate(void)
obj.entities[i].lerpoldxp = obj.entities[i].xp; obj.entities[i].lerpoldxp = obj.entities[i].xp;
obj.entities[i].lerpoldyp = obj.entities[i].yp; obj.entities[i].lerpoldyp = obj.entities[i].yp;
obj.entities[j].tile = 2; 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].invis = false;
obj.entities[i].dir = 1; obj.entities[i].dir = 1;
@@ -4898,7 +4867,7 @@ void Game::deserializesettings(tinyxml2::XMLElement* dataNode, struct ScreenSett
if (SDL_strcmp(pKey, "flipButton") == 0) if (SDL_strcmp(pKey, "flipButton") == 0)
{ {
SDL_GamepadButton newButton; SDL_GameControllerButton newButton;
if (GetButtonFromString(pText, &newButton)) if (GetButtonFromString(pText, &newButton))
{ {
controllerButton_flip.push_back(newButton); controllerButton_flip.push_back(newButton);
@@ -4907,7 +4876,7 @@ void Game::deserializesettings(tinyxml2::XMLElement* dataNode, struct ScreenSett
if (SDL_strcmp(pKey, "enterButton") == 0) if (SDL_strcmp(pKey, "enterButton") == 0)
{ {
SDL_GamepadButton newButton; SDL_GameControllerButton newButton;
if (GetButtonFromString(pText, &newButton)) if (GetButtonFromString(pText, &newButton))
{ {
controllerButton_map.push_back(newButton); controllerButton_map.push_back(newButton);
@@ -4916,7 +4885,7 @@ void Game::deserializesettings(tinyxml2::XMLElement* dataNode, struct ScreenSett
if (SDL_strcmp(pKey, "escButton") == 0) if (SDL_strcmp(pKey, "escButton") == 0)
{ {
SDL_GamepadButton newButton; SDL_GameControllerButton newButton;
if (GetButtonFromString(pText, &newButton)) if (GetButtonFromString(pText, &newButton))
{ {
controllerButton_esc.push_back(newButton); controllerButton_esc.push_back(newButton);
@@ -4925,7 +4894,7 @@ void Game::deserializesettings(tinyxml2::XMLElement* dataNode, struct ScreenSett
if (SDL_strcmp(pKey, "restartButton") == 0) if (SDL_strcmp(pKey, "restartButton") == 0)
{ {
SDL_GamepadButton newButton; SDL_GameControllerButton newButton;
if (GetButtonFromString(pText, &newButton)) if (GetButtonFromString(pText, &newButton))
{ {
controllerButton_restart.push_back(newButton); controllerButton_restart.push_back(newButton);
@@ -4934,7 +4903,7 @@ void Game::deserializesettings(tinyxml2::XMLElement* dataNode, struct ScreenSett
if (SDL_strcmp(pKey, "interactButton") == 0) if (SDL_strcmp(pKey, "interactButton") == 0)
{ {
SDL_GamepadButton newButton; SDL_GameControllerButton newButton;
if (GetButtonFromString(pText, &newButton)) if (GetButtonFromString(pText, &newButton))
{ {
controllerButton_interact.push_back(newButton); controllerButton_interact.push_back(newButton);
@@ -4971,10 +4940,6 @@ void Game::deserializesettings(tinyxml2::XMLElement* dataNode, struct ScreenSett
roomname_translator::set_enabled(help.Int(pText)); roomname_translator::set_enabled(help.Int(pText));
} }
if (SDL_strcmp(pKey, "checkpoint_saving") == 0)
{
checkpoint_saving = help.Int(pText);
}
} }
setdefaultcontrollerbuttons(); setdefaultcontrollerbuttons();
@@ -5233,8 +5198,6 @@ void Game::serializesettings(tinyxml2::XMLElement* dataNode, const struct Screen
xml::update_tag(dataNode, "english_sprites", (int) loc::english_sprites); 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, "new_level_font", loc::new_level_font.c_str());
xml::update_tag(dataNode, "roomname_translator", (int) roomname_translator::enabled); xml::update_tag(dataNode, "roomname_translator", (int) roomname_translator::enabled);
xml::update_tag(dataNode, "checkpoint_saving", (int) checkpoint_saving);
} }
static bool settings_loaded = false; static bool settings_loaded = false;
@@ -5367,7 +5330,7 @@ void Game::deathsequence(void)
} }
if (INBOUNDS_VEC(i, obj.entities)) if (INBOUNDS_VEC(i, obj.entities))
{ {
obj.entities[i].colour = EntityColour_DEAD; obj.entities[i].colour = 1;
obj.entities[i].invis = false; obj.entities[i].invis = false;
} }
@@ -5934,10 +5897,6 @@ void Game::customloadquick(const std::string& savfile)
{ {
map.customshowmm = help.Int(pText); map.customshowmm = help.Int(pText);
} }
else if (SDL_strcmp(pKey, "mapreveal") == 0)
{
map.revealmap = help.Int(pText);
}
else if (SDL_strcmp(pKey, "disabletemporaryaudiopause") == 0) else if (SDL_strcmp(pKey, "disabletemporaryaudiopause") == 0)
{ {
disabletemporaryaudiopause = help.Int(pText); disabletemporaryaudiopause = help.Int(pText);
@@ -5952,48 +5911,6 @@ void Game::customloadquick(const std::string& savfile)
map.roomnameset = true; map.roomnameset = true;
map.roomname_special = 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);
}
}
} }
} }
@@ -6378,41 +6295,6 @@ bool Game::customsavequick(const std::string& savfile)
xml::update_tag(msgs, "crewmates", crewmates()); 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 //Special stats
@@ -6454,8 +6336,6 @@ bool Game::customsavequick(const std::string& savfile)
xml::update_tag(msgs, "showminimap", (int) map.customshowmm); 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, "disabletemporaryaudiopause", (int) disabletemporaryaudiopause);
xml::update_tag(msgs, "showtrinkets", (int) map.showtrinkets); xml::update_tag(msgs, "showtrinkets", (int) map.showtrinkets);
@@ -6976,7 +6856,6 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
option(loc::gettext("unfocus pause")); option(loc::gettext("unfocus pause"));
option(loc::gettext("unfocus audio pause")); option(loc::gettext("unfocus audio pause"));
option(loc::gettext("room name background")); option(loc::gettext("room name background"));
option(loc::gettext("checkpoint saving"));
option(loc::gettext("return")); option(loc::gettext("return"));
menuyoff = 0; menuyoff = 0;
maxspacing = 15; maxspacing = 15;
@@ -7893,11 +7772,6 @@ void Game::returntoingame(void)
} }
} }
DEFER_CALLBACK(nextbgcolor); DEFER_CALLBACK(nextbgcolor);
if (nocompetitive())
{
invalidate_ndm_trophy();
}
} }
void Game::unlockAchievement(const char* name) void Game::unlockAchievement(const char* name)
@@ -7949,22 +7823,8 @@ void Game::copyndmresults(void)
SDL_memcpy(ndmresultcrewstats, crewstats, sizeof(ndmresultcrewstats)); 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) switch (slowdown)
{ {
case 30: case 30:
@@ -7985,7 +7845,7 @@ int Game::get_timestep(void)
if ((gamestate == GAMEMODE || (gamestate == TELEPORTERMODE && !useteleporter)) && if ((gamestate == GAMEMODE || (gamestate == TELEPORTERMODE && !useteleporter)) &&
level_debugger::is_active() && level_debugger::is_active() &&
!level_debugger::is_pausing() && !level_debugger::is_pausing() &&
key.isDown(SDLK_F)) key.isDown(SDLK_f))
{ {
return 1; return 1;
} }
@@ -7993,7 +7853,7 @@ int Game::get_timestep(void)
switch (gamestate) switch (gamestate)
{ {
case GAMEMODE: case GAMEMODE:
return get_framerate(slowdown, deathseq); return get_framerate(slowdown);
default: default:
return 34; return 34;
} }
+7 -12
View File
@@ -1,7 +1,7 @@
#ifndef GAME_H #ifndef GAME_H
#define GAME_H #define GAME_H
#include <SDL3/SDL.h> #include <SDL.h>
#include <map> #include <map>
#include <string> #include <string>
#include <vector> #include <vector>
@@ -225,8 +225,6 @@ public:
void crewmate_textbox(const int color); void crewmate_textbox(const int color);
void remaining_textbox(void); void remaining_textbox(void);
void actionprompt_textbox(void); void actionprompt_textbox(void);
void show_save_fail(void);
void checkpoint_save(void);
void savetele_textbox(void); void savetele_textbox(void);
void setstate(int gamestate); void setstate(int gamestate);
@@ -365,7 +363,6 @@ public:
int savetrinkets; int savetrinkets;
bool startscript; bool startscript;
std::string newscript; std::string newscript;
bool checkpoint_saving;
bool menustart; bool menustart;
@@ -404,7 +401,7 @@ public:
int creditposx, creditposy, creditposdelay; int creditposx, creditposy, creditposdelay;
int oldcreditposx; int oldcreditposx;
SDL_GamepadButton gpmenu_lastbutton; SDL_GameControllerButton gpmenu_lastbutton;
bool gpmenu_confirming; bool gpmenu_confirming;
bool gpmenu_showremove; bool gpmenu_showremove;
@@ -439,8 +436,6 @@ public:
int ndmresulthardestroom_y; int ndmresulthardestroom_y;
bool ndmresulthardestroom_specialname; bool ndmresulthardestroom_specialname;
void copyndmresults(void); void copyndmresults(void);
bool nodeatheligible;
void invalidate_ndm_trophy(void);
//Time Trials //Time Trials
bool intimetrial, timetrialparlost; bool intimetrial, timetrialparlost;
@@ -547,11 +542,11 @@ public:
std::map<std::string, int> customlevelstats; std::map<std::string, int> customlevelstats;
std::vector<SDL_GamepadButton> controllerButton_map; std::vector<SDL_GameControllerButton> controllerButton_map;
std::vector<SDL_GamepadButton> controllerButton_flip; std::vector<SDL_GameControllerButton> controllerButton_flip;
std::vector<SDL_GamepadButton> controllerButton_esc; std::vector<SDL_GameControllerButton> controllerButton_esc;
std::vector<SDL_GamepadButton> controllerButton_restart; std::vector<SDL_GameControllerButton> controllerButton_restart;
std::vector<SDL_GamepadButton> controllerButton_interact; std::vector<SDL_GameControllerButton> controllerButton_interact;
bool skipfakeload; bool skipfakeload;
bool ghostsenabled; bool ghostsenabled;
+2 -2
View File
@@ -1,7 +1,7 @@
#include "GlitchrunnerMode.h" #include "GlitchrunnerMode.h"
#include <SDL3/SDL_assert.h> #include <SDL_assert.h>
#include <SDL3/SDL_stdinc.h> #include <SDL_stdinc.h>
#define LOOKUP_TABLE \ #define LOOKUP_TABLE \
FOREACH_ENUM(GlitchrunnerNone, "") \ FOREACH_ENUM(GlitchrunnerNone, "") \
+186 -292
View File
@@ -1,7 +1,7 @@
#define GRAPHICS_DEFINITION #define GRAPHICS_DEFINITION
#include "Graphics.h" #include "Graphics.h"
#include <SDL3/SDL.h> #include <SDL.h>
#include "Alloc.h" #include "Alloc.h"
#include "Constants.h" #include "Constants.h"
@@ -157,7 +157,7 @@ void Graphics::destroy(void)
#define CLEAR_ARRAY(name) \ #define CLEAR_ARRAY(name) \
for (size_t i = 0; i < name.size(); i += 1) \ for (size_t i = 0; i < name.size(); i += 1) \
{ \ { \
VVV_freefunc(SDL_DestroySurface, name[i]); \ VVV_freefunc(SDL_FreeSurface, name[i]); \
} \ } \
name.clear(); name.clear();
@@ -200,12 +200,12 @@ void Graphics::create_buffers(void)
SDL_SetTextureScaleMode( SDL_SetTextureScaleMode(
gameTexture, gameTexture,
gameScreen.isFiltered ? SDL_SCALEMODE_LINEAR : SDL_SCALEMODE_NEAREST gameScreen.isFiltered ? SDL_ScaleModeLinear : SDL_ScaleModeNearest
); );
SDL_SetTextureScaleMode( SDL_SetTextureScaleMode(
tempShakeTexture, tempShakeTexture,
gameScreen.isFiltered ? SDL_SCALEMODE_LINEAR : SDL_SCALEMODE_NEAREST gameScreen.isFiltered ? SDL_ScaleModeLinear : SDL_ScaleModeNearest
); );
} }
@@ -221,10 +221,10 @@ void Graphics::destroy_buffers(void)
VVV_freefunc(SDL_DestroyTexture, tempScrollingTexture); VVV_freefunc(SDL_DestroyTexture, tempScrollingTexture);
VVV_freefunc(SDL_DestroyTexture, towerbg.texture); VVV_freefunc(SDL_DestroyTexture, towerbg.texture);
VVV_freefunc(SDL_DestroyTexture, titlebg.texture); VVV_freefunc(SDL_DestroyTexture, titlebg.texture);
VVV_freefunc(SDL_DestroySurface, tempFilterSrc); VVV_freefunc(SDL_FreeSurface, tempFilterSrc);
VVV_freefunc(SDL_DestroySurface, tempFilterDest); VVV_freefunc(SDL_FreeSurface, tempFilterDest);
VVV_freefunc(SDL_DestroySurface, tempScreenshot); VVV_freefunc(SDL_FreeSurface, tempScreenshot);
VVV_freefunc(SDL_DestroySurface, tempScreenshot2x); VVV_freefunc(SDL_FreeSurface, tempScreenshot2x);
} }
void Graphics::drawspritesetcol(int x, int y, int t, int c) void Graphics::drawspritesetcol(int x, int y, int t, int c)
@@ -425,119 +425,99 @@ void Graphics::print_level_creator(
int width_for_face = 17; int width_for_face = 17;
int total_width = width_for_face + font::len(print_flags, creator.c_str()); int total_width = width_for_face + font::len(print_flags, creator.c_str());
int face_x, text_x, sprite_x; int face_x, text_x, sprite_x;
int offset_x = -7;
if (!font::is_rtl(print_flags)) if (!font::is_rtl(print_flags))
{ {
face_x = (SCREEN_WIDTH_PIXELS - total_width) / 2; face_x = (SCREEN_WIDTH_PIXELS - total_width) / 2;
text_x = face_x + width_for_face; text_x = face_x + width_for_face;
sprite_x = 0; sprite_x = 7;
} }
else else
{ {
face_x = (SCREEN_WIDTH_PIXELS + total_width) / 2; face_x = (SCREEN_WIDTH_PIXELS + total_width) / 2;
text_x = face_x - width_for_face; text_x = face_x - width_for_face;
face_x -= 10; // sprite origin face_x -= 10; // sprite origin
sprite_x = 96; sprite_x = 103;
print_flags |= PR_RIGHT; print_flags |= PR_RIGHT;
} }
set_texture_color_mod(grphx.im_sprites, r, g, b); 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); draw_texture_part(grphx.im_sprites, face_x, y - 1, sprite_x, 2, 10, 10, 1, 1);
set_texture_color_mod(grphx.im_sprites, 255, 255, 255); set_texture_color_mod(grphx.im_sprites, 255, 255, 255);
font::print(print_flags, text_x, y, creator, r, g, b); font::print(print_flags, text_x, y, creator, r, g, b);
} }
bool Graphics::set_render_target(SDL_Texture* texture) int Graphics::set_render_target(SDL_Texture* texture)
{ {
const bool result = SDL_SetRenderTarget(gameScreen.m_renderer, texture); const int result = SDL_SetRenderTarget(gameScreen.m_renderer, texture);
if (!result) if (result != 0)
{ {
WHINE_ONCE_ARGS(("Could not set render target: %s", SDL_GetError())); WHINE_ONCE_ARGS(("Could not set render target: %s", SDL_GetError()));
} }
return result; return result;
} }
bool Graphics::set_texture_color_mod(SDL_Texture* texture, const Uint8 r, const Uint8 g, const Uint8 b) int Graphics::set_texture_color_mod(SDL_Texture* texture, const Uint8 r, const Uint8 g, const Uint8 b)
{ {
const bool result = SDL_SetTextureColorMod(texture, r, g, b); const int result = SDL_SetTextureColorMod(texture, r, g, b);
if (!result) if (result != 0)
{ {
WHINE_ONCE_ARGS(("Could not set texture color mod: %s", SDL_GetError())); WHINE_ONCE_ARGS(("Could not set texture color mod: %s", SDL_GetError()));
} }
return result; return result;
} }
bool Graphics::set_texture_alpha_mod(SDL_Texture* texture, const Uint8 alpha) int Graphics::set_texture_alpha_mod(SDL_Texture* texture, const Uint8 alpha)
{ {
const bool result = SDL_SetTextureAlphaMod(texture, alpha); const int result = SDL_SetTextureAlphaMod(texture, alpha);
if (!result) if (result != 0)
{ {
WHINE_ONCE_ARGS(("Could not set texture alpha mod: %s", SDL_GetError())); WHINE_ONCE_ARGS(("Could not set texture alpha mod: %s", SDL_GetError()));
} }
return result; return result;
} }
bool Graphics::query_texture(SDL_Texture* texture, Uint32* format, int* access, int* w, int* h) int Graphics::query_texture(SDL_Texture* texture, Uint32* format, int* access, int* w, int* h)
{ {
SDL_PropertiesID props = SDL_GetTextureProperties(texture); const int result = SDL_QueryTexture(texture, format, access, w, h);
if (result != 0)
if (props == 0)
{ {
WHINE_ONCE_ARGS(("Could not query texture: %s", SDL_GetError())); WHINE_ONCE_ARGS(("Could not query texture: %s", SDL_GetError()));
return false;
} }
return result;
if (format) {
*format = SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_FORMAT_NUMBER, 0);
}
if (access) {
*access = SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_ACCESS_NUMBER, 0);
}
if (w) {
*w = SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_WIDTH_NUMBER, 0);
}
if (h) {
*h = SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_HEIGHT_NUMBER, 0);
}
return true;
} }
bool Graphics::set_blendmode(const SDL_BlendMode blendmode) int Graphics::set_blendmode(const SDL_BlendMode blendmode)
{ {
const bool result = SDL_SetRenderDrawBlendMode(gameScreen.m_renderer, blendmode); const int result = SDL_SetRenderDrawBlendMode(gameScreen.m_renderer, blendmode);
if (!result) if (result != 0)
{ {
WHINE_ONCE_ARGS(("Could not set draw mode: %s", SDL_GetError())); WHINE_ONCE_ARGS(("Could not set draw mode: %s", SDL_GetError()));
} }
return result; return result;
} }
bool Graphics::set_blendmode(SDL_Texture* texture, const SDL_BlendMode blendmode) int Graphics::set_blendmode(SDL_Texture* texture, const SDL_BlendMode blendmode)
{ {
const bool result = SDL_SetTextureBlendMode(texture, blendmode); const int result = SDL_SetTextureBlendMode(texture, blendmode);
if (!result) if (result != 0)
{ {
WHINE_ONCE_ARGS(("Could not set texture blend mode: %s", SDL_GetError())); WHINE_ONCE_ARGS(("Could not set texture blend mode: %s", SDL_GetError()));
} }
return result; return result;
} }
bool Graphics::clear(const int r, const int g, const int b, const int a) int Graphics::clear(const int r, const int g, const int b, const int a)
{ {
set_color(r, g, b, a); set_color(r, g, b, a);
const bool result = SDL_RenderClear(gameScreen.m_renderer); const int result = SDL_RenderClear(gameScreen.m_renderer);
if (!result) if (result != 0)
{ {
WHINE_ONCE_ARGS(("Could not clear current render target: %s", SDL_GetError())); WHINE_ONCE_ARGS(("Could not clear current render target: %s", SDL_GetError()));
} }
return result; return result;
} }
bool Graphics::clear(void) int Graphics::clear(void)
{ {
return clear(0, 0, 0, 255); return clear(0, 0, 0, 255);
} }
@@ -585,12 +565,12 @@ void Graphics::post_substitute(SDL_Texture* subst)
set_texture_alpha_mod(subst, 255); set_texture_alpha_mod(subst, 255);
} }
bool Graphics::copy_texture(SDL_Texture* texture, const SDL_FRect* src, const SDL_FRect* dest) int Graphics::copy_texture(SDL_Texture* texture, const SDL_Rect* src, const SDL_Rect* dest)
{ {
bool is_substituted = substitute(&texture); bool is_substituted = substitute(&texture);
const bool result = SDL_RenderTexture(gameScreen.m_renderer, texture, src, dest); const int result = SDL_RenderCopy(gameScreen.m_renderer, texture, src, dest);
if (!result) if (result != 0)
{ {
WHINE_ONCE_ARGS(("Could not copy texture: %s", SDL_GetError())); WHINE_ONCE_ARGS(("Could not copy texture: %s", SDL_GetError()));
} }
@@ -603,12 +583,12 @@ bool Graphics::copy_texture(SDL_Texture* texture, const SDL_FRect* src, const SD
return result; return result;
} }
bool Graphics::copy_texture(SDL_Texture* texture, const SDL_FRect* src, const SDL_FRect* dest, const double angle, const SDL_FPoint* center, const SDL_FlipMode flip) 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); bool is_substituted = substitute(&texture);
const bool result = SDL_RenderTextureRotated(gameScreen.m_renderer, texture, src, dest, angle, center, flip); const int result = SDL_RenderCopyEx(gameScreen.m_renderer, texture, src, dest, angle, center, flip);
if (!result) if (result != 0)
{ {
WHINE_ONCE_ARGS(("Could not copy texture: %s", SDL_GetError())); WHINE_ONCE_ARGS(("Could not copy texture: %s", SDL_GetError()));
} }
@@ -621,151 +601,141 @@ bool Graphics::copy_texture(SDL_Texture* texture, const SDL_FRect* src, const SD
return result; return result;
} }
bool Graphics::set_color(const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a) int Graphics::set_color(const Uint8 r, const Uint8 g, const Uint8 b, const Uint8 a)
{ {
const bool result = SDL_SetRenderDrawColor(gameScreen.m_renderer, r, g, b, a); const int result = SDL_SetRenderDrawColor(gameScreen.m_renderer, r, g, b, a);
if (!result) if (result != 0)
{ {
WHINE_ONCE_ARGS(("Could not set draw color: %s", SDL_GetError())); WHINE_ONCE_ARGS(("Could not set draw color: %s", SDL_GetError()));
} }
return result; return result;
} }
bool Graphics::set_color(const Uint8 r, const Uint8 g, const Uint8 b) int Graphics::set_color(const Uint8 r, const Uint8 g, const Uint8 b)
{ {
return set_color(r, g, b, 255); return set_color(r, g, b, 255);
} }
bool Graphics::set_color(const SDL_Color color) int Graphics::set_color(const SDL_Color color)
{ {
return set_color(color.r, color.g, color.b, color.a); return set_color(color.r, color.g, color.b, color.a);
} }
bool Graphics::fill_rect(const SDL_FRect* rect) int Graphics::fill_rect(const SDL_Rect* rect)
{ {
const bool result = SDL_RenderFillRect(gameScreen.m_renderer, rect); const int result = SDL_RenderFillRect(gameScreen.m_renderer, rect);
if (!result) if (result != 0)
{ {
WHINE_ONCE_ARGS(("Could not draw filled rectangle: %s", SDL_GetError())); WHINE_ONCE_ARGS(("Could not draw filled rectangle: %s", SDL_GetError()));
} }
return result; return result;
} }
bool Graphics::fill_rect(const SDL_FRect* rect, const int r, const int g, const int b, const int a) 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); set_color(r, g, b, a);
return fill_rect(rect); return fill_rect(rect);
} }
bool Graphics::fill_rect(const SDL_FRect* rect, const int r, const int g, const int b) 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); return fill_rect(rect, r, g, b, 255);
} }
bool Graphics::fill_rect(const int r, const int g, const int b) int Graphics::fill_rect(const int r, const int g, const int b)
{ {
return fill_rect(NULL, r, g, b, 255); return fill_rect(NULL, r, g, b, 255);
} }
bool Graphics::fill_rect(const SDL_FRect* rect, const SDL_Color color) int Graphics::fill_rect(const SDL_Rect* rect, const SDL_Color color)
{ {
return fill_rect(rect, color.r, color.g, color.b, color.a); return fill_rect(rect, color.r, color.g, color.b, color.a);
} }
bool 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) 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_FRect rect = { const SDL_Rect rect = {x, y, w, h};
static_cast<float>(x),
static_cast<float>(y),
static_cast<float>(w),
static_cast<float>(h)
};
return fill_rect(&rect, r, g, b, a); return fill_rect(&rect, r, g, b, a);
} }
bool Graphics::fill_rect(const int x, const int y, const int w, const int h, const int r, const int g, const int b) 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); return fill_rect(x, y, w, h, r, g, b, 255);
} }
bool Graphics::fill_rect(const SDL_Color color) int Graphics::fill_rect(const SDL_Color color)
{ {
return fill_rect(NULL, color); return fill_rect(NULL, color);
} }
bool Graphics::fill_rect(const int x, const int y, const int w, const int h, const SDL_Color 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); return fill_rect(x, y, w, h, color.r, color.g, color.b, color.a);
} }
bool Graphics::draw_rect(const SDL_FRect* rect) int Graphics::draw_rect(const SDL_Rect* rect)
{ {
const bool result = SDL_RenderRect(gameScreen.m_renderer, rect); const int result = SDL_RenderDrawRect(gameScreen.m_renderer, rect);
if (!result) if (result != 0)
{ {
WHINE_ONCE_ARGS(("Could not draw rectangle: %s", SDL_GetError())); WHINE_ONCE_ARGS(("Could not draw rectangle: %s", SDL_GetError()));
} }
return result; return result;
} }
bool Graphics::draw_rect(const SDL_FRect* rect, const int r, const int g, const int b, const int a) 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); set_color(r, g, b, a);
return draw_rect(rect); return draw_rect(rect);
} }
bool Graphics::draw_rect(const SDL_FRect* rect, const int r, const int g, const int b) 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); return draw_rect(rect, r, g, b, 255);
} }
bool Graphics::draw_rect(const SDL_FRect* rect, const SDL_Color color) int Graphics::draw_rect(const SDL_Rect* rect, const SDL_Color color)
{ {
return draw_rect(rect, color.r, color.g, color.b, color.a); return draw_rect(rect, color.r, color.g, color.b, color.a);
} }
bool 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) 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_FRect rect = { const SDL_Rect rect = {x, y, w, h};
static_cast<float>(x),
static_cast<float>(y),
static_cast<float>(w),
static_cast<float>(h)
};
return draw_rect(&rect, r, g, b, a); return draw_rect(&rect, r, g, b, a);
} }
bool Graphics::draw_rect(const int x, const int y, const int w, const int h, const int r, const int g, const int b) 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); return draw_rect(x, y, w, h, r, g, b, 255);
} }
bool Graphics::draw_rect(const int x, const int y, const int w, const int h, const SDL_Color color) 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); return draw_rect(x, y, w, h, color.r, color.g, color.b, color.a);
} }
bool Graphics::draw_line(const int x, const int y, const int x2, const int y2) int Graphics::draw_line(const int x, const int y, const int x2, const int y2)
{ {
const bool result = SDL_RenderLine(gameScreen.m_renderer, x, y, x2, y2); const int result = SDL_RenderDrawLine(gameScreen.m_renderer, x, y, x2, y2);
if (!result) if (result != 0)
{ {
WHINE_ONCE_ARGS(("Could not draw line: %s", SDL_GetError())); WHINE_ONCE_ARGS(("Could not draw line: %s", SDL_GetError()));
} }
return result; return result;
} }
bool Graphics::draw_points(const SDL_FPoint* points, const int count) int Graphics::draw_points(const SDL_Point* points, const int count)
{ {
const bool result = SDL_RenderPoints(gameScreen.m_renderer, points, count); const int result = SDL_RenderDrawPoints(gameScreen.m_renderer, points, count);
if (!result) if (result != 0)
{ {
WHINE_ONCE_ARGS(("Could not draw points: %s", SDL_GetError())); WHINE_ONCE_ARGS(("Could not draw points: %s", SDL_GetError()));
} }
return result; return result;
} }
bool Graphics::draw_points(const SDL_FPoint* points, const int count, const int r, const int g, const int b) 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); set_color(r, g, b);
return draw_points(points, count); return draw_points(points, count);
@@ -790,20 +760,10 @@ void Graphics::scroll_texture(SDL_Texture* texture, SDL_Texture* temp, const int
{ {
SDL_Texture* target = SDL_GetRenderTarget(gameScreen.m_renderer); SDL_Texture* target = SDL_GetRenderTarget(gameScreen.m_renderer);
SDL_Rect texture_rect = {0, 0, 0, 0}; SDL_Rect texture_rect = {0, 0, 0, 0};
query_texture(texture, NULL, NULL, &texture_rect.w, &texture_rect.h); SDL_QueryTexture(texture, NULL, NULL, &texture_rect.w, &texture_rect.h);
const SDL_FRect src = { const SDL_Rect src = {0, 0, texture_rect.w, texture_rect.h};
0.0f, const SDL_Rect dest = {x, y, texture_rect.w, texture_rect.h};
0.0f,
static_cast<float>(texture_rect.w),
static_cast<float>(texture_rect.h)
};
const SDL_FRect dest = {
static_cast<float>(x),
static_cast<float>(y),
static_cast<float>(texture_rect.w),
static_cast<float>(texture_rect.h)
};
set_render_target(temp); set_render_target(temp);
clear(); clear();
@@ -852,7 +812,7 @@ void Graphics::drawtile3(int x, int y, int t, int off, int height_subtract /*= 0
// so do the logic ourselves (except include height_subtract in the final call) // so do the logic ourselves (except include height_subtract in the final call)
int width; int width;
if (!query_texture(grphx.im_tiles3, NULL, NULL, &width, NULL)) if (query_texture(grphx.im_tiles3, NULL, NULL, &width, NULL) != 0)
{ {
return; return;
} }
@@ -969,20 +929,13 @@ void Graphics::drawgui(void)
size_t j; size_t j;
for (j = 0; j < textboxes[i].lines.size(); j++) for (j = 0; j < textboxes[i].lines.size(); j++)
{ {
const int x = text_xp; font::print(
const int y = yp + text_yoff + text_sign * (j * (font_height + textboxes[i].linegap)); print_flags | PR_BOR,
if (!textboxes[i].force_outline) text_xp,
{ yp + text_yoff + text_sign * (j * (font_height + textboxes[i].linegap)),
font::print(print_flags | PR_BOR, x, y, textbox_line(buffer, sizeof(buffer), i, j), 0, 0, 0); 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++) for (j = 0; j < textboxes[i].lines.size(); j++)
{ {
@@ -1159,7 +1112,7 @@ void Graphics::drawimagecol( int t, int xp, int yp, const SDL_Color ct, bool cen
trect.x = xp; trect.x = xp;
trect.y = yp; trect.y = yp;
if (!query_texture(images[t], NULL, NULL, &trect.w, &trect.h)) if (query_texture(images[t], NULL, NULL, &trect.w, &trect.h) != 0)
{ {
return; return;
} }
@@ -1186,7 +1139,7 @@ void Graphics::drawimage( int t, int xp, int yp, bool cent/*=false*/ )
trect.x = xp; trect.x = xp;
trect.y = yp; trect.y = yp;
if (!query_texture(images[t], NULL, NULL, &trect.w, &trect.h)) if (query_texture(images[t], NULL, NULL, &trect.w, &trect.h) != 0)
{ {
return; return;
} }
@@ -1212,29 +1165,19 @@ void Graphics::draw_texture(SDL_Texture* image, const int x, const int y)
{ {
int w, h; int w, h;
if (!query_texture(image, NULL, NULL, &w, &h)) if (query_texture(image, NULL, NULL, &w, &h) != 0)
{ {
return; return;
} }
const SDL_FRect dstrect = { const SDL_Rect dstrect = {x, y, w, h};
static_cast<float>(x),
static_cast<float>(y),
static_cast<float>(w),
static_cast<float>(h)
};
copy_texture(image, NULL, &dstrect); copy_texture(image, NULL, &dstrect);
} }
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) 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_FRect srcrect = { const SDL_Rect srcrect = {x2, y2, w, h};
static_cast<float>(x2),
static_cast<float>(y2),
static_cast<float>(w),
static_cast<float>(h)
};
int flip = SDL_FLIP_NONE; int flip = SDL_FLIP_NONE;
@@ -1247,21 +1190,16 @@ void Graphics::draw_texture_part(SDL_Texture* image, const int x, const int y, c
flip |= SDL_FLIP_VERTICAL; flip |= SDL_FLIP_VERTICAL;
} }
const SDL_FRect dstrect = { const SDL_Rect dstrect = {x, y, w * SDL_abs(scalex), h * SDL_abs(scaley)};
static_cast<float>(x),
static_cast<float>(y),
static_cast<float>(w * SDL_abs(scalex)),
static_cast<float>(h * SDL_abs(scaley))
};
copy_texture(image, &srcrect, &dstrect, 0, NULL, (SDL_FlipMode) flip); 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) 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; int tex_width;
if (!query_texture(texture, NULL, NULL, &tex_width, NULL)) if (query_texture(texture, NULL, NULL, &tex_width, NULL) != 0)
{ {
return; return;
} }
@@ -1333,15 +1271,6 @@ void Graphics::draw_grid_tile(
draw_grid_tile(texture, t, x, y, width, height, color, 1, 1); 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);
}
void Graphics::cutscenebars(void) void Graphics::cutscenebars(void)
{ {
const int usethispos = lerp(oldcutscenebarspos, cutscenebarspos); const int usethispos = lerp(oldcutscenebarspos, cutscenebarspos);
@@ -1545,18 +1474,6 @@ void Graphics::setimage(TextboxImage image)
textboxes[m].setimage(image); textboxes[m].setimage(image);
} }
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 ) void Graphics::addline( const std::string& t )
{ {
if (!INBOUNDS_VEC(m, textboxes)) if (!INBOUNDS_VEC(m, textboxes))
@@ -1924,7 +1841,53 @@ void Graphics::drawgravityline(const int t, const int x, const int y, const int
return; return;
} }
set_color(obj.entities[t].realcol); if (obj.entities[t].life == 0)
{
if (game.noflashingmode)
{
set_color(200 - 20, 200 - 20, 200 - 20);
draw_line(x, y, x + w, y + h);
return;
}
switch(linestate)
{
case 0:
set_color(200 - 20, 200 - 20, 200 - 20);
break;
case 1:
set_color(245 - 30, 245 - 30, 225 - 30);
break;
case 2:
set_color(225 - 30, 245 - 30, 245 - 30);
break;
case 3:
set_color(200 - 20, 200 - 20, 164 - 10);
break;
case 4:
set_color(196 - 20, 255 - 30, 224 - 20);
break;
case 5:
set_color(196 - 20, 235 - 30, 205 - 20);
break;
case 6:
set_color(164 - 10, 164 - 10, 164 - 10);
break;
case 7:
set_color(205 - 20, 245 - 30, 225 - 30);
break;
case 8:
set_color(225 - 30, 255 - 30, 205 - 20);
break;
case 9:
set_color(245 - 30, 245 - 30, 245 - 30);
break;
}
}
else
{
set_color(96, 96, 96);
}
draw_line(x, y, x + w, y + h); draw_line(x, y, x + w, y + h);
} }
@@ -2377,8 +2340,7 @@ void Graphics::drawbackground( int t )
fill_rect(0, 0, 0); fill_rect(0, 0, 0);
for (int i = 0; i < numstars; i++) for (int i = 0; i < numstars; i++)
{ {
SDL_FRect star_rect = {0}; SDL_Rect star_rect = stars[i];
SDL_RectToFRect(&stars[i], &star_rect);
star_rect.x = lerp(star_rect.x + starsspeed[i], star_rect.x); star_rect.x = lerp(star_rect.x + starsspeed[i], star_rect.x);
if (starsspeed[i] <= 6) if (starsspeed[i] <= 6)
{ {
@@ -2531,8 +2493,7 @@ void Graphics::drawbackground( int t )
break; break;
} }
SDL_FRect backboxrect = {0}; SDL_Rect backboxrect = backboxes[i];
SDL_RectToFRect(&backboxes[i], &backboxrect);
backboxrect.x = lerp(backboxes[i].x - backboxvx[i], backboxes[i].x); backboxrect.x = lerp(backboxes[i].x - backboxvx[i], backboxes[i].x);
backboxrect.y = lerp(backboxes[i].y - backboxvy[i], backboxes[i].y); backboxrect.y = lerp(backboxes[i].y - backboxvy[i], backboxes[i].y);
@@ -2550,12 +2511,7 @@ void Graphics::drawbackground( int t )
clear(); clear();
const int offset = (int) lerp(-3, 0); const int offset = (int) lerp(-3, 0);
const SDL_FRect srcRect = { const SDL_Rect srcRect = {8 + offset, 0, SCREEN_WIDTH_PIXELS, SCREEN_HEIGHT_PIXELS};
8.0f + offset,
0.0f,
static_cast<float>(SCREEN_WIDTH_PIXELS),
static_cast<float>(SCREEN_HEIGHT_PIXELS)
};
copy_texture(backgroundTexture, &srcRect, NULL); copy_texture(backgroundTexture, &srcRect, NULL);
break; break;
@@ -2565,12 +2521,7 @@ void Graphics::drawbackground( int t )
clear(); clear();
const int offset = (int) lerp(-3, 0); const int offset = (int) lerp(-3, 0);
const SDL_FRect srcRect = { const SDL_Rect srcRect = {0, 8 + offset, SCREEN_WIDTH_PIXELS, SCREEN_HEIGHT_PIXELS};
0.0f,
8.0f + offset,
static_cast<float>(SCREEN_WIDTH_PIXELS),
static_cast<float>(SCREEN_HEIGHT_PIXELS)
};
copy_texture(backgroundTexture, &srcRect, NULL); copy_texture(backgroundTexture, &srcRect, NULL);
break; break;
@@ -2620,12 +2571,7 @@ void Graphics::drawbackground( int t )
for (int i = 10; i >= 0; i--) for (int i = 10; i >= 0; i--)
{ {
const int temp = (i * 16) + backoffset; const int temp = (i * 16) + backoffset;
const SDL_FRect warprect = { const SDL_Rect warprect = {160 - temp, 120 - temp, temp * 2, temp * 2};
160.0f - temp,
120.0f - temp,
temp * 2.0f,
temp * 2.0f
};
if (i % 2 == warpskip) if (i % 2 == warpskip)
{ {
fill_rect(&warprect, warpbcol); fill_rect(&warprect, warpbcol);
@@ -2642,8 +2588,7 @@ void Graphics::drawbackground( int t )
fill_rect(0, 0, 0); fill_rect(0, 0, 0);
for (int i = 0; i < numstars; i++) for (int i = 0; i < numstars; i++)
{ {
SDL_FRect star_rect = {0}; SDL_Rect star_rect = stars[i];
SDL_RectToFRect(&stars[i], &star_rect);
star_rect.y = lerp(star_rect.y + starsspeed[i], star_rect.y); star_rect.y = lerp(star_rect.y + starsspeed[i], star_rect.y);
if (starsspeed[i] <= 8) if (starsspeed[i] <= 8)
{ {
@@ -2975,12 +2920,7 @@ void Graphics::drawtowerbackground(const TowerBG& bg_obj)
clear(); clear();
const int offset = (int) lerp(-bg_obj.bscroll, 0); const int offset = (int) lerp(-bg_obj.bscroll, 0);
const SDL_FRect srcRect = { const SDL_Rect srcRect = {0, 8 + offset, SCREEN_WIDTH_PIXELS, SCREEN_HEIGHT_PIXELS};
0.0f,
8.0f + offset,
static_cast<float>(SCREEN_WIDTH_PIXELS),
static_cast<float>(SCREEN_HEIGHT_PIXELS)
};
copy_texture(bg_obj.texture, &srcRect, NULL); copy_texture(bg_obj.texture, &srcRect, NULL);
} }
@@ -3116,49 +3056,8 @@ SDL_Color Graphics::getcol( int t )
case 23: // Enemy : Indicator Gray 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)); 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) // Trophies
return getRGB(96, 96, 96); // cyan
case 25: // Gravity line (Active)
if (game.noflashingmode)
{
return getRGB(200 - 20, 200 - 20, 200 - 20);
}
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);
// Trophies
// cyan
case 30: case 30:
return RGBf(160, 200, 220); return RGBf(160, 200, 220);
// Purple // Purple
@@ -3261,36 +3160,44 @@ SDL_Color Graphics::getcol( int t )
void Graphics::menuoffrender(void) void Graphics::menuoffrender(void)
{ {
if (copy_texture(gameplayTexture, NULL, NULL) == 0) if (copy_texture(gameplayTexture, NULL, NULL) != 0)
{ {
return; return;
} }
const int offset = (int) lerp(oldmenuoffset, menuoffset); const int offset = (int) lerp(oldmenuoffset, menuoffset);
const SDL_FRect offsetRect = { const SDL_Rect offsetRect = {0, offset, SCREEN_WIDTH_PIXELS, SCREEN_HEIGHT_PIXELS};
0.0f,
static_cast<float>(offset),
static_cast<float>(SCREEN_WIDTH_PIXELS),
static_cast<float>(SCREEN_HEIGHT_PIXELS)
};
if (copy_texture(menuTexture, NULL, &offsetRect) == 0) if (copy_texture(menuTexture, NULL, &offsetRect) != 0)
{ {
return; return;
} }
} }
void Graphics::textboxabsolutepos(int x, int y) SDL_Color Graphics::huetilegetcol()
{ {
if (!INBOUNDS_VEC(m, textboxes)) if (game.noflashingmode)
{ {
vlog_error("textboxabsolutepos() out-of-bounds!"); return getRGB(234, 234, 10);
return;
} }
textboxes[m].position_absolute = true; return getRGB(250 - (int) (fRandom() * 32), 250 - (int) (fRandom() * 32), 10);
textboxes[m].xp = x; }
textboxes[m].yp = y;
SDL_Color Graphics::bigchunkygetcol(int t)
{
// A seperate index of colours, for simplicity
float random = game.noflashingmode ? 0.5 : fRandom();
switch (t)
{
case 1:
return getRGB(random * 64, 10, 10);
case 2:
return getRGB(160 - help.glow / 2 - (int) (random * 20), 200 - help.glow / 2, 220 - help.glow);
}
const SDL_Color color = {0, 0, 0, 0};
return color;
} }
void Graphics::textboxcenterx(void) void Graphics::textboxcenterx(void)
@@ -3506,19 +3413,19 @@ int Graphics::crewcolour(const int t)
switch (t) switch (t)
{ {
case 0: case 0:
return EntityColour_CREW_CYAN; return CYAN;
case 1: case 1:
return EntityColour_CREW_PURPLE; return PURPLE;
case 2: case 2:
return EntityColour_CREW_YELLOW; return YELLOW;
case 3: case 3:
return EntityColour_CREW_RED; return RED;
case 4: case 4:
return EntityColour_CREW_GREEN; return GREEN;
case 5: case 5:
return EntityColour_CREW_BLUE; return BLUE;
default: default:
return EntityColour_CREW_CYAN; return 0;
} }
} }
@@ -3540,12 +3447,7 @@ void Graphics::screenshake(void)
set_blendmode(SDL_BLENDMODE_NONE); set_blendmode(SDL_BLENDMODE_NONE);
clear(); clear();
const SDL_FRect shake = { const SDL_Rect shake = {screenshake_x, screenshake_y, SCREEN_WIDTH_PIXELS, SCREEN_HEIGHT_PIXELS};
static_cast<float>(screenshake_x),
static_cast<float>(screenshake_y),
static_cast<float>(SCREEN_WIDTH_PIXELS),
static_cast<float>(SCREEN_HEIGHT_PIXELS)
};
copy_texture(gameTexture, NULL, &shake); copy_texture(gameTexture, NULL, &shake);
@@ -3565,7 +3467,7 @@ void Graphics::screenshake(void)
set_blendmode(SDL_BLENDMODE_NONE); set_blendmode(SDL_BLENDMODE_NONE);
draw_window_background(); draw_window_background();
SDL_FRect rect; SDL_Rect rect;
get_stretch_info(&rect); get_stretch_info(&rect);
copy_texture(tempShakeTexture, NULL, &rect, 0, NULL, flipmode ? SDL_FLIP_VERTICAL : SDL_FLIP_NONE); copy_texture(tempShakeTexture, NULL, &rect, 0, NULL, flipmode ? SDL_FLIP_VERTICAL : SDL_FLIP_NONE);
@@ -3582,7 +3484,7 @@ void Graphics::draw_window_background(void)
clear(); clear();
} }
void Graphics::get_stretch_info(SDL_FRect* rect) void Graphics::get_stretch_info(SDL_Rect* rect)
{ {
int width; int width;
int height; int height;
@@ -3624,15 +3526,12 @@ void Graphics::get_stretch_info(SDL_FRect* rect)
break; break;
default: default:
SDL_assert(0 && "Invalid scaling mode!"); SDL_assert(0 && "Invalid scaling mode!");
/* Width and height should be nonzero to avoid division by zero. */
rect->x = 0; rect->x = 0;
rect->y = 0; rect->y = 0;
rect->w = width; rect->w = width;
rect->h = height; 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);
} }
void Graphics::render(void) void Graphics::render(void)
@@ -3650,7 +3549,7 @@ void Graphics::render(void)
draw_window_background(); draw_window_background();
SDL_FRect stretch_info; SDL_Rect stretch_info;
get_stretch_info(&stretch_info); get_stretch_info(&stretch_info);
ime_set_rect(&stretch_info); ime_set_rect(&stretch_info);
@@ -3724,12 +3623,7 @@ void Graphics::draw_screenshot_border(void)
return; return;
} }
const SDL_FRect rect_inner = { const SDL_Rect rect_inner = {1, 1, width - 2, height - 2};
1.0f,
1.0f,
width - 2.0f,
height - 2.0f
};
if (game.screenshot_saved_success) if (game.screenshot_saved_success)
{ {
@@ -3791,7 +3685,7 @@ bool Graphics::checktexturesize(
) { ) {
int texturewidth; int texturewidth;
int textureheight; int textureheight;
if (!query_texture(texture, NULL, NULL, &texturewidth, &textureheight)) if (query_texture(texture, NULL, NULL, &texturewidth, &textureheight) != 0)
{ {
/* Just give it the benefit of the doubt. */ /* Just give it the benefit of the doubt. */
vlog_warn( vlog_warn(
+37 -90
View File
@@ -40,54 +40,6 @@ enum ImageNames
#define FADEMODE_IS_FADING(mode) ((mode) != FADE_NONE && (mode) != FADE_FULLY_BLACK) #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 class Graphics
{ {
public: public:
@@ -99,6 +51,9 @@ public:
GraphicsResources grphx; GraphicsResources grphx;
SDL_Color huetilegetcol();
SDL_Color bigchunkygetcol(int t);
void drawgravityline(int t, int x, int y, int w, int h); void drawgravityline(int t, int x, int y, int w, int h);
void drawcoloredtile(int x, int y, int t, int r, int g, int b); void drawcoloredtile(int x, int y, int t, int r, int g, int b);
@@ -139,8 +94,6 @@ public:
int r, int g, int b int r, int g, int b
); );
void textboxabsolutepos(int x, int y);
void textboxcenterx(void); void textboxcenterx(void);
int textboxwidth(void); int textboxwidth(void);
@@ -182,8 +135,6 @@ public:
void setimage(TextboxImage image); void setimage(TextboxImage image);
void textboxoutline(bool enabled);
void textboxindex(int index); void textboxindex(int index);
void textboxremove(void); void textboxremove(void);
@@ -221,8 +172,6 @@ public:
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, int scalex, int scaley);
void draw_grid_tile(SDL_Texture* texture, int t, int x, int y, int width, int height, SDL_Color color); void draw_grid_tile(SDL_Texture* texture, int t, int x, int y, int width, int height, SDL_Color color);
void draw_region_image(int t, int xp, int yp, int wp, int hp);
void updatetextboxes(void); void updatetextboxes(void);
const char* textbox_line(char* buffer, size_t buffer_len, size_t textbox_i, size_t line_i); const char* textbox_line(char* buffer, size_t buffer_len, size_t textbox_i, size_t line_i);
void drawgui(void); void drawgui(void);
@@ -248,52 +197,52 @@ public:
uint8_t b uint8_t b
); );
bool set_render_target(SDL_Texture* texture); int set_render_target(SDL_Texture* texture);
bool set_texture_color_mod(SDL_Texture* texture, Uint8 r, Uint8 g, Uint8 b); int set_texture_color_mod(SDL_Texture* texture, Uint8 r, Uint8 g, Uint8 b);
bool set_texture_alpha_mod(SDL_Texture* texture, Uint8 alpha); int set_texture_alpha_mod(SDL_Texture* texture, Uint8 alpha);
bool query_texture(SDL_Texture* texture, Uint32* format, int* access, int* w, int* h); int query_texture(SDL_Texture* texture, Uint32* format, int* access, int* w, int* h);
bool set_blendmode(SDL_BlendMode blendmode); int set_blendmode(SDL_BlendMode blendmode);
bool set_blendmode(SDL_Texture* texture, SDL_BlendMode blendmode); int set_blendmode(SDL_Texture* texture, SDL_BlendMode blendmode);
bool clear(int r, int g, int b, int a); int clear(int r, int g, int b, int a);
bool clear(void); int clear(void);
bool substitute(SDL_Texture** texture); bool substitute(SDL_Texture** texture);
void post_substitute(SDL_Texture* subst); void post_substitute(SDL_Texture* subst);
bool copy_texture(SDL_Texture* texture, const SDL_FRect* src, const SDL_FRect* dest); int copy_texture(SDL_Texture* texture, const SDL_Rect* src, const SDL_Rect* dest);
bool copy_texture(SDL_Texture* texture, const SDL_FRect* src, const SDL_FRect* dest, double angle, const SDL_FPoint* center, SDL_FlipMode flip); int copy_texture(SDL_Texture* texture, const SDL_Rect* src, const SDL_Rect* dest, double angle, const SDL_Point* center, SDL_RendererFlip flip);
bool set_color(Uint8 r, Uint8 g, Uint8 b, Uint8 a); int set_color(Uint8 r, Uint8 g, Uint8 b, Uint8 a);
bool set_color(Uint8 r, Uint8 g, Uint8 b); int set_color(Uint8 r, Uint8 g, Uint8 b);
bool set_color(SDL_Color color); int set_color(SDL_Color color);
bool fill_rect(const SDL_FRect* rect); int fill_rect(const SDL_Rect* rect);
bool fill_rect(const SDL_FRect* rect, int r, int g, int b, int a); int fill_rect(const SDL_Rect* rect, int r, int g, int b, int a);
bool 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 a);
bool fill_rect(int x, int y, int w, int h, int r, int g, int b); int fill_rect(int x, int y, int w, int h, int r, int g, int b);
bool fill_rect(const SDL_FRect* rect, int r, int g, int b); int fill_rect(const SDL_Rect* rect, int r, int g, int b);
bool fill_rect(int r, int g, int b); int fill_rect(int r, int g, int b);
bool fill_rect(const SDL_FRect* rect, SDL_Color color); int fill_rect(const SDL_Rect* rect, SDL_Color color);
bool fill_rect(int x, int y, int w, int h, SDL_Color color); int fill_rect(int x, int y, int w, int h, SDL_Color color);
bool fill_rect(SDL_Color color); int fill_rect(SDL_Color color);
bool draw_rect(const SDL_FRect* rect); int draw_rect(const SDL_Rect* rect);
bool draw_rect(const SDL_FRect* rect, int r, int g, int b, int a); int draw_rect(const SDL_Rect* rect, int r, int g, int b, int a);
bool 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 a);
bool draw_rect(int x, int y, int w, int h, int r, int g, int b); int draw_rect(int x, int y, int w, int h, int r, int g, int b);
bool draw_rect(const SDL_FRect* rect, int r, int g, int b); int draw_rect(const SDL_Rect* rect, int r, int g, int b);
bool draw_rect(const SDL_FRect* rect, SDL_Color color); int draw_rect(const SDL_Rect* rect, SDL_Color color);
bool draw_rect(int x, int y, int w, int h, SDL_Color color); int draw_rect(int x, int y, int w, int h, SDL_Color color);
bool draw_line(int x, int y, int x2, int y2); int draw_line(int x, int y, int x2, int y2);
bool draw_points(const SDL_FPoint* points, int count); int draw_points(const SDL_Point* points, int count);
bool draw_points(const SDL_FPoint* points, int count, int r, int g, int b); int draw_points(const SDL_Point* points, int count, int r, int g, int b);
void map_tab(int opt, const char* text, bool selected = false); void map_tab(int opt, const char* text, bool selected = false);
@@ -311,7 +260,7 @@ public:
void draw_window_background(void); void draw_window_background(void);
void get_stretch_info(SDL_FRect* rect); void get_stretch_info(SDL_Rect* rect);
void render(void); void render(void);
void renderwithscreeneffects(void); void renderwithscreeneffects(void);
@@ -388,8 +337,6 @@ public:
SDL_Texture* images[NUM_IMAGES]; SDL_Texture* images[NUM_IMAGES];
SDL_Texture* customminimaps[401];
bool flipmode; bool flipmode;
bool setflipmode; bool setflipmode;
bool notextoutline; bool notextoutline;
@@ -412,7 +359,7 @@ public:
SDL_Rect sprites_rect; SDL_Rect sprites_rect;
SDL_Rect tele_rect; SDL_Rect tele_rect;
SDL_FRect footerrect; SDL_Rect footerrect;
int linestate, linedelay; int linestate, linedelay;
int backoffset; int backoffset;
+18 -45
View File
@@ -59,13 +59,17 @@ static SDL_Surface* LoadImageRaw(const char* filename, unsigned char** data)
return NULL; return NULL;
} }
loadedImage = SDL_CreateSurfaceFrom(width, height, loadedImage = SDL_CreateRGBSurfaceWithFormatFrom(
*data,
width,
height,
32,
width * 4,
#if SDL_BYTEORDER == SDL_BIG_ENDIAN #if SDL_BYTEORDER == SDL_BIG_ENDIAN
SDL_PIXELFORMAT_RGBA8888 SDL_PIXELFORMAT_RGBA8888
#else #else
SDL_PIXELFORMAT_ABGR8888 SDL_PIXELFORMAT_ABGR8888
#endif #endif
, *data, width * 4
); );
return loadedImage; return loadedImage;
@@ -73,9 +77,10 @@ static SDL_Surface* LoadImageRaw(const char* filename, unsigned char** data)
static SDL_Surface* LoadSurfaceFromRaw(SDL_Surface* loadedImage) static SDL_Surface* LoadSurfaceFromRaw(SDL_Surface* loadedImage)
{ {
SDL_Surface* optimizedImage = SDL_ConvertSurface( SDL_Surface* optimizedImage = SDL_ConvertSurfaceFormat(
loadedImage, loadedImage,
SDL_PIXELFORMAT_ARGB8888 SDL_PIXELFORMAT_ARGB8888,
0
); );
SDL_SetSurfaceBlendMode(optimizedImage, SDL_BLENDMODE_BLEND); SDL_SetSurfaceBlendMode(optimizedImage, SDL_BLENDMODE_BLEND);
return optimizedImage; return optimizedImage;
@@ -90,7 +95,7 @@ SDL_Surface* LoadImageSurface(const char* filename)
SDL_Surface* optimizedImage = LoadSurfaceFromRaw(loadedImage); SDL_Surface* optimizedImage = LoadSurfaceFromRaw(loadedImage);
if (loadedImage != NULL) if (loadedImage != NULL)
{ {
VVV_freefunc(SDL_DestroySurface, loadedImage); VVV_freefunc(SDL_FreeSurface, loadedImage);
} }
VVV_free(data); VVV_free(data);
@@ -180,7 +185,7 @@ SDL_Texture* LoadImage(const char *filename, const TextureLoadType loadtype)
if (loadedImage != NULL) if (loadedImage != NULL)
{ {
VVV_freefunc(SDL_DestroySurface, loadedImage); VVV_freefunc(SDL_FreeSurface, loadedImage);
} }
VVV_free(data); VVV_free(data);
@@ -237,7 +242,7 @@ static void LoadVariants(const char* filename, SDL_Texture** colored, SDL_Textur
if (loadedImage != NULL) if (loadedImage != NULL)
{ {
VVV_freefunc(SDL_DestroySurface, loadedImage); VVV_freefunc(SDL_FreeSurface, loadedImage);
} }
VVV_free(data); VVV_free(data);
@@ -265,7 +270,7 @@ static void LoadSprites(const char* filename, SDL_Texture** texture, SDL_Surface
if (loadedImage != NULL) if (loadedImage != NULL)
{ {
VVV_freefunc(SDL_DestroySurface, loadedImage); VVV_freefunc(SDL_FreeSurface, loadedImage);
} }
VVV_free(data); VVV_free(data);
@@ -303,7 +308,7 @@ static void LoadSpritesTranslation(
SDL_Surface* loaded_image = LoadImageRaw(filename, &data); SDL_Surface* loaded_image = LoadImageRaw(filename, &data);
translated = LoadSurfaceFromRaw(loaded_image); translated = LoadSurfaceFromRaw(loaded_image);
VVV_freefunc(SDL_DestroySurface, loaded_image); VVV_freefunc(SDL_FreeSurface, loaded_image);
VVV_free(data); VVV_free(data);
} }
SDL_SetSurfaceBlendMode(translated, SDL_BLENDMODE_NONE); SDL_SetSurfaceBlendMode(translated, SDL_BLENDMODE_NONE);
@@ -339,8 +344,8 @@ static void LoadSpritesTranslation(
*texture = LoadTextureFromRaw(filename, working, TEX_WHITE); *texture = LoadTextureFromRaw(filename, working, TEX_WHITE);
VVV_freefunc(SDL_DestroySurface, translated); VVV_freefunc(SDL_FreeSurface, translated);
VVV_freefunc(SDL_DestroySurface, working); VVV_freefunc(SDL_FreeSurface, working);
} }
void GraphicsResources::init_translations(void) void GraphicsResources::init_translations(void)
@@ -437,33 +442,6 @@ void GraphicsResources::init(void)
SDL_assert(0 && "Failed to create minimap texture! See stderr."); SDL_assert(0 && "Failed to create minimap texture! See stderr.");
return; 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);
} }
@@ -498,15 +476,10 @@ void GraphicsResources::destroy(void)
CLEAR(im_sprites_translated); CLEAR(im_sprites_translated);
CLEAR(im_flipsprites_translated); CLEAR(im_flipsprites_translated);
for (size_t i = 0; i < SDL_arraysize(graphics.customminimaps); i++)
{
CLEAR(graphics.customminimaps[i]);
}
#undef CLEAR #undef CLEAR
VVV_freefunc(SDL_DestroySurface, im_sprites_surf); VVV_freefunc(SDL_FreeSurface, im_sprites_surf);
VVV_freefunc(SDL_DestroySurface, im_flipsprites_surf); VVV_freefunc(SDL_FreeSurface, im_flipsprites_surf);
} }
bool SaveImage(const SDL_Surface* surface, const char* filename) bool SaveImage(const SDL_Surface* surface, const char* filename)
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef GRAPHICSRESOURCES_H #ifndef GRAPHICSRESOURCES_H
#define GRAPHICSRESOURCES_H #define GRAPHICSRESOURCES_H
#include <SDL3/SDL.h> #include <SDL.h>
enum TextureLoadType enum TextureLoadType
{ {
+43 -56
View File
@@ -1,4 +1,4 @@
#include <SDL3/SDL.h> #include <SDL.h>
#include <stddef.h> #include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
@@ -10,15 +10,10 @@
#include "UtilityClass.h" #include "UtilityClass.h"
#include "Vlogging.h" #include "Vlogging.h"
void setRect( SDL_Rect& _r, int x, int y, int w, int h )
{
_r.x = x;
_r.y = y;
_r.w = w;
_r.h = h;
}
void setRect( SDL_FRect& _r, int x, int y, int w, int h )
void setRect( SDL_Rect& _r, int x, int y, int w, int h )
{ {
_r.x = x; _r.x = x;
_r.y = y; _r.y = y;
@@ -39,10 +34,15 @@ static SDL_Surface* RecreateSurfaceWithDimensions(
return NULL; return NULL;
} }
retval = SDL_CreateSurface( retval = SDL_CreateRGBSurface(
surface->flags,
width, width,
height, height,
surface->format surface->format->BitsPerPixel,
surface->format->Rmask,
surface->format->Gmask,
surface->format->Bmask,
surface->format->Amask
); );
if (retval == NULL) if (retval == NULL)
@@ -95,9 +95,8 @@ void DrawPixel(SDL_Surface* surface, const int x, const int y, const SDL_Color c
return; return;
} }
const SDL_PixelFormat fmt = surface->format; const SDL_PixelFormat* fmt = surface->format;
const SDL_PixelFormatDetails *fmt_details = SDL_GetPixelFormatDetails(fmt); const int bpp = fmt->BytesPerPixel;
const int bpp = fmt_details->bytes_per_pixel;
Uint8* pixel = (Uint8*) surface->pixels + y * surface->pitch + x * bpp; Uint8* pixel = (Uint8*) surface->pixels + y * surface->pitch + x * bpp;
Uint32* pixel32 = (Uint32*) pixel; Uint32* pixel32 = (Uint32*) pixel;
@@ -110,7 +109,7 @@ void DrawPixel(SDL_Surface* surface, const int x, const int y, const SDL_Color c
case 3: case 3:
{ {
const Uint32 single = SDL_MapSurfaceRGB(surface, color.r, color.g, color.b); const Uint32 single = SDL_MapRGB(fmt, color.r, color.g, color.b);
pixel[0] = (single & 0xFF0000) >> 16; pixel[0] = (single & 0xFF0000) >> 16;
pixel[1] = (single & 0x00FF00) >> 8; pixel[1] = (single & 0x00FF00) >> 8;
pixel[2] = (single & 0x0000FF) >> 0; pixel[2] = (single & 0x0000FF) >> 0;
@@ -118,7 +117,7 @@ void DrawPixel(SDL_Surface* surface, const int x, const int y, const SDL_Color c
} }
case 4: case 4:
*pixel32 = SDL_MapSurfaceRGBA(surface, color.r, color.g, color.b, color.a); *pixel32 = SDL_MapRGBA(fmt, color.r, color.g, color.b, color.a);
} }
} }
@@ -139,9 +138,8 @@ SDL_Color ReadPixel(const SDL_Surface* surface, const int x, const int y)
return color; return color;
} }
const SDL_PixelFormat fmt = surface->format; const SDL_PixelFormat* fmt = surface->format;
const SDL_PixelFormatDetails *fmt_details = SDL_GetPixelFormatDetails(fmt); const int bpp = surface->format->BytesPerPixel;
const int bpp = fmt_details->bytes_per_pixel;
const Uint8* pixel = (Uint8*) surface->pixels + y * surface->pitch + x * bpp; const Uint8* pixel = (Uint8*) surface->pixels + y * surface->pitch + x * bpp;
const Uint32* pixel32 = (Uint32*) pixel; const Uint32* pixel32 = (Uint32*) pixel;
@@ -155,13 +153,13 @@ SDL_Color ReadPixel(const SDL_Surface* surface, const int x, const int y)
case 3: case 3:
{ {
const Uint32 single = (pixel[0] << 16) | (pixel[1] << 8) | (pixel[2] << 0); const Uint32 single = (pixel[0] << 16) | (pixel[1] << 8) | (pixel[2] << 0);
SDL_GetRGB(single, fmt_details, SDL_GetSurfacePalette((SDL_Surface *) surface), &color.r, &color.g, &color.b); SDL_GetRGB(single, fmt, &color.r, &color.g, &color.b);
color.a = 255; color.a = 255;
break; break;
} }
case 4: case 4:
SDL_GetRGBA(*pixel32, fmt_details, SDL_GetSurfacePalette((SDL_Surface *) surface), &color.r, &color.g, &color.b, &color.a); SDL_GetRGBA(*pixel32, fmt, &color.r, &color.g, &color.b, &color.a);
} }
return color; return color;
@@ -191,15 +189,8 @@ void UpdateFilter(void)
} }
} }
static bool disabled_filter = false;
void ApplyFilter(SDL_Surface** src, SDL_Surface** dest) void ApplyFilter(SDL_Surface** src, SDL_Surface** dest)
{ {
if (disabled_filter)
{
return;
}
if (src == NULL || dest == NULL) if (src == NULL || dest == NULL)
{ {
SDL_assert(0 && "NULL src or dest!"); SDL_assert(0 && "NULL src or dest!");
@@ -208,11 +199,11 @@ void ApplyFilter(SDL_Surface** src, SDL_Surface** dest)
if (*src == NULL) if (*src == NULL)
{ {
*src = SDL_CreateSurface(SCREEN_WIDTH_PIXELS, SCREEN_HEIGHT_PIXELS, SDL_GetPixelFormatForMasks(32, 0, 0, 0, 0)); *src = SDL_CreateRGBSurface(0, SCREEN_WIDTH_PIXELS, SCREEN_HEIGHT_PIXELS, 32, 0, 0, 0, 0);
} }
if (*dest == NULL) if (*dest == NULL)
{ {
*dest = SDL_CreateSurface(SCREEN_WIDTH_PIXELS, SCREEN_HEIGHT_PIXELS, SDL_GetPixelFormatForMasks(32, 0, 0, 0, 0)); *dest = SDL_CreateRGBSurface(0, SCREEN_WIDTH_PIXELS, SCREEN_HEIGHT_PIXELS, 32, 0, 0, 0, 0);
} }
if (*src == NULL || *dest == NULL) if (*src == NULL || *dest == NULL)
{ {
@@ -220,19 +211,14 @@ void ApplyFilter(SDL_Surface** src, SDL_Surface** dest)
return; return;
} }
SDL_Surface *read_pixels = SDL_RenderReadPixels(gameScreen.m_renderer, NULL); const int result = SDL_RenderReadPixels(gameScreen.m_renderer, NULL, 0, (*src)->pixels, (*src)->pitch);
if (read_pixels == NULL) if (result != 0)
{ {
disabled_filter = true; SDL_FreeSurface(*src);
VVV_freefunc(SDL_DestroySurface, *src);
VVV_freefunc(SDL_DestroySurface, *dest);
WHINE_ONCE_ARGS(("Could not read pixels from renderer: %s", SDL_GetError())); WHINE_ONCE_ARGS(("Could not read pixels from renderer: %s", SDL_GetError()));
return; return;
} }
SDL_BlitSurface(read_pixels, NULL, *src, NULL);
SDL_DestroySurface(read_pixels);
const int red_offset = rand() % 4; const int red_offset = rand() % 4;
for (int x = 0; x < (*src)->w; x++) for (int x = 0; x < (*src)->w; x++)
@@ -299,14 +285,17 @@ bool TakeScreenshot(SDL_Surface** surface)
int width = 0; int width = 0;
int height = 0; int height = 0;
if (!graphics.query_texture(graphics.gameTexture, NULL, NULL, &width, int result = graphics.query_texture(
&height)) { graphics.gameTexture, NULL, NULL, &width, &height
return false; );
if (result != 0)
{
return false;
} }
if (*surface == NULL) if (*surface == NULL)
{ {
*surface = SDL_CreateSurface(width, height, SDL_PIXELFORMAT_RGB24); *surface = SDL_CreateRGBSurface(0, width, height, 24, 0, 0, 0, 0);
if (*surface == NULL) if (*surface == NULL)
{ {
WHINE_ONCE_ARGS( WHINE_ONCE_ARGS(
@@ -322,13 +311,17 @@ bool TakeScreenshot(SDL_Surface** surface)
return false; return false;
} }
if (!graphics.set_render_target(graphics.gameTexture)) result = graphics.set_render_target(graphics.gameTexture);
if (result != 0)
{ {
return false; return false;
} }
SDL_Surface *read_pixels = SDL_RenderReadPixels(gameScreen.m_renderer, NULL); result = SDL_RenderReadPixels(
if (read_pixels == NULL) gameScreen.m_renderer, NULL, SDL_PIXELFORMAT_RGB24,
(*surface)->pixels, (*surface)->pitch
);
if (result != 0)
{ {
WHINE_ONCE_ARGS( WHINE_ONCE_ARGS(
("Could not read pixels from renderer: %s", SDL_GetError()) ("Could not read pixels from renderer: %s", SDL_GetError())
@@ -336,9 +329,6 @@ bool TakeScreenshot(SDL_Surface** surface)
return false; return false;
} }
SDL_BlitSurface(read_pixels, NULL, *surface, NULL);
SDL_DestroySurface(read_pixels);
/* Need to manually vertically reverse pixels in Flip Mode. */ /* Need to manually vertically reverse pixels in Flip Mode. */
if (graphics.flipmode) if (graphics.flipmode)
{ {
@@ -372,7 +362,9 @@ bool UpscaleScreenshot2x(SDL_Surface* src, SDL_Surface** dest)
if (*dest == NULL) if (*dest == NULL)
{ {
*dest = SDL_CreateSurface(src->w * 2, src->h * 2, src->format); *dest = SDL_CreateRGBSurface(
0, src->w * 2, src->h * 2, src->format->BitsPerPixel, 0, 0, 0, 0
);
if (*dest == NULL) if (*dest == NULL)
{ {
WHINE_ONCE_ARGS( WHINE_ONCE_ARGS(
@@ -382,13 +374,8 @@ bool UpscaleScreenshot2x(SDL_Surface* src, SDL_Surface** dest)
} }
} }
/* PIXELART scaling would be cool here, but that's usually done in a shader while int result = SDL_BlitScaled(src, NULL, *dest, NULL);
* this is just a sw blit. SDL_surface.c currently just aliases this to NEAREST, if (result != 0)
* so let's use that to improve 3.2 compatibility for now.
* -flibit
*/
int result = SDL_BlitSurfaceScaled(src, NULL, *dest, NULL, SDL_SCALEMODE_NEAREST);
if (result == 0)
{ {
WHINE_ONCE_ARGS(("Could not blit surface: %s", SDL_GetError())); WHINE_ONCE_ARGS(("Could not blit surface: %s", SDL_GetError()));
return false; return false;
+1 -2
View File
@@ -1,10 +1,9 @@
#ifndef GRAPHICSUTIL_H #ifndef GRAPHICSUTIL_H
#define GRAPHICSUTIL_H #define GRAPHICSUTIL_H
#include <SDL3/SDL.h> #include <SDL.h>
void setRect(SDL_Rect& _r, int x, int y, int w, int h); void setRect(SDL_Rect& _r, int x, int y, int w, int h);
void setRect(SDL_FRect& _r, int x, int y, int w, int h);
SDL_Surface* GetSubSurface( SDL_Surface* metaSurface, int x, int y, int width, int height ); SDL_Surface* GetSubSurface( SDL_Surface* metaSurface, int x, int y, int width, int height );
+8 -15
View File
@@ -1,21 +1,19 @@
#include <SDL3/SDL.h> #include <SDL.h>
#include "Constants.h" #include "Constants.h"
#include "Font.h" #include "Font.h"
#include "Graphics.h" #include "Graphics.h"
#include "KeyPoll.h" #include "KeyPoll.h"
#include "UTF8.h" #include "UTF8.h"
#include "Screen.h"
#include "GraphicsUtil.h"
static bool render_done = false; static bool render_done = false;
static SDL_FRect imebox; static SDL_Rect imebox;
void ime_render(void) void ime_render(void)
{ {
render_done = false; render_done = false;
if (!SDL_TextInputActive(gameScreen.m_window) || key.imebuffer == "") if (!SDL_IsTextInputActive() || key.imebuffer == "")
{ {
return; return;
} }
@@ -26,7 +24,7 @@ void ime_render(void)
imebox.w = font::len(PR_FONT_LEVEL, key.imebuffer.c_str()) + 1; imebox.w = font::len(PR_FONT_LEVEL, key.imebuffer.c_str()) + 1;
imebox.h = fontheight + 1; imebox.h = fontheight + 1;
SDL_FRect imebox_border = imebox; SDL_Rect imebox_border = imebox;
imebox_border.x -= 1; imebox_border.x -= 1;
imebox_border.y -= 1; imebox_border.y -= 1;
imebox_border.w += 2; imebox_border.w += 2;
@@ -76,7 +74,7 @@ void ime_render(void)
in_sel_pixels += 1; in_sel_pixels += 1;
} }
SDL_FRect selrect = imebox; SDL_Rect selrect = imebox;
selrect.x += before_sel_pixels + 1; selrect.x += before_sel_pixels + 1;
selrect.w = in_sel_pixels; selrect.w = in_sel_pixels;
graphics.fill_rect(&selrect, 128, 64, 0); graphics.fill_rect(&selrect, 128, 64, 0);
@@ -90,19 +88,14 @@ void ime_render(void)
render_done = true; render_done = true;
} }
void ime_set_rect(SDL_FRect* stretch_info) void ime_set_rect(SDL_Rect* stretch_info)
{ {
if (!render_done) if (!render_done)
{ {
return; return;
} }
SDL_Rect imebox_scaled = { SDL_Rect imebox_scaled = imebox;
static_cast<int>(imebox.x),
static_cast<int>(imebox.y),
static_cast<int>(imebox.w),
static_cast<int>(imebox.h)
};
float x_scale = (float) stretch_info->w / SCREEN_WIDTH_PIXELS; float x_scale = (float) stretch_info->w / SCREEN_WIDTH_PIXELS;
float y_scale = (float) stretch_info->h / SCREEN_HEIGHT_PIXELS; float y_scale = (float) stretch_info->h / SCREEN_HEIGHT_PIXELS;
imebox_scaled.x *= x_scale; imebox_scaled.x *= x_scale;
@@ -112,5 +105,5 @@ void ime_set_rect(SDL_FRect* stretch_info)
imebox_scaled.x += stretch_info->x; imebox_scaled.x += stretch_info->x;
imebox_scaled.y += stretch_info->y; imebox_scaled.y += stretch_info->y;
SDL_SetTextInputArea(gameScreen.m_window, &imebox_scaled, 0); SDL_SetTextInputRect(&imebox_scaled);
} }
+1 -1
View File
@@ -2,6 +2,6 @@
#define IMERENDER_H #define IMERENDER_H
void ime_render(void); void ime_render(void);
void ime_set_rect(SDL_FRect* stretch_info); void ime_set_rect(SDL_Rect* stretch_info);
#endif /* IMERENDER_H */ #endif /* IMERENDER_H */
+14 -23
View File
@@ -25,14 +25,13 @@
#include "Script.h" #include "Script.h"
#include "UtilityClass.h" #include "UtilityClass.h"
#include "Vlogging.h" #include "Vlogging.h"
#include "Alloc.h"
static void updatebuttonmappings(int bind) static void updatebuttonmappings(int bind)
{ {
for ( for (
SDL_GamepadButton i = SDL_GAMEPAD_BUTTON_SOUTH; SDL_GameControllerButton i = SDL_CONTROLLER_BUTTON_A;
i < SDL_GAMEPAD_BUTTON_DPAD_UP; i < SDL_CONTROLLER_BUTTON_DPAD_UP;
i = (SDL_GamepadButton) (i + 1) i = (SDL_GameControllerButton) (i + 1)
) { ) {
if (key.isDown(i)) if (key.isDown(i))
{ {
@@ -42,7 +41,7 @@ static void updatebuttonmappings(int bind)
game.gpmenu_lastbutton = i; game.gpmenu_lastbutton = i;
// Is this button already in the list for this action? // Is this button already in the list for this action?
std::vector<SDL_GamepadButton>* vec = NULL; std::vector<SDL_GameControllerButton>* vec = NULL;
switch (bind) switch (bind)
{ {
case 1: vec = &game.controllerButton_flip; break; case 1: vec = &game.controllerButton_flip; break;
@@ -899,12 +898,6 @@ static void menuactionpress(void)
game.savestatsandsettings_menu(); game.savestatsandsettings_menu();
music.playef(Sound_VIRIDIAN); music.playef(Sound_VIRIDIAN);
break; break;
case 3:
// toggle checkpoint saving
game.checkpoint_saving = !game.checkpoint_saving;
game.savestatsandsettings_menu();
music.playef(Sound_VIRIDIAN);
break;
default: default:
//back //back
music.playef(Sound_VIRIDIAN); music.playef(Sound_VIRIDIAN);
@@ -1408,9 +1401,7 @@ static void menuactionpress(void)
else if (game.currentmenuoption == (int)game.menuoptions.size()-2) else if (game.currentmenuoption == (int)game.menuoptions.size()-2)
{ {
// play the cutscene, from clipboard // play the cutscene, from clipboard
char *cutscene = SDL_GetClipboardText(); game.cutscenetest_menu_play_id = std::string(SDL_GetClipboardText());
game.cutscenetest_menu_play_id = std::string(cutscene);
VVV_free(cutscene);
startmode(Start_CUTSCENETEST); startmode(Start_CUTSCENETEST);
} }
else if (game.currentmenuoption == (int)game.menuoptions.size()-1) else if (game.currentmenuoption == (int)game.menuoptions.size()-1)
@@ -2781,14 +2772,14 @@ void gameinput(void)
int player = obj.getplayer(); int player = obj.getplayer();
if (INBOUNDS_VEC(player, obj.entities)) if (INBOUNDS_VEC(player, obj.entities))
{ {
obj.entities[player].colour = EntityColour_TELEPORTER_FLASHING; obj.entities[player].colour = 102;
} }
int teleporter = obj.getteleporter(); int teleporter = obj.getteleporter();
if (INBOUNDS_VEC(teleporter, obj.entities)) if (INBOUNDS_VEC(teleporter, obj.entities))
{ {
obj.entities[teleporter].tile = 6; 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! //which teleporter script do we use? it depends on the companion!
game.setstate(4000); game.setstate(4000);
@@ -2812,16 +2803,16 @@ void gameinput(void)
int player = obj.getplayer(); int player = obj.getplayer();
if (INBOUNDS_VEC(player, obj.entities)) if (INBOUNDS_VEC(player, obj.entities))
{ {
obj.entities[player].colour = EntityColour_TELEPORTER_FLASHING; obj.entities[player].colour = 102;
} }
int companion = obj.getcompanion(); 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(); int teleporter = obj.getteleporter();
if (INBOUNDS_VEC(teleporter, obj.entities)) if (INBOUNDS_VEC(teleporter, obj.entities))
{ {
obj.entities[teleporter].tile = 6; 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! //which teleporter script do we use? it depends on the companion!
game.setstate(3000); game.setstate(3000);
@@ -3048,7 +3039,7 @@ void gameinput(void)
game.menupage = 30; // Pause screen game.menupage = 30; // Pause screen
} }
if (game.deathseq == -1 && (key.isDown(SDLK_R) || key.isDown(game.controllerButton_restart)) && !game.nodeathmode)// && map.custommode) //Have fun glitchrunners! if (game.deathseq == -1 && (key.isDown(SDLK_r) || key.isDown(game.controllerButton_restart)) && !game.nodeathmode)// && map.custommode) //Have fun glitchrunners!
{ {
game.deathseq = 30; game.deathseq = 30;
} }
@@ -3285,7 +3276,7 @@ static void mapmenuactionpress(const bool version2_2)
int i = obj.getplayer(); int i = obj.getplayer();
if (INBOUNDS_VEC(i, obj.entities)) 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! //which teleporter script do we use? it depends on the companion!
@@ -3507,14 +3498,14 @@ void teleporterinput(void)
int i = obj.getplayer(); int i = obj.getplayer();
if (INBOUNDS_VEC(i, obj.entities)) if (INBOUNDS_VEC(i, obj.entities))
{ {
obj.entities[i].colour = EntityColour_TELEPORTER_FLASHING; obj.entities[i].colour = 102;
} }
i = obj.getteleporter(); i = obj.getteleporter();
if (INBOUNDS_VEC(i, obj.entities)) if (INBOUNDS_VEC(i, obj.entities))
{ {
obj.entities[i].tile = 6; 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! //which teleporter script do we use? it depends on the companion!
game.setstate(4000); game.setstate(4000);
+149 -130
View File
@@ -71,12 +71,12 @@ void KeyPoll::enabletextentry(void)
imebuffer = ""; imebuffer = "";
imebuffer_start = 0; imebuffer_start = 0;
imebuffer_length = 0; imebuffer_length = 0;
SDL_StartTextInput(gameScreen.m_window); SDL_StartTextInput();
} }
void KeyPoll::disabletextentry(void) void KeyPoll::disabletextentry(void)
{ {
SDL_StopTextInput(gameScreen.m_window); SDL_StopTextInput();
imebuffer = ""; imebuffer = "";
imebuffer_start = 0; imebuffer_start = 0;
imebuffer_length = 0; imebuffer_length = 0;
@@ -84,7 +84,7 @@ void KeyPoll::disabletextentry(void)
bool KeyPoll::textentry(void) bool KeyPoll::textentry(void)
{ {
return SDL_TextInputActive(gameScreen.m_window) == true; return SDL_IsTextInputActive() == SDL_TRUE;
} }
void KeyPoll::toggleFullscreen(void) void KeyPoll::toggleFullscreen(void)
@@ -106,7 +106,8 @@ static int changemousestate(
const bool show, const bool show,
const bool hide const bool hide
) { ) {
bool visible; int prev;
int new_;
if (timeout > 0) if (timeout > 0)
{ {
@@ -116,28 +117,34 @@ static int changemousestate(
/* If we want to both show and hide at the same time, prioritize showing */ /* If we want to both show and hide at the same time, prioritize showing */
if (show) if (show)
{ {
visible = true; new_ = SDL_ENABLE;
} }
else if (hide) else if (hide)
{ {
visible = false; new_ = SDL_DISABLE;
} }
else else
{ {
return timeout; return timeout;
} }
if (SDL_CursorVisible() == visible) prev = SDL_ShowCursor(SDL_QUERY);
if (prev == new_)
{ {
return timeout; return timeout;
} }
if (visible) { SDL_ShowCursor(new_);
SDL_ShowCursor();
switch (new_)
{
case SDL_DISABLE:
timeout = 0; timeout = 0;
} else { break;
SDL_HideCursor(); case SDL_ENABLE:
timeout = 30; timeout = 30;
break;
} }
return timeout; return timeout;
@@ -221,7 +228,7 @@ void KeyPoll::Poll(void)
bool hidemouse = false; bool hidemouse = false;
bool altpressed = false; bool altpressed = false;
bool fullscreenkeybind = false; bool fullscreenkeybind = false;
SDL_Gamepad *controller = NULL; SDL_GameController *controller = NULL;
SDL_Event evt; SDL_Event evt;
bool should_recompute_textboxes = false; bool should_recompute_textboxes = false;
bool active_input_device_changed = false; bool active_input_device_changed = false;
@@ -231,29 +238,29 @@ void KeyPoll::Poll(void)
switch (evt.type) switch (evt.type)
{ {
/* Keyboard Input */ /* Keyboard Input */
case SDL_EVENT_KEY_DOWN: case SDL_KEYDOWN:
{ {
keymap[evt.key.key] = true; keymap[evt.key.keysym.sym] = true;
if (evt.key.key == SDLK_BACKSPACE) if (evt.key.keysym.sym == SDLK_BACKSPACE)
{ {
pressedbackspace = true; pressedbackspace = true;
} }
#ifdef SDL_PLATFORM_APPLE /* OSX prefers the command keys over the alt keys. -flibit */ #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 #else
altpressed = keymap[SDLK_LALT] || keymap[SDLK_RALT]; altpressed = keymap[SDLK_LALT] || keymap[SDLK_RALT];
#endif #endif
bool returnpressed = evt.key.key == SDLK_RETURN; bool returnpressed = evt.key.keysym.sym == SDLK_RETURN;
bool fpressed = evt.key.key == SDLK_F; bool fpressed = evt.key.keysym.sym == SDLK_f;
bool f11pressed = evt.key.key == SDLK_F11; bool f11pressed = evt.key.keysym.sym == SDLK_F11;
if ((altpressed && (returnpressed || fpressed)) || f11pressed) if ((altpressed && (returnpressed || fpressed)) || f11pressed)
{ {
fullscreenkeybind = true; fullscreenkeybind = true;
} }
if (loc::show_translator_menu && evt.key.key == SDLK_F8 && !evt.key.repeat) if (loc::show_translator_menu && evt.key.keysym.sym == SDLK_F8 && !evt.key.repeat)
{ {
if (keymap[SDLK_LCTRL]) if (keymap[SDLK_LCTRL])
{ {
@@ -269,7 +276,7 @@ void KeyPoll::Poll(void)
} }
} }
if (evt.key.key == SDLK_F6 && !evt.key.repeat) if (evt.key.keysym.sym == SDLK_F6 && !evt.key.repeat)
{ {
const bool success = SaveScreenshot(); const bool success = SaveScreenshot();
game.old_screenshot_border_timer = 255; game.old_screenshot_border_timer = 255;
@@ -281,7 +288,7 @@ void KeyPoll::Poll(void)
if (textentry()) if (textentry())
{ {
if (evt.key.key == SDLK_BACKSPACE && !keybuffer.empty()) if (evt.key.keysym.sym == SDLK_BACKSPACE && !keybuffer.empty())
{ {
keybuffer.erase(UTF8_backspace(keybuffer.c_str(), keybuffer.length())); keybuffer.erase(UTF8_backspace(keybuffer.c_str(), keybuffer.length()));
if (keybuffer.empty()) if (keybuffer.empty())
@@ -289,7 +296,7 @@ void KeyPoll::Poll(void)
linealreadyemptykludge = true; linealreadyemptykludge = true;
} }
} }
else if ( evt.key.key == SDLK_V && else if ( evt.key.keysym.sym == SDLK_v &&
keymap[SDLK_LCTRL] ) keymap[SDLK_LCTRL] )
{ {
char* text = SDL_GetClipboardText(); char* text = SDL_GetClipboardText();
@@ -299,10 +306,10 @@ void KeyPoll::Poll(void)
VVV_free(text); VVV_free(text);
} }
} }
else if ( evt.key.key == SDLK_X && else if ( evt.key.keysym.sym == SDLK_x &&
keymap[SDLK_LCTRL] ) keymap[SDLK_LCTRL] )
{ {
if (SDL_SetClipboardText(keybuffer.c_str())) if (SDL_SetClipboardText(keybuffer.c_str()) == 0)
{ {
keybuffer = ""; keybuffer = "";
} }
@@ -310,31 +317,37 @@ void KeyPoll::Poll(void)
} }
break; break;
} }
case SDL_EVENT_KEY_UP: case SDL_KEYUP:
keymap[evt.key.key] = false; keymap[evt.key.keysym.sym] = false;
if (evt.key.key == SDLK_BACKSPACE) if (evt.key.keysym.sym == SDLK_BACKSPACE)
{ {
pressedbackspace = false; pressedbackspace = false;
} }
break; break;
case SDL_EVENT_TEXT_INPUT: case SDL_TEXTINPUT:
if (!altpressed) if (!altpressed)
{ {
keybuffer += evt.text.text; keybuffer += evt.text.text;
} }
break; break;
case SDL_EVENT_TEXT_EDITING: case SDL_TEXTEDITING:
imebuffer = evt.edit.text; imebuffer = evt.edit.text;
imebuffer_start = evt.edit.start; imebuffer_start = evt.edit.start;
imebuffer_length = evt.edit.length; imebuffer_length = evt.edit.length;
break; 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;
/* Mouse Input */ /* Mouse Input */
case SDL_EVENT_MOUSE_MOTION: case SDL_MOUSEMOTION:
raw_mousex = evt.motion.x; raw_mousex = evt.motion.x;
raw_mousey = evt.motion.y; raw_mousey = evt.motion.y;
break; break;
case SDL_EVENT_MOUSE_BUTTON_DOWN: case SDL_MOUSEBUTTONDOWN:
switch (evt.button.button) switch (evt.button.button)
{ {
case SDL_BUTTON_LEFT: case SDL_BUTTON_LEFT:
@@ -354,7 +367,7 @@ void KeyPoll::Poll(void)
break; break;
} }
break; break;
case SDL_EVENT_MOUSE_BUTTON_UP: case SDL_MOUSEBUTTONUP:
switch (evt.button.button) switch (evt.button.button)
{ {
case SDL_BUTTON_LEFT: case SDL_BUTTON_LEFT:
@@ -376,69 +389,69 @@ void KeyPoll::Poll(void)
break; break;
/* Controller Input */ /* Controller Input */
case SDL_EVENT_GAMEPAD_BUTTON_DOWN: case SDL_CONTROLLERBUTTONDOWN:
buttonmap[(SDL_GamepadButton) evt.gbutton.button] = true; buttonmap[(SDL_GameControllerButton) evt.cbutton.button] = true;
BUTTONGLYPHS_keyboard_set_active(false); BUTTONGLYPHS_keyboard_set_active(false);
controller = controllers[evt.gbutton.which]; controller = controllers[evt.cbutton.which];
BUTTONGLYPHS_update_layout(controller); BUTTONGLYPHS_update_layout(controller);
break; break;
case SDL_EVENT_GAMEPAD_BUTTON_UP: case SDL_CONTROLLERBUTTONUP:
buttonmap[(SDL_GamepadButton) evt.gbutton.button] = false; buttonmap[(SDL_GameControllerButton) evt.cbutton.button] = false;
break; break;
case SDL_EVENT_GAMEPAD_AXIS_MOTION: case SDL_CONTROLLERAXISMOTION:
{ {
const int threshold = getThreshold(); const int threshold = getThreshold();
switch (evt.gaxis.axis) switch (evt.caxis.axis)
{ {
case SDL_GAMEPAD_AXIS_LEFTX: case SDL_CONTROLLER_AXIS_LEFTX:
if ( evt.gaxis.value > -threshold && if ( evt.caxis.value > -threshold &&
evt.gaxis.value < threshold ) evt.caxis.value < threshold )
{ {
xVel = 0; xVel = 0;
} }
else else
{ {
xVel = (evt.gaxis.value > 0) ? 1 : -1; xVel = (evt.caxis.value > 0) ? 1 : -1;
} }
break; break;
case SDL_GAMEPAD_AXIS_LEFTY: case SDL_CONTROLLER_AXIS_LEFTY:
if ( evt.gaxis.value > -threshold && if ( evt.caxis.value > -threshold &&
evt.gaxis.value < threshold ) evt.caxis.value < threshold )
{ {
yVel = 0; yVel = 0;
} }
else else
{ {
yVel = (evt.gaxis.value > 0) ? 1 : -1; yVel = (evt.caxis.value > 0) ? 1 : -1;
} }
break; break;
} }
BUTTONGLYPHS_keyboard_set_active(false); BUTTONGLYPHS_keyboard_set_active(false);
controller = controllers[evt.gaxis.which]; controller = controllers[evt.caxis.which];
BUTTONGLYPHS_update_layout(controller); BUTTONGLYPHS_update_layout(controller);
break; break;
} }
case SDL_EVENT_GAMEPAD_ADDED: case SDL_CONTROLLERDEVICEADDED:
{ {
controller = SDL_OpenGamepad(evt.cdevice.which); controller = SDL_GameControllerOpen(evt.cdevice.which);
vlog_info( vlog_info(
"Opened SDL_Gamepad ID #%i, %s", "Opened SDL_GameController ID #%i, %s",
evt.cdevice.which, evt.cdevice.which,
SDL_GetGamepadName(controller) SDL_GameControllerName(controller)
); );
controllers[SDL_GetJoystickID(SDL_GetGamepadJoystick(controller))] = controller; controllers[SDL_JoystickInstanceID(SDL_GameControllerGetJoystick(controller))] = controller;
BUTTONGLYPHS_keyboard_set_active(false); BUTTONGLYPHS_keyboard_set_active(false);
BUTTONGLYPHS_update_layout(controller); BUTTONGLYPHS_update_layout(controller);
break; break;
} }
case SDL_EVENT_GAMEPAD_REMOVED: case SDL_CONTROLLERDEVICEREMOVED:
{ {
controller = controllers[evt.cdevice.which]; controller = controllers[evt.cdevice.which];
controllers.erase(evt.cdevice.which); controllers.erase(evt.cdevice.which);
vlog_info("Closing %s", SDL_GetGamepadName(controller)); vlog_info("Closing %s", SDL_GameControllerName(controller));
SDL_CloseGamepad(controller); SDL_GameControllerClose(controller);
if (controllers.empty()) if (controllers.empty())
{ {
BUTTONGLYPHS_keyboard_set_active(true); BUTTONGLYPHS_keyboard_set_active(true);
@@ -446,96 +459,102 @@ void KeyPoll::Poll(void)
break; break;
} }
case SDL_EVENT_RENDER_TARGETS_RESET: case SDL_RENDER_TARGETS_RESET:
gameScreen.recacheTextures(); gameScreen.recacheTextures();
break; break;
/* Window Resize */ /* Window Events */
case SDL_EVENT_WINDOW_RESIZED: case SDL_WINDOWEVENT:
if (SDL_GetWindowFlags( switch (evt.window.event)
SDL_GetWindowFromID(evt.window.windowID)
) & SDL_WINDOW_INPUT_FOCUS)
{ {
resetWindow = true; /* Window Resize */
} case SDL_WINDOWEVENT_RESIZED:
break; if (SDL_GetWindowFlags(
SDL_GetWindowFromID(evt.window.windowID)
/* Window Focus */ ) & SDL_WINDOW_INPUT_FOCUS)
case SDL_EVENT_WINDOW_FOCUS_GAINED:
if (!game.disablepause)
{
isActive = true;
if ((!game.disableaudiopause || !game.disabletemporaryaudiopause) && music.currentsong != -1)
{ {
music.resume(); resetWindow = true;
music.resumeef();
} }
} break;
if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0)
{ /* Window Focus */
if (wasFullscreen) case SDL_WINDOWEVENT_FOCUS_GAINED:
if (!game.disablepause)
{ {
gameScreen.isWindowed = false; 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();
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_SetWindowFullscreen(
SDL_GetWindowFromID(evt.window.windowID), SDL_GetWindowFromID(evt.window.windowID),
true 0
); );
} }
} SDL_EnableScreenSaver();
SDL_DisableScreenSaver(); break;
break;
case SDL_EVENT_WINDOW_FOCUS_LOST:
if (!game.disablepause)
{
isActive = false;
if (!game.disableaudiopause || !game.disabletemporaryaudiopause)
{
music.pause();
music.pauseef();
}
}
if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0) /* Mouse Focus */
{ case SDL_WINDOWEVENT_ENTER:
wasFullscreen = !gameScreen.isWindowed; SDL_DisableScreenSaver();
gameScreen.isWindowed = true; break;
SDL_SetWindowFullscreen( case SDL_WINDOWEVENT_LEAVE:
SDL_GetWindowFromID(evt.window.windowID), SDL_EnableScreenSaver();
false break;
);
} }
SDL_EnableScreenSaver();
break;
/* Mouse Focus */
case SDL_EVENT_WINDOW_MOUSE_ENTER:
SDL_DisableScreenSaver();
break;
case SDL_EVENT_WINDOW_MOUSE_LEAVE:
SDL_EnableScreenSaver();
break; break;
/* Quit Event */ /* Quit Event */
case SDL_EVENT_QUIT: case SDL_QUIT:
VVV_exit(0); VVV_exit(0);
break; break;
} }
switch (evt.type) switch (evt.type)
{ {
case SDL_EVENT_KEY_DOWN: case SDL_KEYDOWN:
if (evt.key.repeat == 0) if (evt.key.repeat == 0)
{ {
hidemouse = true; hidemouse = true;
} }
break; break;
case SDL_EVENT_TEXT_INPUT: case SDL_TEXTINPUT:
case SDL_EVENT_GAMEPAD_BUTTON_DOWN: case SDL_CONTROLLERBUTTONDOWN:
case SDL_EVENT_GAMEPAD_AXIS_MOTION: case SDL_CONTROLLERAXISMOTION:
hidemouse = true; hidemouse = true;
break; break;
case SDL_EVENT_MOUSE_MOTION: case SDL_MOUSEMOTION:
case SDL_EVENT_MOUSE_BUTTON_DOWN: case SDL_MOUSEBUTTONDOWN:
showmouse = true; showmouse = true;
break; break;
} }
@@ -552,7 +571,7 @@ void KeyPoll::Poll(void)
toggleFullscreen(); toggleFullscreen();
} }
SDL_FRect rect; SDL_Rect rect;
graphics.get_stretch_info(&rect); graphics.get_stretch_info(&rect);
int window_width; int window_width;
@@ -583,7 +602,7 @@ bool KeyPoll::isDown(SDL_Keycode key)
return keymap[key]; return keymap[key];
} }
bool KeyPoll::isDown(std::vector<SDL_GamepadButton> buttons) bool KeyPoll::isDown(std::vector<SDL_GameControllerButton> buttons)
{ {
for (size_t i = 0; i < buttons.size(); i += 1) for (size_t i = 0; i < buttons.size(); i += 1)
{ {
@@ -595,7 +614,7 @@ bool KeyPoll::isDown(std::vector<SDL_GamepadButton> buttons)
return false; return false;
} }
bool KeyPoll::isDown(SDL_GamepadButton button) bool KeyPoll::isDown(SDL_GameControllerButton button)
{ {
return buttonmap[button]; return buttonmap[button];
} }
@@ -603,9 +622,9 @@ bool KeyPoll::isDown(SDL_GamepadButton button)
bool KeyPoll::controllerButtonDown(void) bool KeyPoll::controllerButtonDown(void)
{ {
for ( for (
SDL_GamepadButton button = SDL_GAMEPAD_BUTTON_SOUTH; SDL_GameControllerButton button = SDL_CONTROLLER_BUTTON_A;
button < SDL_GAMEPAD_BUTTON_DPAD_UP; button < SDL_CONTROLLER_BUTTON_DPAD_UP;
button = (SDL_GamepadButton) (button + 1) button = (SDL_GameControllerButton) (button + 1)
) { ) {
if (isDown(button)) if (isDown(button))
{ {
@@ -617,28 +636,28 @@ bool KeyPoll::controllerButtonDown(void)
bool KeyPoll::controllerWantsLeft(bool includeVert) bool KeyPoll::controllerWantsLeft(bool includeVert)
{ {
return ( buttonmap[SDL_GAMEPAD_BUTTON_DPAD_LEFT] || return ( buttonmap[SDL_CONTROLLER_BUTTON_DPAD_LEFT] ||
xVel < 0 || xVel < 0 ||
( includeVert && ( includeVert &&
( buttonmap[SDL_GAMEPAD_BUTTON_DPAD_UP] || ( buttonmap[SDL_CONTROLLER_BUTTON_DPAD_UP] ||
yVel < 0 ) ) ); yVel < 0 ) ) );
} }
bool KeyPoll::controllerWantsRight(bool includeVert) bool KeyPoll::controllerWantsRight(bool includeVert)
{ {
return ( buttonmap[SDL_GAMEPAD_BUTTON_DPAD_RIGHT] || return ( buttonmap[SDL_CONTROLLER_BUTTON_DPAD_RIGHT] ||
xVel > 0 || xVel > 0 ||
( includeVert && ( includeVert &&
( buttonmap[SDL_GAMEPAD_BUTTON_DPAD_DOWN] || ( buttonmap[SDL_CONTROLLER_BUTTON_DPAD_DOWN] ||
yVel > 0 ) ) ); yVel > 0 ) ) );
} }
bool KeyPoll::controllerWantsUp(void) bool KeyPoll::controllerWantsUp(void)
{ {
return buttonmap[SDL_GAMEPAD_BUTTON_DPAD_UP] || yVel < 0; return buttonmap[SDL_CONTROLLER_BUTTON_DPAD_UP] || yVel < 0;
} }
bool KeyPoll::controllerWantsDown(void) bool KeyPoll::controllerWantsDown(void)
{ {
return buttonmap[SDL_GAMEPAD_BUTTON_DPAD_DOWN] || yVel > 0; return buttonmap[SDL_CONTROLLER_BUTTON_DPAD_DOWN] || yVel > 0;
} }
+14 -14
View File
@@ -2,7 +2,7 @@
#define KEYPOLL_H #define KEYPOLL_H
#include <map> // FIXME: I should feel very bad for using C++ -flibit #include <map> // FIXME: I should feel very bad for using C++ -flibit
#include <SDL3/SDL.h> #include <SDL.h>
#include <string> #include <string>
#include <vector> #include <vector>
@@ -15,16 +15,16 @@ enum Kybrd
KEYBOARD_ENTER = SDLK_RETURN, KEYBOARD_ENTER = SDLK_RETURN,
KEYBOARD_SPACE = SDLK_SPACE, KEYBOARD_SPACE = SDLK_SPACE,
KEYBOARD_w = SDLK_W, KEYBOARD_w = SDLK_w,
KEYBOARD_s = SDLK_S, KEYBOARD_s = SDLK_s,
KEYBOARD_a = SDLK_A, KEYBOARD_a = SDLK_a,
KEYBOARD_d = SDLK_D, KEYBOARD_d = SDLK_d,
KEYBOARD_e = SDLK_E, KEYBOARD_e = SDLK_e,
KEYBOARD_m = SDLK_M, KEYBOARD_m = SDLK_m,
KEYBOARD_n = SDLK_N, KEYBOARD_n = SDLK_n,
KEYBOARD_v = SDLK_V, KEYBOARD_v = SDLK_v,
KEYBOARD_z = SDLK_Z, KEYBOARD_z = SDLK_z,
KEYBOARD_BACKSPACE = SDLK_BACKSPACE KEYBOARD_BACKSPACE = SDLK_BACKSPACE
}; };
@@ -54,8 +54,8 @@ public:
bool isDown(SDL_Keycode key); bool isDown(SDL_Keycode key);
bool isDown(std::vector<SDL_GamepadButton> buttons); bool isDown(std::vector<SDL_GameControllerButton> buttons);
bool isDown(SDL_GamepadButton button); bool isDown(SDL_GameControllerButton button);
bool controllerButtonDown(void); bool controllerButtonDown(void);
bool controllerWantsLeft(bool includeVert); bool controllerWantsLeft(bool includeVert);
bool controllerWantsRight(bool includeVert); bool controllerWantsRight(bool includeVert);
@@ -76,8 +76,8 @@ public:
bool linealreadyemptykludge; bool linealreadyemptykludge;
private: private:
std::map<SDL_JoystickID, SDL_Gamepad*> controllers; std::map<SDL_JoystickID, SDL_GameController*> controllers;
std::map<SDL_GamepadButton, bool> buttonmap; std::map<SDL_GameControllerButton, bool> buttonmap;
int xVel, yVel; int xVel, yVel;
Uint32 wasFullscreen; Uint32 wasFullscreen;
}; };
+10 -12
View File
@@ -63,7 +63,7 @@ namespace level_debugger
return; return;
} }
if (key.isDown(SDLK_Y)) if (key.isDown(SDLK_y))
{ {
if (!debug_held) if (!debug_held)
{ {
@@ -282,11 +282,11 @@ namespace level_debugger
graphics.draw_rect(bounding_box.x, bounding_box.y, bounding_box.w, bounding_box.h, graphics.getRGB(15, 90, 90)); 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. // For gravity lines, show the true hitbox.
if (obj.entities[i].type == EntityType_HORIZONTAL_GRAVITY_LINE) if (obj.entities[i].type == 9)
{ {
graphics.draw_rect(bounding_box.x - 1, bounding_box.y + 1, bounding_box.w + 2, bounding_box.h, graphics.getRGB(90, 90, 15)); 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) else if (obj.entities[i].type == 10)
{ {
graphics.fill_rect(bounding_box.x - 2, bounding_box.y - 1, bounding_box.w + 1, bounding_box.h + 2, graphics.getRGB(90, 90, 15)); graphics.fill_rect(bounding_box.x - 2, bounding_box.y - 1, bounding_box.w + 1, bounding_box.h + 2, graphics.getRGB(90, 90, 15));
} }
@@ -314,7 +314,7 @@ namespace level_debugger
int line = 0; int line = 0;
if (key.isDown(SDLK_U)) if (key.isDown(SDLK_u))
{ {
SDL_Color on = graphics.getRGB(220 - (help.glow), 220 - (help.glow), 255 - (help.glow / 2)); 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)); SDL_Color off = graphics.getRGB(220 / 1.5 - (help.glow), 220 / 1.5 - (help.glow), 255 / 1.5 - (help.glow / 2));
@@ -390,35 +390,33 @@ namespace level_debugger
// Mostly contains duplicates, but for ease of use // Mostly contains duplicates, but for ease of use
switch (entity->type) switch (entity->type)
{ {
case EntityType_PLAYER: case 0:
// Player // Player
render_info(line++, "Gravity", help.String(game.gravitycontrol)); render_info(line++, "Gravity", help.String(game.gravitycontrol));
render_info(line++, "Checkpoint", help.String(game.savepoint)); render_info(line++, "Checkpoint", help.String(game.savepoint));
break; break;
case EntityType_MOVING: case 1:
// Moving platforms and enemies // Moving platforms and enemies
render_info(line++, "Speed", help.String(entity->para)); render_info(line++, "Speed", help.String(entity->para));
render_info(line++, "Movement type", help.String(entity->behave)); render_info(line++, "Movement type", help.String(entity->behave));
break; break;
case EntityType_TRINKET: case 7:
// Trinkets // Trinkets
render_info(line++, "ID", help.String(entity->para)); render_info(line++, "ID", help.String(entity->para));
break; break;
case EntityType_CHECKPOINT: case 8:
// Checkpoints // Checkpoints
render_info(line++, "ID", help.String(entity->para)); render_info(line++, "ID", help.String(entity->para));
render_info(line++, "Active", game.savepoint == entity->para ? "True" : "False"); render_info(line++, "Active", game.savepoint == entity->para ? "True" : "False");
break; break;
case EntityType_HORIZONTAL_GRAVITY_LINE: case 9:
// Horizontal gravity lines // Horizontal gravity lines
render_info(line++, "Horizontal"); render_info(line++, "Horizontal");
break; break;
case EntityType_VERTICAL_GRAVITY_LINE: case 10:
// Vertical gravity lines // Vertical gravity lines
render_info(line++, "Vertical"); render_info(line++, "Vertical");
break; break;
default:
break;
} }
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef LEVELDEBUGGER_H #ifndef LEVELDEBUGGER_H
#define LEVELDEBUGGER_H #define LEVELDEBUGGER_H
#include <SDL3/SDL.h> #include <SDL.h>
namespace level_debugger namespace level_debugger
{ {
+14 -29
View File
@@ -373,7 +373,7 @@ void gamelogic(void)
{ {
if (game.roomx == 111 && game.roomy == 107 && !map.custommode) 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) if (obj.entities[i].xp < 152)
{ {
@@ -391,7 +391,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 //Ok! super magical exception for the room with the intention death for the shiny trinket
//fix this when the maps are finalised //fix this when the maps are finalised
@@ -405,7 +405,7 @@ void gamelogic(void)
map.settile(18, 9, 59); 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 //ok, unfortunate case where the disappearing platform hasn't fully disappeared. Accept a little
//graphical uglyness to avoid breaking the room! //graphical uglyness to avoid breaking the room!
@@ -421,7 +421,7 @@ void gamelogic(void)
} }
if (!entitygone) obj.entities[i].state = 4; 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. //if playing SWN, get the enemies offscreen.
obj.entities[i].xp += obj.entities[i].vx*5; obj.entities[i].xp += obj.entities[i].vx*5;
@@ -461,8 +461,6 @@ void gamelogic(void)
game.deathseq--; game.deathseq--;
if (game.deathseq <= 0) if (game.deathseq <= 0)
{ {
game.invalidate_ndm_trophy();
if (game.nodeathmode) if (game.nodeathmode)
{ {
game.deathseq = 1; game.deathseq = 1;
@@ -730,7 +728,7 @@ void gamelogic(void)
bool square_onscreen = false; bool square_onscreen = false;
for (size_t i = 0; i < obj.entities.size(); i++) 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; square_onscreen = true;
break; break;
@@ -773,14 +771,7 @@ void gamelogic(void)
music.play(Music_POTENTIALFORANYTHING); music.play(Music_POTENTIALFORANYTHING);
break; break;
case TimeTrial_TOWER: case TimeTrial_TOWER:
if (graphics.flipmode) music.play(Music_POSITIVEFORCE);
{
music.play(Music_POSITIVEFORCEREVERSED);
}
else
{
music.play(Music_POSITIVEFORCE);
}
break; break;
case TimeTrial_SPACESTATION2: case TimeTrial_SPACESTATION2:
music.play(Music_PUSHINGONWARDS); music.play(Music_PUSHINGONWARDS);
@@ -1043,11 +1034,9 @@ void gamelogic(void)
size_t i; size_t i;
for (i = 0; i < obj.entities.size(); ++i) for (i = 0; i < obj.entities.size(); ++i)
{ {
if (obj.entities[i].type == EntityType_WARP_LINE_LEFT if ((obj.entities[i].type >= 51
|| obj.entities[i].type == EntityType_WARP_LINE_RIGHT && obj.entities[i].type <= 54) /* Don't warp warp lines */
|| obj.entities[i].type == EntityType_WARP_LINE_TOP || obj.entities[i].size == 12) /* Don't warp gravitron squares */
|| obj.entities[i].type == EntityType_WARP_LINE_BOTTOM /* Don't warp warp lines */
|| obj.entities[i].size == 12) /* Don't warp gravitron squares */
{ {
continue; continue;
} }
@@ -1103,10 +1092,8 @@ void gamelogic(void)
size_t i; size_t i;
for (i = 0; i < obj.entities.size(); ++i) for (i = 0; i < obj.entities.size(); ++i)
{ {
if (obj.entities[i].type == EntityType_WARP_LINE_LEFT if (obj.entities[i].type >= 51
|| obj.entities[i].type == EntityType_WARP_LINE_RIGHT && obj.entities[i].type <= 54) /* Don't warp warp lines */
|| obj.entities[i].type == EntityType_WARP_LINE_TOP
|| obj.entities[i].type == EntityType_WARP_LINE_BOTTOM) /* Don't warp warp lines */
{ {
continue; continue;
} }
@@ -1137,11 +1124,9 @@ void gamelogic(void)
size_t i; size_t i;
for (i = 0; i < obj.entities.size(); ++i) for (i = 0; i < obj.entities.size(); ++i)
{ {
if ((obj.entities[i].type == EntityType_WARP_LINE_LEFT if ((obj.entities[i].type >= 51
|| obj.entities[i].type == EntityType_WARP_LINE_RIGHT && obj.entities[i].type <= 54) /* Don't warp warp lines */
|| obj.entities[i].type == EntityType_WARP_LINE_TOP || obj.entities[i].rule == 0) /* Don't warp the player */
|| obj.entities[i].type == EntityType_WARP_LINE_BOTTOM) /* Don't warp warp lines */
|| obj.entities[i].rule == 0) /* Don't warp the player */
{ {
continue; continue;
} }
+26 -171
View File
@@ -52,8 +52,9 @@ mapclass::mapclass(void)
custommode=false; custommode=false;
custommodeforreal=false; custommodeforreal=false;
custommmxoff=0; custommmyoff=0; custommmxsize=0; custommmysize=0;
customzoom=0;
customshowmm=true; customshowmm=true;
revealmap = true;
rcol = 0; rcol = 0;
@@ -87,9 +88,6 @@ mapclass::mapclass(void)
roomtexton = false; roomtexton = false;
nexttowercolour_set = false; nexttowercolour_set = false;
currentregion = 0;
SDL_zeroa(region);
} }
static char roomname_static[SCREEN_WIDTH_CHARS]; static char roomname_static[SCREEN_WIDTH_CHARS];
@@ -200,12 +198,6 @@ void mapclass::resetmap(void)
SDL_memset(explored, 0, sizeof(explored)); SDL_memset(explored, 0, sizeof(explored));
} }
void mapclass::fullmap(void)
{
//mark the whole map as explored
SDL_memset(explored, 1, sizeof(explored));
}
void mapclass::updateroomnames(void) void mapclass::updateroomnames(void)
{ {
if (roomnameset) if (roomnameset)
@@ -486,28 +478,28 @@ int mapclass::maptiletoenemycol(int t)
switch(t) switch(t)
{ {
case 0: case 0:
return EntityColour_ENEMY_CYAN; return 11;
break; break;
case 1: case 1:
return EntityColour_ENEMY_RED; return 6;
break; break;
case 2: case 2:
return EntityColour_ENEMY_PINK; return 8;
break; break;
case 3: case 3:
return EntityColour_ENEMY_BLUE; return 12;
break; break;
case 4: case 4:
return EntityColour_ENEMY_YELLOW; return 9;
break; break;
case 5: case 5:
return EntityColour_ENEMY_GREEN; return 7;
break; break;
case 6: case 6:
return EntityColour_ENEMY_GRAY; return 18;
break; break;
} }
return EntityColour_ENEMY_CYAN; return 11;
} }
void mapclass::changefinalcol(int t) void mapclass::changefinalcol(int t)
@@ -519,7 +511,7 @@ void mapclass::changefinalcol(int t)
//Next, entities //Next, entities
for (size_t i = 0; i < obj.entities.size(); i++) for (size_t i = 0; i < obj.entities.size(); i++)
{ {
if (obj.entities[i].type == EntityType_MOVING) if (obj.entities[i].type == 1) //something with a movement behavior
{ {
if (obj.entities[i].animate == 10 || obj.entities[i].animate == 11) //treadmill if (obj.entities[i].animate == 10 || obj.entities[i].animate == 11) //treadmill
{ {
@@ -542,7 +534,7 @@ void mapclass::changefinalcol(int t)
obj.entities[i].colour = maptiletoenemycol(temp); obj.entities[i].colour = maptiletoenemycol(temp);
} }
} }
else if (obj.entities[i].type == EntityType_DISAPPEARING_PLATFORM) else if (obj.entities[i].type == 2) //disappearing platforms
{ {
obj.entities[i].tile = 915+(temp*40); obj.entities[i].tile = 915+(temp*40);
} }
@@ -785,18 +777,12 @@ void mapclass::resetplayer(void)
void mapclass::resetplayer(const bool player_died) void mapclass::resetplayer(const bool player_died)
{ {
bool was_in_tower = towermode; bool was_in_tower = towermode;
game.deathseq = -1;
if (game.roomx != game.saverx || game.roomy != game.savery) if (game.roomx != game.saverx || game.roomy != game.savery)
{ {
gotoroom(game.saverx, game.savery); gotoroom(game.saverx, game.savery);
if (player_died)
{
twoframedelayfix();
}
} }
game.deathseq = -1;
int i = obj.getplayer(); int i = obj.getplayer();
if(INBOUNDS_VEC(i, obj.entities)) if(INBOUNDS_VEC(i, obj.entities))
{ {
@@ -898,7 +884,7 @@ void mapclass::gotoroom(int rx, int ry)
//Ok, let's save the position of all lines on the screen //Ok, let's save the position of all lines on the screen
for (size_t i = 0; i < obj.entities.size(); i++) for (size_t i = 0; i < obj.entities.size(); i++)
{ {
if (obj.entities[i].type == EntityType_HORIZONTAL_GRAVITY_LINE) if (obj.entities[i].type == 9)
{ {
//It's a horizontal line //It's a horizontal line
if (obj.entities[i].xp <= 0 || (obj.entities[i].xp + obj.entities[i].w) >= 312) if (obj.entities[i].xp <= 0 || (obj.entities[i].xp + obj.entities[i].w) >= 312)
@@ -1036,7 +1022,7 @@ void mapclass::gotoroom(int rx, int ry)
for (size_t i = 0; i < obj.entities.size(); i++) for (size_t i = 0; i < obj.entities.size(); i++)
{ {
if (obj.entities[i].type == EntityType_HORIZONTAL_GRAVITY_LINE) if (obj.entities[i].type == 9)
{ {
//It's a horizontal line //It's a horizontal line
if (obj.entities[i].xp <= 0 || obj.entities[i].xp + obj.entities[i].w >= 312) if (obj.entities[i].xp <= 0 || obj.entities[i].xp + obj.entities[i].w >= 312)
@@ -1318,15 +1304,12 @@ static void copy_short_to_int(int* dest, const short* src, const size_t size)
void mapclass::loadlevel(int rx, int ry) void mapclass::loadlevel(int rx, int ry)
{ {
int t; int t;
if (revealmap) if (!finalmode)
{ {
if (!finalmode) setexplored(rx - 100, ry - 100, true);
if (rx == 109 && !custommode)
{ {
setexplored(rx - 100, ry - 100, true); exploretower();
if (rx == 109 && !custommode)
{
exploretower();
}
} }
} }
@@ -1867,7 +1850,7 @@ void mapclass::loadlevel(int rx, int ry)
{ {
case 1: // Enemies case 1: // Enemies
obj.customenemy = room->enemytype; obj.customenemy = room->enemytype;
obj.createentity(ex, ey, 56, ent.p1, 4 + room->enemyv, bx1, by1, bx2, by2); obj.createentity(ex, ey, 56, ent.p1, 4, bx1, by1, bx2, by2);
break; break;
case 2: // Platforms and conveyors case 2: // Platforms and conveyors
if (ent.p1 <= 4) if (ent.p1 <= 4)
@@ -2064,7 +2047,7 @@ void mapclass::loadlevel(int rx, int ry)
for (size_t i = 0; i < obj.entities.size(); i++) 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) if (obj.entities[i].type == 1 && obj.entities[i].behave >= 8 && obj.entities[i].behave < 10)
{ {
//put a block underneath //put a block underneath
int temp = obj.entities[i].xp / 8.0f; int temp = obj.entities[i].xp / 8.0f;
@@ -2191,7 +2174,7 @@ void mapclass::loadlevel(int rx, int ry)
{ {
//A slight varation - she's upside down //A slight varation - she's upside down
obj.createentity(249, 62, 18, 16, 0, 18); obj.createentity(249, 62, 18, 16, 0, 18);
int j = obj.getcrewman(EntityColour_CREW_BLUE); int j = obj.getcrewman(BLUE);
if (INBOUNDS_VEC(j, obj.entities)) if (INBOUNDS_VEC(j, obj.entities))
{ {
obj.entities[j].rule = 7; obj.entities[j].rule = 7;
@@ -2212,16 +2195,16 @@ void mapclass::twoframedelayfix(void)
// A bit kludge-y, but it's the least we can do without changing the frame ordering. // 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) if (GlitchrunnerMode_less_than_or_equal(Glitchrunner2_2)
|| !custommode || !custommode
|| game.deathseq != -1) || game.deathseq != -1)
return; return;
int block_idx = -1; int block_idx = -1;
// obj.checktrigger() sets block_idx // obj.checktrigger() sets block_idx
int activetrigger = obj.checktrigger(&block_idx); int activetrigger = obj.checktrigger(&block_idx);
if (activetrigger <= -1 if (activetrigger <= -1
|| !INBOUNDS_VEC(block_idx, obj.blocks) || !INBOUNDS_VEC(block_idx, obj.blocks)
|| activetrigger < 300) || activetrigger < 300)
{ {
return; return;
} }
@@ -2232,131 +2215,3 @@ void mapclass::twoframedelayfix(void)
game.setstatedelay(0); game.setstatedelay(0);
script.load(game.newscript); 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();
}
}
+2 -38
View File
@@ -12,21 +12,6 @@
#include "TowerBG.h" #include "TowerBG.h"
#include "WarpClass.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 struct Roomtext
{ {
int x, y; int x, y;
@@ -73,8 +58,6 @@ public:
void resetmap(void); void resetmap(void);
void fullmap(void);
void updateroomnames(void); void updateroomnames(void);
void initmapdata(void); void initmapdata(void);
@@ -142,8 +125,6 @@ public:
bool isexplored(const int rx, const int ry); bool isexplored(const int rx, const int ry);
void setexplored(const int rx, const int ry, const bool status); void setexplored(const int rx, const int ry, const bool status);
bool revealmap;
int background; int background;
int rcol; int rcol;
int tileset; int tileset;
@@ -178,6 +159,8 @@ public:
//Variables for playing custom levels //Variables for playing custom levels
bool custommode; bool custommode;
bool custommodeforreal; bool custommodeforreal;
int custommmxoff, custommmyoff, custommmxsize, custommmysize;
int customzoom;
bool customshowmm; bool customshowmm;
//final level colour cycling stuff //final level colour cycling stuff
@@ -211,25 +194,6 @@ public:
//Map cursor //Map cursor
int cursorstate, cursordelay; 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 #ifndef MAP_DEFINITION
+104 -370
View File
@@ -1,8 +1,9 @@
#define MUSIC_DEFINITION #define MUSIC_DEFINITION
#include "Music.h" #include "Music.h"
#include <SDL3/SDL.h> #include <SDL.h>
#include <FAudio.h> #include <FAudio.h>
#include <physfsrwops.h>
#include "Alloc.h" #include "Alloc.h"
#include "BinaryBlob.h" #include "BinaryBlob.h"
@@ -45,7 +46,7 @@
#define assert SDL_assert #define assert SDL_assert
#define FILE SDL_IOStream #define FILE SDL_RWops
#ifdef SEEK_SET #ifdef SEEK_SET
#undef SEEK_SET #undef SEEK_SET
#endif #endif
@@ -58,16 +59,16 @@
#ifdef EOF #ifdef EOF
#undef EOF #undef EOF
#endif #endif
#define SEEK_SET SDL_IO_SEEK_SET #define SEEK_SET 0
#define SEEK_CUR SDL_IO_SEEK_CUR #define SEEK_CUR 1
#define SEEK_END SDL_IO_SEEK_END #define SEEK_END 2
#define EOF -1 #define EOF -1
#define fopen(path, mode) SDL_IOFromFile(path, mode) #define fopen(path, mode) SDL_RWFromFile(path, mode)
#define fopen_s(io, path, mode) (!(*io = fopen(path, mode))) #define fopen_s(io, path, mode) (!(*io = fopen(path, mode)))
#define fclose(io) SDL_CloseIO(io) #define fclose(io) SDL_RWclose(io)
#define fread(dst, size, count, io) SDL_ReadIO(io, dst, ((size) * (count))) #define fread(dst, size, count, io) SDL_RWread(io, dst, size, count)
#define fseek(io, offset, whence) SDL_SeekIO(io, offset, whence) #define fseek(io, offset, whence) SDL_RWseek(io, offset, whence)
#define ftell(io) SDL_TellIO(io) #define ftell(io) SDL_RWtell(io)
#define FAudio_alloca(x) SDL_stack_alloc(uint8_t, x) #define FAudio_alloca(x) SDL_stack_alloc(uint8_t, x)
#define FAudio_dealloca(x) SDL_stack_free(x) #define FAudio_dealloca(x) SDL_stack_free(x)
@@ -92,7 +93,7 @@ static FAudioMasteringVoice* masteringvoice = NULL;
class SoundTrack class SoundTrack
{ {
public: public:
SoundTrack(const char* fileName, const char* _id, bool _extra) SoundTrack(const char* fileName)
{ {
unsigned char* mem; unsigned char* mem;
size_t length; size_t length;
@@ -117,17 +118,14 @@ public:
{ {
LoadWAV(fileName, mem, length); LoadWAV(fileName, mem, length);
} }
extra = _extra;
id = SDL_strdup(_id);
} }
void LoadWAV(const char* fileName, unsigned char* mem, const size_t length) void LoadWAV(const char* fileName, unsigned char* mem, const size_t length)
{ {
SDL_AudioSpec spec; SDL_AudioSpec spec;
SDL_IOStream *fileIn; SDL_RWops *fileIn;
fileIn = SDL_IOFromConstMem(mem, length); fileIn = SDL_RWFromConstMem(mem, length);
if (!SDL_LoadWAV_IO(fileIn, 1, &spec, &wav_buffer, &wav_length)) if (SDL_LoadWAV_RW(fileIn, 1, &spec, &wav_buffer, &wav_length) == NULL)
{ {
vlog_error("Unable to load WAV file %s", fileName); vlog_error("Unable to load WAV file %s", fileName);
goto end; goto end;
@@ -136,7 +134,7 @@ public:
format.nSamplesPerSec = spec.freq; format.nSamplesPerSec = spec.freq;
format.wFormatTag = FAUDIO_FORMAT_PCM; format.wFormatTag = FAUDIO_FORMAT_PCM;
format.wBitsPerSample = SDL_AUDIO_BITSIZE(spec.format); format.wBitsPerSample = SDL_AUDIO_BITSIZE(spec.format);
format.nBlockAlign = format.nChannels * (format.wBitsPerSample / 8); format.nBlockAlign = format.nChannels * format.wBitsPerSample;
format.nAvgBytesPerSec = format.nSamplesPerSec * format.nBlockAlign; format.nAvgBytesPerSec = format.nSamplesPerSec * format.nBlockAlign;
format.cbSize = 0; format.cbSize = 0;
valid = true; valid = true;
@@ -160,7 +158,7 @@ end:
format.wBitsPerSample = sizeof(float) * 8; format.wBitsPerSample = sizeof(float) * 8;
format.nChannels = vorbis_info.channels; format.nChannels = vorbis_info.channels;
format.nSamplesPerSec = vorbis_info.sample_rate; format.nSamplesPerSec = vorbis_info.sample_rate;
format.nBlockAlign = format.nChannels * (format.wBitsPerSample / 8); format.nBlockAlign = format.nChannels * format.wBitsPerSample;
format.nAvgBytesPerSec = format.nSamplesPerSec * format.nBlockAlign; format.nAvgBytesPerSec = format.nSamplesPerSec * format.nBlockAlign;
format.cbSize = 0; format.cbSize = 0;
@@ -182,7 +180,6 @@ end:
VVV_free(decoded_buf_reserve); VVV_free(decoded_buf_reserve);
VVV_freefunc(stb_vorbis_close, vorbis); VVV_freefunc(stb_vorbis_close, vorbis);
VVV_free(ogg_file); VVV_free(ogg_file);
VVV_free(id);
} }
void Play(void) void Play(void)
@@ -213,7 +210,7 @@ end:
} }
FAudioBuffer faudio_buffer = { FAudioBuffer faudio_buffer = {
FAUDIO_END_OF_STREAM, /* Flags */ FAUDIO_END_OF_STREAM, /* Flags */
wav_length, /* AudioBytes */ wav_length * 8, /* AudioBytes */
wav_buffer, /* AudioData */ wav_buffer, /* AudioData */
0, /* playbegin */ 0, /* playbegin */
0, /* playlength */ 0, /* playlength */
@@ -265,7 +262,7 @@ end:
format.nSamplesPerSec = audio_rate; format.nSamplesPerSec = audio_rate;
format.wFormatTag = FAUDIO_FORMAT_PCM; format.wFormatTag = FAUDIO_FORMAT_PCM;
format.wBitsPerSample = 16; format.wBitsPerSample = 16;
format.nBlockAlign = format.nChannels * (format.wBitsPerSample / 8); format.nBlockAlign = format.nChannels * format.wBitsPerSample;
format.nAvgBytesPerSec = format.nSamplesPerSec * format.nBlockAlign; format.nAvgBytesPerSec = format.nSamplesPerSec * format.nBlockAlign;
format.cbSize = 0; format.cbSize = 0;
voice_formats[i] = format; voice_formats[i] = format;
@@ -367,9 +364,6 @@ end:
static FAudioSourceVoice** voices; static FAudioSourceVoice** voices;
static FAudioWaveFormatEx voice_formats[VVV_MAX_CHANNELS]; static FAudioWaveFormatEx voice_formats[VVV_MAX_CHANNELS];
static float volume; static float volume;
char* id;
bool extra;
}; };
FAudioSourceVoice** SoundTrack::voices = NULL; FAudioSourceVoice** SoundTrack::voices = NULL;
FAudioWaveFormatEx SoundTrack::voice_formats[VVV_MAX_CHANNELS]; FAudioWaveFormatEx SoundTrack::voice_formats[VVV_MAX_CHANNELS];
@@ -378,26 +372,15 @@ float SoundTrack::volume = 0.0f;
class MusicTrack class MusicTrack
{ {
public: public:
MusicTrack(SDL_IOStream *rw, const char* _id, bool _loose_extra) MusicTrack(SDL_RWops *rw)
{ {
SDL_zerop(this); SDL_zerop(this);
read_buf = (Uint8*) SDL_malloc(rw->size(rw));
id = SDL_strdup(_id); SDL_RWread(rw, read_buf, rw->size(rw), 1);
loose_extra = _loose_extra;
if (SDL_GetIOSize(rw) <= 1)
{
// Don't bother
vlog_debug("Skipping empty music track");
goto end;
}
read_buf = (Uint8*) SDL_malloc(SDL_GetIOSize(rw));
SDL_ReadIO(rw, read_buf, SDL_GetIOSize(rw));
int err; int err;
stb_vorbis_info vorbis_info; stb_vorbis_info vorbis_info;
stb_vorbis_comment vorbis_comment; stb_vorbis_comment vorbis_comment;
vorbis = stb_vorbis_open_memory(read_buf, rw->size(rw), &err, NULL);
vorbis = stb_vorbis_open_memory(read_buf, SDL_GetIOSize(rw), &err, NULL);
if (vorbis == NULL) if (vorbis == NULL)
{ {
vlog_error("Unable to create Vorbis handle, error %d", err); vlog_error("Unable to create Vorbis handle, error %d", err);
@@ -409,7 +392,7 @@ public:
format.wBitsPerSample = sizeof(float) * 8; format.wBitsPerSample = sizeof(float) * 8;
format.nChannels = vorbis_info.channels; format.nChannels = vorbis_info.channels;
format.nSamplesPerSec = vorbis_info.sample_rate; format.nSamplesPerSec = vorbis_info.sample_rate;
format.nBlockAlign = format.nChannels * (format.wBitsPerSample / 8); format.nBlockAlign = format.nChannels * format.wBitsPerSample;
format.nAvgBytesPerSec = format.nSamplesPerSec * format.nBlockAlign; format.nAvgBytesPerSec = format.nSamplesPerSec * format.nBlockAlign;
format.cbSize = 0; format.cbSize = 0;
@@ -426,7 +409,7 @@ public:
valid = true; valid = true;
end: end:
SDL_CloseIO(rw); SDL_RWclose(rw);
} }
void Dispose(void) void Dispose(void)
@@ -435,7 +418,6 @@ end:
VVV_free(read_buf); VVV_free(read_buf);
VVV_free(decoded_buf_playing); VVV_free(decoded_buf_playing);
VVV_free(decoded_buf_reserve); VVV_free(decoded_buf_reserve);
VVV_free(id);
if (!IsHalted()) if (!IsHalted())
{ {
VVV_freefunc(FAudioVoice_DestroyVoice, musicVoice); VVV_freefunc(FAudioVoice_DestroyVoice, musicVoice);
@@ -522,9 +504,9 @@ end:
} }
} }
static void SetVolume(int controlVolume) static void SetVolume(int musicVolume)
{ {
float adj_vol = (float)controlVolume / VVV_MAX_VOLUME; float adj_vol = (float) musicVolume / VVV_MAX_VOLUME;
if (!IsHalted()) if (!IsHalted())
{ {
FAudioVoice_SetVolume(musicVoice, adj_vol, FAUDIO_COMMIT_NOW); FAudioVoice_SetVolume(musicVoice, adj_vol, FAUDIO_COMMIT_NOW);
@@ -544,8 +526,6 @@ end:
Uint8* decoded_buf_playing; Uint8* decoded_buf_playing;
Uint8* decoded_buf_reserve; Uint8* decoded_buf_reserve;
Uint8* read_buf; Uint8* read_buf;
char* id;
bool loose_extra;
bool shouldloop; bool shouldloop;
bool valid; bool valid;
@@ -735,7 +715,7 @@ musicclass::musicclass(void)
safeToProcessMusic= false; safeToProcessMusic= false;
m_doFadeInVol = false; m_doFadeInVol = false;
m_doFadeOutVol = false; m_doFadeOutVol = false;
controlVolume = 0; musicVolume = 0;
user_music_volume = USER_VOLUME_MAX; user_music_volume = USER_VOLUME_MAX;
user_sound_volume = USER_VOLUME_MAX; user_sound_volume = USER_VOLUME_MAX;
@@ -749,74 +729,9 @@ musicclass::musicclass(void)
usingmmmmmm = false; usingmmmmmm = false;
} }
static void make_id_from_filename(char* id, size_t id_size, const char* filename)
{
// Create the ID
size_t current_char = 0;
size_t item_len = SDL_strlen(filename);
for (size_t i = 0; i < item_len; i++)
{
// If it's a space, we don't want to include this.
if (filename[i] == ' ')
{
continue;
}
// Otherwise, add it to our ID string, lowered
id[current_char] = SDL_tolower(filename[i]);
current_char++;
if (current_char >= (id_size - 1))
{
break;
}
}
// Null-terminate the string
id[current_char] = '\0';
// Chop off the extension!
char* dot = SDL_strrchr(id, '.');
if (dot != NULL)
{
*dot = '\0';
}
}
static void add_builtin_sound(const char* id)
{
char asset_filename[256];
SDL_snprintf(asset_filename, sizeof(asset_filename), "sounds/%s.wav", id);
soundTracks.push_back(SoundTrack(asset_filename, id, false));
}
static void add_builtin_track(SDL_IOStream* rw, const char* track_name)
{
// Make an ID from the track name
char id[256];
SDL_strlcpy(id, track_name, sizeof(id));
// Strip "music/" prefix if it exists
if (SDL_strncmp(id, "music/", 6) == 0)
{
SDL_memmove(id, id + 6, SDL_strlen(id) - 5);
}
// Strip file extension if any
char* dot = SDL_strrchr(id, '.');
if (dot != NULL)
{
*dot = '\0';
}
musicTracks.push_back(MusicTrack(rw, id, false));
}
void musicclass::init(void) void musicclass::init(void)
{ {
if (FAudioCreate(&faudioctx, FAUDIO_1024_QUANTUM, FAUDIO_DEFAULT_PROCESSOR)) if (FAudioCreate(&faudioctx, 0, FAUDIO_DEFAULT_PROCESSOR))
{ {
vlog_error("Unable to initialize FAudio"); vlog_error("Unable to initialize FAudio");
return; return;
@@ -829,55 +744,34 @@ void musicclass::init(void)
SoundTrack::Init(44100); SoundTrack::Init(44100);
add_builtin_sound("jump"); soundTracks.push_back(SoundTrack( "sounds/jump.wav" ));
add_builtin_sound("jump2"); soundTracks.push_back(SoundTrack( "sounds/jump2.wav" ));
add_builtin_sound("hurt"); soundTracks.push_back(SoundTrack( "sounds/hurt.wav" ));
add_builtin_sound("souleyeminijingle"); soundTracks.push_back(SoundTrack( "sounds/souleyeminijingle.wav" ));
add_builtin_sound("coin"); soundTracks.push_back(SoundTrack( "sounds/coin.wav" ));
add_builtin_sound("save"); soundTracks.push_back(SoundTrack( "sounds/save.wav" ));
add_builtin_sound("crumble"); soundTracks.push_back(SoundTrack( "sounds/crumble.wav" ));
add_builtin_sound("vanish"); soundTracks.push_back(SoundTrack( "sounds/vanish.wav" ));
add_builtin_sound("blip"); soundTracks.push_back(SoundTrack( "sounds/blip.wav" ));
add_builtin_sound("preteleport"); soundTracks.push_back(SoundTrack( "sounds/preteleport.wav" ));
add_builtin_sound("teleport"); soundTracks.push_back(SoundTrack( "sounds/teleport.wav" ));
add_builtin_sound("crew1"); soundTracks.push_back(SoundTrack( "sounds/crew1.wav" ));
add_builtin_sound("crew2"); soundTracks.push_back(SoundTrack( "sounds/crew2.wav" ));
add_builtin_sound("crew3"); soundTracks.push_back(SoundTrack( "sounds/crew3.wav" ));
add_builtin_sound("crew4"); soundTracks.push_back(SoundTrack( "sounds/crew4.wav" ));
add_builtin_sound("crew5"); soundTracks.push_back(SoundTrack( "sounds/crew5.wav" ));
add_builtin_sound("crew6"); soundTracks.push_back(SoundTrack( "sounds/crew6.wav" ));
add_builtin_sound("terminal"); soundTracks.push_back(SoundTrack( "sounds/terminal.wav" ));
add_builtin_sound("gamesaved"); soundTracks.push_back(SoundTrack( "sounds/gamesaved.wav" ));
add_builtin_sound("crashing"); soundTracks.push_back(SoundTrack( "sounds/crashing.wav" ));
add_builtin_sound("blip2"); soundTracks.push_back(SoundTrack( "sounds/blip2.wav" ));
add_builtin_sound("countdown"); soundTracks.push_back(SoundTrack( "sounds/countdown.wav" ));
add_builtin_sound("go"); soundTracks.push_back(SoundTrack( "sounds/go.wav" ));
add_builtin_sound("crash"); soundTracks.push_back(SoundTrack( "sounds/crash.wav" ));
add_builtin_sound("combine"); soundTracks.push_back(SoundTrack( "sounds/combine.wav" ));
add_builtin_sound("newrecord"); soundTracks.push_back(SoundTrack( "sounds/newrecord.wav" ));
add_builtin_sound("trophy"); soundTracks.push_back(SoundTrack( "sounds/trophy.wav" ));
add_builtin_sound("rescue"); soundTracks.push_back(SoundTrack( "sounds/rescue.wav" ));
EnumHandle handle = {};
const char* item;
while ((item = FILESYSTEM_enumerateAssets("sounds", &handle)) != NULL)
{
char asset_filename[256];
char id[256];
SDL_snprintf(asset_filename, sizeof(asset_filename), "sounds/%s", item);
make_id_from_filename(id, sizeof(id), item);
if (soundidexists(id))
{
// Make sure we haven't already loaded this file
continue;
}
vlog_info("Reading extra sound file %s as %s", item, id);
soundTracks.push_back(SoundTrack(asset_filename, id, true));
}
FILESYSTEM_freeEnumerate(&handle);
#ifdef VVV_COMPILEMUSIC #ifdef VVV_COMPILEMUSIC
binaryBlob musicWriteBlob; binaryBlob musicWriteBlob;
@@ -894,41 +788,28 @@ void musicclass::init(void)
if (!mmmmmm_blob.unPackBinary("mmmmmm.vvv")) if (!mmmmmm_blob.unPackBinary("mmmmmm.vvv"))
{ {
// If mmmmmm.vvv is invalid, or doesn't exist...
SDL_IOStream* rw;
if (pppppp_blob.unPackBinary("vvvvvvmusic.vvv")) if (pppppp_blob.unPackBinary("vvvvvvmusic.vvv"))
{ {
vlog_info("Loading music from PPPPPP blob..."); vlog_info("Loading music from PPPPPP blob...");
mmmmmm = false; mmmmmm = false;
usingmmmmmm = false; usingmmmmmm=false;
int index; int index;
SDL_RWops* rw;
#define TRACK_LOAD_BLOB(blob, track_name) \ #define TRACK_LOAD_BLOB(blob, track_name) \
vlog_debug("Searching for track " track_name " as loose file"); \ index = blob.getIndex("data/" track_name); \
rw = FILESYSTEM_loadAssetRWops(track_name); \ if (index >= 0 && index < blob.max_headers) \
if (rw != NULL) \
{ \ { \
vlog_debug("Found loose music file " track_name); \ rw = SDL_RWFromConstMem(blob.getAddress(index), blob.getSize(index)); \
add_builtin_track(rw, track_name); \ if (rw == NULL) \
} \
else \
{ \
index = blob.getIndex("data/" track_name); \
if (index >= 0 && index < blob.max_headers) \
{ \ { \
rw = SDL_IOFromConstMem(blob.getAddress(index), blob.getSize(index)); \ vlog_error("Unable to read music file header: %s", SDL_GetError()); \
if (rw == NULL) \ } \
{ \ else \
vlog_error("Unable to read music file header: %s", SDL_GetError()); \ { \
} \ musicTracks.push_back(MusicTrack(rw)); \
else \
{ \
add_builtin_track(rw, track_name); \
} \
} \ } \
} }
@@ -940,23 +821,21 @@ void musicclass::init(void)
} }
else else
{ {
vlog_info("No music blobs found"); vlog_info("Loading music from loose files...");
#define TRACK_LOAD_LOOSE(_, track_name) \ SDL_RWops* rw;
vlog_debug("Searching for track " track_name " as loose file"); \
rw = FILESYSTEM_loadAssetRWops(track_name); \ #define FOREACH_TRACK(_, track_name) \
if (rw != NULL) \ rw = PHYSFSRWOPS_openRead(track_name); \
if (rw == NULL) \
{ \ { \
vlog_debug("Found loose music file \"" track_name "\""); \ vlog_error("Unable to read loose music file: %s", SDL_GetError()); \
add_builtin_track(rw, track_name); \
} \ } \
else \ else \
{ \ { \
vlog_error("Unable to load loose music file: %s", SDL_GetError()); \ musicTracks.push_back(MusicTrack(rw)); \
} }
#define FOREACH_TRACK(_, track_name) TRACK_LOAD_LOOSE(_, track_name)
TRACK_NAMES(_) TRACK_NAMES(_)
#undef FOREACH_TRACK #undef FOREACH_TRACK
@@ -968,7 +847,7 @@ void musicclass::init(void)
mmmmmm = true; mmmmmm = true;
int index; int index;
SDL_IOStream* rw; SDL_RWops* rw;
#define FOREACH_TRACK(blob, track_name) TRACK_LOAD_BLOB(blob, track_name) #define FOREACH_TRACK(blob, track_name) TRACK_LOAD_BLOB(blob, track_name)
@@ -979,8 +858,8 @@ void musicclass::init(void)
size_t index_ = 0; size_t index_ = 0;
while (mmmmmm_blob.nextExtra(&index_)) while (mmmmmm_blob.nextExtra(&index_))
{ {
rw = SDL_IOFromConstMem(mmmmmm_blob.getAddress(index_), mmmmmm_blob.getSize(index_)); rw = SDL_RWFromConstMem(mmmmmm_blob.getAddress(index_), mmmmmm_blob.getSize(index_));
add_builtin_track(rw, mmmmmm_blob.m_headers[index_].name); musicTracks.push_back(MusicTrack( rw ));
num_mmmmmm_tracks++; num_mmmmmm_tracks++;
index_++; index_++;
@@ -997,58 +876,16 @@ void musicclass::init(void)
num_pppppp_tracks += musicTracks.size() - num_mmmmmm_tracks; num_pppppp_tracks += musicTracks.size() - num_mmmmmm_tracks;
SDL_IOStream* rw; SDL_RWops* rw;
size_t index_ = 0; size_t index_ = 0;
while (pppppp_blob.nextExtra(&index_)) while (pppppp_blob.nextExtra(&index_))
{ {
rw = SDL_IOFromConstMem(pppppp_blob.getAddress(index_), pppppp_blob.getSize(index_)); rw = SDL_RWFromConstMem(pppppp_blob.getAddress(index_), pppppp_blob.getSize(index_));
add_builtin_track(rw, pppppp_blob.m_headers[index_].name); musicTracks.push_back(MusicTrack( rw ));
num_pppppp_tracks++; num_pppppp_tracks++;
index_++; index_++;
} }
EnumHandle music_handle = {};
const char* music_item;
while ((music_item = FILESYSTEM_enumerateAssets("music", &music_handle)) != NULL)
{
char asset_filename[256];
char id[256];
SDL_snprintf(asset_filename, sizeof(asset_filename), "music/%s", music_item);
make_id_from_filename(id, sizeof(id), music_item);
if (idexists(id))
{
// Make sure we haven't already loaded this file
continue;
}
vlog_info("Reading loose extra music file %s as %s", music_item, id);
unsigned char* mem;
size_t len;
FILESYSTEM_loadAssetToMemory(asset_filename, &mem, &len);
if (mem == NULL)
{
vlog_error("Unable to load loose extra music file to memory: %s", SDL_GetError());
}
else
{
rw = SDL_IOFromConstMem(mem, len);
if (rw == NULL)
{
vlog_error("Unable to read loose extra music file from memory: %s", SDL_GetError());
}
else
{
musicTracks.push_back(MusicTrack(rw, id, true));
num_pppppp_tracks++;
}
VVV_free(mem);
}
}
FILESYSTEM_freeEnumerate(&music_handle);
} }
void musicclass::destroy(void) void musicclass::destroy(void)
@@ -1072,17 +909,7 @@ void musicclass::destroy(void)
VVV_freefunc(FAudio_Release, faudioctx); VVV_freefunc(FAudio_Release, faudioctx);
} }
void musicclass::set_music_volume(int volume) void musicclass::play(int t)
{
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);
}
bool musicclass::play(int t)
{ {
if (mmmmmm && usingmmmmmm) if (mmmmmm && usingmmmmmm)
{ {
@@ -1106,7 +933,7 @@ bool musicclass::play(int t)
if (currentsong == t && !m_doFadeOutVol) if (currentsong == t && !m_doFadeOutVol)
{ {
return true; return;
} }
currentsong = t; currentsong = t;
@@ -1114,14 +941,14 @@ bool musicclass::play(int t)
if (t == -1) if (t == -1)
{ {
return true; return;
} }
if (!INBOUNDS_VEC(t, musicTracks)) if (!INBOUNDS_VEC(t, musicTracks))
{ {
vlog_error("play() out-of-bounds!"); vlog_error("play() out-of-bounds!");
currentsong = -1; currentsong = -1;
return false; return;
} }
if (currentsong == Music_PATHCOMPLETE || if (currentsong == Music_PATHCOMPLETE ||
@@ -1134,8 +961,8 @@ bool musicclass::play(int t)
{ {
m_doFadeInVol = false; m_doFadeInVol = false;
m_doFadeOutVol = false; m_doFadeOutVol = false;
controlVolume = VVV_MAX_VOLUME; musicVolume = VVV_MAX_VOLUME;
set_music_volume(controlVolume); MusicTrack::SetVolume(VVV_MAX_VOLUME * user_music_volume / USER_VOLUME_MAX);
} }
} }
else else
@@ -1163,51 +990,6 @@ bool musicclass::play(int t)
fadeMusicVolumeIn(3000); fadeMusicVolumeIn(3000);
} }
} }
return true;
}
bool musicclass::playid(const char* id)
{
for (size_t i = 0; i < musicTracks.size(); i++)
{
if (SDL_strcmp(musicTracks[i].id, id) == 0)
{
return play(i);
}
}
vlog_error("playid() couldn't find music ID: %s", id);
return false;
}
bool musicclass::idexists(const char* id)
{
for (size_t i = 0; i < musicTracks.size(); i++)
{
if (SDL_strcmp(musicTracks[i].id, id) == 0)
{
return true;
}
}
return false;
}
bool musicclass::isextra(int t)
{
if (INBOUNDS_VEC(t, musicTracks))
{
return musicTracks[t].loose_extra;
}
return false;
}
const char* musicclass::getid(int t)
{
if (INBOUNDS_VEC(t, musicTracks))
{
return musicTracks[t].id;
}
return NULL;
} }
void musicclass::resume(void) void musicclass::resume(void)
@@ -1258,7 +1040,7 @@ void musicclass::haltdasmusik(const bool from_fade)
void musicclass::silencedasmusik(void) void musicclass::silencedasmusik(void)
{ {
controlVolume = 0; musicVolume = 0;
m_doFadeInVol = false; m_doFadeInVol = false;
m_doFadeOutVol = false; m_doFadeOutVol = false;
} }
@@ -1315,10 +1097,10 @@ void musicclass::fadeMusicVolumeIn(int ms)
m_doFadeOutVol = false; m_doFadeOutVol = false;
/* Ensure it starts at 0 */ /* Ensure it starts at 0 */
controlVolume = 0; musicVolume = 0;
/* Fix 1-frame glitch */ /* Fix 1-frame glitch */
set_music_volume(0); MusicTrack::SetVolume(0);
fade.step_ms = 0; fade.step_ms = 0;
fade.duration_ms = ms; fade.duration_ms = ms;
@@ -1338,8 +1120,8 @@ void musicclass::fadeMusicVolumeOut(const int fadeout_ms)
fade.step_ms = 0; fade.step_ms = 0;
/* Duration is proportional to current volume. */ /* Duration is proportional to current volume. */
fade.duration_ms = fadeout_ms * controlVolume / VVV_MAX_VOLUME; fade.duration_ms = fadeout_ms * musicVolume / VVV_MAX_VOLUME;
fade.start_volume = controlVolume; fade.start_volume = musicVolume;
fade.end_volume = 0; fade.end_volume = 0;
} }
@@ -1351,7 +1133,7 @@ void musicclass::fadeout(const bool quick_fade_ /*= true*/)
void musicclass::processmusicfadein(void) void musicclass::processmusicfadein(void)
{ {
enum FadeCode fade_code = processmusicfade(&fade, &controlVolume); enum FadeCode fade_code = processmusicfade(&fade, &musicVolume);
if (fade_code == Fade_finished) if (fade_code == Fade_finished)
{ {
m_doFadeInVol = false; m_doFadeInVol = false;
@@ -1360,10 +1142,10 @@ void musicclass::processmusicfadein(void)
void musicclass::processmusicfadeout(void) void musicclass::processmusicfadeout(void)
{ {
enum FadeCode fade_code = processmusicfade(&fade, &controlVolume); enum FadeCode fade_code = processmusicfade(&fade, &musicVolume);
if (fade_code == Fade_finished) if (fade_code == Fade_finished)
{ {
controlVolume = 0; musicVolume = 0;
m_doFadeOutVol = false; m_doFadeOutVol = false;
haltdasmusik(true); haltdasmusik(true);
} }
@@ -1489,61 +1271,13 @@ void musicclass::changemusicarea(int x, int y)
niceplay(track); niceplay(track);
} }
bool musicclass::playef(int t) void musicclass::playef(int t)
{ {
if (!INBOUNDS_VEC(t, soundTracks)) if (!INBOUNDS_VEC(t, soundTracks))
{ {
return false; return;
} }
if (soundTracks[t].valid) soundTracks[t].Play();
{
soundTracks[t].Play();
return true;
}
return false;
}
bool musicclass::playefid(const char* id)
{
for (size_t i = 0; i < soundTracks.size(); i++)
{
if (SDL_strcmp(soundTracks[i].id, id) == 0)
{
return playef(i);
}
}
vlog_error("playefid() couldn't find sound ID: %s", id);
return false;
}
bool musicclass::soundidexists(const char* id)
{
for (size_t i = 0; i < soundTracks.size(); i++)
{
if (SDL_strcmp(soundTracks[i].id, id) == 0)
{
return true;
}
}
return false;
}
bool musicclass::soundisextra(int t)
{
if (INBOUNDS_VEC(t, soundTracks))
{
return soundTracks[t].extra;
}
return false;
}
const char* musicclass::getsoundid(int t)
{
if (INBOUNDS_VEC(t, soundTracks))
{
return soundTracks[t].id;
}
return NULL;
} }
void musicclass::pauseef(void) void musicclass::pauseef(void)
@@ -1565,20 +1299,20 @@ void musicclass::updatemutestate(void)
{ {
if (game.muted) if (game.muted)
{ {
set_music_volume(0); MusicTrack::SetVolume(0);
set_sound_volume(0); SoundTrack::SetVolume(0);
} }
else else
{ {
set_sound_volume(VVV_MAX_VOLUME); SoundTrack::SetVolume(VVV_MAX_VOLUME * user_sound_volume / USER_VOLUME_MAX);
if (game.musicmuted) if (game.musicmuted)
{ {
set_music_volume(0); MusicTrack::SetVolume(0);
} }
else else
{ {
set_music_volume(controlVolume); MusicTrack::SetVolume(musicVolume * user_music_volume / USER_VOLUME_MAX);
} }
} }
} }
+3 -14
View File
@@ -70,14 +70,7 @@ public:
void init(void); void init(void);
void destroy(void); void destroy(void);
void set_music_volume(int volume); void play(int t);
void set_sound_volume(int volume);
bool play(int t);
bool playid(const char* id);
bool idexists(const char* id);
bool isextra(int t);
const char* getid(int t);
void resume(void); void resume(void);
void resumefade(const int fadein_ms); void resumefade(const int fadein_ms);
void pause(void); void pause(void);
@@ -98,11 +91,7 @@ public:
int currentsong; int currentsong;
int haltedsong; int haltedsong;
bool playef(int t); void playef(int t);
bool playefid(const char* id);
bool soundidexists(const char* id);
bool soundisextra(int t);
const char* getsoundid(int t);
void pauseef(void); void pauseef(void);
void resumeef(void); void resumeef(void);
@@ -116,7 +105,7 @@ public:
bool m_doFadeInVol; bool m_doFadeInVol;
bool m_doFadeOutVol; bool m_doFadeOutVol;
int controlVolume; int musicVolume;
/* 0..USER_VOLUME_MAX */ /* 0..USER_VOLUME_MAX */
int user_music_volume; int user_music_volume;
+1 -2
View File
@@ -1,7 +1,6 @@
#include "Otherlevel.h" #include "Otherlevel.h"
#include "Game.h" #include "Game.h"
#include "Graphics.h"
#include "Entity.h" #include "Entity.h"
#include "MakeAndPlay.h" #include "MakeAndPlay.h"
#include "UtilityClass.h" #include "UtilityClass.h"
@@ -8905,7 +8904,7 @@ const short* otherlevelclass::loadlevel(int rx, int ry)
//violet //violet
obj.createentity(83, 126, 18, 20, 0, 18); obj.createentity(83, 126, 18, 20, 0, 18);
int crewman = obj.getcrewman(EntityColour_CREW_PURPLE); int crewman = obj.getcrewman(PURPLE);
if (INBOUNDS_VEC(crewman, obj.entities)) if (INBOUNDS_VEC(crewman, obj.entities))
{ {
obj.entities[crewman].rule = 7; obj.entities[crewman].rule = 7;
+1 -12
View File
@@ -1,17 +1,6 @@
#ifndef RELEASEVERSION_H #ifndef RELEASEVERSION_H
#define RELEASEVERSION_H #define RELEASEVERSION_H
#define MAJOR_VERSION 2 #define RELEASE_VERSION "v2.4.3"
#define MINOR_VERSION 5
#define PATCH_VERSION 0
#define VVV_STRINGIFY(x) #x
#define VVV_TOSTRING(x) VVV_STRINGIFY(x)
#if PATCH_VERSION == 0
#define RELEASE_VERSION "v" VVV_TOSTRING(MAJOR_VERSION) "." VVV_TOSTRING(MINOR_VERSION)
#else
#define RELEASE_VERSION "v" VVV_TOSTRING(MAJOR_VERSION) "." VVV_TOSTRING(MINOR_VERSION) "." VVV_TOSTRING(PATCH_VERSION)
#endif
#endif /* RELEASEVERSION_H */ #endif /* RELEASEVERSION_H */
+102 -116
View File
@@ -1,4 +1,4 @@
#include <SDL3/SDL.h> #include <SDL.h>
#include "ActionSets.h" #include "ActionSets.h"
#include "ButtonGlyphs.h" #include "ButtonGlyphs.h"
@@ -32,6 +32,15 @@ static int tr;
static int tg; static int tg;
static int tb; static int tb;
struct MapRenderData
{
int zoom;
int xoff;
int yoff;
int legendxoff;
int legendyoff;
};
static inline void drawslowdowntext(const int y) static inline void drawslowdowntext(const int y)
{ {
switch (game.slowdown) switch (game.slowdown)
@@ -105,7 +114,7 @@ static void volumesliderrender(void)
} }
char slider[40 + 1]; char slider[40 + 1];
slider_get(slider, sizeof(slider), volume_max_position * volume / USER_VOLUME_MAX, volume_max_position + 1, 240); slider_get(slider, sizeof(slider), volume_max_position*volume/USER_VOLUME_MAX, volume_max_position+1, 240);
char buffer[SCREEN_WIDTH_CHARS + 1]; char buffer[SCREEN_WIDTH_CHARS + 1];
@@ -1209,7 +1218,6 @@ static void menurender(void)
break; break;
} }
case 2: case 2:
{
font::print(PR_2X | PR_CEN, -1, 30, loc::gettext("Room Name BG"), tr, tg, tb); 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); 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);
if (graphics.translucentroomname) if (graphics.translucentroomname)
@@ -1218,21 +1226,6 @@ static void menurender(void)
font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Room name background is OPAQUE"), tr, tg, tb); font::print_wrap(PR_CEN, -1, next_y, loc::gettext("Room name background is OPAQUE"), tr, tg, tb);
break; 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; break;
case Menu::accessibility: case Menu::accessibility:
{ {
@@ -1873,7 +1866,7 @@ static void menurender(void)
{ {
if (game.currentmenuoption == 1) if (game.currentmenuoption == 1)
{ {
if (SDL_GetHintBoolean("SteamDeck", false)) 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); 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);
} }
@@ -2859,26 +2852,42 @@ static void draw_roomname_menu(void)
#define FLIP_PR_CJK_LOW (graphics.flipmode ? PR_CJK_HIGH : PR_CJK_LOW) #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) #define FLIP_PR_CJK_HIGH (graphics.flipmode ? PR_CJK_LOW : PR_CJK_HIGH)
static MapRenderData getmaprenderdata(void)
{
MapRenderData data;
data.zoom = map.custommode ? map.customzoom : 1;
data.xoff = map.custommode ? map.custommmxoff : 0;
data.yoff = map.custommode ? map.custommmyoff : 0;
data.legendxoff = 40 + data.xoff;
data.legendyoff = 21 + data.yoff;
// Magic numbers for centering legend tiles.
switch (data.zoom)
{
case 4:
data.legendxoff += 20;
data.legendyoff += 14;
break;
case 2:
data.legendxoff += 8;
data.legendyoff += 5;
break;
default:
data.legendxoff += 2;
data.legendyoff += 1;
break;
}
return data;
}
static void rendermap(void) static void rendermap(void)
{ {
if (map.custommode && map.customshowmm) if (map.custommode && map.customshowmm)
{ {
const MapRenderData data = map.get_render_data(); graphics.drawpixeltextbox(35 + map.custommmxoff, 16 + map.custommmyoff, map.custommmxsize + 10, map.custommmysize + 10, 65, 185, 207);
graphics.drawpartimage(graphics.minimap_mounted ? IMAGE_MINIMAP : IMAGE_CUSTOMMINIMAP, 40 + map.custommmxoff, 21 + map.custommmyoff, map.custommmxsize, map.custommmysize);
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; return;
} }
@@ -2888,11 +2897,11 @@ static void rendermap(void)
static void rendermapfog(void) static void rendermapfog(void)
{ {
const MapRenderData data = map.get_render_data(); const MapRenderData data = getmaprenderdata();
for (int j = data.starty; j < data.starty + data.height; j++) for (int j = 0; j < map.getheight(); j++)
{ {
for (int i = data.startx; i < data.startx + data.width; i++) for (int i = 0; i < map.getwidth(); i++)
{ {
if (!map.isexplored(i, j)) if (!map.isexplored(i, j))
{ {
@@ -2901,7 +2910,7 @@ static void rendermapfog(void)
{ {
for (int y = 0; y < data.zoom; y++) 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); graphics.drawimage(IMAGE_COVERED, data.xoff + 40 + (x * 12) + (i * (12 * data.zoom)), data.yoff + 21 + (y * 9) + (j * (9 * data.zoom)), false);
} }
} }
} }
@@ -2913,22 +2922,17 @@ static void rendermaplegend(void)
{ {
// Draw the map legend, aka teleports/targets/trinkets // Draw the map legend, aka teleports/targets/trinkets
const MapRenderData data = map.get_render_data(); const MapRenderData data = getmaprenderdata();
for (size_t i = 0; i < map.teleporters.size(); i++) for (size_t i = 0; i < map.teleporters.size(); i++)
{ {
int x = map.teleporters[i].x - data.startx; if (map.showteleporters && map.isexplored(map.teleporters[i].x, map.teleporters[i].y))
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 + (map.teleporters[i].x * 12 * data.zoom), data.legendyoff + (map.teleporters[i].y * 9 * data.zoom), "💿", 171, 255, 252);
{ }
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(map.teleporters[i].x, map.teleporters[i].y))
} {
else if (map.showtargets && !map.isexplored(x + data.startx, y + data.starty)) font::print(PR_FONT_8X8 | PR_FULLBOR, data.legendxoff + (map.teleporters[i].x * 12 * data.zoom), data.legendyoff + (map.teleporters[i].y * 9 * data.zoom), "❓", 64, 64, 64);
{
font::print(PR_FONT_8X8 | PR_FULLBOR, data.legendxoff + (x * 12 * data.zoom), data.legendyoff + (y * 9 * data.zoom), "❓", 64, 64, 64);
}
} }
} }
@@ -2938,12 +2942,7 @@ static void rendermaplegend(void)
{ {
if (!obj.collect[i]) if (!obj.collect[i])
{ {
int x = map.shinytrinkets[i].x - data.startx; font::print(PR_FONT_8X8 | PR_FULLBOR, data.legendxoff + (map.shinytrinkets[i].x * 12 * data.zoom), data.legendyoff + (map.shinytrinkets[i].y * 9 * data.zoom), "🪙", 254, 252, 58);
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);
}
} }
} }
} }
@@ -2951,45 +2950,44 @@ static void rendermaplegend(void)
static void rendermapcursor(const bool flashing) static void rendermapcursor(const bool flashing)
{ {
const MapRenderData data = map.get_render_data(); const MapRenderData data = getmaprenderdata();
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) if (!map.custommode && game.roomx == 109)
{ {
// Draw the tower specially // Draw the tower specially
if (!flashing || game.noflashingmode) 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)); graphics.draw_rect(40 + ((game.roomx - 100) * 12) + 2, 21 + 2, 12 - 4, 180 - 4, 16, 245 - (help.glow * 2), 245 - (help.glow * 2));
} }
else if (map.cursorstate == 1) else if (map.cursorstate == 1)
{ {
if (int(map.cursordelay / 4) % 2 == 0) if (int(map.cursordelay / 4) % 2 == 0)
{ {
graphics.draw_rect(40 + pixels_x, 21, 12, 180, 255, 255, 255); graphics.draw_rect(40 + ((game.roomx - 100) * 12), 21, 12, 180, 255, 255, 255);
graphics.draw_rect(40 + pixels_x + 2, 21 + 2, 12 - 4, 180 - 4, 255, 255, 255); graphics.draw_rect(40 + ((game.roomx - 100) * 12) + 2, 21 + 2, 12 - 4, 180 - 4, 255, 255, 255);
} }
} }
else if (map.cursorstate == 2 && (int(map.cursordelay / 15) % 2 == 0)) 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)); graphics.draw_rect(40 + ((game.roomx - 100) * 12) + 2, 21 + 2, 12 - 4, 180 - 4, 16, 245 - (help.glow), 245 - (help.glow));
} }
return; 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))
{ {
if (!flashing || ((map.cursorstate == 2 && int(map.cursordelay / 15) % 2 == 0) || game.noflashingmode)) int margin = (data.zoom == 4) ? 2 : 1;
{ graphics.draw_rect(
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)); 40 + ((game.roomx - 100) * 12 * data.zoom) + margin + data.xoff,
} 21 + ((game.roomy - 100) * 9 * data.zoom) + margin + data.yoff,
else if (map.cursorstate == 1 && int(map.cursordelay / 4) % 2 == 0) (12 * data.zoom) - (2 * margin), (9 * data.zoom) - (2 * margin),
{ 16, 245 - (help.glow), 245 - (help.glow)
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); }
} else if (map.cursorstate == 1 && int(map.cursordelay / 4) % 2 == 0)
{
graphics.draw_rect(40 + ((game.roomx - 100) * 12 * data.zoom) + data.xoff, 21 + ((game.roomy - 100) * 9 * data.zoom) + data.yoff, 12 * data.zoom, 9 * data.zoom, 255, 255, 255);
graphics.draw_rect(40 + ((game.roomx - 100) * 12 * data.zoom) + 2 + data.xoff, 21 + ((game.roomy - 100) * 9 * data.zoom) + 2 + data.yoff, (12 * data.zoom) - 4, (9 * data.zoom) - 4, 255, 255, 255);
} }
} }
@@ -3181,30 +3179,26 @@ void maprender(void)
font::print(title_flags | PR_2X | PR_CEN, -1, FLIP(45, 8), meta.title, 196, 196, 255 - help.glow); 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 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); 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(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(70+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); font::print(PR_FONT_LEVEL | PR_CEN, -1, FLIP(70+sp*4, 8), meta.Desc2, 196, 196, 255 - help.glow);
if (sp <= 10) if (sp <= 10)
{ {
font::print(PR_FONT_LEVEL | PR_CEN, -1, FLIP(desc_pos + sp*5, 8), meta.Desc3, 196, 196, 255 - help.glow); font::print(PR_FONT_LEVEL | PR_CEN, -1, FLIP(70+sp*5, 8), meta.Desc3, 196, 196, 255 - help.glow);
} }
if (cl.numcrewmates() > 0) int remaining = cl.numcrewmates() - game.crewmates();
{
int remaining = cl.numcrewmates() - game.crewmates();
char buffer[SCREEN_WIDTH_CHARS + 1]; char buffer[SCREEN_WIDTH_CHARS + 1];
loc::gettext_plural_fill( loc::gettext_plural_fill(
buffer, sizeof(buffer), buffer, sizeof(buffer),
"{n_crew|wordy} crewmates remain", "{n_crew|wordy} crewmates remain",
"{n_crew|wordy} crewmate remains", "{n_crew|wordy} crewmate remains",
"n_crew:int", "n_crew:int",
remaining remaining
); );
font::print_wrap(PR_CEN, -1, FLIP(165, 8), buffer, 196, 196, 255 - help.glow); font::print_wrap(PR_CEN, -1, FLIP(165, 8), buffer, 196, 196, 255 - help.glow);
}
} }
else else
{ {
@@ -3277,29 +3271,21 @@ void maprender(void)
} }
/* Stats. */ /* Stats. */
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);
// Always show trinkets if you're in the main game, otherwise only show them if any exist in the level font::print(PR_CEN | FLIP_PR_CJK_HIGH, -1, FLIP(102, 8), loc::gettext("[Number of Deaths]"), 196, 196, 255 - help.glow);
bool show_trinkets = map.custommode ? (cl.numtrinkets() > 0) : true; font::print(PR_CEN | FLIP_PR_CJK_LOW, -1, FLIP(114, 8), help.String(game.deathcounts), 96, 96, 96);
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_HIGH, -1, FLIP(152, 8), loc::gettext("[Time Taken]"), 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_LOW, -1, FLIP(164, 8), game.timestring(), 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; break;
} }
case 3: case 3:
@@ -3568,7 +3554,7 @@ void teleporterrender(void)
// Draw a box around the currently selected teleporter // Draw a box around the currently selected teleporter
const MapRenderData data = map.get_render_data(); const MapRenderData data = getmaprenderdata();
if (game.useteleporter) if (game.useteleporter)
{ {
+4 -4
View File
@@ -323,7 +323,7 @@ namespace roomname_translator
if (help_screen) if (help_screen)
{ {
if ((key.isDown(SDLK_LCTRL) || key.isDown(SDLK_RCTRL)) && key_pressed_once(SDLK_E, &held_e)) if ((key.isDown(SDLK_LCTRL) || key.isDown(SDLK_RCTRL)) && key_pressed_once(SDLK_e, &held_e))
{ {
expl_mode = !expl_mode; expl_mode = !expl_mode;
} }
@@ -386,7 +386,7 @@ namespace roomname_translator
edit_mode = !edit_mode; edit_mode = !edit_mode;
} }
if (key_pressed_once(SDLK_I, &held_i)) if (key_pressed_once(SDLK_i, &held_i))
{ {
if (game.intimetrial) if (game.intimetrial)
{ {
@@ -412,13 +412,13 @@ namespace roomname_translator
return true; return true;
} }
if ((key.isDown(SDLK_LCTRL) || key.isDown(SDLK_RCTRL)) && key_pressed_once(SDLK_E, &held_e)) if ((key.isDown(SDLK_LCTRL) || key.isDown(SDLK_RCTRL)) && key_pressed_once(SDLK_e, &held_e))
{ {
expl_mode = !expl_mode; expl_mode = !expl_mode;
return true; return true;
} }
if (key_pressed_once(SDLK_RETURN, &held_return) || key_pressed_once(SDLK_E, &held_e)) if (key_pressed_once(SDLK_RETURN, &held_return) || key_pressed_once(SDLK_e, &held_e))
{ {
if (map.roomname_special || map.roomname[0] == '\0') if (map.roomname_special || map.roomname[0] == '\0')
{ {
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef ROOMNAMETRANSLATOR_H #ifndef ROOMNAMETRANSLATOR_H
#define ROOMNAMETRANSLATOR_H #define ROOMNAMETRANSLATOR_H
#include <SDL3/SDL.h> #include <SDL.h>
namespace roomname_translator namespace roomname_translator
{ {
-23
View File
@@ -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 <SDL3/SDL_main.h>
#if defined(SDL_PLATFORM_IOS) || defined(SDL_PLATFORM_TVOS)
#ifndef SDL_MAIN_HANDLED
#ifdef main
#undef main
#endif
int main(int argc, char *argv[])
{
return SDL_RunApp(argc, argv, SDL_main, NULL);
}
#endif /* !SDL_MAIN_HANDLED */
#endif /* SDL_PLATFORM_IOS || SDL_PLATFORM_TVOS */
/* vi: set ts=4 sw=4 expandtab: */
+27 -30
View File
@@ -1,7 +1,7 @@
#define GAMESCREEN_DEFINITION #define GAMESCREEN_DEFINITION
#include "Screen.h" #include "Screen.h"
#include <SDL3/SDL.h> #include <SDL.h>
#include "Alloc.h" #include "Alloc.h"
#include "Constants.h" #include "Constants.h"
@@ -12,7 +12,7 @@
#include "Game.h" #include "Game.h"
#include "Graphics.h" #include "Graphics.h"
#include "GraphicsUtil.h" #include "GraphicsUtil.h"
#ifndef SDL_PLATFORM_APPLE #ifndef __APPLE__
#include "GraphicsResources.h" #include "GraphicsResources.h"
#endif #endif
#include "InterimVersion.h" #include "InterimVersion.h"
@@ -50,9 +50,11 @@ void Screen::init(const struct ScreenSettings* settings)
m_window = SDL_CreateWindow( m_window = SDL_CreateWindow(
"VVVVVV", "VVVVVV",
SDL_WINDOWPOS_CENTERED_DISPLAY(windowDisplay),
SDL_WINDOWPOS_CENTERED_DISPLAY(windowDisplay),
SCREEN_WIDTH_PIXELS * 2, SCREEN_WIDTH_PIXELS * 2,
SCREEN_HEIGHT_PIXELS * 2, SCREEN_HEIGHT_PIXELS * 2,
SDL_WINDOW_HIDDEN | SDL_WINDOW_RESIZABLE | SDL_WINDOW_HIGH_PIXEL_DENSITY SDL_WINDOW_HIDDEN | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI
); );
if (m_window == NULL) if (m_window == NULL)
@@ -61,13 +63,7 @@ void Screen::init(const struct ScreenSettings* settings)
VVV_exit(1); VVV_exit(1);
} }
SDL_SetWindowPosition( m_renderer = SDL_CreateRenderer(m_window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE);
m_window,
SDL_WINDOWPOS_CENTERED_DISPLAY(windowDisplay),
SDL_WINDOWPOS_CENTERED_DISPLAY(windowDisplay)
);
m_renderer = SDL_CreateRenderer(m_window, NULL);
if (m_renderer == NULL) if (m_renderer == NULL)
{ {
@@ -75,9 +71,7 @@ void Screen::init(const struct ScreenSettings* settings)
VVV_exit(1); VVV_exit(1);
} }
SDL_SetDefaultTextureScaleMode(m_renderer, SDL_SCALEMODE_NEAREST); SDL_RenderSetVSync(m_renderer, (int) vsync);
SDL_SetRenderVSync(m_renderer, (int) vsync);
#ifdef INTERIM_VERSION_EXISTS #ifdef INTERIM_VERSION_EXISTS
/* Branch name limits are ill-defined but on GitHub it's ~256 chars /* Branch name limits are ill-defined but on GitHub it's ~256 chars
@@ -106,7 +100,7 @@ void Screen::destroy(void)
void Screen::GetSettings(struct ScreenSettings* settings) void Screen::GetSettings(struct ScreenSettings* settings)
{ {
windowDisplay = SDL_GetDisplayForWindow(m_window); windowDisplay = SDL_GetWindowDisplayIndex(m_window);
if (windowDisplay < 0) if (windowDisplay < 0)
{ {
vlog_error("Error: could not get display index: %s", SDL_GetError()); vlog_error("Error: could not get display index: %s", SDL_GetError());
@@ -123,7 +117,7 @@ void Screen::GetSettings(struct ScreenSettings* settings)
settings->badSignal = badSignalEffect; settings->badSignal = badSignalEffect;
} }
#ifdef SDL_PLATFORM_APPLE #ifdef __APPLE__
/* Apple doesn't like icons anymore... */ /* Apple doesn't like icons anymore... */
void Screen::LoadIcon(void) void Screen::LoadIcon(void)
{ {
@@ -138,13 +132,13 @@ void Screen::LoadIcon(void)
return; return;
} }
SDL_SetWindowIcon(m_window, icon); SDL_SetWindowIcon(m_window, icon);
VVV_freefunc(SDL_DestroySurface, icon); VVV_freefunc(SDL_FreeSurface, icon);
} }
#endif /* SDL_PLATFORM_APPLE */ #endif /* __APPLE__ */
void Screen::ResizeScreen(int x, int y) void Screen::ResizeScreen(int x, int y)
{ {
windowDisplay = SDL_GetDisplayForWindow(m_window); windowDisplay = SDL_GetWindowDisplayIndex(m_window);
if (windowDisplay < 0) if (windowDisplay < 0)
{ {
vlog_error("Error: could not get display index: %s", SDL_GetError()); vlog_error("Error: could not get display index: %s", SDL_GetError());
@@ -160,7 +154,8 @@ void Screen::ResizeScreen(int x, int y)
if (!isWindowed || isForcedFullscreen()) if (!isWindowed || isForcedFullscreen())
{ {
if (!SDL_SetWindowFullscreen(m_window, true)) int result = SDL_SetWindowFullscreen(m_window, SDL_WINDOW_FULLSCREEN_DESKTOP);
if (result != 0)
{ {
vlog_error("Error: could not set the game to fullscreen mode: %s", SDL_GetError()); vlog_error("Error: could not set the game to fullscreen mode: %s", SDL_GetError());
return; return;
@@ -168,7 +163,8 @@ void Screen::ResizeScreen(int x, int y)
} }
else else
{ {
if (!SDL_SetWindowFullscreen(m_window, false)) int result = SDL_SetWindowFullscreen(m_window, 0);
if (result != 0)
{ {
vlog_error("Error: could not set the game to windowed mode: %s", SDL_GetError()); vlog_error("Error: could not set the game to windowed mode: %s", SDL_GetError());
} }
@@ -186,14 +182,15 @@ void Screen::ResizeScreen(int x, int y)
static void constrain_to_desktop(int display_index, int* width, int* height) static void constrain_to_desktop(int display_index, int* width, int* height)
{ {
const SDL_DisplayMode *display_mode = SDL_GetDesktopDisplayMode(display_index); SDL_DisplayMode display_mode = {};
if (display_mode == NULL) int success = SDL_GetDesktopDisplayMode(display_index, &display_mode);
if (success != 0)
{ {
vlog_error("Could not get desktop display mode: %s", SDL_GetError()); vlog_error("Could not get desktop display mode: %s", SDL_GetError());
return; return;
} }
while ((*width > display_mode->w || *height > display_mode->h) while ((*width > display_mode.w || *height > display_mode.h)
&& *width > SCREEN_WIDTH_PIXELS && *height > SCREEN_HEIGHT_PIXELS) && *width > SCREEN_WIDTH_PIXELS && *height > SCREEN_HEIGHT_PIXELS)
{ {
// We are too big, take away one multiple // We are too big, take away one multiple
@@ -260,7 +257,7 @@ void Screen::ResizeToNearestMultiple(void)
h = final_dimension; h = final_dimension;
} }
windowDisplay = SDL_GetDisplayForWindow(m_window); windowDisplay = SDL_GetWindowDisplayIndex(m_window);
if (windowDisplay < 0) if (windowDisplay < 0)
{ {
vlog_error("Could not get display index: %s", SDL_GetError()); vlog_error("Could not get display index: %s", SDL_GetError());
@@ -274,7 +271,7 @@ void Screen::ResizeToNearestMultiple(void)
void Screen::GetScreenSize(int* x, int* y) void Screen::GetScreenSize(int* x, int* y)
{ {
if (!SDL_GetCurrentRenderOutputSize(m_renderer, x, y)) if (SDL_GetRendererOutputSize(m_renderer, x, y) != 0)
{ {
vlog_error("Could not get window size: %s", SDL_GetError()); vlog_error("Could not get window size: %s", SDL_GetError());
/* Initialize to safe defaults */ /* Initialize to safe defaults */
@@ -343,19 +340,19 @@ void Screen::toggleLinearFilter(void)
SDL_SetTextureScaleMode( SDL_SetTextureScaleMode(
graphics.gameTexture, graphics.gameTexture,
isFiltered ? SDL_SCALEMODE_LINEAR : SDL_SCALEMODE_NEAREST isFiltered ? SDL_ScaleModeLinear : SDL_ScaleModeNearest
); );
SDL_SetTextureScaleMode( SDL_SetTextureScaleMode(
graphics.tempShakeTexture, graphics.tempShakeTexture,
isFiltered ? SDL_SCALEMODE_LINEAR : SDL_SCALEMODE_NEAREST isFiltered ? SDL_ScaleModeLinear : SDL_ScaleModeNearest
); );
} }
void Screen::toggleVSync(void) void Screen::toggleVSync(void)
{ {
vsync = !vsync; vsync = !vsync;
SDL_SetRenderVSync(m_renderer, (int) vsync); SDL_RenderSetVSync(m_renderer, (int) vsync);
} }
void Screen::recacheTextures(void) void Screen::recacheTextures(void)
@@ -391,9 +388,9 @@ bool Screen::isForcedFullscreen(void)
* If you're working on a tenfoot-only build, add a def that always * If you're working on a tenfoot-only build, add a def that always
* returns true! * returns true!
*/ */
#if defined(SDL_PLATFORM_ANDROID) || TARGET_OS_IPHONE #ifdef __ANDROID__
return true; return true;
#else #else
return SDL_GetHintBoolean("SteamTenfoot", false); return SDL_GetHintBoolean("SteamTenfoot", SDL_FALSE);
#endif #endif
} }
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef SCREEN_H #ifndef SCREEN_H
#define SCREEN_H #define SCREEN_H
#include <SDL3/SDL.h> #include <SDL.h>
#include "ScreenSettings.h" #include "ScreenSettings.h"
+73 -289
View File
@@ -2,7 +2,7 @@
#include "Script.h" #include "Script.h"
#include <limits.h> #include <limits.h>
#include <SDL3/SDL_timer.h> #include <SDL_timer.h>
#include "Alloc.h" #include "Alloc.h"
#include "Constants.h" #include "Constants.h"
@@ -20,7 +20,6 @@
#include "LocalizationStorage.h" #include "LocalizationStorage.h"
#include "Map.h" #include "Map.h"
#include "Music.h" #include "Music.h"
#include "ReleaseVersion.h"
#include "Unreachable.h" #include "Unreachable.h"
#include "UtilityClass.h" #include "UtilityClass.h"
#include "VFormat.h" #include "VFormat.h"
@@ -54,7 +53,6 @@ scriptclass::scriptclass(void)
textlarge = false; textlarge = false;
textbox_sprites.clear(); textbox_sprites.clear();
textbox_image = TEXTIMAGE_NONE; textbox_image = TEXTIMAGE_NONE;
textbox_absolutepos = false;
} }
void scriptclass::add_default_colours(void) void scriptclass::add_default_colours(void)
@@ -135,16 +133,16 @@ void scriptclass::tokenize( const std::string& t )
static int getcolorfromname(std::string name) static int getcolorfromname(std::string name)
{ {
if (name == "player") return EntityColour_CREW_CYAN; if (name == "player") return CYAN;
else if (name == "cyan") return EntityColour_CREW_CYAN; else if (name == "cyan") return CYAN;
else if (name == "red") return EntityColour_CREW_RED; else if (name == "red") return RED;
else if (name == "green") return EntityColour_CREW_GREEN; else if (name == "green") return GREEN;
else if (name == "yellow") return EntityColour_CREW_YELLOW; else if (name == "yellow") return YELLOW;
else if (name == "blue") return EntityColour_CREW_BLUE; else if (name == "blue") return BLUE;
else if (name == "purple") return EntityColour_CREW_PURPLE; else if (name == "purple") return PURPLE;
else if (name == "customcyan") return EntityColour_CREW_CYAN; else if (name == "customcyan") return CYAN;
else if (name == "gray") return EntityColour_CREW_GRAY; else if (name == "gray") return GRAY;
else if (name == "teleporter") return EntityColour_TELEPORTER_FLASHING; else if (name == "teleporter") return TELEPORTER;
int color = help.Int(name.c_str(), -1); int color = help.Int(name.c_str(), -1);
if (color < 0) return -1; // Not a number (or it's negative), so we give up if (color < 0) return -1; // Not a number (or it's negative), so we give up
@@ -159,6 +157,7 @@ static int getcrewmanfromname(std::string name)
return obj.getcrewman(color); return obj.getcrewman(color);
} }
/* Also used in gamestate 1001. */ /* Also used in gamestate 1001. */
void foundtrinket_textbox1(textboxclass* THIS); void foundtrinket_textbox1(textboxclass* THIS);
void foundtrinket_textbox2(textboxclass* THIS); void foundtrinket_textbox2(textboxclass* THIS);
@@ -295,7 +294,7 @@ void scriptclass::run(void)
{ {
for (size_t edi = 0; edi < obj.entities.size(); edi++) 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) if (obj.entities[edi].type == 9 || obj.entities[edi].type == 10)
{ {
obj.disableentity(edi); obj.disableentity(edi);
} }
@@ -305,7 +304,7 @@ void scriptclass::run(void)
{ {
for (size_t edi = 0; edi < obj.entities.size(); edi++) for (size_t edi = 0; edi < obj.entities.size(); edi++)
{ {
if (obj.entities[edi].type == EntityType_WARP_TOKEN) if (obj.entities[edi].type == 11)
{ {
obj.disableentity(edi); obj.disableentity(edi);
} }
@@ -332,74 +331,13 @@ void scriptclass::run(void)
for (size_t edi = 0; edi < obj.entities.size(); edi++) for (size_t edi = 0; edi < obj.entities.size(); edi++)
{ {
obj.disableblockat(obj.entities[edi].xp, obj.entities[edi].yp); obj.disableblockat(obj.entities[edi].xp, obj.entities[edi].yp);
if (obj.entities[edi].type == EntityType_DISAPPEARING_PLATFORM && obj.entities[edi].rule == 3) if (obj.entities[edi].type == 2 && obj.entities[edi].rule == 3)
{ {
obj.disableentity(edi); obj.disableentity(edi);
} }
} }
} }
} }
if (words[0] == "ifversion")
{
// A short for each is SURELY enough
unsigned short version[3] = { 0, 0, 0 };
bool valid_version = true;
int current = 0;
// Crawl through the string
for (size_t i = 0; i < words[1].size(); i++)
{
// If the current character is a number, add it to the current version part
if (words[1][i] >= '0' && words[1][i] <= '9')
{
version[current] = version[current] * 10 + (words[1][i] - '0');
}
else if (words[1][i] == '.')
{
current++;
if (current >= 3)
{
break;
}
}
else
{
// Unexpected character
valid_version = false;
break;
}
}
if (valid_version)
{
bool version_is_met = false;
if (MAJOR_VERSION > version[0])
{
version_is_met = true;
}
else if (MAJOR_VERSION == version[0])
{
if (MINOR_VERSION > version[1])
{
version_is_met = true;
}
else if (MINOR_VERSION == version[1])
{
if (PATCH_VERSION >= version[2])
{
version_is_met = true;
}
}
}
if (version_is_met)
{
loadalts("custom_" + words[2], "custom_" + raw_words[2]);
position--;
}
}
}
if (words[0] == "customiftrinkets") if (words[0] == "customiftrinkets")
{ {
if (game.trinkets() >= ss_toi(words[1])) if (game.trinkets() >= ss_toi(words[1]))
@@ -433,23 +371,6 @@ void scriptclass::run(void)
map.customshowmm=false; 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") if (words[0] == "delay")
{ {
//USAGE: delay(frames) //USAGE: delay(frames)
@@ -509,41 +430,11 @@ void scriptclass::run(void)
} }
if (words[0] == "playef") if (words[0] == "playef")
{ {
bool played = false; music.playef(ss_toi(words[1]));
int sound_id = help.Int(words[1].c_str(), -1);
if (music.soundidexists(words[1].c_str()))
{
played = music.playefid(words[1].c_str());
}
else if (!music.soundisextra(sound_id))
{
played = music.playef(sound_id);
}
if (!played)
{
vlog_error("playef() couldn't play sound: %s", words[1].c_str());
}
} }
if (words[0] == "play") if (words[0] == "play")
{ {
bool played = false; music.play(ss_toi(words[1]));
int song_id = ss_toi(words[1].c_str());
if (music.idexists(words[1].c_str()))
{
played = music.playid(words[1].c_str());
}
else if (!music.isextra(song_id))
{
played = music.play(song_id);
}
if (!played)
{
vlog_error("play() couldn't play song: %s", words[1].c_str());
}
} }
if (words[0] == "stopmusic") if (words[0] == "stopmusic")
{ {
@@ -658,15 +549,11 @@ void scriptclass::run(void)
textcrewmateposition = TextboxCrewmatePosition(); textcrewmateposition = TextboxCrewmatePosition();
textbox_sprites.clear(); textbox_sprites.clear();
textbox_image = TEXTIMAGE_NONE; textbox_image = TEXTIMAGE_NONE;
textbox_absolutepos = false;
textbox_force_outline = false;
textbox_outline = false;
} }
else if (words[0] == "position") else if (words[0] == "position")
{ {
//are we facing left or right? for some objects we don't care, default at 0. //are we facing left or right? for some objects we don't care, default at 0.
j = 0; j = 0;
textbox_absolutepos = false;
//the first word is the object to position relative to //the first word is the object to position relative to
if (words[1] == "centerx") if (words[1] == "centerx")
@@ -688,13 +575,6 @@ void scriptclass::run(void)
textx = -500; textx = -500;
texty = -500; texty = -500;
} }
else if (words[1] == "absolute")
{
words[2] = "donothing";
j = -1;
textbox_absolutepos = true;
}
else // Well, are they asking for a crewmate...? else // Well, are they asking for a crewmate...?
{ {
i = getcrewmanfromname(words[1]); i = getcrewmanfromname(words[1]);
@@ -729,37 +609,37 @@ void scriptclass::run(void)
//the first word is the object to position relative to //the first word is the object to position relative to
if (words[1] == "player") if (words[1] == "player")
{ {
i = obj.getcustomcrewman(EntityColour_CREW_CYAN); i = obj.getcustomcrewman(0);
j = obj.entities[i].dir; j = obj.entities[i].dir;
} }
else if (words[1] == "cyan") else if (words[1] == "cyan")
{ {
i = obj.getcustomcrewman(EntityColour_CREW_CYAN); i = obj.getcustomcrewman(0);
j = obj.entities[i].dir; j = obj.entities[i].dir;
} }
else if (words[1] == "purple") else if (words[1] == "purple")
{ {
i = obj.getcustomcrewman(EntityColour_CREW_PURPLE); i = obj.getcustomcrewman(1);
j = obj.entities[i].dir; j = obj.entities[i].dir;
} }
else if (words[1] == "yellow") else if (words[1] == "yellow")
{ {
i = obj.getcustomcrewman(EntityColour_CREW_YELLOW); i = obj.getcustomcrewman(2);
j = obj.entities[i].dir; j = obj.entities[i].dir;
} }
else if (words[1] == "red") else if (words[1] == "red")
{ {
i = obj.getcustomcrewman(EntityColour_CREW_RED); i = obj.getcustomcrewman(3);
j = obj.entities[i].dir; j = obj.entities[i].dir;
} }
else if (words[1] == "green") else if (words[1] == "green")
{ {
i = obj.getcustomcrewman(EntityColour_CREW_GREEN); i = obj.getcustomcrewman(4);
j = obj.entities[i].dir; j = obj.entities[i].dir;
} }
else if (words[1] == "blue") else if (words[1] == "blue")
{ {
i = obj.getcustomcrewman(EntityColour_CREW_BLUE); i = obj.getcustomcrewman(5);
j = obj.entities[i].dir; j = obj.entities[i].dir;
} }
else if (words[1] == "centerx") else if (words[1] == "centerx")
@@ -839,23 +719,6 @@ void scriptclass::run(void)
textbox_image = TEXTIMAGE_NONE; 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") else if (words[0] == "flipme")
{ {
textflipme = !textflipme; textflipme = !textflipme;
@@ -894,28 +757,16 @@ void scriptclass::run(void)
graphics.setimage(textbox_image); graphics.setimage(textbox_image);
if (textbox_absolutepos) if (textx == -500 || textx == -1)
{ {
graphics.textboxabsolutepos(textx, texty); graphics.textboxcenterx();
} textcrewmateposition.override_x = false;
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) if (texty == -500)
{ {
graphics.textboxoutline(textbox_outline); graphics.textboxcentery();
textcrewmateposition.override_y = false;
} }
TextboxOriginalContext context = TextboxOriginalContext(); TextboxOriginalContext context = TextboxOriginalContext();
@@ -1001,7 +852,7 @@ void scriptclass::run(void)
obj.entities[i].lerpoldxp = obj.entities[i].xp; obj.entities[i].lerpoldxp = obj.entities[i].xp;
obj.entities[i].lerpoldyp = obj.entities[i].yp; obj.entities[i].lerpoldyp = obj.entities[i].yp;
obj.entities[i].size = 13; obj.entities[i].size = 13;
obj.entities[i].colour = EntityColour_GRAVITRON_INDICATOR; obj.entities[i].colour = 23;
obj.entities[i].cx = 36;// 6; obj.entities[i].cx = 36;// 6;
obj.entities[i].cy = 12+80;// 2; obj.entities[i].cy = 12+80;// 2;
obj.entities[i].h = 126-80;// 21; obj.entities[i].h = 126-80;// 21;
@@ -1016,7 +867,7 @@ void scriptclass::run(void)
obj.entities[i].xp = 100; obj.entities[i].xp = 100;
obj.entities[i].lerpoldxp = obj.entities[i].xp; obj.entities[i].lerpoldxp = obj.entities[i].xp;
obj.entities[i].size = 0; obj.entities[i].size = 0;
obj.entities[i].colour = EntityColour_CREW_CYAN; obj.entities[i].colour = 0;
obj.entities[i].cx = 6; obj.entities[i].cx = 6;
obj.entities[i].cy = 2; obj.entities[i].cy = 2;
obj.entities[i].h = 21; obj.entities[i].h = 21;
@@ -1113,47 +964,47 @@ void scriptclass::run(void)
{ {
if (words[1] == "player") if (words[1] == "player")
{ {
i=obj.getcustomcrewman(EntityColour_CREW_CYAN); i=obj.getcustomcrewman(0);
obj.customcrewmoods[0]=ss_toi(words[2]); obj.customcrewmoods[0]=ss_toi(words[2]);
} }
else if (words[1] == "cyan") else if (words[1] == "cyan")
{ {
i=obj.getcustomcrewman(EntityColour_CREW_CYAN); i=obj.getcustomcrewman(0);
obj.customcrewmoods[0]=ss_toi(words[2]); obj.customcrewmoods[0]=ss_toi(words[2]);
} }
else if (words[1] == "customcyan") else if (words[1] == "customcyan")
{ {
i=obj.getcustomcrewman(EntityColour_CREW_CYAN); i=obj.getcustomcrewman(0);
obj.customcrewmoods[0]=ss_toi(words[2]); obj.customcrewmoods[0]=ss_toi(words[2]);
} }
else if (words[1] == "red") else if (words[1] == "red")
{ {
i=obj.getcustomcrewman(EntityColour_CREW_RED); i=obj.getcustomcrewman(3);
obj.customcrewmoods[3]=ss_toi(words[2]); obj.customcrewmoods[3]=ss_toi(words[2]);
} }
else if (words[1] == "green") else if (words[1] == "green")
{ {
i=obj.getcustomcrewman(EntityColour_CREW_GREEN); i=obj.getcustomcrewman(4);
obj.customcrewmoods[4]=ss_toi(words[2]); obj.customcrewmoods[4]=ss_toi(words[2]);
} }
else if (words[1] == "yellow") else if (words[1] == "yellow")
{ {
i=obj.getcustomcrewman(EntityColour_CREW_YELLOW); i=obj.getcustomcrewman(2);
obj.customcrewmoods[2]=ss_toi(words[2]); obj.customcrewmoods[2]=ss_toi(words[2]);
} }
else if (words[1] == "blue") else if (words[1] == "blue")
{ {
i=obj.getcustomcrewman(EntityColour_CREW_BLUE); i=obj.getcustomcrewman(5);
obj.customcrewmoods[5]=ss_toi(words[2]); obj.customcrewmoods[5]=ss_toi(words[2]);
} }
else if (words[1] == "purple") else if (words[1] == "purple")
{ {
i=obj.getcustomcrewman(EntityColour_CREW_PURPLE); i=obj.getcustomcrewman(1);
obj.customcrewmoods[1]=ss_toi(words[2]); obj.customcrewmoods[1]=ss_toi(words[2]);
} }
else if (words[1] == "pink") else if (words[1] == "pink")
{ {
i=obj.getcustomcrewman(EntityColour_CREW_PURPLE); i=obj.getcustomcrewman(1);
obj.customcrewmoods[1]=ss_toi(words[2]); obj.customcrewmoods[1]=ss_toi(words[2]);
} }
@@ -1279,7 +1130,7 @@ void scriptclass::run(void)
if (INBOUNDS_VEC(i, obj.entities)) if (INBOUNDS_VEC(i, obj.entities))
{ {
obj.entities[i].tile = 6; obj.entities[i].tile = 6;
obj.entities[i].colour = EntityColour_TELEPORTER_FLASHING; obj.entities[i].colour = 102;
} }
} }
else if (words[0] == "changecolour") else if (words[0] == "changecolour")
@@ -1355,21 +1206,12 @@ void scriptclass::run(void)
{ {
game.savedir = obj.entities[i].dir; game.savedir = obj.entities[i].dir;
} }
game.checkpoint_save();
} }
else if (words[0] == "gamestate") else if (words[0] == "gamestate")
{ {
// Allow the gamestate command to bypass statelock, at least for now // Allow the gamestate command to bypass statelock, at least for now
game.state = ss_toi(words[1]); game.state = ss_toi(words[1]);
if (argexists[2]) game.statedelay = 0;
{
game.statedelay = ss_toi(words[2]);
}
else
{
game.statedelay = 0;
}
} }
else if (words[0] == "textboxactive") else if (words[0] == "textboxactive")
{ {
@@ -1486,28 +1328,6 @@ void scriptclass::run(void)
map.setexplored(19, 7, false); map.setexplored(19, 7, false);
map.setexplored(19, 8, 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") else if (words[0] == "showteleporters")
{ {
map.showteleporters = true; map.showteleporters = true;
@@ -1593,7 +1413,7 @@ void scriptclass::run(void)
{ {
game.unlocknum(Unlock_SECRETLAB); game.unlocknum(Unlock_SECRETLAB);
game.insecretlab = true; game.insecretlab = true;
map.fullmap(); SDL_memset(map.explored, true, sizeof(map.explored));
} }
else if (words[0] == "leavesecretlab") else if (words[0] == "leavesecretlab")
{ {
@@ -1746,9 +1566,9 @@ void scriptclass::run(void)
{ {
for (j = 0; j < (int) obj.entities.size(); j++) for (j = 0; j < (int) obj.entities.size(); j++)
{ {
if (obj.entities[j].type == EntityType_TERMINAL) if (obj.entities[j].type == 13)
{ {
obj.entities[j].colour = EntityColour_INACTIVE_ENTITY; obj.entities[j].colour = 4;
} }
} }
if (ss_toi(words[1]) == 1) if (ss_toi(words[1]) == 1)
@@ -1758,7 +1578,7 @@ void scriptclass::run(void)
{ {
if (obj.entities[j].xp == 88 && obj.entities[j].yp==80) if (obj.entities[j].xp == 88 && obj.entities[j].yp==80)
{ {
obj.entities[j].colour = EntityColour_ACTIVE_ENTITY; obj.entities[j].colour = 5;
} }
} }
} }
@@ -1769,7 +1589,7 @@ void scriptclass::run(void)
{ {
if (obj.entities[j].xp == 128 && obj.entities[j].yp==80) if (obj.entities[j].xp == 128 && obj.entities[j].yp==80)
{ {
obj.entities[j].colour = EntityColour_ACTIVE_ENTITY; obj.entities[j].colour = 5;
} }
} }
} }
@@ -1780,7 +1600,7 @@ void scriptclass::run(void)
{ {
if (obj.entities[j].xp == 176 && obj.entities[j].yp==80) if (obj.entities[j].xp == 176 && obj.entities[j].yp==80)
{ {
obj.entities[j].colour = EntityColour_ACTIVE_ENTITY; obj.entities[j].colour = 5;
} }
} }
} }
@@ -1791,7 +1611,7 @@ void scriptclass::run(void)
{ {
if (obj.entities[j].xp == 216 && obj.entities[j].yp==80) if (obj.entities[j].xp == 216 && obj.entities[j].yp==80)
{ {
obj.entities[j].colour = EntityColour_ACTIVE_ENTITY; obj.entities[j].colour = 5;
} }
} }
} }
@@ -1802,7 +1622,7 @@ void scriptclass::run(void)
{ {
if (obj.entities[j].xp == 88 && obj.entities[j].yp==128) if (obj.entities[j].xp == 88 && obj.entities[j].yp==128)
{ {
obj.entities[j].colour = EntityColour_ACTIVE_ENTITY; obj.entities[j].colour = 5;
} }
} }
} }
@@ -1813,7 +1633,7 @@ void scriptclass::run(void)
{ {
if (obj.entities[j].xp == 176 && obj.entities[j].yp==128) if (obj.entities[j].xp == 176 && obj.entities[j].yp==128)
{ {
obj.entities[j].colour = EntityColour_ACTIVE_ENTITY; obj.entities[j].colour = 5;
} }
} }
} }
@@ -1824,7 +1644,7 @@ void scriptclass::run(void)
{ {
if (obj.entities[j].xp == 40 && obj.entities[j].yp==40) if (obj.entities[j].xp == 40 && obj.entities[j].yp==40)
{ {
obj.entities[j].colour = EntityColour_ACTIVE_ENTITY; obj.entities[j].colour = 5;
} }
} }
} }
@@ -1835,7 +1655,7 @@ void scriptclass::run(void)
{ {
if (obj.entities[j].xp == 216 && obj.entities[j].yp==128) if (obj.entities[j].xp == 216 && obj.entities[j].yp==128)
{ {
obj.entities[j].colour = EntityColour_ACTIVE_ENTITY; obj.entities[j].colour = 5;
} }
} }
} }
@@ -1846,7 +1666,7 @@ void scriptclass::run(void)
{ {
if (obj.entities[j].xp == 128 && obj.entities[j].yp==128) if (obj.entities[j].xp == 128 && obj.entities[j].yp==128)
{ {
obj.entities[j].colour = EntityColour_ACTIVE_ENTITY; obj.entities[j].colour = 5;
} }
} }
} }
@@ -1857,7 +1677,7 @@ void scriptclass::run(void)
{ {
if (obj.entities[j].xp == 264 && obj.entities[j].yp==40) if (obj.entities[j].xp == 264 && obj.entities[j].yp==40)
{ {
obj.entities[j].colour = EntityColour_ACTIVE_ENTITY; obj.entities[j].colour = 5;
} }
} }
} }
@@ -1868,31 +1688,31 @@ void scriptclass::run(void)
if (words[1] == "red") if (words[1] == "red")
{ {
i = 3; i = 3;
crew_color = EntityColour_CREW_RED; crew_color = RED;
} }
else if (words[1] == "green") else if (words[1] == "green")
{ {
i = 4; i = 4;
crew_color = EntityColour_CREW_GREEN; crew_color = GREEN;
} }
else if (words[1] == "yellow") else if (words[1] == "yellow")
{ {
i = 2; i = 2;
crew_color = EntityColour_CREW_YELLOW; crew_color = YELLOW;
} }
else if (words[1] == "blue") else if (words[1] == "blue")
{ {
i = 5; i = 5;
crew_color = EntityColour_CREW_BLUE; crew_color = BLUE;
} }
else if (words[1] == "purple") else if (words[1] == "purple")
{ {
i = 1; i = 1;
crew_color = EntityColour_CREW_PURPLE; crew_color = PURPLE;
} }
int crewman = obj.getcrewman(crew_color); int crewman = obj.getcrewman(crew_color);
if (INBOUNDS_VEC(crewman, obj.entities) && crew_color == EntityColour_CREW_GREEN) if (INBOUNDS_VEC(crewman, obj.entities) && crew_color == GREEN)
{ {
obj.createblock(5, obj.entities[crewman].xp - 32, obj.entities[crewman].yp-20, 96, 60, i, "", (i == 35)); obj.createblock(5, obj.entities[crewman].xp - 32, obj.entities[crewman].yp-20, 96, 60, i, "", (i == 35));
} }
@@ -1948,9 +1768,8 @@ void scriptclass::run(void)
i = obj.getplayer(); i = obj.getplayer();
if (INBOUNDS_VEC(i, obj.entities)) if (INBOUNDS_VEC(i, obj.entities))
{ {
obj.entities[i].colour = cl.player_colour; obj.entities[i].colour = 0;
} }
game.savecolour = cl.player_colour;
} }
else if (words[0] == "changeplayercolour") else if (words[0] == "changeplayercolour")
{ {
@@ -1974,7 +1793,7 @@ void scriptclass::run(void)
i = obj.getteleporter(); i = obj.getteleporter();
if (INBOUNDS_VEC(i, obj.entities)) if (INBOUNDS_VEC(i, obj.entities))
{ {
obj.entities[i].colour = EntityColour_TELEPORTER_ACTIVE; obj.entities[i].colour = 101;
} }
} }
else if (words[0] == "foundtrinket") else if (words[0] == "foundtrinket")
@@ -2067,16 +1886,6 @@ void scriptclass::run(void)
} }
} }
} }
else if (words[0] == "everybodyhappy")
{
for (i = 0; i < (int) obj.entities.size(); i++)
{
if (obj.entities[i].rule == 6 || obj.entities[i].rule == 0)
{
obj.entities[i].tile = 0;
}
}
}
else if (words[0] == "startintermission2") else if (words[0] == "startintermission2")
{ {
map.finalmode = true; //Enable final level mode map.finalmode = true; //Enable final level mode
@@ -2099,9 +1908,9 @@ void scriptclass::run(void)
else if (words[0] == "createlastrescued") else if (words[0] == "createlastrescued")
{ {
r = graphics.crewcolour(game.lastsaved); r = graphics.crewcolour(game.lastsaved);
if (r == EntityColour_CREW_CYAN || r == EntityColour_CREW_PURPLE) if (r == 0 || r == PURPLE)
{ {
r = EntityColour_CREW_GRAY; // Default to gray if invalid color. r = GRAY; // Default to gray if invalid color.
} }
obj.createentity(200, 153, 18, r, 0, 19, 30); obj.createentity(200, 153, 18, r, 0, 19, 30);
@@ -2761,7 +2570,7 @@ void scriptclass::startgamemode(const enum StartMode mode)
} }
} }
/* State which needs to be reset before gameplay starts /* Containers which need to be reset before gameplay starts
* ex. before custom levels get loaded */ * ex. before custom levels get loaded */
switch (mode) switch (mode)
@@ -2771,8 +2580,6 @@ void scriptclass::startgamemode(const enum StartMode mode)
default: default:
textbox_colours.clear(); textbox_colours.clear();
add_default_colours(); add_default_colours();
cl.onewaycol_override = false;
cl.player_colour = 0;
break; break;
} }
@@ -2844,16 +2651,6 @@ void scriptclass::startgamemode(const enum StartMode mode)
graphics.showcutscenebars = true; graphics.showcutscenebars = true;
graphics.setbars(320); graphics.setbars(320);
load("intro"); load("intro");
if (!game.nocompetitive())
{
game.nodeatheligible = true;
vlog_debug("NDM trophy is eligible.");
}
else
{
game.invalidate_ndm_trophy();
}
} }
break; break;
@@ -2915,7 +2712,7 @@ void scriptclass::startgamemode(const enum StartMode mode)
{ {
game.timetrialcountdown = 0; game.timetrialcountdown = 0;
game.timetrialparlost = true; game.timetrialparlost = true;
map.fullmap(); SDL_memset(map.explored, true, sizeof(map.explored));
} }
graphics.fademode = FADE_START_FADEIN; graphics.fademode = FADE_START_FADEIN;
@@ -2925,9 +2722,9 @@ void scriptclass::startgamemode(const enum StartMode mode)
game.startspecial(0); game.startspecial(0);
/* Unlock the entire map */ /* Unlock the entire map */
map.fullmap();
/* Give all 20 trinkets */
SDL_memset(obj.collect, true, sizeof(obj.collect[0]) * 20); SDL_memset(obj.collect, true, sizeof(obj.collect[0]) * 20);
/* Give all 20 trinkets */
SDL_memset(map.explored, true, sizeof(map.explored));
i = 400; /* previously a nested for-loop set this */ i = 400; /* previously a nested for-loop set this */
game.insecretlab = true; game.insecretlab = true;
map.showteleporters = true; map.showteleporters = true;
@@ -3021,7 +2818,6 @@ void scriptclass::startgamemode(const enum StartMode mode)
map.custommode = true; map.custommode = true;
map.custommodeforreal = false; map.custommodeforreal = false;
map.customshowmm = true; map.customshowmm = true;
map.revealmap = true;
if (cl.levmusic > 0) if (cl.levmusic > 0)
{ {
@@ -3048,7 +2844,6 @@ void scriptclass::startgamemode(const enum StartMode mode)
cl.findstartpoint(); cl.findstartpoint();
map.customshowmm = true; map.customshowmm = true;
map.revealmap = true;
music.fadeout(); music.fadeout();
game.customstart(); game.customstart();
@@ -3256,7 +3051,7 @@ void scriptclass::hardreset(void)
if (game.seed_use_sdl_getticks) if (game.seed_use_sdl_getticks)
{ {
/* The RNG is 32-bit. We don't _really_ need 64-bit... */ /* The RNG is 32-bit. We don't _really_ need 64-bit... */
xoshiro_seed((Uint32) SDL_GetTicks()); xoshiro_seed((Uint32) SDL_GetTicks64());
} }
else else
{ {
@@ -3293,7 +3088,6 @@ void scriptclass::hardreset(void)
game.nodeathmode = false; game.nodeathmode = false;
game.nocutscenes = false; game.nocutscenes = false;
game.nodeatheligible = false;
for (i = 0; i < (int) SDL_arraysize(game.crewstats); i++) for (i = 0; i < (int) SDL_arraysize(game.crewstats); i++)
{ {
@@ -3318,7 +3112,7 @@ void scriptclass::hardreset(void)
game.savey = 0; game.savey = 0;
game.savegc = 0; game.savegc = 0;
} }
game.savecolour = cl.player_colour; game.savecolour = 0;
game.intimetrial = false; game.intimetrial = false;
game.timetrialcountdown = 0; game.timetrialcountdown = 0;
@@ -3421,14 +3215,11 @@ void scriptclass::hardreset(void)
map.cameraseekframe = 0; map.cameraseekframe = 0;
map.resumedelay = 0; map.resumedelay = 0;
graphics.towerbg.scrolldir = 0; graphics.towerbg.scrolldir = 0;
map.customshowmm = true; map.customshowmm=true;
map.revealmap = true;
SDL_memset(map.roomdeaths, 0, sizeof(map.roomdeaths)); SDL_memset(map.roomdeaths, 0, sizeof(map.roomdeaths));
SDL_memset(map.roomdeathsfinal, 0, sizeof(map.roomdeathsfinal)); SDL_memset(map.roomdeathsfinal, 0, sizeof(map.roomdeathsfinal));
map.resetmap(); map.resetmap();
map.currentregion = 0;
SDL_zeroa(map.region);
//entityclass //entityclass
obj.nearelephant = false; obj.nearelephant = false;
obj.upsetmode = false; obj.upsetmode = false;
@@ -3548,10 +3339,6 @@ bool scriptclass::loadcustom(const std::string& t)
}else { tstring="play("+words[1]+")"; } }else { tstring="play("+words[1]+")"; }
} }
add(tstring); add(tstring);
}else if(words[0] == "sound") {
if(customtextmode==1){ add("endtext"); customtextmode=0;}
tstring="playef("+words[1]+")";
add(tstring);
}else if(words[0] == "playremix"){ }else if(words[0] == "playremix"){
add("play(15)"); add("play(15)");
}else if(words[0] == "flash"){ }else if(words[0] == "flash"){
@@ -3669,9 +3456,6 @@ bool scriptclass::loadcustom(const std::string& t)
}else if(words[0] == "iftrinketsless"){ }else if(words[0] == "iftrinketsless"){
if(customtextmode==1){ add("endtext"); customtextmode=0;} if(customtextmode==1){ add("endtext"); customtextmode=0;}
add("custom"+lines[i]); add("custom"+lines[i]);
}else if(words[0] == "ifversion"){
if(customtextmode==1){ add("endtext"); customtextmode=0;}
add(lines[i]);
}else if(words[0] == "textcase"){ }else if(words[0] == "textcase"){
if(customtextmode==1){ add("endtext"); customtextmode=0;} if(customtextmode==1){ add("endtext"); customtextmode=0;}
add(lines[i]); add(lines[i]);
+1 -4
View File
@@ -2,7 +2,7 @@
#define SCRIPT_H #define SCRIPT_H
#include <map> #include <map>
#include <SDL3/SDL.h> #include <SDL.h>
#include <string> #include <string>
#include <vector> #include <vector>
@@ -122,9 +122,6 @@ public:
int textboxtimer; int textboxtimer;
std::vector<TextboxSprite> textbox_sprites; std::vector<TextboxSprite> textbox_sprites;
TextboxImage textbox_image; TextboxImage textbox_image;
bool textbox_absolutepos;
bool textbox_force_outline;
bool textbox_outline;
//Misc //Misc
int i, j, k; int i, j, k;
+1 -1
View File
@@ -1,6 +1,6 @@
#include "Script.h" #include "Script.h"
#include <SDL3/SDL.h> #include <SDL.h>
bool scriptclass::load(const std::string& name) bool scriptclass::load(const std::string& name)
{ {
+11 -19
View File
@@ -3,24 +3,24 @@
#ifndef MAKEANDPLAY #ifndef MAKEANDPLAY
#include <stdint.h> #include <stdint.h>
#include <SDL3/SDL.h> #include <SDL.h>
#include "CWrappers.h" #include "CWrappers.h"
#include "Vlogging.h" #include "Vlogging.h"
/* Steamworks interface versions */ /* Steamworks interface versions */
#define VVVVVV_STEAMCLIENT "SteamClient023" #define VVVVVV_STEAMCLIENT "SteamClient017"
#define VVVVVV_STEAMUSERSTATS "STEAMUSERSTATS_INTERFACE_VERSION013" #define VVVVVV_STEAMUSERSTATS "STEAMUSERSTATS_INTERFACE_VERSION011"
#define VVVVVV_STEAMSCREENSHOTS "STEAMSCREENSHOTS_INTERFACE_VERSION003" #define VVVVVV_STEAMSCREENSHOTS "STEAMSCREENSHOTS_INTERFACE_VERSION003"
/* Shared object file name */ /* Shared object file name */
#if defined(_WIN32) #if defined(_WIN32)
#define STEAM_LIBRARY "steam_api.dll" #define STEAM_LIBRARY "steam_api.dll"
#elif defined(SDL_PLATFORM_APPLE) #elif defined(__APPLE__)
#define STEAM_LIBRARY "libsteam_api.dylib" #define STEAM_LIBRARY "libsteam_api.dylib"
#elif defined(SDL_PLATFORM_LINUX) || defined(SDL_PLATFORM_FREEBSD) || defined(SDL_PLATFORM_OPENBSD) || defined(SDL_PLATFORM_HAIKU) || defined(__DragonFly__) #elif defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__HAIKU__) || defined(__DragonFly__)
#define STEAM_LIBRARY "libsteam_api.so" #define STEAM_LIBRARY "libsteam_api.so"
#else #else
#error STEAM_LIBRARY: Unrecognized platform! #error STEAM_LIBRARY: Unrecognized platform!
@@ -45,16 +45,8 @@ struct SteamAPICallCompleted_t
uint32_t m_cubParam; uint32_t m_cubParam;
}; };
typedef enum ESteamAPIInitResult
{
k_ESteamAPIInitResult_OK = 0,
k_ESteamAPIInitResult_FailedGeneric = 1,
k_ESteamAPIInitResult_NoSteamClient = 2,
k_ESteamAPIInitResult_VersionMismatch = 3,
} ESteamAPIInitResult;
#define FUNC_LIST \ #define FUNC_LIST \
FOREACH_FUNC(ESteamAPIInitResult, SteamAPI_InitFlat, (void*)) \ FOREACH_FUNC(uint8_t, SteamAPI_Init, (void)) \
FOREACH_FUNC(void, SteamAPI_Shutdown, (void)) \ FOREACH_FUNC(void, SteamAPI_Shutdown, (void)) \
FOREACH_FUNC(void, SteamAPI_RunCallbacks, (void)) \ FOREACH_FUNC(void, SteamAPI_RunCallbacks, (void)) \
FOREACH_FUNC(struct ISteamClient*, SteamInternal_CreateInterface, (const char*)) \ FOREACH_FUNC(struct ISteamClient*, SteamInternal_CreateInterface, (const char*)) \
@@ -66,6 +58,7 @@ typedef enum ESteamAPIInitResult
int32_t, \ int32_t, \
const char* \ 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_StoreStats, (struct ISteamUserStats*)) \
FOREACH_FUNC(uint8_t, SteamAPI_ISteamUserStats_SetAchievement, ( \ FOREACH_FUNC(uint8_t, SteamAPI_ISteamUserStats_SetAchievement, ( \
struct ISteamUserStats*, \ struct ISteamUserStats*, \
@@ -145,12 +138,10 @@ static void run_screenshot()
return; return;
} }
const SDL_PixelFormatDetails* details = SDL_GetPixelFormatDetails(surface2x->format);
SteamAPI_ISteamScreenshots_WriteScreenshot( SteamAPI_ISteamScreenshots_WriteScreenshot(
steamScreenshots, steamScreenshots,
surface2x->pixels, surface2x->pixels,
surface2x->w * surface2x->h * details->bytes_per_pixel, surface2x->w * surface2x->h * surface2x->format->BytesPerPixel,
surface2x->w, surface2x->w,
surface2x->h surface2x->h
); );
@@ -162,7 +153,7 @@ static int32_t steamPipe = 0;
int32_t STEAM_init(void) int32_t STEAM_init(void)
{ {
#if defined(SDL_PLATFORM_FREEBSD) || defined(SDL_PLATFORM_OPENBSD) || defined(SDL_PLATFORM_HAIKU) || defined(__DragonFly__) #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__HAIKU__) || defined(__DragonFly__)
return 0; return 0;
#endif #endif
struct ISteamClient *steamClient; struct ISteamClient *steamClient;
@@ -186,7 +177,7 @@ int32_t STEAM_init(void)
FUNC_LIST FUNC_LIST
#undef FOREACH_FUNC #undef FOREACH_FUNC
if (SteamAPI_InitFlat(NULL) != k_ESteamAPIInitResult_OK) if (!SteamAPI_Init())
{ {
vlog_error("Steamworks not initialized!"); vlog_error("Steamworks not initialized!");
ClearPointers(); ClearPointers();
@@ -216,6 +207,7 @@ int32_t STEAM_init(void)
ClearPointers(); ClearPointers();
return 0; return 0;
} }
SteamAPI_ISteamUserStats_RequestCurrentStats(steamUserStats);
steamScreenshots = SteamAPI_ISteamClient_GetISteamScreenshots( steamScreenshots = SteamAPI_ISteamClient_GetISteamScreenshots(
steamClient, steamClient,
steamUser, steamUser,
+1 -1
View File
@@ -1,6 +1,6 @@
#include "Script.h" #include "Script.h"
#include <SDL3/SDL.h> #include <SDL.h>
void scriptclass::loadother(const char* t) void scriptclass::loadother(const char* t)
{ {
+1 -1
View File
@@ -1,6 +1,6 @@
#include "Textbook.h" #include "Textbook.h"
#include <SDL3/SDL.h> #include <SDL.h>
#include "Alloc.h" #include "Alloc.h"
#include "Vlogging.h" #include "Vlogging.h"
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef TEXTBOOK_H #ifndef TEXTBOOK_H
#define TEXTBOOK_H #define TEXTBOOK_H
#include <SDL3/SDL_stdinc.h> #include <SDL_stdinc.h>
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> #include <stddef.h>
+12 -20
View File
@@ -1,6 +1,6 @@
#include "Textbox.h" #include "Textbox.h"
#include <SDL3/SDL.h> #include <SDL.h>
#include "Font.h" #include "Font.h"
#include "Localization.h" #include "Localization.h"
@@ -29,8 +29,6 @@ textboxclass::textboxclass(int gap)
large = false; large = false;
position_absolute = false;
should_centerx = false; should_centerx = false;
should_centery = false; should_centery = false;
@@ -43,9 +41,6 @@ textboxclass::textboxclass(int gap)
image = TEXTIMAGE_NONE; image = TEXTIMAGE_NONE;
force_outline = false;
outline = false;
crewmate_position = TextboxCrewmatePosition(); crewmate_position = TextboxCrewmatePosition();
original = TextboxOriginalContext(); original = TextboxOriginalContext();
original.text_case = 1; original.text_case = 1;
@@ -83,21 +78,18 @@ void textboxclass::centery(void)
void textboxclass::applyposition(void) void textboxclass::applyposition(void)
{ {
resize(); resize();
if (!position_absolute) reposition();
if (should_centerx)
{ {
reposition(); centerx();
if (should_centerx) }
{ if (should_centery)
centerx(); {
} centery();
if (should_centery) }
{ if (translate == TEXTTRANSLATE_CUTSCENE)
centery(); {
} adjust();
if (translate == TEXTTRANSLATE_CUTSCENE)
{
adjust();
}
} }
} }
-5
View File
@@ -125,8 +125,6 @@ public:
bool large; bool large;
bool position_absolute;
bool should_centerx; bool should_centerx;
bool should_centery; bool should_centery;
@@ -137,9 +135,6 @@ public:
std::vector<TextboxSprite> sprites; std::vector<TextboxSprite> sprites;
TextboxImage image; TextboxImage image;
bool force_outline;
bool outline;
TextboxCrewmatePosition crewmate_position; TextboxCrewmatePosition crewmate_position;
TextboxOriginalContext original; TextboxOriginalContext original;
TextboxSpacing spacing; TextboxSpacing spacing;
+1 -1
View File
@@ -1,4 +1,4 @@
#include <SDL3/SDL_stdinc.h> #include <SDL_stdinc.h>
#include "Alloc.h" #include "Alloc.h"
+1 -1
View File
@@ -1,6 +1,6 @@
#include "Tower.h" #include "Tower.h"
#include <SDL3/SDL_stdinc.h> #include <SDL_stdinc.h>
#include <stddef.h> #include <stddef.h>
#include "Constants.h" #include "Constants.h"

Some files were not shown because too many files have changed in this diff Show More