Icône de la fenêtre du jeu (SDL_SetWindowIcon)

- host_sdl.c : dtr-256.png (à côté de l'exécutable, ou assets/icon/ du dépôt
  depuis build\) posée sur la fenêtre : barre de titre, Alt+Tab, Linux. Sans
  le fichier, Windows garde l'icône compilée dans tucker.exe (17868ee).
- ROADMAP : icône du jeu cochée.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
linkatplugandClaude Opus 5.5 committed 2026-12-05 12:57:45 +01:00
1 parent 5ba251b4ce
commit c691e110a9
3 files changed
+26 -2

No files matched your search

+1 -1
View File
@@ -45,7 +45,7 @@ INTRO.EXE stays local (`build/`). Mods replace files at runtime, never touching
does not pass it on
- [x] **Widescreen without black bars**: sides filled with a blurred background or an illustration
- [ ] **Upscaled FLC cutscenes**
- [ ] Game icon: `tucker.exe` (`assets/icon/dtr.rc` resource compiled with `rc` in `build.bat`) and
- [x] Game icon: `tucker.exe` (`assets/icon/dtr.rc` resource compiled with `rc` in `build.bat`) and
window (`SDL_SetWindowIcon` with `assets/icon/dtr-256.png`). The launcher already has it
## 2. Sound
+1 -1
View File
@@ -48,7 +48,7 @@ jamais modifier les originaux.
- [x] **Écran large sans bandes noires** : bords remplis par le décor flouté ou une illustration
- [ ] **Cinématiques FLC agrandies**
- [ ] Police HD pour les textes et les sous-titres
- [ ] Icône du jeu : `tucker.exe` (ressource `assets/icon/dtr.rc` compilée avec `rc` dans `build.bat`)
- [x] Icône du jeu : `tucker.exe` (ressource `assets/icon/dtr.rc` compilée avec `rc` dans `build.bat`)
et fenêtre (`SDL_SetWindowIcon` avec `assets/icon/dtr-256.png`). Le launcher l'a déjà
## 2. Son
+24
View File
@@ -248,6 +248,29 @@ static int is_dir(const char *p) {
return stat(p, &st) == 0 && (st.st_mode & S_IFDIR);
}
/* icône de la fenêtre (barre de titre, Alt+Tab, Linux) : dtr-256.png à côté de l'exécutable, ou assets/icon/ du
* dépôt depuis build\. Sous Windows, sans ce fichier, la fenêtre garde l'icône compilée dans tucker.exe. */
static void set_window_icon(void) {
char *base = SDL_GetBasePath();
char path[700];
int i, w, h;
uint32_t *img = NULL;
if (!base) return;
for (i = 0; i < 3 && !img; i++) {
char sep = base[strlen(base) - 1];
if (i == 0) snprintf(path, sizeof path, "%sdtr-256.png", base);
else if (i == 1) snprintf(path, sizeof path, "%sassets%cicon%cdtr-256.png", base, sep, sep);
else snprintf(path, sizeof path, "%s..%cassets%cicon%cdtr-256.png", base, sep, sep, sep);
img = png_load(path, &w, &h, NULL);
}
SDL_free(base);
if (img) {
SDL_Surface *s = SDL_CreateRGBSurfaceWithFormatFrom(img, w, h, 32, w * 4, SDL_PIXELFORMAT_ARGB8888);
if (s) { SDL_SetWindowIcon(win, s); SDL_FreeSurface(s); }
free(img);
}
}
/* dossier des mods : réglage mods.dir, sinon « mods » à côté de l'exécutable (ou du dossier build\), sinon ./mods */
static void init_mods(void) {
char dir[600];
@@ -334,6 +357,7 @@ int host_init(int argc, char **argv) {
win = SDL_CreateWindow("Bud Tucker in Double Trouble (recomp) — F12 : réglages", SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED, w, h, SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI);
}
if (win) set_window_icon();
glctx = win ? SDL_GL_CreateContext(win) : NULL;
if (!glctx) { fprintf(stderr, "OpenGL 3.3 indisponible : %s\n", SDL_GetError()); return 0; }
if (!gfx_init()) { fprintf(stderr, "initialisation du rendu OpenGL impossible\n"); return 0; }