1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-28 15:38:30 +02:00
Commit Graph

2762 Commits

Author SHA1 Message Date
Dav999
37c4f76988 Add RTL language property
This doesn't have an effect yet, but it'll do things like
right-alignment in textboxes and other design-flipping.
2024-01-08 19:17:44 -08:00
Dav999
2003eed2a5 Hide unicode directional control characters
They shouldn't be looked up in the font and displayed under any
circumstances.
2024-01-08 19:17:44 -08:00
Dav999
45ec77973b Implement bidi_should_transform()
This now returns true if any of the characters in the text belong to
the Arabic or Hebrew alphabet, or are one of the Unicode directional
formatting characters. This is just so the bidi machinery doesn't have
to run 100% of the time for 100% of the languages. I will also make it
so the Arabic language pack, as well as custom levels, have an RTL
attribute that always enables bidi (and does things like
right-alignment in textboxes and other design-flipping)
2024-01-08 19:17:44 -08:00
Dav999
822755a75f Add Arabic ligature support
Montassar prepared a list of all the ligatures that needed to be
supported, which was a simple A+B->C table, so that one was not too
difficult either!
2024-01-08 19:17:44 -08:00
Dav999
30c68f70bd Add Arabic font
The Arabic part was made by Montassar Ghanmi, it didn't have its own
Latin part so I just copied 00-FF from Space Station.
2024-01-08 19:17:44 -08:00
Dav999
ef712f9f0c Add support for Arabic reshaping
This code can probably be polished a bit more, but the hard part is
over!

This part was written with guidance of this code:
https://github.com/TerryCavanagh/hx_arabic_shaper
2024-01-08 19:17:44 -08:00
Dav999
e011273eb3 Add Arabic reshaping lookup table
This adds the lookup table and an accompanying hashmap that will be
used for reshaping Arabic - it's not yet used though.
2024-01-08 19:17:44 -08:00
Dav999
59ccdbea00 Implement bidi reordering at display time
I'm now using SheenBidi to reorder RTL and bidirectional text properly
at text rendering time! For Arabic this is still missing reshaping, but
everything's looking really promising now!

The code changes are really non-invasive. The changes to Font.cpp are
absolutely minimal:

     1305+    if (bidi_should_transform(text))
     1306+    {
     1307+        text = bidi_transform(text);
     1308+    }

There's now a FontBidi.cpp, which implements these two functions,
notably bidi_transform(), which takes a UTF-8 encoded string and
returns another UTF-8 encoded string that has bidi reorderings and
reshapings applied.

In that function, SheenBidi gives us information about where in the
input string runs start and end, and on a basic level, all we need to
do there is to concatenate the parts together in the order that we're
given them, and to reverse the RTL runs (recognizable by odd levels).

As this is a proof-of-concept, bidi_should_transform() still always
returns true, applying the bidi algorithm to all languages and all
strings. I'm thinking of enabling bidi only when the language/font
metadata enables RTL (which could be for the interface or for a custom
level), or outside of that, at least when RTL characters are detected
(such as Arabic or Hebrew Unicode blocks).
2024-01-08 19:17:44 -08:00
Dav999
5766e6c426 Add SheenBidi to CMakeLists
Not much to see here, just making sure SheenBidi is compiled with the
game and we can include its headers.
2024-01-08 19:17:44 -08:00
AllyTally
8af57a072a Fix another incorrect autotile 2024-01-08 13:17:59 -08:00
TerryCavanagh
6e436880ab minor fix to Portuguese (pt)
from translator's reply to Kokasgui's feedback
2024-01-08 16:07:27 +01:00
Dav999
5f7cb46a35 Remove hair spaces from Japanese translation
I had added 1px spaces in some Japanese strings with buttons in them,
to avoid the button glyphs touching the rest of the text. However, the
Japanese translator later ended up putting full spaces in, not noticing
the hair spaces. So now the space was 1 pixel wider than it should've
been, and it's better to remove them.
2024-01-07 16:31:42 -08:00
Misa
4922fa4599 Disable debugger logic when not active
This fixes a bug where you could still drag an entity around with the
debugger inactive if you were holding the entity while disabling the
debugger with Y. Furthermore, you couldn't even drop the entity even if
you wanted to.
2024-01-06 20:51:59 -08:00
Misa
9e2d6e921c Fix clash between Gravitron start text and timer
There is a clash between the timer text and the "Survive for 60
seconds!" text. It's minor in English but it can be worse in other
languages (e.g. Polish).

So make the timer go away when that text is onscreen.
2024-01-06 20:38:25 -08:00
Misa
44fb76ba90 Fix clash between timer and return editor text
The "[Press {button} to return to editor]" and the "TIME:" text
overlapped, which resulted in an ugly clash.

To fix this, make the return editor text take priority over the timer
text. This involves a minor refactor to first calculate whether or not
we should draw the return editor text before we check if we should draw
the timer text.
2024-01-06 15:45:40 -08:00
Dav999
f4bdea7d6d Add a system for selecting between wordy/wordy2
Some languages have different spellings of wordy numbers based on the
gender of the things they're counting (uno crewmate versus una trinket)
or what a number's role is in the sentence (e.g. twenta out of twentu).
We've always had the idea we couldn't support such complex differences
though, because the game can't be adapted to know what gender each
object will have and what word classes might exist in other languages,
so translators would in those cases just have to forgo the wordy
numbers and just let the game use "20 out of 20".

A solution we came up semi-recently though (after all translations were
finished except for Arabic), was to allow the translator to define
however many classes of wordy numbers they need, and fill them all out.
This would not need the game to be *adapted* for every language's
specific grammar and word genders/classes. Instead, the translator
would just choose their correct self-defined class at the time they use
`wordy` in the VFormat placeholder. Something like
{n|wordy|class=feminine}, or {n|wordy_feminine}.

