Compare commits

...

7 Commits

Author SHA1 Message Date
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
6 changed files with 23 additions and 4 deletions

View File

@ -22,3 +22,4 @@ Last updated on January 23rd, 2024.
| 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) |
| 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/) |

View File

@ -294,6 +294,11 @@ if(MSVC)
# Disable RTTI
string(REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-")
if(MSVC_VERSION GREATER 1900)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /utf-8")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /utf-8")
endif()
else()
string(REGEX REPLACE "-std=[a-z0-9]+" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")

View File

@ -4728,7 +4728,13 @@ void Game::deserializesettings(tinyxml2::XMLElement* dataNode, struct ScreenSett
if (SDL_strcmp(pKey, "stretch") == 0)
{
screen_settings->scalingMode = help.Int(pText);
int mode = help.Int(pText);
if (mode < 0 || mode >= NUM_SCALING_MODES)
{
/* Pick a sane default. */
mode = SCALING_INTEGER;
}
screen_settings->scalingMode = mode;
}
if (SDL_strcmp(pKey, "useLinearFilter") == 0)

View File

@ -3517,6 +3517,13 @@ void Graphics::get_stretch_info(SDL_Rect* rect)
rect->w = width;
rect->h = height;
break;
default:
SDL_assert(0 && "Invalid scaling mode!");
/* Width and height should be nonzero to avoid division by zero. */
rect->x = 0;
rect->y = 0;
rect->w = width;
rect->h = height;
}
}

View File

@ -1,6 +1,6 @@
#ifndef RELEASEVERSION_H
#define RELEASEVERSION_H
#define RELEASE_VERSION "v2.4.1"
#define RELEASE_VERSION "v2.4.2"
#endif /* RELEASEVERSION_H */

View File

@ -681,7 +681,7 @@ void scriptclass::run(void)
texty = 0;
textcrewmateposition.x = obj.entities[i].xp;
textcrewmateposition.override_x = true;
textcrewmateposition.y = obj.entities[i].xp;
textcrewmateposition.y = obj.entities[i].yp;
textcrewmateposition.override_y = true;
textcrewmateposition.dir = j;
@ -3547,7 +3547,7 @@ bool scriptclass::loadcustom(const std::string& t)
}else if(words[0] == "reply"){
//For this version, terminal only
if(squeakmode==0) add("squeak(player)");
add("text(cyan,0,0,"+words[1]+")");
add("text(player,0,0,"+words[1]+")");
int ti=help.Int(words[1].c_str());
int nti = ti>=0 ? ti : 1;