#include "resources.h" #include #include 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; } Font *GetMonoFont() { return &MonoFont; } void DrawStripe(int start_step, int end_step, Color color) { int height = GetScreenHeight(); Vector2 p1 = { .x = start_step, .y = 0 }, p2 = { .x = end_step, .y = height }, p3 = { .x = start_step, .y = height }; DrawTriangle(p1, p2, p3, color); p2 = p3; p3 = p1; p3.x += (start_step - end_step); DrawTriangle(p1, p2, p3, color); } void DrawBackground() { ClearBackground(COLORSCHEME_WHITE); double step = GetScreenWidth() / 6.0f; DrawStripe(step * 2, step, COLORSCHEME_YELLOW); DrawStripe(step * 3 - 1, step * 2 - 1, COLORSCHEME_ORANGE); DrawStripe(step * 4 - 2, step * 3 - 2, COLORSCHEME_RED); DrawStripe(step * 5 - 3, step * 4 - 3, COLORSCHEME_BROWN); DrawRectangle(step * 5 - 3, 0, step * 2, GetScreenHeight(), COLORSCHEME_BROWN); }