1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 09:39:43 +01:00
Commit graph

2953 commits

Author SHA1 Message Date
Dav999
a9ca63b367 Add buffer for IME editing events
When inputting uncommitted text from an IME, this is now stored in a
std::string imebuffer, just like keybuffer. It also enables extended
editing events, so text longer than what fits in the standard editing
event is also supported. This commit does not yet display the text
onscreen.
2024-08-02 22:25:00 -07:00
Misa
345eca5e10 Fix regression: Escape from conveyor spikes
This fixes a regression from 2.3. Consider the following diagram:

       CC
    X  CC
      <<<<

"C" indicates one tile of a checkpoint entity, "X" indicates a spike
tile, and "<" indicates one tile of a conveyor entity that has the
default speed (4 pixels per frame) going leftwards.

Now consider if the player were to touch the checkpoint and die. In 2.2,
they would be able to escape from the spike by holding right. But in
2.3, they would not be able to, and would die from the spike
continuously with no escape.

This happens because in 2.2, the player would spawn a couple pixels off
the surface, and this gained them an extra frame of movement to move
away from the conveyor. 2.3 places the player directly on the ground,
moving them one frame earlier and thus forcing them to their doom.

Now consider the following diagram:

      CC
    X CC
     <<<<

The difference with the previous diagram is that this time, the spike is
one tile closer. This time, there is no escape in 2.2 and you will
always die no matter what.

By the way, both diagrams have the same behavior if the conveyor is
rightwards and if everything is flipped upside-down. Thankfully, it
doesn't seem to be direction-dependent.

