summaryrefslogtreecommitdiff
path: root/src/resources/resources.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/resources.c')
-rw-r--r--src/resources/resources.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/resources/resources.c b/src/resources/resources.c
index e82b6e0..c1b78b5 100644
--- a/src/resources/resources.c
+++ b/src/resources/resources.c
@@ -5,9 +5,43 @@
Font MainFont;
Font MonoFont;
+Texture ButtonsAtlas;
+
+Texture PrepareTexture(char *location) {
+ Image img = LoadImage(location);
+ // Applying colorscheme
+ ImageColorReplace(&img,
+ (Color) { .r = 0xFF, .g = 0x00, .b = 0x00, .a = 0xFF },
+ COLORSCHEME_RED);
+ ImageColorReplace(&img,
+ (Color) { .r = 0x00, .g = 0xFF, .b = 0x00, .a = 0xFF },
+ COLORSCHEME_GREEN);
+ ImageColorReplace(&img,
+ (Color) { .r = 0XFF, .g = 0x7F, .b = 0x00, .a = 0xFF },
+ COLORSCHEME_YELLOW);
+ ImageColorReplace(&img,
+ (Color) { .r = 0x00, .g = 0x00, .b = 0xFF, .a = 0xFF },
+ COLORSCHEME_ORANGE);
+ ImageColorReplace(&img,
+ (Color) { .r = 0x00, .g = 0x00, .b = 0x00, .a = 0xFF },
+ COLORSCHEME_BROWN);
+ ImageColorReplace(&img,
+ (Color) { .r = 0xFF, .g = 0xFF, .b = 0xFF, .a = 0xFF },
+ COLORSCHEME_WHITE);
+ Texture outp = LoadTextureFromImage(img);
+ UnloadImage(img);
+ return outp;
+}
+
void LoadResources() {
MainFont = LoadFontEx("assets/fonts/coolvetica.ttf", 100, NULL, 0);
MonoFont = LoadFontEx("assets/fonts/monofont.ttf", 100, NULL, 0);
+
+ ButtonsAtlas = PrepareTexture("assets/textures/buttons_atlas.png");
+}
+
+Texture *GetButtonsAtlas() {
+ return &ButtonsAtlas;
}
Font *GetMainFont() { return &MainFont; }