So this would benefit several languages, but we came up with the
solution a little late for all languages to benefit from it. The Arabic
translators asked for two separate classes of wordy numbers though, so
my plan is to first just have a second list of wordy numbers
(translation2 in numbers.xml), which can be accessed by passing the
`wordy2` flag to VFormat, instead of `wordy`.

Once 2.4 is released, we can take our time to do it properly. This
would involve the ability for translators to define however many
classes they need, to name them what they want, and this name would
then be useable in VFormat placeholders. We can convert all existing
translations to have one class defined by default, such as "wordy", or
"translation" depending on implementation, but there's not so much
concern for maintaining backwards compatibility here, so we can do a
mass-switchover for all language files. That said, it wouldn't be too
hard to add a special case for "translation" being "wordy" either.
We can then ask translators if they would like to change anything with
the new system in place.

For now, we can use this system for Arabic, maybe Spanish since there
were complaints about uno/una, and *maybe* Dutch (it has a thing where
the number "one" is often capitalized differently, but it's not
mandatory per se)
2024-01-06 14:11:40 -08:00
Dav999
ce1327f37a Enable SDL_HINT_IME_SHOW_UI to make typing CJK not guesswork
For some reason, the default behavior of SDL and/or Windows(?) (I only
tested this on Windows) seems to result in the fact that if any SDL app
doesn't account for it, there is no way for Japanese and Chinese
speakers to know what they're typing in.

How IMEs are supposed to work is that you can type words as sort of
WIP versions, and then select out of a list of candidates what the
final result should be. The app may display the WIP text and tell the
IME where the text field is so that the IME's menu can be displayed
around it. But if the app doesn't say where the text field is, then the
candidate list can also be displayed at the corner of the screen, which
is done in Minecraft.

By default, however, SDL apps don't get a candidate list at all, which
means you're basically flying blind as to what you're typing in, and
you would have to basically open notepad and copy-paste everything from
there - unless I'm missing something.

This commit sets the SDL_HINT_IME_SHOW_UI hint (added in SDL 2.0.18
apparently), so that the candidate list is at least shown in the corner.
We can probably deal with positioning and uncommitted text later.
2024-01-05 15:24:27 -08:00
Misa
95c6dc58d3 Fix TAB bind conflict with translator & debugger
The TAB bind is used in both roomname translator mode and the level
debugger. To fix this, the TAB keybind will prioritize roomname
translator mode, unless the debugger text is enabled (with the Y
keybind), in which case the debugger takes priority. Additionally, the
roomname translator text will not render when the debugger text is
shown.

Fixes #1094.
2024-01-05 11:42:10 -08:00
Terry Cavanagh
7bd281ee3d updated credits to include the Eternal Dream Arabization team 2024-01-04 16:29:01 +01:00
Misa
fc51c2219d README: Reword to "Viki", wordwrap line 2024-01-02 15:33:35 -08:00
TerryCavanagh
eb13e7962a updated Italian localisation credits 2024-01-02 22:27:05 +01:00
Terry Cavanagh
e99c2b7487 reverted note at end of desktop_version/Readme about data.zip and distribution 2024-01-02 22:27:05 +01:00
Terry Cavanagh
f1a5857ffb Update README.md
general cleanup, added a link to Misa's very helpful guide on the vsix wiki
2024-01-02 22:27:05 +01:00
Terry Cavanagh
d94328c6cc added localisation credits to repo 2024-01-02 22:27:05 +01:00
Misa
b4579d88d3 Add SimpleMessageBox for early filesystem bail
This ensures that the game won't silently fail to start if it can't
initialize the filesystem. Instead, it will fail loudly by popping open
a message box (using SDL_ShowSimpleMessageBox).

The motivation for this comes from issue #1010 where this is likely to
occur if the user has Controlled Folder Access enabled on Windows, but I
didn't want to put in the work to specifically detect CFA (and not sure
if it's even possible if it turns out that the OS just gives a standard
"permission denied" in this case). At least any message box is better
than silently failing but printing to console when most users don't know
what a console is.

Fixes #1010.
2023-12-31 16:54:53 -08:00
Reese Rivers
76882e9a13 Update "It's Not Easy Being Green" Esperanto roomname translation 2023-12-30 11:37:43 -08:00
Misa
e318d6f176 Fix regression: Tower BG lerps in reverse direction
This is the same as commit 70357a65bf
("Fix regression: Warp BG lerps in reverse direction"), but for the
tower background.

This bug is most visible when moving the camera in a tower using
invincibility, or holding down ACTION during the credits scroll.
2023-12-29 14:11:08 -08:00
Misa
e6b1b54214 Add a fast-forward keybind to level debugger
This lets you hold down F to fast-forward the game if you have the level
debugger interface open (with Y) and the game isn't paused.

