finally compiling and running, text still needs rework

This commit is contained in:
2024-09-16 16:17:00 +03:00
parent 551d60ef85
commit 16c96010dc
43 changed files with 299 additions and 309 deletions

View File

@ -1,7 +1,6 @@
#include "townengine/textures/internal_api.h"
#include "townengine/config.h"
#include "townengine/util.h"
#include "townengine/context.h"
#include "twn_textures_c.h"
#include "twn_config.h"
#include "twn_util.h"
#include <SDL2/SDL.h>
#include <physfs.h>
@ -123,7 +122,7 @@ static void add_new_atlas(struct texture_cache *cache) {
static void upload_texture_from_surface(gpu_texture texture, SDL_Surface *surface) {
SDL_LockSurface(surface);
specify_gpu_texture(texture, surface->pixels, surface->w, surface->h);
upload_gpu_texture(texture, surface->pixels, 4, surface->w, surface->h);
SDL_UnlockSurface(surface);
}
@ -404,7 +403,7 @@ void textures_update_atlas(struct texture_cache *cache) {
/* EXPERIMANTAL: LIKELY TO BE REMOVED! */
#if defined(__linux__) && !defined(HOT_RELOAD_SUPPORT) /* use rodata elf section for fast lookups of repeating textures */
#include "townengine/system/linux/elf.h"
#include "system/linux/twn_elf.h"
static const char *rodata_start;
static const char *rodata_stop;
@ -528,10 +527,11 @@ void textures_bind_repeating(const struct texture_cache *cache, t_texture_key ke
SDL_LockSurface(texture.data);
specify_gpu_texture(repeating_texture,
texture.data->pixels,
texture.data->w,
texture.data->h);
upload_gpu_texture(repeating_texture,
texture.data->pixels,
4,
texture.data->w,
texture.data->h);
SDL_UnlockSurface(texture.data);