mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
e93d8989d3e82e5afc52e09fd7aeae3d41644e64
As reported by Dav999, Victoria and Vermilion's trophy colors are swapped again in 2.4. He points to37b7615b71, the commit where I fixed the color masks of every single surface to always be RGB or RGBA. It sounded plausible to me, because it did have to do with colors, after all. However, it didn't make sense to me, because I was like, I didn't touch the trophy colors at all after I originally fixed them. After I ruled out the RGBf() function as a confounder, I decided to see whether intentionally reversing the color order in RGBf() to be BGR would do anything, and to my surprise it actually swapped the colors back around and it didn't actually look bad. And then I realized: Swapping the trophy colors between RGB and BGR ordering results in similar colors that still look good, but are simply wrong, but not so wrong that they take on a color that no crewmate uses, so it'd appear as if the crewmates were swapped, when in reality the only thing that was swapped was actually the color order of the colors. Trying to fix this by swapping the colors again, I actively confused colors 33 and 35 (Vermilion and Victoria) with colors 32 and 34 (Vitellary and Viridian), so I was confused when Vermilion and Victoria weren't swapping. Then as a debugging step, I only changed 34 to 32 without swapping 32 as well, and then finally noticed that I was swapping Vitellary and Viridian, because there were now two Vitellarys. And then I was reminded that Vitellary and Viridian were also wrongly swapped since 2.0 as well. And so then I finally realized: The original comments accompanying the colors were correct after all. The only problem was that they were fed into a function, RGBf(), that read the colors backwards, because the codebase habitually changed the color order on a whim and it was really hard to reason out which color order should be used at a given time, so it ended up reading RGB colors as BGR, while it looked like it was passing them through as-is. So what happened was that in the first place, RGBf() was swapping RGB to BGR. Then I came and swapped Vermilion and Victoria, and Vitellary and Viridian around. Then later I fixed all the color masks, so RGBf() stopped swapping RGB and BGR around. But then this ended up swapping the colors of Vermilion and Victoria, and Vitellary and Viridian once again! Therefore, swapping Vermilion and Victoria, and Vitellary and Viridian was incorrect. Or at least, not the fix to the root cause. The root cause would be to swap the colors in RGBf(), but this would be sort of confusing to reason about - at least if I didn't bother to just type the RGB values into an image editor. But that doesn't fix the real issue, which is that the game kept swapping RGB and BGR around in every corner of the codebase. I further confirmed that there was no more RGB or BGR swapping by deleting the plus-one-divide-by-three transformation in RGBf() and seeing if the colors looked okay. Now with the colors being brighter, I could see that passing it straight through looked fine, but intentionally reversing it to be BGR resulted in colors that at a distance looked okay, but were either washed out or too bright. At least finally I could use my 8 years of playing this game for something. So in conclusion, actually,37b7615b71("Fix surface color masks") was the real fix, andd271907f8c("Fix Secret Lab Time Trial trophies having wrong colors") was the real regression. It's just that the regression came first, but it wasn't really a regression until I did the other fix, so the fix isn't the regression, the regression is... this is hurting my brain. Or the real regression was the friends we made along the way, or something like that. This is the most trivial bug ever caused by the technical debt of those god-awful reversed color masks. --- This reverts commitd271907f8c. Fixes #862.
This is the source code to VVVVVV, version 2.0+. For more context about this release, see the announcement on Terry's blog!
License
VVVVVV's source code is made available under a custom license. See LICENSE.md for more details.
In general, if you're interested in creating something that falls outside the license terms, get in touch with Terry and we'll talk about it!
Authors
- Created by Terry Cavanagh
- Room Names by Bennett Foddy
- Music by Magnus Pålsson
- Metal Soundtrack by FamilyJules
- 2.0 Update (C++ Port) by Simon Roth
- 2.2 Update (SDL2/PhysicsFS/Steamworks port) by Ethan Lee
- Beta Testing by Sam Kaplan and Pauli Kohberger
- Ending Picture by Pauli Kohberger
Versions
There are two versions of the VVVVVV source code available - the desktop version (based on the C++ port, and currently live on Steam), and the mobile version (based on a fork of the original flash source code, and currently live on iOS and Android).
Description
Languages
ActionScript
54.4%
C++
44.3%
C
0.7%
Java
0.4%
CMake
0.2%