This is most useful for quickly skipping through cutscenes to test
something.
2023-12-29 13:56:30 -08:00
Misa
b8fdbe53b9 Fix loading plain font.png Unicode indexing out of bounds
This code was introduced by Dav999 in
abf12632bb (PR #1077), but it contains a
memory error. I spotted this with Valgrind.

The problem comes from the fact that `max_codepoint` is calculated from
the width and height of the surface (which will have the same width and
height as the source `font.png` from the filesystem). Let's work through
an example using a typical 128 by 128 `font.png` and an 8 by 8 glyph.

`chars_per_line` is calculated by dividing the width of the image
(`temp_surface->w`, or 128) by `f->glyph_w` (8), yielding 16.
`max_codepoint` is calculated by first calculating the height of the
image divided by the height of the glyph - which here just happens to be
the same as `chars_per_line` (16) since we have a square `font.png` -
and then multiplying the result by `chars_per_line`. 16 times 16 is 256.

Now it is important to recognize here that this is the _amount_ of
glyphs in `font.png`. It is _not_ the last codepoint in the image. To
see why, consider the fact that codepoint 0 is contained in the image.
If we have codepoint 0, then we can't have codepoint 256, because that
would imply that we have 257 codepoints, but clearly, we don't. If we
try to read codepoint 256, then after working through the calculations
to read the glyphs, we would be trying to read from pixel columns 0
through 7 and pixel rows 128 through 135... in a 128 by 128 image...
which is clearly incorrect.

Therefore, it's incorrect to write the upper bound of the for-loop
iterating over every codepoint as `codepoint <= max_codepoint` instead
of `codepoint < max_codepoint`.
2023-12-29 11:55:09 -08:00
Misa
6f435661e7 Add inbounds pixel assertion to DrawPixel/ReadPixel
I was running the game through Valgrind and I noticed a memory error
where the game was attempting to read a pixel that was just outside the
image. Since this is an error that doesn't immediately result in a
segfault, I figured that it would be prudent to put in an assertion to
make it loud and clear that a memory error is, in fact, happening here.

Similarly, drawing to a pixel just outside the surface wouldn't result
in a crash, so I copy-pasted the check there too (with changes).
2023-12-29 11:54:19 -08:00
AllyTally
e1e5e43089 Fix another incorrect tile in autotiler 2023-12-24 12:39:22 -08:00
AllyTally
1d130acc20 Fix resizing the map not changing the current room
If you're in (5, 5) (1-indexed) and you resize the map to (4,5), the
editor stays in (5, 5). This has no real consequences, other than
possibly confusing the user, but it should probably be fixed anyway.
2023-12-24 12:36:16 -08:00
Dav999
a97ba5e768 Fix minor [Press ACTION to save your game] overflow in German
Turns out the string I fixed in the previous commit was also never
noticed in German. For that one, I simply used the wording that was
used in the old hardcoded-ACTION string (with my German knowledge,
I'm confident that's still correct).
2023-12-23 10:50:12 -08:00
Dav999
1dc7ed4d65 Fix minor [Press ACTION to save your game] overflow in Turkish
When ACTION is filled in, the closing ] will go offscreen.
To fix it, I simply removed the square brackets.
2023-12-23 10:50:12 -08:00
Ethan Lee
148b518745
Steam now shares device info with SDL! 2023-12-20 23:17:28 -05:00
TerryCavanagh
30c9438f17 minor fixes for Spanish 2023-12-18 16:59:12 +01:00
Dav999
827417fec8 Restore gravity/warp lines sticking out a tile offscreen
I just discovered this: whereas 2.3 and older versions make gravity
and warp lines - when placed in the editor - stick out one tile
offscreen, the latest version stops the lines at the room border.

This change restores the old behavior, and it's a simple fix: the
refactored code was written to let tiles outside the room block
gravity/warp lines. Instead of all offscreen tiles blocking lines, now
there's a 1-tile padding around the room that will let them through.
2023-12-15 20:03:34 -08:00
Dav999
82aef30649 Minor indentation style fix in Render.cpp
This used 2-space indentation for one level, as well as }else{ on a
single line.
2023-12-15 20:00:05 -08:00
Dav999
e638544665 Add limits to the translator credits strings
Luckily, seems like no language has broken the limit when it is 40!
2023-12-15 20:00:05 -08:00
Dav999
bf85e10219 Try to prevent some lines in rolling credits going offscreen
The new localization-related credits are placed 5 characters from
the left border in the rolling credits (at x=40), which means the
limit was 35 8x8 characters. Which was broken by several languages.
So instead, move the string leftward a bit if it would run offscreen
otherwise.
2023-12-15 20:00:05 -08:00
Dav999
c1fea5f55a Fix current_credits_list_index not always being reset
If you go into the middle of the list of translators in the main menu
credits, then press Escape, and then go into the credits again, the
first page of the list may start at the wrong place, because while
game.translator_credits_pagenum was reset to 0,
game.current_credits_list_index wasn't. This is fixed now.
2023-12-15 20:00:05 -08:00
Dav999
f420b08a0b Fix translator credits headers being forced to 8x8 font
The header "Translators", as well as the language names, were using
PR_FONT_8X8, even though it was translatable text. This is now fixed.
(Also, the CJK spacing for the language names is now higher because
that looked nicer)
2023-12-15 20:00:05 -08:00
Dav999
abf12632bb Load plain font.png beyond U+007F
VVVVVV 2.2 only supported displaying characters 00-7F with its font
system. VVVVVV 2.3 added support for unicode, by supplying a font.txt
with all the characters that are in the font image. But 2.3 made
another change that I didn't immediately realize, even after reading
the code: if font.txt is not present, then the font is not assumed to
have _only_ 00-7F, but _all_ of unicode, as far as the image dimensions
allow.

However, an inconsistency I _did_ notice is how unknown characters
would be rendered in 2.3. If a font had a font.txt, then any unknown
characters would be shown as a '?'. If a font had no font.txt however,
then suddenly any unknown characters would just come out as a space.
I fixed this behavior with the new font system; but what was actually
happening for characters to come out blank is that characters up to
U+00FF, which _were_ technically in the font image but as fully
transparent, would be shown as they were in the image, and characters
beyond U+00FF wouldn't be shown since they were outside of the image.

I don't really want to show blank characters for any character between
80-FF if it is technically inside the image, because pretty much every
single ASCII-only font.png in existence (including the one in data.zip)
contains a blank lower half, just because the font in the game had
always had this specific resolution. (We didn't want to do things that
might crash the game because something was different from what it
expected...)

We have had some confusing occasions before with the old behavior where
the fonts weren't correctly packaged or something (like when the
Catalan translator was sent the first version of the translator pack,
or when people customize their fonts wrong) and special characters were
just blank spaces.

