1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-25 22:18:30 +02:00
VVVVVV/desktop_version/src
Misa 3699adec82 Fix, for in-GAMEMODE sprites, their colors updating too fast
Okay, so the problem here is that Graphics::setcol() is called right
before a sprite is drawn in a render function, but render functions are
done in deltatime, meaning that the color of a sprite keeps being
recalculated every time. This only affects sprites that use fRandom()
(the other thing that can dynamically determine a color is help.glow,
but that's only updated in the fixed-timestep loop), but is especially
noticeable for sprites that flash wildly, like the teleporter, trinket,
and elephant.

To fix this, we need to make the color be recalculated only in the
fixed-timestep loop. However, this means that we MUST store the color of
the sprite SOMEWHERE for the delta-timesteps to render it, otherwise the
color calculation will just be lost or something.

So each entity now has a new attribute, `realcol`, which is the actual
raw color used to render the sprite in render functions. This is not to
be confused with their `colour` attribute, which is more akin to a color
"ID" of sorts, but which isn't an actual color.

At the end of gamelogic(), as well as when an entity is first created,
the `colour` is given to Graphics::setcol() and then `realcol` gets set
to the actual color. Then when it comes time to render the entity,
`realcol` gets used instead.

Gravitron squares are a somewhat tricky case where there's technically
TWO colors for it - one is the actual sprite itself and the other is the
indicator. However, usually the indicator and the square aren't both
onscreen at the same time, so we can simply switch the realcol between
the two as needed.

However, we can't use this system for the sprite colors used on the
title and map screen, so we'll have to do something else for those.
2020-06-19 09:05:48 -04:00
..
BinaryBlob.cpp Maybe check the right size m8 2020-06-14 22:44:34 -04:00
BinaryBlob.h Sigh. 2020-06-15 07:37:05 -04:00
BlockV.cpp Remove blockclass::clear(), simplify blockclass initializations 2020-04-03 23:28:47 -04:00
BlockV.h Remove blockclass::clear(), simplify blockclass initializations 2020-04-03 23:28:47 -04:00
editor.cpp Move all-sides warp background update code to logic functions 2020-06-19 09:05:48 -04:00
editor.h Add 7x7, 9x9, full horizontal and vertical brush sizes 2020-06-17 19:13:48 -04:00
Ent.cpp Fix, for in-GAMEMODE sprites, their colors updating too fast 2020-06-19 09:05:48 -04:00
Ent.h Fix, for in-GAMEMODE sprites, their colors updating too fast 2020-06-19 09:05:48 -04:00
Entity.cpp Fix, for in-GAMEMODE sprites, their colors updating too fast 2020-06-19 09:05:48 -04:00
Entity.h Interpolate trophy text 2020-06-19 09:05:48 -04:00
Enums.h Hello WWWWWWorld! 2020-01-08 10:37:50 -05:00
FileSystemUtils.cpp Like the thing I did but the opposite 2020-06-12 16:21:45 -04:00
FileSystemUtils.h Remove TinyXML-1 2020-06-12 15:08:29 -04:00
Finalclass.cpp Statically allocate level arrays 2020-05-29 10:21:25 -04:00
Finalclass.h Refactor Finalclass.cpp to not use strings for tilemaps 2020-05-17 22:03:29 -04:00
Game.cpp Interpolate credits position 2020-06-19 09:05:48 -04:00
Game.h Interpolate credits position 2020-06-19 09:05:48 -04:00
GOGNetwork.c Add support for multiple Network backends, stub in GOGNetwork 2020-01-13 11:15:22 -05:00
Graphics.cpp Fix, for in-GAMEMODE sprites, their colors updating too fast 2020-06-19 09:05:48 -04:00
Graphics.h Fix, for in-GAMEMODE sprites, their colors updating too fast 2020-06-19 09:05:48 -04:00
GraphicsResources.cpp Fix some leaks 2020-06-07 22:40:03 -04:00
GraphicsResources.h Fix some leaks 2020-06-07 22:40:03 -04:00
GraphicsUtil.cpp Fix mixed indentation in GraphicsUtil.cpp 2020-04-03 10:40:50 -04:00
GraphicsUtil.h Hello WWWWWWorld! 2020-01-08 10:37:50 -05:00
Input.cpp Fix credits position being 1 frame off w/ BG when press/release ACTION 2020-06-19 09:05:48 -04:00
Input.h Remove global args from Input.cpp 2020-04-03 10:40:50 -04:00
KeyPoll.cpp Remove passing around pointer to gameScreen from KeyPoll::Poll() 2020-06-13 14:50:33 -04:00
KeyPoll.h Remove passing around pointer to gameScreen from KeyPoll::Poll() 2020-06-13 14:50:33 -04:00
Labclass.cpp Statically allocate level arrays 2020-05-29 10:21:25 -04:00
Labclass.h Refactor Labclass.cpp to not use strings for tilemaps 2020-05-17 22:03:29 -04:00
Logic.cpp Fix, for in-GAMEMODE sprites, their colors updating too fast 2020-06-19 09:05:48 -04:00
Logic.h Merge towerlogic() into gamelogic() 2020-04-26 19:07:40 -04:00
main.cpp Interpolate horizontal warp BG 2020-06-19 09:05:48 -04:00
MakeAndPlay.h Re-comment out #define MAKEANDPLAY 2020-02-09 10:42:03 -05:00
Map.cpp Interpolate spikeleveltop and spikelevelbottom 2020-06-19 09:05:48 -04:00
Map.h Interpolate spikeleveltop and spikelevelbottom 2020-06-19 09:05:48 -04:00
Maths.h Hello WWWWWWorld! 2020-01-08 10:37:50 -05:00
Music.cpp Add bounds checks to script commands that didn't have them 2020-06-13 01:24:42 -04:00
Music.h Don't leak binaryBlob 2020-06-07 22:40:03 -04:00
Network.c Allow for conditional building of Steam and GOG APIs 2020-06-01 14:21:06 -04:00
Network.h Add support for multiple Network backends, stub in GOGNetwork 2020-01-13 11:15:22 -05:00
Otherlevel.cpp Statically allocate level arrays 2020-05-29 10:21:25 -04:00
Otherlevel.h Remove i/j/k attributes from classes that don't need them 2020-06-14 14:37:29 -04:00
preloader.cpp Only render screen effects on the title screen and in-game 2020-04-27 15:07:58 -04:00
preloader.h Remove global args from preloader.cpp 2020-04-03 10:40:50 -04:00
Render.cpp Interpolate credits position 2020-06-19 09:05:48 -04:00
Render.h Merge towerrender() into gamerender() 2020-04-26 19:07:40 -04:00
Screen.cpp Move gameScreen off of the stack and onto the heap 2020-06-13 14:50:33 -04:00
Screen.h Move gameScreen off of the stack and onto the heap 2020-06-13 14:50:33 -04:00
Script.cpp Interpolate bringing up and down quit/pause/teleporter screen 2020-06-19 09:05:48 -04:00
Script.h Refactor custom scripts to not be stored in one giant vector of lines 2020-06-11 22:13:52 -04:00
Scripts.cpp Remove include guards from Scripts.cpp and TerminalScripts.cpp 2020-06-11 22:13:52 -04:00
SoundSystem.cpp Revert "Add destructor for SoundTrack/MusicTrack (and explicitly define move constructor to prevent double-free)" 2020-06-07 22:40:03 -04:00
SoundSystem.h Revert "Add destructor for SoundTrack/MusicTrack (and explicitly define move constructor to prevent double-free)" 2020-06-07 22:40:03 -04:00
Spacestation2.cpp Statically allocate Prize for the Reckless tilemap 2020-05-29 19:39:05 -04:00
Spacestation2.h Refactor Spacestation2.cpp to not use strings for tilemaps 2020-05-17 22:03:29 -04:00
SteamNetwork.c Fix build on DragonFlyBSD 2020-04-23 23:35:33 -04:00
TerminalScripts.cpp Remove include guards from Scripts.cpp and TerminalScripts.cpp 2020-06-11 22:13:52 -04:00
Textbox.cpp Fix special text box images sometimes flashing 2020-06-19 09:05:48 -04:00
Textbox.h Fix special text box images sometimes flashing 2020-06-19 09:05:48 -04:00
Tower.cpp Remove now-unused fillbackground/fillcontents/fillminitower from Tower 2020-05-17 22:03:29 -04:00
Tower.h Remove i/j/k attributes from classes that don't need them 2020-06-14 14:37:29 -04:00
UtilityClass.cpp Support hex entities in metadata 2020-06-15 20:32:10 -04:00
UtilityClass.h Support hex entities in metadata 2020-06-15 20:32:10 -04:00
WarpClass.cpp Statically allocate level arrays 2020-05-29 10:21:25 -04:00
WarpClass.h Refactor WarpClass.cpp to not use strings for tilemaps 2020-05-17 22:03:29 -04:00