- [WIP] Acabant la fase 2

- [NEW] Preparant codi per a la fase 3
This commit is contained in:
2026-04-14 21:45:25 +02:00
parent 380295aed0
commit c0d1b1fecf
12 changed files with 269 additions and 228 deletions
+12 -3
View File
@@ -5,8 +5,7 @@
#include "aux/log.h"
#include "mini/file/file.h"
#include "mini/draw/draw.h"
#include <SDL3/SDL.h>
#include "mini/win/win.h"
#include <stdlib.h>
@@ -17,6 +16,16 @@ namespace mini
state_t state;
void init() {
target::set(create(win::state.width, win::state.height));
state.dest_surface = state.screen_surface;
}
void quit() {
for (unsigned int i=0;i<MAX_SURFACES;++i) surf::destroy(i);
state.dest_surface = state.source_surface = NULL;
}
uint8_t create(int w, int h) {
unsigned int i = 0;
while (i<MAX_SURFACES && state.surfaces[i].p != NULL) ++i;
@@ -150,7 +159,7 @@ namespace mini
void cls(uint8_t color) {
const uint8_t col = draw::state.draw_palette[color];
SDL_memset(state.dest_surface->p, col, state.dest_surface->size);
memset(state.dest_surface->p, col, state.dest_surface->size);
}
namespace target {