So, instead, for characters beyond 7F, I decided to consider them part
of the font, as long as they are not blank. That means, if a character
beyond the ASCII range has any (non-alpha-0) pixels, then it will be
added, otherwise it won't be. This is just to handle legacy fonts, and
the case where all fonts are missing and the one from data.zip is used;
new fonts should just use .fontmeta or .txt to define their characters.
2023-12-15 19:54:33 -08:00
Dav999
c2ad3d3b97 Clarify translators and programmers READMEs
The top of the programmers readme now says that you need the
translators readme to translate the game into a new language. Also,
since language file syncing now works to populate an empty language
folder, document that in the translators readme as well.
2023-12-15 19:48:55 -08:00
Dav999
6377fd5e73 Make language sync support creating blank language files
Two translators thus far have tried to populate initial language files
by creating a blank folder and then using the in-game sync option. For
example, see #1078.

That is not how the sync option was intended to be used, but it's
really close to getting everything, so I decided to just complete the
support by making sure numbers.xml is copied from English, and making
sure meta.xml is filled in with English text and not text from an
arbitrary language. Also, minor detail on plural form 1 being set to 1
by default if reset, so strings_plural.xml is fully consistent too.
2023-12-15 19:48:55 -08:00
Dav999
66ba557c4d Fix binding menu allowing you to lock yourself out of the game
Or well, lock yourself out if you don't have (easy) access to a
keyboard, like on Steam Deck.

In 2.3, this problem used to be much worse, since you could bind any
button to "menu" - which is actually also "return" in menus - and that
button could then no longer be bound to any other action, because
exiting the bindings menu had priority over assigning a different
binding. The result would be that people could have all their buttons
bound to "escape" with no way of undoing it or using their controllers
at all other than manually going into their config file to change it.

In 2.4, the most important bugs in the bindings menu are fixed, but
it's still possible to remove all your bindings from the "flip"
(confirm) action, meaning you can't navigate the menus anymore with a
controller to fix your bindings or even do anything.

There is one interesting part to all this: if an action has no buttons
bound to it at all when the game is started, then that action is
populated with the default button for that action. This is done for
each action separately, without accounting for the case where the
default button was already bound to another action which was not empty.
(This is something that the binding menu does try to prevent).
Therefore, having no buttons bound to "flip" while having A and B bound
to "menu", would result in A being bound to "flip" and A and B bound to
"menu".

That would still make you unable to enter the gamepad menu, since both
"confirm" and "return" are pressed in a row.

This commit fixes the specific situation where flip/confirm buttons are
also bound to menu/return, by removing all buttons that are in the flip
button list from the menu list. This means that, on Steam Deck, you can
still go to your bindings menu.
2023-12-15 19:44:51 -08:00
AllyTally
9782b450ef Fix broken warp background check
Seems like I made a mistake while originally writing the "make
autotiling base" code. This commit fixes the warp background turning
into solid tiles when you switch to a different tileset.
2023-12-15 19:40:07 -08:00
AllyTally
03bc9566fb Make outside background tiles ignore solid walls
This was the behavior in the old autotiling system, so this brings that
behavior back.
2023-12-15 19:40:07 -08:00
TerryCavanagh
d314672614 whoops 2023-12-12 15:19:21 +01:00
TerryCavanagh
b11d33f353 updated Italian localisation credits 2023-12-12 10:22:44 +01:00
TerryCavanagh
7e000a9668 minor updates to Italian 2023-12-12 10:17:22 +01:00
TerryCavanagh
4005fe9725 updates to Korean
from our translator, based on TARI1237KR's feedback
2023-12-11 10:42:45 +01:00
TerryCavanagh
912e621259 minor updates to Welsh, German, Japanese, Polish and Silesian 2023-12-06 19:20:28 +01:00
TerryCavanagh
9a40993b5f Add localisation credits to main menu credits
In addition, this adds Ally and mothbeanie to the Localisation
Implementation page credits. Also updated the game complete credits!
2023-12-05 16:14:06 -08:00
TerryCavanagh
e754654926 Change Spanish name in meta.xml to Español (es)
might consider adding an Español (latam) edit next year, but this is
enough for 2.4. We're using "Español (es)" instead of "Castellano"
because our translator prefers it
2023-12-05 16:14:01 -08:00
Reese Rivers
79376ae82e Initial implementation of localisation credits
This commit adds translation credits to the game's end credits
screen. Note that this is not implemented into the menu credits
screen yet. The translator name list is subject to tweaks, and
additionally some localised strings ("Localisation Project Led by"
and "Pan-European Font Design by") run off the screen in some
languages (Catalan, Spanish, Irish, Italian, Dutch, European
Portuguese and Ukrainian) and will need to be addressed later.
2023-12-05 16:13:03 -08:00
TerryCavanagh
c660000292 updated İZLE sprite for turkish
as approved by our translator
2023-12-05 16:46:41 +01:00
Dav999
8f7d0f4913 Make some minor refinements to Dutch translation
I put a main focus on the first cutscenes in the game, changing the
first "Uh oh..." from something like "Oh dear..." to "Oh no..." to make
sure it always sounds right. (The real translation of "Uh oh" is "O-o",
but that seemed too easy to read wrong for the first line in the game
that I wanted to avoid it altogether.)
2023-12-05 16:41:05 +01:00
Dav999
d745bf2e6c Restore correct LIES/TRUTH for Korean
This reverts the Korean sprites in commit
6a8db6a22d.

How many times did we accidentally flip these around now lol
2023-12-05 15:33:20 +01:00
Dav999
2533e144b6 Fix centering of game complete texts if level font != interface font
Textboxes created with graphics.createtextboxflipme() use PR_FONT_LEVEL
by default, but can be overridden with graphics.textboxprintflags() to,
for example, set PR_FONT_INTERFACE. This happens for the textboxes on
the Game Complete screen, which use interface text. The textboxes are
centered by setting the X position to -1 though, which means they're
solely centered based on the width of the first line, in the level
font (because the font hasn't been changed to the interface font yet).

Normally, this isn't a problem, because in the main game (where the
Game Complete screen usually appears), the level font is always equal
to the interface font. However, in custom levels you can still get it
(by calling gamestate 3500) and in that case some of the text may be
misaligned. This change fixes that by adding graphics.textboxcenterx()
to these textboxes.