The reason 2.3 lowered the player onto the surface was for consistency
(see PR #502), and I don't want to undo that. So I think the best
solution here is to re-add the extra frame of control by conveyors only
moving the player after lifeseq has advanced enough.
2024-07-31 22:17:50 -07:00
Misa
6930bde91b Use variable timestep for SDL_Delay
This fixes a bug where fast-forward wouldn't work in 30-FPS-only mode.

This is because the 30-FPS-only code has a hardcoded check for the
number 34, as in 34 milliseconds must pass before the next frame can
advance. This is why slowdown still worked, because slowdown means
you're waiting longer than 34 ms anyways, but fast-forward tries to wait
for only 1 ms, which wouldn't work if the 34 limit was still enforced.

So instead, swap out the 34 with game.get_timestep() and this will be
fixed.

Fixes #1185.
2024-07-20 18:40:16 -07:00
mothbeanie
487e0c6b2d fix music ear blast bug 2024-07-13 13:11:05 -07:00
Misa
c636713a43 Use add_custom_command over add_custom_target
This fixes an issue where the CentOS CI kept failing because it couldn't
find the generated InterimVersion output file.

It seems like using the BYPRODUCTS statement in add_custom_target
didn't work because BYPRODUCTS was only added in CMake 3.2, so then
add_custom_target never ran, which is obviously a problem.

The solution is to use add_custom_command instead, and to solve the
problem that the interim version needs to be regenerated every time no
matter what (which is what BYPRODUCTS was supposed to do) we just add a
dummy output instead.
2024-07-12 21:34:53 -07:00
Misa
e3876feb3b Style: Lowercase commands in version.cmake
We made the lowercase names be a consistent style in the main CMake file
but we missed this one.

[skip ci]
2024-07-12 21:34:53 -07:00
Misa
d4425ed762 Always have interim version indicators
Previously, the interim version indicators (commit, date, and branch)
would go away on development builds if git didn't exist. And if it did
exist but provided blank output for whatever reason, that was almost
exactly the same as not having them at all (save for the window title
saying "VVVVVV []" which can be easy to overlook). This was bad because
it complicates troubleshooting when you potentially have an unofficial
or in-development build since those get distributed around or compiled
by some people frequently.

Now, there will always be an interim version indicators unless the game
is compiled with -DOFFICIAL_BUILD=ON. And if the indicators are blank
for any reason, they will just be replaced with placeholder defaults so
they will still show up.
2024-07-12 21:34:53 -07:00
Misa
b0d2a6a372 Add -std=c99 for C-Hashmap and FAudio
GCC on CentOS will default to C90, it seems. This means it needs C99
explicitly specified for C-Hashmap and FAudio, or it will fail on them
using C99 features (variable declaration in a `for`-loop and the
`restrict` keyword, respectively).
2024-07-12 21:33:47 -07:00
Misa
ff611a56ff CMake: Scope C99/C++98 flags to VVVVVV only
Due to a confluence of weird factors, it turns out that PhysFS is
compiling with implicit function definitions due to function definitions
that get hidden with -std=c99, but not with -std=gnu99 (or the default
GCC value of -std=gnu17).

Also, due to a recent GCC update (GCC 14), implicit function
declarations are actually prohibited with -std=c99 as the C99 standard
proscribes.

This meant that people started getting build errors in PhysFS code on
default settings, which wasn't ideal.

To fix this, we will make our -std= flags apply only to VVVVVV source
files. In CMake 2.8.12, this can be done with
set_source_files_properties. Additionally the flags to disable
exceptions and RTTI are scoped down too.

Thanks to leo60228 for helping debug and solve this issue.

Fixes #1167.
2024-07-12 21:33:47 -07:00
Misa
7d01c6bdb0 Fix double error dialog if data.zip is missing
A minor gripe, but one thing I didn't notice with commit
b4579d88d3 is that it now results in two
dialogs if data.zip is missing: The first being the "data.zip is
missing" dialog, and the second is the generic "Unable to initialize
filesystem" dialog.

So just bail early if data.zip can't be found, it's going to take the
error path in main() and also bail regardless.
2024-07-11 11:47:59 -07:00
Misa
a990f8d87d Fix wrong comment on disabling MSVC exceptions
`/EHsc` does not actually disable exceptions on MSVC, it only makes the
compiler assume that `extern "C"` functions never throw C++ exceptions.

We had a discussion on Discord about actually disabling exceptions, and
from research, that requires defining `_HAS_EXCEPTIONS=0`, but it's
unsupported and undocumented so we deemed the benefits not worth it.
Thus, we will stay with `/EHsc`. But the comment still has to be
updated.

[skip ci]
2024-07-11 11:44:49 -07:00
Dav999
6df7d5df8a Fix font::print_wrap() name in README-programmers
lang/README-programmers.txt accidentally lists the name of the
font::print function twice, when the second one should've been
font::print_wrap instead. Oops.

[skip ci]
2024-06-28 08:03:55 -07:00
Misa
64c554261e Fix regression: Entities not moving
Commit 53d725f78a, intended to fix an
overzealous commit, was itself overzealous. This is because it applied
to all entities when it should only apply to entity-emitting entities.
To fix this, `entityclonefix` needs to no-op if the entity is not an
entity emitter.

Fixes #1176.
2024-06-09 19:41:48 -07:00
Misa
53d725f78a Fix regression: Overzealous emitter dupe fix
Commit 4f881b9e26 fixed a duplication bug
where enemy movement types 10 and 12 would keep duplicating itself on
every frame if it was spawned outside of the rooms they were supposed to
be used in the main game. The downside was that this was an overzealous
fix and unintentionally broke some cases that were working before.

As brought to my attention by Ally, you can no longer place an edentity
with a `p1` of 10 or 12 (translating to movement type 10 or 12) in the
proper rooms and have it spawn perfectly working entities (that don't
clone on themselves every frame), whereas you could in 2.2. This is
considered a regression from 2.3.

So the problem here is that the reason the two emitter entities were so
dangerous outside their respective rooms is because the entity they
spawned (`createentity` entry 1) checked if it was in the correct rooms,
and if so, it would call `setenemy`, and `setenemy` would set the
`behave` attribute (movement type) correctly, and so the new entity
would have a different `behave` that wouldn't be the exact same `behave`
as the previous one, so it wouldn't be a duplicate emitter entity.

The previous `entityclonefix` worked okay for entry 1, because it would
only be run if the room checks failed and `setenemy` wasn't called, but
it broke a previously-working case for entry 56, because it was always
run for entry 56.

So the best way to check if we have a dangerous entity is not by seeing
if it is still `behave` 10 or 12 at the end of entity creation - because
10 or 12 could be harmless under the right conditions - but by checking
if the right conditions were satisfied, and if not, then neutralize the
entity.

I considered making the emitter entities work everywhere - which would
be simpler - but I didn't want to go too far and add a new feature,
especially in a minor release.
2024-06-07 14:20:28 -07:00
Misa
c20db02f15 Unload zips before loading zips
This fixes a minor issue where if you had a zip in the levels list, but
then removed it, it would still show up in the levels list after
reloading it (if you also had a .vvvvvv file named the same as in the
zip) even though it shouldn't.

Thankfully, this didn't lead to a memory leak or duplicate zip mounts or
anything like that, because PhysFS ignores mounting a zip if it's
already mounted.

This also didn't result in a level entry from a zip persisting after
removal after reloading the levels list, because the entry would be gone
due to the .vvvvvv file not being found.
2024-06-04 15:42:39 -07:00
Misa
dd15d67e62 Fix info args not working with -console
The intention of the `-console` argument was to enable seeing console
output on Windows without having to use workarounds. However, this
didn't actually work for arguments like `-addresses` and `-version`,
because the program would exit first before it could get the chance to
create the console.

The other issue is that the console closes too quickly before output can
be read by the user. So to fix that, we must hold it open and let the
user close it when they want to by waiting for an enter press from
STDIN.
2024-06-03 21:42:57 -07:00
Misa
a9d43b543f Fix regression: Foreground redraw after G keybind
This fixes a regression from 2.4 where the foreground wouldn't update
after using the G keybind to go to a room, requiring the user to touch a
tile to update the rendering.
2024-06-03 20:58:52 -07:00
Misa
16d75d2da8 Disable state locking if inc'ing state w/ ACTION
This fixes a bug report from Elomavi that you could still softlock from
warping to ship and incrementing the gamestate by pressing ACTION, which
is diverging behavior from how it was in 2.3. Warping to ship and
incrementing by pressing ACTION is useful behavior for a couple niche
speedrun categories.

I had already fixed this earlier by ignoring state locking if
glitchrunner 2.2 or 2.0 was enabled, but softlocks could still happen
because having glitchrunner mode off still enabled you to increment the
gamestate when otherwise unintended. Softlocks shouldn't happen.

But without removing state locking entirely, I've chosen a middle ground
where it will only be disabled if you press ACTION. That signifies
intent that you still want to perform state incrementing glitches even
with glitchrunner mode off (but in the future it could be considered a
2.3/2.4 glitch that could be patched and made re-enable-able). That way,
casual players can't interrupt the warp to ship by accident (unless they
accidentally press ACTION) while softlocks will be removed.
2024-05-25 23:34:03 -07:00
Misa
ff6bb68f3a Fix "Thanks for playing!" reversed in Flip Mode
For localization, the "Thanks for playing!" text was split into two
lines, when it was originally one line. Unfortunately, it was not
updated to account for Flip Mode, so in Flip Mode, it looked like
"playing! Thanks for".

