mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 09:54:10 +03:00
Clean up and prevent unnecessary qualifiers to self
By "unnecessary qualifiers to self", I mean something like using the 'game.' qualifier for a variable on the Game class when you're inside a function on the Game class itself. This patch is to enforce consistency as most of the code doesn't have these unnecessary qualifiers. To prevent further unnecessary qualifiers to self, I made it so the extern in each header file can be omitted by using a define. That way, if someone writes something referring to 'game.' on a Game function, there will be a compile error. However, if you really need to have a reference to the global name, and you're within the same .cpp file as the implementation of that object, you can just do the extern at the function-level. A good example of this is editorinput()/editorrender()/editorlogic() in editor.cpp. In my opinion, they should probably be split off into their own separate file because editor.cpp is getting way too big, but this will do for now.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#define GRAPHICS_DEFINITION
|
||||
#include "Graphics.h"
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -2991,16 +2992,16 @@ void Graphics::renderwithscreeneffects()
|
||||
{
|
||||
if (game.flashlight > 0 && !game.noflashingmode)
|
||||
{
|
||||
graphics.flashlight();
|
||||
flashlight();
|
||||
}
|
||||
|
||||
if (game.screenshake > 0 && !game.noflashingmode)
|
||||
{
|
||||
graphics.screenshake();
|
||||
screenshake();
|
||||
}
|
||||
else
|
||||
{
|
||||
graphics.render();
|
||||
render();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user