As far as I can tell, these are the only textboxes that are centered
by just x=-1 despite changing the font afterwards.
2023-12-04 19:49:17 -08:00
Dav999
3c49be7d81 Fix ACCIÓN having changed to ACTION in Spanish 2023-12-04 19:45:01 -08:00
Ethan Lee
2d1009e815 Add "type:" override check for virtual Sony gamepads.
Fixes #1056
2023-12-01 12:08:26 -05:00
AllyTally
b23983c0b8 Fix BG tile bug from switching from pink SS
If you had a pink space station background, and switched to a different
tileset, some solid tiles would be placed instead. This commit fixes
that by transforming the room into the basic autotiling tiles before
changing the tileset itself. The reason why I chose this solution is
because it will help with a future change, being unhardcoding warp zone
backgrounds (which'll help with custom autotiling, if that becomes a
thing.)
2023-11-30 19:17:52 -08:00
AllyTally
96d36f86f0 Change 0s to 713 for lab background
This is so it gets treated as a background tile, so background tiles
don't get thrown away when you shift tilesets.
2023-11-30 19:17:52 -08:00
Dav999
bafd494a67 Polish: Change roomname Ostrzeżenie to Przestroga 2023-11-30 14:59:30 -08:00
Dav999
10ed1079ae Fix "he'd be a a big help" typo
Now that the language files are fairly stable, we should be able to do
this without any accidental reverts taking place (if any do happen, it
should be easy to see and prevent)
2023-11-30 08:38:40 -08:00
Dav999
a111576a98 Correct one letter's capitalization in German
It's a menu option, so it should be uncapitalized, like all other menu
options.
2023-11-29 17:56:58 -08:00
Reese Rivers
80626d358c Fixed duplicated/shifted characters 2023-11-29 10:24:07 -08:00
Dav999
02e15ed829 Italian: Fix in-game timer ON/OFF being reversed 2023-11-29 09:52:14 -08:00
Dav999
1ae9370a72 Japanese: apply change from 凄い to すごい 2023-11-29 09:52:14 -08:00
Misa
af35be5bb6 Name conditionals in text box loop
With the recent change to drawing overlays (images and sprites) from
PR #1058, it's starting to get a bit hairy. This names the conditionals
responsible for determining if the text box is transparent (checking
that all of its RGB is 0) and if overlays should be drawn or not (which
is now either when it's opaque or transparent).
2023-11-28 19:07:49 -08:00
Reese Rivers
44a889efeb Changed timing of textsprites in transparent textboxes
Textsprites and textimages no longer wait for the opacity
value in order to display within transparent textboxes.
Text sprites in normal opaque textboxes are not affected
by this change.
2023-11-28 19:07:49 -08:00
Reese Rivers
2e950fc935 Update Space Station font to latest version 2023-11-28 18:11:42 -08:00
AllyTally
041a81d8de Fix incorrect tiles in outside BG autotiling 2023-11-28 17:21:02 -08:00
Dav999
133adba10e Fix remaining audio speedup/slowdown bug
Fixes #1057.

Based on Ethan's hunch, I simply removed the format comparison that
decides whether to halt and restart, or reuse the voice. Voices are
now always restarted when playing a new track.

This also simplifies the code somewhat: `MusicTrack::musicVoiceFormat`
was now no longer used, and an `if (!IsHalted())` was no longer
necessary because `Halt()` already does that. So those are now removed
as well.
2023-11-28 20:16:38 -05:00
Dav999
456a81df67 Add spaces at the end of "TEMPS :" string (and MORTS and BLINGS)
This string is used both in time trials (alongside "MORTS :" and
"BLINGS :") as well as outside time trials if you enable the in-game
timer. In English, this looks like "TIME:1:23.45". Since French adds
a space before the colon, it will look like "TEMPS :1:23.45" instead.
Therefore, I've added a space after the colon as well.
2023-11-27 18:45:09 -08:00
Dav999
d49fb7eb2e Apply changes to two terminal textboxes in Japanese
These are to make the textboxes not overlap with the header, by making
them wrap to less lines.
2023-11-27 15:22:22 -08:00
Dav999
61c5e18413 Fix position of crewmate in "You have rescued a crew member!" box
At first my CJK changes also misaligned this sprite, and my solution
that time was to position the textbox higher depending on the height
of the textbox, so it would be centered around the crewmate sprite
(which stayed at a hardcoded place onscreen). Recently, #987 changed
these sprites to be relative to the position of the textbox instead of
relative to the screen, which is much more logical, but it stopped
centering these sprites again. But it's an easy fix: simply account for
the extra-added height when adding the sprite in.
2023-11-27 15:02:47 -08:00
Misa
c9fd9e7924 README: Delete section on compiler quirks
This hasn't been relevant for years now. Even in 2.3, this wasn't
relevant, but we added a disclaimer saying that it only applies to 2.2.

But now issue #1052 has been opened specifically pointing to this
section as something that should be removed. Therefore, I'm removing it.
2023-11-27 13:43:23 -08:00
Misa
70357a65bf Fix regression: Warp BG lerps in reverse direction
This fixes a regression caused by PR #923 (the PR that moved rendering
to be GPU-based) where the interpolation of the horizontal and vertical
warp backgrounds (in over-30-FPS mode) was in the wrong direction, which
makes them look blurry.

This happens because the arguments to the `lerp` function were in the
wrong, reverse order.

