Compare commits

...

14 commits

Author SHA1 Message Date
Ethan Lee
ca35c53c1a 2.3.3 2021-09-04 16:31:56 -04:00
Misa
b667e44bcf Don't use map.extrarow for menu animations
This fixes all the headaches about map.extrarow having to be the correct
value and which way it should be and whatnot. The latest headache was
the detection that prevent user-initiated menu animations while an
animation was already happening being tripped because
graphics.menuoffset would be 230 (due to closing the menu while being in
a room without a room name), but then going to a room with a room name
would check for 240 instead, and 230 is less than 240. (The numbers are
the wrong way round because I got the ternaries the wrong way round, but
even if the numbers are the correct way round, the bug would still
happen, but it would just be reversed.)

So instead, I've just made it 240 for both. This doesn't change the
duration of the menu animation (because the animation moves in
increments of 25, and 230 / 25 == 240 / 25 under integer division). It
might change the animation slightly, but it was already inconsistent
anyway because map.extrarow was always set to be 1 in custom levels, and
I legitimately would not be able to tell the difference without
recording the animations and nitpicking it frame-by-frame.

Fixes #841.
2021-09-03 17:18:17 -07:00
Misa
70d3c999be Only reset fade booleans when music is actually played
Otherwise, the block that fades existing music out if m_doFadeOutVol is
true will never execute, because m_doFadeOutVol would always be false!
2021-09-03 16:44:19 -07:00
Ethan Lee
6f315af42d Updated .ico 2021-09-03 15:57:30 -04:00
Ethan Lee
c8fcbc1256 2.3.2 2021-09-03 15:26:38 -04:00
Misa
a302692ab2 Add message when player is kicked out of Super Gravitron
The player gets kicked out of the Super Gravitron if they have
invincibility or slowdown enabled. However, this can be confusing if no
message pops up
( 3039355280/ )
. So I've made it so that a text box will pop up when they get kicked
out.
2021-09-03 12:09:53 -07:00
Misa
a59e9d51db gamemode(teleporter): Set gamestate to GAMEMODE
This makes it so gamemode(teleporter) will always do an animation, even
if the game is already in TELEPORTERMODE.

I used this script to test:

    gamemode(teleporter)
    delay(5)
    gamemode(teleporter)
    delay(5)
    gamemode(teleporter)

In 2.2, this script starts the map menu bringing-up animation three
times.

In previous 2.3, this script starts the map menu bringing-up animation
once, but then the next gamemode(teleporter) immediately finishes the
animation, and the third gamemode(teleporter) does nothing.

This commit restores it to 2.2 behavior.
2021-09-02 12:29:55 -07:00
Misa
82971296c2 Prevent user-initiated map menu changes during menu animations
This makes it so it's not even possible to stay on the TELEPORTERMODE
screen by opening the map while it's being brought down. It also makes
it so the map animation is able to be canceled when being brought up
just by opening the map and closing it.

Fixes #833.
2021-09-02 12:29:55 -07:00
Misa
4ecec8a327 Call teleporterrenderfixed in TELEPORTERMODE
This restores it to 2.2 behavior, where the cutscene bars timer also
ticked in TELEPORTERMODE. It was a 2.3 regression that the cutscene bars
timer didn't tick there.

This makes it so if you manage to get stuck in TELEPORTERMODE when a
cutscene ends, the cutscene won't be stuck on untilbars() waiting for
the cutscene bars to go away, since the cutscene bars timer now ticks.
2021-09-02 12:29:55 -07:00
Ethan Lee
f1ae40a7c5 2.3.1 2021-09-01 12:26:53 -04:00
Ethan Lee
d501a6245f Added my quick script to fixup Mac dylib paths 2021-09-01 12:08:12 -04:00
Ethan Lee
514d56ee20 Minor VS buildfix 2021-08-31 19:07:36 -04:00
Misa
9cfbd1ae51 Fix not-Flip-Mode flag turning off when returning from options menu
We need to check for graphics.setflipmode, not graphics.flipmode,
because graphics.flipmode only gets assigned at the end of the frame
(due to the deferred callback). Otherwise, returning from the options
menu would always turn flag 73 on, which would make you ineligible to
get the Flip Mode trophy, even if you're in Flip Mode.
2021-08-31 15:34:32 -07:00
Ethan Lee
96812f8046 Default to VSync being enabled 2021-08-31 15:09:07 -04:00
13 changed files with 57 additions and 17 deletions

