GCC ready. Removed VS Project. Removed stb_image

This commit is contained in:
2021-04-15 18:30:49 +02:00
parent 87f1526ee5
commit fed8dc01f9
13 changed files with 207 additions and 7076 deletions

View File

@@ -1,8 +1,7 @@
#include "debug.h"
#include <SDL.h>
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
#include <SDL2/SDL.h>
#include "parser.h"
#include "font_bmp.h"
typedef unsigned char byte;
typedef unsigned short word;
@@ -299,14 +298,19 @@ void debug_show_window() {
debug_window_id = SDL_GetWindowID(debug_window);
SDL_SetRenderDrawColor(debug_renderer, 128, 128, 128, 255);
FILE* f = fopen("font.png", "rb");
// [RZC 15-04-2021] Old version using PNG
/*FILE* f = fopen("font.png", "rb");
int x = 128, y = 128, c;
Uint8* buffer = stbi_load_from_file(f, &x, &y, &c, 4);
debug_texture = SDL_CreateTexture(debug_renderer, SDL_PIXELFORMAT_ABGR8888, SDL_TEXTUREACCESS_STATIC, 128, 128);
SDL_UpdateTexture(debug_texture, NULL, buffer, 128 * sizeof(Uint32));
SDL_SetTextureBlendMode(debug_texture, SDL_BLENDMODE_BLEND);
stbi_image_free(buffer);
fclose(f);
SDL_SetTextureBlendMode(debug_texture, SDL_BLENDMODE_BLEND);*/
// [RZC 15-04-2021] New version using 1 bit BMP
debug_texture = SDL_CreateTextureFromSurface(debug_renderer, SDL_LoadBMP_RW(SDL_RWFromMem(font_bmp, font_bmp_len), 1));
SDL_SetTextureBlendMode(debug_texture, SDL_BLENDMODE_ADD);
visible = true;
}