On the VVVVVV Discord server, Ally raised the argument that they were in
the same order before she made the changes; therefore the previous code
was also incorrect and it wasn't her fault. However, this argument is
incorrect, because in that case, the reverse order _is_ the correct
order.

The reason that it's now the wrong order is because the output of `lerp`
is now being used as the argument to a source rectangle. Previously, the
output of `lerp` was being used as the offset argument to
`ScrollSurface`, which is analogous to being a destination rectangle.

Fixes #1038.
2023-11-27 13:29:06 -08:00
Ethan Lee
8426e0930d VS2010 buildfixes.
The main issue was mostly that we have to build C files as C++ in some
cases, and extern "C" wasn't being used everywhere, so linker errors
popped up. The rest is the usual tedious VS2010 stuff like casting void*
to other stuff, so this commit as a whole is pretty boring!
2023-11-27 12:09:42 -05:00
TerryCavanagh
4725bc4d5e minor change to SIM enemy sprite in pt_BR and pt_PT 2023-11-25 23:31:51 +01:00
TerryCavanagh
0d13a1d38b small update to Polish (changed roomname Aleja Woronicza -> Taśmy prawdy) 2023-11-25 17:08:36 +01:00
TerryCavanagh
46df77e837 minor fixes for Turkish and Esperanto 2023-11-25 16:07:29 +01:00
David Galiev
c27f35b15d Fix some Russian strings 2023-11-25 15:21:47 +01:00
TerryCavanagh
6bbc649269 minor fixes for Polish and Silesian 2023-11-25 15:21:47 +01:00
TerryCavanagh
432487b2d9 Final strings for Polish and Silesian 2023-11-25 15:21:47 +01:00
TerryCavanagh
081b8938b6 minor fixes for Irish
fixed checkpoint letter S being wrong upside down, changed the "big C thing" cutscene
2023-11-25 15:21:47 +01:00
TerryCavanagh
6a8db6a22d Enemy graphics for all other languages*
*subject to changes

Also, Traditional Chinese is current using the Simplified Chinese graphics, which is acceptable but not ideal:

Obey -> 服從 (ok to use simplified 服从)
Lies -> 謊言 (ok to use simplified 谎言)

The other words are the same for Simplified Chinese and Traditional Chinese.
2023-11-25 15:21:47 +01:00
TerryCavanagh
268564cadc minor fix for Esperanto (checkpoint c -> k) 2023-11-25 15:21:47 +01:00
TerryCavanagh
e1eaaaed32 minor fix for Spanish
whoops
2023-11-25 15:21:47 +01:00
TerryCavanagh
b2d15c0bba Final strings for Spanish 2023-11-25 15:21:47 +01:00
TerryCavanagh
5a95040a4d Enemy graphics for Korean 2023-11-25 15:21:47 +01:00
TerryCavanagh
83b9db71ee Final strings for French 2023-11-25 15:21:47 +01:00
TerryCavanagh
f5b9c3b09e Final strings for European Portuguese 2023-11-25 15:21:47 +01:00
TerryCavanagh
43cb7a5cde Final strings for Welsh 2023-11-25 15:21:47 +01:00
TerryCavanagh
085b2d5987 minor fix for Japanese 2023-11-25 15:21:47 +01:00
TerryCavanagh
61d14ce2af Enemy graphics for Japanese
These depend on pull request https://github.com/TerryCavanagh/VVVVVV/pull/1031 - if the format or implementation changes, I'll update the branch to match!
2023-11-25 15:21:47 +01:00
TerryCavanagh
99dd10b158 Final strings for Japanese 2023-11-25 15:21:47 +01:00
TerryCavanagh
48d9ab3083 Final strings for Brazilian Portuguese 2023-11-25 15:21:47 +01:00
TerryCavanagh
195b375d2e minor fixes for Ukrainian 2023-11-25 15:21:47 +01:00
Dav999
2db9eaa9a2 Final strings for Esperanto (credits part) 2023-11-25 15:21:47 +01:00
TerryCavanagh
7ad96c6d43 Final strings for Ukrainian 2023-11-25 15:21:47 +01:00
TerryCavanagh
9bea54578e Squashed commit of the following:
commit 3d6802add8
Author: Dav999 <dav999.tolp@gmail.com>
Date:   Thu Oct 19 17:16:01 2023 +0200

    Change AVOID to FAINIC in Irish

commit 21fd84f479
Author: Dav999 <dav999.tolp@gmail.com>
Date:   Thu Oct 19 17:04:27 2023 +0200

    Partial final strings for Esperanto

    This does not yet include the new localization credits, but I already
    had all the other strings.

commit 45382a358c
Author: Dav999 <dav999.tolp@gmail.com>
Date:   Thu Oct 19 17:01:30 2023 +0200

    Final strings for Dutch

    I also decided to change AVOID from ONTWIJKEN to ONTWIJK, to make it
    a bit more fitting as if it's an actual word enemy with length
    restrictions, heh. (Not that it's an abbreviation - it's just an
    imperative instead of an infinitive. And those terms I had to look up)