8
desktop_version/fixupMac.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/bash
# flibit has this solely for convenience when cleaning up Mac binaries.
install_name_tool -change /usr/local/lib/libSDL2-2.0.0.dylib @rpath/libSDL2-2.0.0.dylib VVVVVV
install_name_tool -change /usr/local/lib/libSDL2_mixer-2.0.0.dylib @rpath/libSDL2_mixer-2.0.0.dylib VVVVVV
strip -S VVVVVV
otool -L VVVVVV

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Before After
Before After

View file

@ -813,6 +813,10 @@ void Game::updatestate(void)
if (!map.custommode && nocompetitive())
{
returntolab();
startscript = true;
newscript = "disableaccessibility";
state = 0;
break;
}
@ -6874,7 +6878,7 @@ void Game::returntoingame(void)
gamestate = MAPMODE;
DEFER_CALLBACK(setflipmode);
DEFER_CALLBACK(setfademode);
if (!map.custommode && !graphics.flipmode)
if (!map.custommode && !graphics.setflipmode)
{
obj.flags[73] = true;
}
@ -6888,8 +6892,15 @@ void Game::unlockAchievement(const char *name) {
#endif
}
void Game::mapmenuchange(const int newgamestate)
void Game::mapmenuchange(const int newgamestate, const bool user_initiated)
{
if (user_initiated
&& graphics.menuoffset > 0
&& graphics.menuoffset < 240)
{
return;
}
prevgamestate = gamestate;
gamestate = newgamestate;
graphics.resumegamemode = false;

View file

@ -245,7 +245,7 @@ public:
int tapleft, tapright;
//Menu interaction stuff
void mapmenuchange(const int newgamestate);
void mapmenuchange(const int newgamestate, const bool user_initiated);
bool mapheld;
int menupage;
int lastsaved;

View file

@ -2124,7 +2124,7 @@ void gameinput(void)
else if (game.companion == 0)
{
//Alright, normal teleporting
game.mapmenuchange(TELEPORTERMODE);
game.mapmenuchange(TELEPORTERMODE, true);
game.useteleporter = true;
game.initteleportermode();
@ -2279,7 +2279,7 @@ void gameinput(void)
//quitting the super gravitron
game.mapheld = true;
//Quit menu, same conditions as in game menu
game.mapmenuchange(MAPMODE);
game.mapmenuchange(MAPMODE, true);
game.gamesaved = false;
game.gamesavefailed = false;
game.menupage = 20; // The Map Page
@ -2299,7 +2299,7 @@ void gameinput(void)
else
{
//Normal map screen, do transition later
game.mapmenuchange(MAPMODE);
game.mapmenuchange(MAPMODE, true);
map.cursordelay = 0;
map.cursorstate = 0;
game.gamesaved = false;
@ -2320,7 +2320,7 @@ void gameinput(void)
{
game.mapheld = true;
//Quit menu, same conditions as in game menu
game.mapmenuchange(MAPMODE);
game.mapmenuchange(MAPMODE, true);
game.gamesaved = false;
game.gamesavefailed = false;
game.menupage = 30; // Pause screen

View file

@ -202,9 +202,6 @@ void musicclass::play(int t)
return;
}
m_doFadeInVol = false;
m_doFadeOutVol = false;
if (currentsong == 0 || currentsong == 7 || (!map.custommode && (currentsong == 0+num_mmmmmm_tracks || currentsong == 7+num_mmmmmm_tracks)))
{
// Level Complete theme, no fade in or repeat
@ -214,6 +211,8 @@ void musicclass::play(int t)
}
else
{
m_doFadeInVol = false;
m_doFadeOutVol = false;
musicVolume = MIX_MAX_VOLUME;
Mix_VolumeMusic(musicVolume);
}
@ -242,6 +241,8 @@ void musicclass::play(int t)
}
else
{
m_doFadeInVol = false;
m_doFadeOutVol = false;
fadeMusicVolumeIn(3000);
}
}

View file

@ -56,7 +56,7 @@ static NetworkBackend backends[NUM_BACKENDS];
int NETWORK_init(void)
{
int32_t any = 0;
int32_t i, any = 0;
#define ASSIGN_BACKEND(name, index) \
backends[index].Init = name##_init; \
backends[index].Shutdown = name##_shutdown; \
@ -72,7 +72,6 @@ int NETWORK_init(void)
#endif
#undef ASSIGN_BACKEND
#if NUM_BACKENDS > 0
int32_t i;
for (i = 0; i < NUM_BACKENDS; i += 1)
{
backends[i].IsInit = backends[i].Init();

View file

@ -159,7 +159,7 @@ static void menurender(void)
#ifdef INTERIM_COMMIT
graphics.Print( 310 - (SDL_arraysize(INTERIM_COMMIT) - 1) * 8, 220, INTERIM_COMMIT, tr/2, tg/2, tb/2);
#endif
graphics.Print( 310 - (4*8), 230, "v2.3", tr/2, tg/2, tb/2);
graphics.Print( 310 - (6*8), 230, "v2.3.3", tr/2, tg/2, tb/2);
if(music.mmmmmm){
graphics.Print( 10, 230, "[MMMMMM Mod Installed]", tr/2, tg/2, tb/2);

View file

@ -205,7 +205,7 @@ void maprenderfixed(void)
|| !script.running)
{
graphics.menuoffset += 25;
int threshold = map.extrarow ? 230 : 240;
int threshold = 240;
if (graphics.menuoffset >= threshold)
{
graphics.menuoffset = threshold;

View file

@ -24,7 +24,7 @@ ScreenSettings::ScreenSettings(void)
windowWidth = 320;
windowHeight = 240;
fullscreen = false;
useVsync = false;
useVsync = true; // Now that uncapped is the default...
stretch = 0;
linearFilter = false;
badSignal = false;

View file

@ -1349,7 +1349,8 @@ void scriptclass::run(void)
{
if (words[1] == "teleporter")
{
game.mapmenuchange(TELEPORTERMODE);
game.gamestate = GAMEMODE; /* to set prevgamestate */
game.mapmenuchange(TELEPORTERMODE, false);
game.useteleporter = false; //good heavens don't actually use it
}

View file

@ -6724,6 +6724,26 @@ void scriptclass::load(const std::string& name)
};
filllines(lines);
}
else if (SDL_strcmp(t, "disableaccessibility") == 0)
{
static const char* lines[] = {
"cutscene()",
"untilbars()",
"squeak(terminal)",
"text(gray,0,114,3)",
"Please disable invincibility",
"and/or slowdown before entering",
"the Super Gravitron.",
"position(center)",
"speak",
"endtext",
"endcutscene()",
"untilbars()",
};
filllines(lines);
}
else
{
loadother(t);

View file

@ -143,7 +143,7 @@ static const inline struct ImplFunc* get_gamestate_funcs(
FUNC_LIST_END
FUNC_LIST_BEGIN(TELEPORTERMODE)
{Func_fixed, maprenderfixed},
{Func_fixed, teleporterrenderfixed},
{Func_delta, teleporterrender},
{Func_input, teleportermodeinput},
{Func_fixed, maplogic},