- [WIP] Reestructuració: Fase 1 acabada

This commit is contained in:
2026-04-03 11:11:53 +02:00
parent 569221d047
commit bc006b8f72
7 changed files with 2312 additions and 2203 deletions

View File

@@ -1,16 +1,9 @@
#pragma once
#include <SDL3/SDL.h>
#include "version.h"
void exception_loop();
int scrw();
int scrh();
void raisewindow();
namespace mini
@@ -59,33 +52,40 @@ namespace mini
uint8_t geth();
void set(int w, int h);
}
}
}
namespace pal
{
uint32_t *load(const char* filename, uint16_t *palsize=NULL);
void set(uint32_t *pal);
namespace color {
void set(uint8_t index, uint32_t color);
uint32_t get(uint8_t index);
}
namespace trans {
void set(uint8_t index);
uint8_t get();
}
namespace subpal {
uint8_t set(uint8_t index, uint8_t color);
void reset();
}
}
void shader_init(const char* vshader, const char* fshader);
void shader_enable();
void shader_disable();
namespace view
{
namespace clip {
void set(int x, int y, int w, int h);
void reset();
}
uint8_t loadfont(const char *filename);
uint8_t getfont();
void setfont(uint8_t font);
uint8_t getfontspacing();
void setfontspacing(uint8_t spacing);
namespace origin {
void set(int x, int y);
int getx();
int gety();
}
}
uint32_t *loadpal(const char* filename, uint16_t *palsize=NULL);
void setpal(uint32_t *pal);
void setcolor(uint8_t index, uint32_t color);
uint32_t getcolor(uint8_t index);
void settrans(uint8_t index);
uint8_t gettrans();
uint8_t subpal(uint8_t index, uint8_t color);
void reset_subpal();
namespace mini
{
namespace draw
{
void line(int x0, int y0, int x1, int y1, uint8_t color);
@@ -103,84 +103,150 @@ namespace mini
void oval(int x0, int y0, int x1, int y1, uint8_t color);
void ovalf(int x0, int y0, int x1, int y1, uint8_t color);
namespace pattern {
void set(uint16_t pat, bool transparent = false);
}
void surf(int sx, int sy, int sw, int sh, int dx, int dy, int dw=0, int dh=0, bool flip_x = false, bool flip_y = false, bool invert = false);
void surfrot(int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, bool flip_x, bool flip_y, float angle_deg);
void text(const char *str, int x, int y, uint8_t color);
namespace mode
{
void set(uint8_t mode);
}
}
namespace shader
{
void init(const char* vshader, const char* fshader);
void enable();
void disable();
}
namespace audio
{
namespace music
{
void play(const char *filename, const int loop=-1);
void pause();
void resume();
void stop(const int t=1000);
namespace pos {
void set(float value);
float get();
}
namespace enable {
void set(const bool value);
const bool get();
}
}
namespace sound
{
int load(const char *filename);
void free(int soundfile);
int play(int soundfile, const int volume=-1);
void stop(int soundchannel);
namespace enable {
void set(const bool value);
const bool get();
}
}
}
namespace sys
{
float delta();
float time();
bool beat(int16_t i);
int getfps();
namespace update {
void set(const int value, const int t=0);
int get();
}
void exit();
}
namespace win
{
namespace zoom {
void set(const int value);
int get();
}
namespace fullscreen {
void set(const bool value);
bool get();
}
namespace cursor {
void set(const bool value);
bool get();
}
namespace res {
void set(const int w, const int h);
int getw();
int geth();
}
}
namespace config
{
namespace key {
void set(const char* key, const char* value);
const char *get(const char* key);
}
const char *folder();
}
namespace font
{
uint8_t load(const char *filename);
namespace current {
void set(uint8_t font);
uint8_t get();
}
namespace spacing {
void set(uint8_t spacing);
uint8_t get();
}
}
namespace mouse
{
int posx();
int posy();
int wheel();
bool down(uint8_t i);
bool press(uint8_t i);
bool dblclick();
void discard();
bool inside(int x, int y, int w, int h);
}
namespace key
{
bool down(uint8_t i);
bool press(uint8_t i);
int press();
bool any();
void text(const bool enable);
const char *utf8char();
}
namespace pad
{
bool down(int8_t i);
bool press(int8_t i);
int press();
}
}
void fillp(uint16_t pat, bool transparent = false);
void print(const char *str, int x, int y, uint8_t color);
void clip(int x, int y, int w, int h);
void clip();
void origin(int x, int y);
int camx();
int camy();
uint8_t sget(int x, int y);
void blit(int sx, int sy, int sw, int sh, int dx, int dy, int dw=0, int dh=0, bool flip_x = false, bool flip_y = false, bool invert = false);
void blit_r(int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, bool flip_x, bool flip_y, float angle_deg);
bool btn(uint8_t i);
int wbtnp();
bool btnp(uint8_t i);
bool anykey();
void textenable(const bool enable);
const char *textinput();
bool pad(int8_t i);
bool padp(int8_t i);
int wpad();
int mousex();
int mousey();
int mwheel();
bool mbtn(uint8_t i);
bool mbtnp(uint8_t i);
bool doubleclick();
void mdiscard();
bool minside(int x, int y, int w, int h);
float time();
float delta();
bool beat(int16_t i);
int getfps();
void playmusic(const char *filename, const int loop=-1);
void pausemusic();
void resumemusic();
void stopmusic(const int t=1000);
void musicpos(float value);
float musicpos();
void enablemusic(const bool value);
const bool ismusicenabled();
int loadsound(const char *filename);
void freesound(int soundfile);
int playsound(int soundfile, const int volume=-1);
void stopsound(int soundchannel);
void enablesound(const bool value);
const bool issoundenabled();
int getzoom();
void setzoom(const int value);
void setres(const int w, const int h);
bool getfullscreen();
void setfullscreen(const bool value);
bool getcursor();
void setcursor(const bool value);
const char *getconfig(const char* key);
void setconfig(const char* key, const char* value);
const char *configfolder();
void setupdatemode(const int value, const int t=0);
int getupdatemode();
void exit();