2023-11-25 15:21:47 +01:00
TerryCavanagh
dcb447b4f3 Final strings for Italian 2023-11-25 15:21:47 +01:00
TerryCavanagh
0cfce45ec6 Final strings for Turkish 2023-11-25 15:21:47 +01:00
TerryCavanagh
faa4266eb7 Final strings for Traditional Chinese 2023-11-25 15:21:47 +01:00
TerryCavanagh
3c4337eca6 Minor fixes for German and Irish 2023-11-25 15:21:47 +01:00
TerryCavanagh
ea7f6982db Final strings for Irish 2023-11-25 15:21:47 +01:00
TerryCavanagh
822aec9d10 Final strings for German 2023-11-25 15:21:47 +01:00
TerryCavanagh
0ae927eb3b Changed to Simplified Chinese to match enemy graphic changes 2023-11-25 15:21:47 +01:00
TerryCavanagh
5ca49e607e Final strings for Simplified Chinese 2023-11-25 15:21:47 +01:00
TerryCavanagh
e30dd618d2 Final strings for Catalan, Russian and Korean
more incoming
2023-11-25 15:21:47 +01:00
AllyTally
b7a8bb138c Unhardcode TAB in translation strings
In case we want to make it rebindable in the future, we shouldn't make
translators retranslate these strings.
2023-11-19 17:34:23 -08:00
AllyTally
4df35da0e4 Fix debugging in the tower, update wording
Fixes debugging mouse targets and rendering in the tower. This also
changes "movement" to "gameplay" in the TAB hint.
2023-11-19 17:34:23 -08:00
AllyTally
0804f2d0c0 Add warp background as general information 2023-11-19 17:34:23 -08:00
AllyTally
f7ca850017 Update to latest commit 2023-11-19 17:34:23 -08:00
AllyTally
6b7bf44402 Add gravity line true hitbox visuals 2023-11-19 17:34:23 -08:00
AllyTally
55a05342e9 Replace manual check with SDL_PointInRect 2023-11-19 17:34:23 -08:00
AllyTally
63620efac8 Fix moving entities flashing in over 30fps mode 2023-11-19 17:34:23 -08:00
Ally
689768b8ca Fix issues
Co-authored-by: Dav999 <44736680+Dav999-v@users.noreply.github.com>
2023-11-19 17:34:23 -08:00
AllyTally
aff4d2012c Add -leveldebugger flag
This commit adds the `-leveldebugger` flag so you can use it while
playtesting from a different editor program, such as Ved.
2023-11-19 17:34:23 -08:00
AllyTally
c62da1c9a0 Add flag display by holding U 2023-11-19 17:34:23 -08:00
AllyTally
fd2f738145 Debug lines while not hovering
This commit adds new debug lines while you're NOT hovering over an
entity or a block. Additionally, coordinates are now displayed smaller,
to not take up as much vertical space.
2023-11-19 17:34:23 -08:00
AllyTally
be77047440 Add more info, add lang string 2023-11-19 17:34:23 -08:00
AllyTally
91f87fa126 Add level debugger screen
The level debugger is toggleable in playtesting mode by pressing Y.
You can toggle whether or not the game is paused inside of the debugger
by pressing TAB. The debugger screen allows you to see entity and block
properties, and allows you to move them around.
2023-11-19 17:34:23 -08:00
Dav999
3c4ed36418 Translate hardest room at display time instead of at time of death
The hardest room used to be stored as a room name in whatever language
it was in when you last died enough times to break the record (before
localization, that was always English). Even after localization became
a thing we could get away with this since we only had a single font,
but now we might have actual question marks appearing when the new font
doesn't support characters from the old language.

