1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01:00

Place GraphicsResources functions in header file

These are functions used in other files that are not on the
GraphicsResources class but are implemented inside the
GraphicsResources.cpp file. For some reason they were never put in the
GraphicsResources.h file until now, even though it's a perfectly good
header file to put them in.
This commit is contained in:
Misa 2024-01-09 16:03:05 -08:00
parent 10030a4340
commit b3b001c2a8
4 changed files with 10 additions and 7 deletions

View file

@ -8,6 +8,7 @@
#include "FileSystemUtils.h" #include "FileSystemUtils.h"
#include "FontBidi.h" #include "FontBidi.h"
#include "Graphics.h" #include "Graphics.h"
#include "GraphicsResources.h"
#include "GraphicsUtil.h" #include "GraphicsUtil.h"
#include "Localization.h" #include "Localization.h"
#include "UTF8.h" #include "UTF8.h"
@ -20,10 +21,6 @@ extern "C"
#include <c-hashmap/map.h> #include <c-hashmap/map.h>
} }
// Sigh... This is the second forward-declaration, we need to put this in a header file
SDL_Texture* LoadImage(const char *filename, TextureLoadType loadtype);
SDL_Surface* LoadImageSurface(const char* filename);
namespace font namespace font
{ {

View file

@ -82,7 +82,6 @@ static SDL_Surface* LoadSurfaceFromRaw(SDL_Surface* loadedImage)
return optimizedImage; return optimizedImage;
} }
/* Can't be static, used in Screen.h */
SDL_Surface* LoadImageSurface(const char* filename) SDL_Surface* LoadImageSurface(const char* filename)
{ {
unsigned char* data; unsigned char* data;

View file

@ -50,4 +50,10 @@ public:
SDL_Texture* im_flipsprites_translated; SDL_Texture* im_flipsprites_translated;
}; };
SDL_Surface* LoadImageSurface(const char* filename);
SDL_Texture* LoadImage(const char *filename, TextureLoadType loadtype);
bool SaveImage(const SDL_Surface* surface, const char* filename);
bool SaveScreenshot(void);
#endif /* GRAPHICSRESOURCES_H */ #endif /* GRAPHICSRESOURCES_H */

View file

@ -10,6 +10,9 @@
#include "Game.h" #include "Game.h"
#include "Graphics.h" #include "Graphics.h"
#include "GraphicsUtil.h" #include "GraphicsUtil.h"
#ifndef __APPLE__
#include "GraphicsResources.h"
#endif
#include "InterimVersion.h" #include "InterimVersion.h"
#include "Render.h" #include "Render.h"
#include "Vlogging.h" #include "Vlogging.h"
@ -118,8 +121,6 @@ void Screen::LoadIcon(void)
} }
#else #else
SDL_Surface* LoadImageSurface(const char* filename);
void Screen::LoadIcon(void) void Screen::LoadIcon(void)
{ {
SDL_Surface* icon = LoadImageSurface("VVVVVV.png"); SDL_Surface* icon = LoadImageSurface("VVVVVV.png");