Core additions since initial commit: - Platform-split MIDI (midi_linux.c / midi_windows.c) - Patch system: save/load/scan, subdirectory navigation, favourites - Config system: last MIDI device and CC mappings persisted to disk - Custom embedded pixel font and sprite sheet (no loose asset files at runtime) - Window icon embedded at runtime (SetWindowIcon) and in Windows .exe (windres) - chdirToExeDir() in platform.c so double-click launch finds patches/ correctly - About screen accessible from Master panel UI polish: - TITLE_BAR_H constant (20 px) — sprite buttons now fit inside title bars - All title bar text, button overlay text, and close/active labels vertically centred - Full-screen dim overlay computed from camera transform (no more partial coverage) - Patch browser: folder navigation, breadcrumb title, 256-slot limit lifted Build: - Makefile auto-discovers sources; embeds sprites/font/icon via xxd rules - Windows cross-compile: make PLATFORM=windows (mingw-w64 + windres) - windows.h isolated in platform.c to avoid Rectangle/CloseWindow conflicts with raylib.h - WIN_RES uses lazy = assignment so OBJ_DIR expands correctly for windres output path Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
30 lines
775 B
C
30 lines
775 B
C
#define _POSIX_C_SOURCE 200809L
|
|
/* Isolated from raylib.h to avoid Rectangle/CloseWindow/ShowCursor conflicts
|
|
with windows.h on Windows cross-compile targets. */
|
|
#ifdef _WIN32
|
|
# include <windows.h>
|
|
# include <direct.h>
|
|
#else
|
|
# include <unistd.h>
|
|
# include <libgen.h>
|
|
#endif
|
|
#include <string.h>
|
|
#include "platform.h"
|
|
|
|
void chdirToExeDir(void)
|
|
{
|
|
char path[1024];
|
|
#ifdef _WIN32
|
|
DWORD len = GetModuleFileNameA(NULL, path, (DWORD)sizeof(path));
|
|
if (!len) return;
|
|
char *last = strrchr(path, '\\');
|
|
if (!last) last = strrchr(path, '/');
|
|
if (last) { *last = '\0'; _chdir(path); }
|
|
#else
|
|
ssize_t len = readlink("/proc/self/exe", path, sizeof(path) - 1);
|
|
if (len <= 0) return;
|
|
path[len] = '\0';
|
|
if (chdir(dirname(path)) != 0) { }
|
|
#endif
|
|
}
|