Therefore, this commit adds more info about the hardest room to save
files - everything that is needed to know in order to do the
translation at display time. These are hardestroom_x and hardestroom_y
for the room coordinates, as well as hardestroom_specialname to mark
special names, in addition to changing the stored room name back to
English. I've also added hardestroom_finalstretch in case we later
decide to drop the English name as a key and rely on just the
coordinates (even though I think that change itself would be more
complicated than any simplification it would accomplish, and I don't
think it's necessary, but better to have it if we do need it later)
2023-11-19 16:47:52 -08:00
Dav999
e0e902d717 Change levelstats data type from vector to map
As described in #1016, there used to be a bug that inflated
levelstats.vvv in 2.3, which was fixed in 2.4, but there was no way
for inflated files to get smaller yet.

This commit changes the storage of levelstats from a std::vector of
structs to a std::map, so that uniqueness is guaranteed and thus the
stats can be optimized automatically. And it also simplifies *and*
optimizes the code that handles the levelstats - no more big loops that
iterated over every element to find the matching level.
(Farewell to the "life optimisation and all that" comment, too)

I tested this with both my own levelstats.vvv, as well as some inflated
ones (including Balneor's 93 MB one) and saw this code correctly reduce
the filesize and speed up the levels list.

Fixes #1016.
2023-11-19 16:18:54 -08:00
Dav999
82240d262b Game::loadcustomlevelstats: move some declarations to later in function
The declarations of `std::vector<std::string> customlevelnames` and
`std::vector<int> customlevelscores` are made quite early in the
function, commented with "Old system", but the place where the old
system is processed is after a big chunk of code that processes the new
system (and indeed never uses these vectors). So for readability,
they're now closer to where they're used.
2023-11-19 16:18:54 -08:00
mothbeanie
58c006f61f decrease map cursor margin on smaller map sizes 2023-11-19 15:59:27 -08:00
mothbeanie
94ece095ed PR_BOR8 -> PR_FULLBOR, border8 -> full_border 2023-11-19 15:59:27 -08:00
mothbeanie
947d716be6 remove tile_offset (no longer used) 2023-11-19 15:59:27 -08:00
mothbeanie
3a3ec659d6 Add translingual map legend code + border8 2023-11-19 15:59:27 -08:00
mothbeanie
7840f72389 Add translingual map legend characters to font 2023-11-19 15:59:27 -08:00
AllyTally
103b4d36a1 Add textimage for levelcomplete and gamecomplete
`levelcomplete` and `gamecomplete` were hardcoded using textbox colors
which were offset by 1. This PR fixes that, no longer requiring
slightly-off colors, and instead adding a new property to textboxes
which tell the game to display either level complete or game complete.
2023-11-19 15:07:25 -08:00
AllyTally
b5c9508dd4 Finish implementing sprites in textboxes
This commit adjusts the Y position for flip-mode, and makes the main
game use this new system.
2023-11-19 15:07:25 -08:00
AllyTally
76ea4488af Initial implementation of textbox sprites
This commit adds a system for displaying sprites in textboxes, meant to
replace the hardcoded system in the main game. This does not support
levelcomplete.png and gamecomplete.png yet, which will most likely just
be special cases.
2023-11-19 15:07:25 -08:00
Dav999
187fd85e14 Change saved <summary> tag back to English
This ensures loading a 2.4 save in the English-only 2.3 or earlier
doesn't result in missing characters because a translated area name
appears in the save file. We are not reading from <summary> anymore
in 2.4.

The way this is done is by not translating the area names inside
mapclass::currentarea(), but at the callsites other than the one which
saves the <summary>.
2023-11-19 13:49:59 -08:00
Dav999
ac7fe4475c Remove more tele/quick variables duplicating info in struct Summary
For both `tele` and `quick`, I removed these attributes of class Game:
- std::string *_gametime
- int *_trinkets
- std::string *_currentarea
- bool *_crewstats[numcrew]

All this info can now be gotten from members of Game::last_telesave and
Game::last_telesave. I've also cleaned up the continue menu to not have
all the display code appear twice (once for telesave and once for
quicksave).

RIP "Error! Error!" though lol
2023-11-19 13:49:59 -08:00
Dav999
f23ffc0457 Get rid of Game::savearea (std::string)
This is what got saved to the area part of the <summary> tags, and it
was specifically set upon pressing ACTION to save in the map menu.
Which meant tsave.vvv may not get an accurate area name (notably
"nowhere" if you hadn't quicksaved before in that session) even though
it's not displayed anywhere so it didn't really matter. But this
variable can be removed - there's only one place where <summary> is
written for both quicksaves and telesaves, so that now gets the area
at saving time.

Fun fact: custom level quicksaves also have a <summary> tag, and it's
even less functional than the one in tsave.vvv, because it stores
whatever main-game area name applies to your current coordinates.
So I simply filled in the level's name instead (just like what the
actual save box says).
2023-11-19 13:49:59 -08:00
Dav999
0ea41e7913 Replace std::string Game::telesummary and Game::quicksummary by Summary
Game::telesummary and Game::quicksummary stored the summary string for
the save files - which is the <summary> tag that says something like
"Space Station, 10:30:59". The game only ever displays the quicksave
variant of these two, for "Last Save:" on the map menu's SAVE tab.
So the telesave has a <summary> too, but it's never displayed anywhere.
(In fact, the area is often set to "nowhere"...)

However, the summary strings have another function: detect that both
the telesave and quicksave exist. If a summary string for a save is
empty, then that save is considered not to exist.

I'm refactoring the summary string system, by making the new variables
Game::last_telesave and Game::last_quicksave of type struct
Game::Summary. This struct should have all data necessary to display
the summary string at runtime, and thus translate it at runtime (so
we don't store a summary in a certain language and then display it in
the wrong font later - the summary can always be in the current
language). It also has an `exists` member, to replace the need to
check for empty strings.

The <summary> tag is now completely unused, but is still written to
for older versions of the game to read.

(This commit does not add the new string to the language files, since
Terry now added it separately in his own branch)
2023-11-19 13:49:59 -08:00
Dav999
64bad7d67f Remove double NULL check in loadthissummary() 2023-11-19 13:49:59 -08:00
Dav999
61adffe6eb Remove finalmode from struct Summary
It's unused (other than some map.finalmode assignments which should not
be there) and we don't need it either. If we do, we can always readd
it.
2023-11-19 13:49:59 -08:00
Dav999
50a560dc5f Change savex and savey in struct Summary to saverx and savery
This is a bit misleading otherwise, since it is the room coordinates,
not pixel coordinates.
2023-11-19 13:49:59 -08:00
Dav999
4e5126a596 Move struct Summary from Game.cpp to Game.h
This will allow it to be used in other source files in a later commit.
2023-11-19 13:49:59 -08:00
Dav999
89a165722e Simplify mapclass::currentarea()
It used to take a single int: the area number returned by
mapclass::area(roomx, roomy). All uses of currentarea() were called
with an extra area() call as its argument. Additionally, there's a
good reason why currentarea() should have the room coordinates: in one
of the cases that it's called, there's a special case for the ship's
coordinates. This results in the SAVE screen in the map menu being able
to show "The Ship", while the continue screen shows "Dimension VVVVVV"
instead. Therefore, why not put that exception inside currentarea()
instead, and remove a few callsite map.area() wrappers by making
currentarea() take the room x and y coordinates?
2023-11-19 13:49:59 -08:00
Dav999
73911a7ada Remove game.customquicksummary
It's completely unused (apart from the variable being set in one
place). So let's get this out of the way.
2023-11-19 13:49:59 -08:00
Misa
0a72cc6614 Android: Update README.md for Maven package
Since #1047 was merged, we now make the user build the SDL prefab
themselves (as SDL does not publish Maven packages yet). Here are some
instructions for doing that.
2023-11-14 17:29:34 -08:00
leo60228
ca71410f14 Use Android SDL2 via Maven 2023-11-14 17:18:08 -08:00
Dav999
1d3173f5c1 Fix %cs showing instead of commit date on Windows (or older git?)
Whenever I'd compile on Windows, I'd see the literal text "%cs" in the
main menu instead of the commit date. I never thought much of it (at
least it runs, and the date only shows up in development builds). Now
that I've also seen a screenshot from Terry with it, I decided to look
into it further. Looks like it's a format string that our gits on
Windows aren't recognizing for whatever reason - probably because
they're too old. I have git version 2.23.0.windows.1, and checking its
help page for `git log`, under PRETTY FORMATS, %cs is missing as an
option, while some other options are still there. So the option was
probably added sometime between that version and 2.34.1, which is the
one I have on Linux, where %cs does work.

Luckily, %cd with --date=short seems equivalent, and better supported,
so we can just use that instead.
2023-11-13 14:42:48 -08:00