This has been fixed.
2024-05-25 23:33:45 -07:00
leo60228
4b2b4fb7c9 CONTRIBUTORS.txt: leo60228 -> leo vriska 2024-05-21 20:57:19 -07:00
Terry Cavanagh
d678bd59ff
Added license exception for Recalbox project
https://shop.recalbox.com/
2024-05-02 17:12:36 +01:00
Misa
ff785aaa8a Bump version to 2.4.2
We still need to fix a couple bugs from 2.4.0.
2024-03-29 21:18:39 -07:00
NyakoFox
3361e71036 Add MSVC version check 2024-03-29 20:31:00 -07:00
NyakoFox
4bba26280f Add /utf-8 to MVSC 2024-03-29 20:31:00 -07:00
Misa
217996b134 Fix UB from out-of-range <stretch>
If there was a scaling mode value (serialized in the XML as <stretch>
for legacy reasons) that was not 0 or 1 or 2, then the rectangle with
the stretch information would not be initialized by get_stretch_info,
which would lead to a crash, either from dividing by zero (most likely)
or from reading an uninitialized value.

To fix this, when reading <stretch>, normalize it to a sane default if
the value is otherwise bogus. And for good measure, an assertion is
added in get_stretch_info() if the value is still somehow bogus.

Fixes #1155.
2024-03-29 20:22:00 -07:00
Misa
8640ead937 Fix copy-paste error in customposition
This would otherwise result in text boxes for custom crewmates being
improperly positioned.
2024-03-29 19:55:41 -07:00
Dav999
a9d438968d Change reply scripting command to player color
This is just a small visual fix to an inconsistency with textbox
colors in simplified scripting. The `reply` command is meant to be
used for the player, and always correctly positions it above the
player, while the `say` command may be used to generate a cyan textbox
that's positioned above a cyan non-player crewmate. However, the color
for both textboxes is always `cyan`, so the `reply` command doesn't use
the (normally identical) `player` color even though all its other
behavior (squeak, position) does. Now that customized textbox colors
were added in 2.4 (#910), it's a shame that this distinction isn't
made between `cyan` and `player`, so this change addresses that (before
we're stuck with levels that change `cyan` but not `player`).
2024-03-29 19:47:46 -07:00
TerryCavanagh
91e144736b whoops 2024-02-09 13:48:11 +01:00
TerryCavanagh
b48cdb0003 minor updates to Spanish 2024-02-09 10:13:17 +01:00
Dav999
99a1562d87 Only re-show language screen in default basedir
After some discussion about the previous commit, the usecase of
managing tons of basedirs and locking files in the filesystem might
mean it gets annoying to have the language screen show up again
whenever a new language is added, for a small group of people. The
solution to get the best of both worlds is to only re-ask for the
language in the default basedir. This means barely anyone will miss
their language having been newly added (especially since barely anyone
will use any custom basedirs, let alone ONLY custom ones).
2024-02-08 10:28:27 -08:00
Dav999
fbc3bd4d5a Make language screen show up once more
Now that two new variants of Spanish have been added, it would be
a shame that many players from Latin-America/Argentina may stay on
Castilian or English because they don't realize the new versions
were added for them. So now, if you've set your language in 2.4.0,
the language screen will show up once more in 2.4.1. This is done by
simply incrementing the lang_set flag to 2 - so that if it's 0 or 1,
your language setting is considered to be possibly outdated.

This shouldn't inconvenience players who don't need to select a new
language - their existing language will still be pre-selected, so they
can just hit ACTION once.

Terry confirms he did the same thing with Dicey Dungeons and says
it's a good idea (and that nobody minds).
2024-02-08 10:28:27 -08:00
KabanFriends
a301ef7c90 Add translation for "Editing and LQA" 2024-02-07 09:08:54 -08:00
Reese Rivers
35ef329575 Translated missing strings into Esperanto
This includes the Spanish variant names, "Editing and LQA",
the "mode enabled" bug text, and the debug mode freeze prompts.
2024-02-07 09:08:32 -08:00
TerryCavanagh
f9e71f1622 added "Editing and LQA" string to es_AR and es_419 2024-02-06 18:08:48 +01:00
TerryCavanagh
003f76464c minor updates to es_419, es_AR and pt_BR 2024-02-06 17:48:45 +01:00
TerryCavanagh
df559e64a9 minor updates to Brazilian Portuguese 2024-02-06 16:21:08 +01:00
Misa
365ee963eb Fix resize-to-nearest could be larger than desktop
This fixes the possibility of the "resize to nearest" graphics option
resizing the game window to be bigger than the resolution of the user's
desktop monitor.

To fix this, just subtract multiples of 320x240 until the chosen
multiple is smaller than the dimensions of the desktop.

Discord user Dzhake discovered this issue.
2024-02-05 18:03:32 -08:00
Dav999
929aaebc84 Align stability generator in es_419 and es_AR 2024-02-05 18:03:08 -08:00
Dav999
d6ec4ae72a Change LATAM Spanish meta.xml Oprime to Pulsa
All of them were changed except for the one in meta.xml. I think it's
safe to assume this is correct, because everywhere else, the same
"Oprime {button} para" pattern always became "Pulsa {button} para" too.
2024-02-05 18:03:08 -08:00
Dav999
139612b319 Fix placeholders in Arabic strings_plural
For some reason all of us overlooked that all of them were {n_crew},
even those which required a different placeholder key...

https://steamcommunity.com/sharedfiles/filedetails/?id=3154670529
2024-02-05 18:03:08 -08:00
TerryCavanagh
2ca912889d minor updates to Latin American Spanish and Argentinian Spanish 2024-02-05 12:04:47 +01:00
KabanFriends
c1a6a1d1df Improve translation for Down Under 2024-02-04 21:37:21 -08:00
KabanFriends
098e356500 Fix typo for Bilinear 2024-02-04 21:37:21 -08:00
KabanFriends
2e633578fd Fix translator credit 2024-02-04 21:37:21 -08:00
KabanFriends
05a3b16f7e Add missing string translations 2024-02-04 21:37:21 -08:00
KabanFriends
55ed42e34c Don't use wordy for numbers 2024-02-04 21:37:21 -08:00
TerryCavanagh
9d933f6c2f minor fixes for Silesian 2024-02-04 20:49:40 +01:00
Ally
3e57d6620c Update desktop_version/src/Graphics.cpp
Co-authored-by: Misa Elizabeth Kai <infoteddy@infoteddy.info>
2024-02-03 18:11:11 -08:00
AllyTally
77a571017d Implement scaling modes manually
For future PRs, it'll be very nice to have full control over how VVVVVV
gets drawn to the window. This means we can use the entire window size
for things like touch input, drawing borders, or anything we want.
2024-02-03 18:11:11 -08:00
Misa
935db27d39 Revert "Translate editor notes on-the-fly"
This reverts commit ec3de52970.

The complexity is not worth it for something that only lasts less than
two seconds anyway. *shrug*
2024-02-02 19:13:59 -08:00