refactor pt 1; getting each thing right and then will push to main

This commit is contained in:
2025-09-19 17:57:48 -04:00
parent 9a6810d1bb
commit dbb6d13f34
37 changed files with 7313 additions and 8950 deletions

View File

@@ -7,30 +7,17 @@
#ifdef _WIN32
#define DIALOG_FILE_EXPLORER_COMMAND "open"
#else
#else
#define DIALOG_FILE_EXPLORER_COMMAND "xdg-open \"%s\" &"
#endif
const SDL_DialogFileFilter DIALOG_FILE_FILTER_ANM2[] =
{
{"Anm2 file", "anm2;xml"}
};
const SDL_DialogFileFilter DIALOG_FILE_FILTER_ANM2[] = {{"Anm2 file", "anm2;xml"}};
const SDL_DialogFileFilter DIALOG_FILE_FILTER_PNG[] =
{
{"PNG image", "png"}
};
const SDL_DialogFileFilter DIALOG_FILE_FILTER_PNG[] = {{"PNG image", "png"}};
const SDL_DialogFileFilter DIALOG_RENDER_FILE_FILTERS[] =
{
{"PNG image", "png"},
{"GIF image", "gif"},
{"WebM video", "webm"},
{"MP4 video", "mp4"}
};
const SDL_DialogFileFilter DIALOG_RENDER_FILE_FILTERS[] = {{"PNG image", "png"}, {"GIF image", "gif"}, {"WebM video", "webm"}, {"MP4 video", "mp4"}};
const SDL_DialogFileFilter DIALOG_FILE_FILTER_FFMPEG[] =
{
const SDL_DialogFileFilter DIALOG_FILE_FILTER_FFMPEG[] = {
#ifdef _WIN32
{"Executable", "exe"}
#else
@@ -38,31 +25,29 @@ const SDL_DialogFileFilter DIALOG_FILE_FILTER_FFMPEG[] =
#endif
};
enum DialogType
{
DIALOG_NONE,
DIALOG_ANM2_OPEN,
DIALOG_ANM2_SAVE,
DIALOG_SPRITESHEET_ADD,
DIALOG_SPRITESHEET_REPLACE,
DIALOG_RENDER_PATH_SET,
DIALOG_FFMPEG_PATH_SET
enum DialogType {
DIALOG_NONE,
DIALOG_ANM2_OPEN,
DIALOG_ANM2_SAVE,
DIALOG_SPRITESHEET_ADD,
DIALOG_SPRITESHEET_REPLACE,
DIALOG_RENDER_PATH_SET,
DIALOG_FFMPEG_PATH_SET
};
struct Dialog
{
SDL_Window* window = nullptr;
s32 selectedFilter = ID_NONE;
std::string path{};
s32 replaceID = ID_NONE;
DialogType type = DIALOG_NONE;
bool isSelected = false;
struct Dialog {
SDL_Window* window = nullptr;
std::string path{};
int selectedFilter = ID_NONE;
int replaceID = ID_NONE;
DialogType type = DIALOG_NONE;
bool isSelected{};
};
void dialog_init(Dialog* self, SDL_Window* window);
void dialog_anm2_open(Dialog* self);
void dialog_spritesheet_add(Dialog* self);
void dialog_spritesheet_replace(Dialog* self, s32 id);
void dialog_spritesheet_replace(Dialog* self, int id);
void dialog_anm2_save(Dialog* self);
void dialog_render_path_set(Dialog* self, RenderType type);
void dialog_render_directory_set(Dialog* self);