Taille de fenêtre en vraie résolution (window_width / window_height, --resolution)
- Nouvelles clés [display] window_width et window_height (0 : window_scale, comme avant). La fenêtre est ouverte à cette taille, réduite (format gardé) si elle ne tient pas à l'écran ; l'image y est mise à l'échelle comme en plein écran. - Option --resolution LxH pour une session ; --echelle N remet window_width à 0. - Menu F12 : « Taille de la fenêtre » propose les résolutions courantes (4:3, 16:10, 16:9) qui tiennent à l'écran, celle de l'écran, et la taille actuelle ; texte long aligné à droite. - docs/SETTINGS.md : clés et option. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
921c3349f4
commit
7d8cb3496d
4 files changed
+141
-31
No files matched your search
+6
-2
@@ -26,6 +26,8 @@ Exemple :
|
||||
[display]
|
||||
fullscreen=0
|
||||
window_scale=3
|
||||
window_width=0
|
||||
window_height=0
|
||||
filter=xbr
|
||||
aspect_43=1
|
||||
vsync=0
|
||||
@@ -52,7 +54,8 @@ disabled=
|
||||
| Clé | Valeurs | Défaut | Effet |
|
||||
|---|---|---|---|
|
||||
| `fullscreen` | `0` / `1` | `0` | Plein écran en résolution du bureau (sans changer de mode vidéo) |
|
||||
| `window_scale` | `1` à `16` | `3` | Fenêtre de `320 × N` sur `240 × N` (ou `200 × N`) pixels. Ramenée à la plus grande taille qui tient sur l'écran |
|
||||
| `window_scale` | `1` à `16` | `3` | Fenêtre de `320 × N` sur `240 × N` (ou `200 × N`) pixels, si `window_width` vaut `0`. Ramenée à la plus grande taille qui tient sur l'écran |
|
||||
| `window_width`, `window_height` | `0` à `16384` | `0` | Taille de la fenêtre en pixels (par exemple `1280` et `960`) ; `0` : `window_scale` est utilisé. Réduite, format gardé, si elle ne tient pas à l'écran. L'image est mise à l'échelle dans la fenêtre comme en plein écran (format 4:3 ou pixels carrés respecté, bandes noires sinon). Le menu F12 propose les résolutions courantes qui tiennent à l'écran, et celle de l'écran |
|
||||
| `filter` | `nearest`, `smooth`, `xbr`, `crt` | `nearest` | Filtre d'image (voir ci-dessous) |
|
||||
| `aspect_43` | `0` / `1` | `1` | `1` : image 320×200 étirée en 4:3, comme sur un écran VGA. `0` : pixels carrés (16:10) |
|
||||
| `vsync` | `0` / `1` | `0` | Synchronisation verticale |
|
||||
@@ -99,7 +102,8 @@ Les options d'affichage valent **pour la session seulement**. Elles ne sont pas
|
||||
| `--config FICHIER` | Utiliser ce fichier de réglages |
|
||||
| `--plein` | `fullscreen=1` |
|
||||
| `--fenetre` | `fullscreen=0` |
|
||||
| `--echelle N` | `window_scale=N` |
|
||||
| `--resolution LxH` | `window_width=L`, `window_height=H` (par exemple `--resolution 1920x1080`) |
|
||||
| `--echelle N` | `window_scale=N`, `window_width=0`, `window_height=0` |
|
||||
| `--filtre NOM` | `filter=NOM` |
|
||||
| `--format43 0\|1` | `aspect_43=0\|1` |
|
||||
| `--vsync 0\|1` | `vsync=0\|1` |
|
||||
|
||||
+76
-16
@@ -2,7 +2,7 @@
|
||||
* F12 : menu de réglages (le jeu est en pause) ; F11 ou Alt+Entrée : plein écran ; fermer la fenêtre : quitter.
|
||||
* Réglages lus et écrits dans settings.ini (%APPDATA%\DoubleTroubleRecomp\ par défaut, ou --config FICHIER),
|
||||
* partagé avec le launcher. Options d'affichage en ligne de commande (valables pour la session, voir docs/SETTINGS.md) :
|
||||
* --echelle N --plein --fenetre --filtre nearest|smooth|xbr|crt --format43 0|1 --vsync 0|1
|
||||
* --resolution LxH --echelle N --plein --fenetre --filtre nearest|smooth|xbr|crt --format43 0|1 --vsync 0|1
|
||||
* --set cle=valeur --config FICHIER
|
||||
* Mods (voir docs/MODS.md) : --mods DOSSIER --sans-mods --sans-hd */
|
||||
#include <stdio.h>
|
||||
@@ -93,30 +93,69 @@ void host_audio_lock(void) { if (adev) SDL_LockAudioDevice(adev); }
|
||||
void host_audio_unlock(void) { if (adev) SDL_UnlockAudioDevice(adev); }
|
||||
|
||||
/* ------------------------------------------------------------------ affichage */
|
||||
/* écran de la fenêtre : taille totale et place utilisable (barre des tâches et barre de titre déduites),
|
||||
* en unités de fenêtre */
|
||||
static void screen_size(int *sw, int *sh, int *uw, int *uh) {
|
||||
SDL_Rect r, u;
|
||||
int d = win ? SDL_GetWindowDisplayIndex(win) : 0;
|
||||
if (d < 0 || SDL_GetDisplayBounds(d, &r) != 0) { r.w = 1280; r.h = 1024; }
|
||||
if (d < 0 || SDL_GetDisplayUsableBounds(d, &u) != 0) u = r;
|
||||
*sw = r.w; *sh = r.h; *uw = u.w; *uh = u.h - 40;
|
||||
}
|
||||
|
||||
/* pixels de dessin par unité de fenêtre (1, sauf écran haute densité sans prise en charge du DPI) */
|
||||
static float px_ratio(void) {
|
||||
int dw, dh, ww, wh;
|
||||
if (!win) return 1.f;
|
||||
SDL_GL_GetDrawableSize(win, &dw, &dh);
|
||||
SDL_GetWindowSize(win, &ww, &wh);
|
||||
return ww > 0 && dw > 0 ? (float)dw / (float)ww : 1.f;
|
||||
}
|
||||
|
||||
/* plus grande échelle de fenêtre qui tient dans l'espace utilisable de l'écran */
|
||||
static int max_scale(void) {
|
||||
SDL_Rect r;
|
||||
int d = win ? SDL_GetWindowDisplayIndex(win) : 0, m;
|
||||
if (d < 0 || SDL_GetDisplayUsableBounds(d, &r) != 0) return 4;
|
||||
m = r.w / 320;
|
||||
if ((r.h - 40) / 240 < m) m = (r.h - 40) / 240; /* place de la barre de titre */
|
||||
int sw, sh, uw, uh, m;
|
||||
screen_size(&sw, &sh, &uw, &uh);
|
||||
m = uw / 320;
|
||||
if (uh / 240 < m) m = uh / 240;
|
||||
return m < 1 ? 1 : m;
|
||||
}
|
||||
|
||||
/* applique settings à la fenêtre ; ne redimensionne que si l'échelle ou le format ont changé */
|
||||
/* taille de la fenêtre en unités de fenêtre : window_width × window_height pixels, réduite (format gardé)
|
||||
* si elle ne tient pas à l'écran ; sinon 320 × window_scale */
|
||||
static void window_size(int *w, int *h) {
|
||||
int sw, sh, uw, uh;
|
||||
screen_size(&sw, &sh, &uw, &uh);
|
||||
if (settings.window_width > 0 && settings.window_height > 0) {
|
||||
float k = px_ratio(), fw = settings.window_width / k, fh = settings.window_height / k, s = 1.f;
|
||||
if (fw > uw) s = uw / fw;
|
||||
if (fh * s > uh) s = uh / fh;
|
||||
*w = (int)(fw * s); *h = (int)(fh * s);
|
||||
} else {
|
||||
int sc = settings.window_scale < max_scale() ? settings.window_scale : max_scale();
|
||||
*w = 320 * sc; *h = game_h * sc;
|
||||
}
|
||||
}
|
||||
|
||||
/* applique settings à la fenêtre ; ne redimensionne que si la taille ou le format ont changé.
|
||||
* L'image est mise à l'échelle dans la fenêtre comme en plein écran (format gardé, bandes noires sinon). */
|
||||
static void apply_display(void) {
|
||||
static int done_scale = -1, done_fmt = -1, done_full = -1, done_vsync = -1;
|
||||
static int done_scale = -1, done_w = -1, done_h = -1, done_fmt = -1, done_full = -1, done_vsync = -1;
|
||||
int full = (SDL_GetWindowFlags(win) & SDL_WINDOW_FULLSCREEN_DESKTOP) != 0;
|
||||
game_h = settings.aspect_43 ? 240 : 200;
|
||||
if (full != settings.fullscreen) SDL_SetWindowFullscreen(win, settings.fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0);
|
||||
if (!settings.fullscreen && (settings.window_scale != done_scale || settings.aspect_43 != done_fmt || done_full == 1)) {
|
||||
SDL_SetWindowSize(win, 320 * settings.window_scale, game_h * settings.window_scale);
|
||||
if (!settings.fullscreen && (settings.window_scale != done_scale || settings.window_width != done_w ||
|
||||
settings.window_height != done_h || settings.aspect_43 != done_fmt || done_full == 1)) {
|
||||
int w, h;
|
||||
window_size(&w, &h);
|
||||
SDL_SetWindowSize(win, w, h);
|
||||
SDL_SetWindowPosition(win, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);
|
||||
}
|
||||
if (settings.vsync != done_vsync) SDL_GL_SetSwapInterval(settings.vsync ? 1 : 0);
|
||||
hd_set_enabled(settings.hd_pack && settings.hd_decors);
|
||||
redraw = 1;
|
||||
done_scale = settings.window_scale; done_fmt = settings.aspect_43; done_full = settings.fullscreen;
|
||||
done_scale = settings.window_scale; done_w = settings.window_width; done_h = settings.window_height;
|
||||
done_fmt = settings.aspect_43; done_full = settings.fullscreen;
|
||||
done_vsync = settings.vsync;
|
||||
}
|
||||
|
||||
@@ -170,7 +209,20 @@ static void parse_options(int argc, char **argv) {
|
||||
const char *a = argv[i], *v = i + 1 < argc ? argv[i + 1] : NULL;
|
||||
if (!strcmp(a, "--plein")) settings_override("fullscreen", "1");
|
||||
else if (!strcmp(a, "--fenetre")) settings_override("fullscreen", "0");
|
||||
else if (!strcmp(a, "--echelle") && v) { if (!settings_override("window_scale", v)) usage_option(a, v); i++; }
|
||||
else if (!strcmp(a, "--echelle") && v) {
|
||||
if (!settings_override("window_scale", v)) usage_option(a, v);
|
||||
else { settings_override("window_width", "0"); settings_override("window_height", "0"); }
|
||||
i++;
|
||||
}
|
||||
else if (!strcmp(a, "--resolution") && v) { /* --resolution 1280x960 : taille de la fenêtre */
|
||||
char w[16], h[16];
|
||||
int lw = 0, lh = 0;
|
||||
if (sscanf(v, "%d%*[xX×]%d", &lw, &lh) == 2 && lw > 0 && lh > 0) {
|
||||
snprintf(w, sizeof w, "%d", lw); snprintf(h, sizeof h, "%d", lh);
|
||||
if (!settings_override("window_width", w) || !settings_override("window_height", h)) usage_option(a, v);
|
||||
} else usage_option(a, v);
|
||||
i++;
|
||||
}
|
||||
else if (!strcmp(a, "--filtre") && v) { if (!settings_override("filter", v)) usage_option(a, v); i++; }
|
||||
else if (!strcmp(a, "--format43") && v) { if (!settings_override("aspect_43", v)) usage_option(a, v); i++; }
|
||||
else if (!strcmp(a, "--vsync") && v) { if (!settings_override("vsync", v)) usage_option(a, v); i++; }
|
||||
@@ -259,9 +311,12 @@ int host_init(int argc, char **argv) {
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
|
||||
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
|
||||
win = SDL_CreateWindow("Bud Tucker in Double Trouble (recomp) — F12 : réglages", SDL_WINDOWPOS_CENTERED,
|
||||
SDL_WINDOWPOS_CENTERED, 320 * settings.window_scale, game_h * settings.window_scale,
|
||||
SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI);
|
||||
{
|
||||
int w, h;
|
||||
window_size(&w, &h); /* corrigée par apply_display si l'écran est haute densité */
|
||||
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);
|
||||
}
|
||||
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; }
|
||||
@@ -396,7 +451,12 @@ static void menu_modal(void) {
|
||||
uint64_t start = SDL_GetPerformanceCounter();
|
||||
int open = 1, dirty = 1, pmx = -1, pmy = -1;
|
||||
SDL_Event e;
|
||||
menu_open(max_scale());
|
||||
{
|
||||
int sw, sh, uw, uh;
|
||||
float k = px_ratio();
|
||||
screen_size(&sw, &sh, &uw, &uh);
|
||||
menu_open((int)(sw * k), (int)(sh * k), (int)(uw * k), (int)(uh * k));
|
||||
}
|
||||
toast_t0 = 0;
|
||||
host_audio_lock(); audio_hold = 1; host_audio_unlock();
|
||||
SDL_ShowCursor(SDL_ENABLE);
|
||||
|
||||
+53
-11
@@ -24,6 +24,7 @@ void settings_defaults(void) {
|
||||
for (i = 0; i < VOL_COUNT; i++) settings.vol[i] = 100;
|
||||
settings.fullscreen = 0;
|
||||
settings.window_scale = 3;
|
||||
settings.window_width = settings.window_height = 0;
|
||||
settings.filter = FILTER_NEAREST;
|
||||
settings.aspect_43 = 1;
|
||||
settings.vsync = 0;
|
||||
@@ -48,6 +49,8 @@ static const struct {
|
||||
} keys[] = {
|
||||
{"display", "fullscreen", &settings.fullscreen, 0, 1, NULL},
|
||||
{"display", "window_scale", &settings.window_scale, 1, 16, NULL},
|
||||
{"display", "window_width", &settings.window_width, 0, 16384, NULL},
|
||||
{"display", "window_height", &settings.window_height, 0, 16384, NULL},
|
||||
{"display", "filter", &settings.filter, 0, FILTER_COUNT - 1, filter_names},
|
||||
{"display", "aspect_43", &settings.aspect_43, 0, 1, NULL},
|
||||
{"display", "vsync", &settings.vsync, 0, 1, NULL},
|
||||
@@ -401,13 +404,20 @@ typedef struct { const char *label; int type; int *val; int lo, hi, step; const
|
||||
|
||||
static const char *const filter_labels[FILTER_COUNT] = {"Net", "Lissé", "xBR", "CRT"};
|
||||
|
||||
/* tailles de fenêtre proposées : résolutions courantes qui tiennent à l'écran, celle de l'écran, et la taille
|
||||
* actuelle si elle n'en fait pas partie (menu_open) */
|
||||
#define MAX_RES 24
|
||||
static int res_index, n_res, res_w[MAX_RES], res_h[MAX_RES];
|
||||
static char res_lab[MAX_RES][32];
|
||||
static const char *res_names[MAX_RES];
|
||||
|
||||
static Item items[] = {
|
||||
{"Volume général", IT_SLIDER, &settings.vol[VOL_GENERAL], 0, 100, 5, NULL},
|
||||
{"Musique", IT_SLIDER, &settings.vol[VOL_MUSIQUE], 0, 100, 5, NULL},
|
||||
{"Voix", IT_SLIDER, &settings.vol[VOL_VOIX], 0, 100, 5, NULL},
|
||||
{"Bruitages", IT_SLIDER, &settings.vol[VOL_BRUITAGES], 0, 100, 5, NULL},
|
||||
{"Plein écran", IT_SWITCH, &settings.fullscreen, 0, 1, 1, NULL},
|
||||
{"Taille de la fenêtre", IT_CHOICE, &settings.window_scale, 1, 16, 1, NULL},
|
||||
{"Taille de la fenêtre", IT_CHOICE, &res_index, 0, 0, 1, res_names}, /* liste : menu_open */
|
||||
{"Filtre d'image", IT_CHOICE, &settings.filter, 0, FILTER_COUNT - 1, 1, filter_labels},
|
||||
{"Format d'origine 4:3", IT_SWITCH, &settings.aspect_43, 0, 1, 1, NULL},
|
||||
{"Synchro verticale", IT_SWITCH, &settings.vsync, 0, 1, 1, NULL},
|
||||
@@ -422,7 +432,7 @@ static Item items[] = {
|
||||
#define ITEM_HD 9
|
||||
#define ITEM_HD_LAST 11 /* Décors HD, Personnages et objets HD : sous l'interrupteur du pack */
|
||||
|
||||
static int sel, button, dragging = -1, max_scale = 4, last_mx = -1, last_my = -1;
|
||||
static int sel, button, dragging = -1, last_mx = -1, last_my = -1;
|
||||
|
||||
/* géométrie */
|
||||
#define PANEL_X0 150
|
||||
@@ -448,10 +458,38 @@ static int button_x(int b) {
|
||||
return x0 + b * (BTN_W + BTN_GAP);
|
||||
}
|
||||
|
||||
void menu_open(int max) {
|
||||
max_scale = max < 1 ? 1 : max;
|
||||
items[ITEM_SCALE].hi = max_scale;
|
||||
settings.window_scale = clampi(settings.window_scale, 1, max_scale);
|
||||
static void add_res(int w, int h, const char *note) {
|
||||
int i, j;
|
||||
for (i = 0; i < n_res; i++) if (res_w[i] == w && res_h[i] == h) return;
|
||||
if (n_res >= MAX_RES || w <= 0 || h <= 0) return;
|
||||
for (i = 0; i < n_res && (res_w[i] < w || (res_w[i] == w && res_h[i] < h)); i++) {}
|
||||
for (j = n_res; j > i; j--) {
|
||||
res_w[j] = res_w[j - 1]; res_h[j] = res_h[j - 1];
|
||||
memcpy(res_lab[j], res_lab[j - 1], sizeof res_lab[j]);
|
||||
}
|
||||
res_w[i] = w; res_h[i] = h;
|
||||
snprintf(res_lab[i], sizeof res_lab[i], "%d × %d%s", w, h, note);
|
||||
n_res++;
|
||||
}
|
||||
|
||||
void menu_open(int screen_w, int screen_h, int usable_w, int usable_h) {
|
||||
static const int common[][2] = {
|
||||
{960, 720}, {1280, 960}, {1440, 1080}, {1600, 1200}, {1920, 1440}, {2560, 1920}, {2880, 2160}, /* 4:3 */
|
||||
{1280, 800}, {1680, 1050}, {1920, 1200}, {2560, 1600}, /* 16:10 */
|
||||
{1280, 720}, {1600, 900}, {1920, 1080}, {2560, 1440}, {3840, 2160}, /* 16:9 */
|
||||
};
|
||||
int i, cur_w = settings.window_width, cur_h = settings.window_height;
|
||||
if (cur_w <= 0 || cur_h <= 0) { cur_w = 320 * settings.window_scale; cur_h = (settings.aspect_43 ? 240 : 200) * settings.window_scale; }
|
||||
n_res = 0;
|
||||
for (i = 0; i < (int)(sizeof common / sizeof common[0]); i++)
|
||||
if (common[i][0] <= usable_w && common[i][1] <= usable_h) add_res(common[i][0], common[i][1], "");
|
||||
add_res(screen_w, screen_h, " (écran)");
|
||||
add_res(cur_w, cur_h, "");
|
||||
for (i = 0; i < n_res; i++) {
|
||||
res_names[i] = res_lab[i];
|
||||
if (res_w[i] == cur_w && res_h[i] == cur_h) res_index = i;
|
||||
}
|
||||
items[ITEM_SCALE].hi = n_res - 1;
|
||||
sel = 0; button = 0; dragging = -1; last_mx = last_my = -1;
|
||||
}
|
||||
|
||||
@@ -461,6 +499,7 @@ static int set_value(int i, int v) {
|
||||
*it->val = clampi(v, it->lo, it->hi);
|
||||
if (*it->val == old) return MENU_STAY;
|
||||
if (it->type == IT_SLIDER) { settings_apply_audio(); return MENU_STAY; }
|
||||
if (i == ITEM_SCALE) { settings.window_width = res_w[res_index]; settings.window_height = res_h[res_index]; }
|
||||
return MENU_DISPLAY;
|
||||
}
|
||||
|
||||
@@ -545,7 +584,7 @@ int menu_mouse(int x, int y, int down, int up, int wheel) {
|
||||
break;
|
||||
case IT_SWITCH: r |= set_value(i, !*it->val); break;
|
||||
case IT_CHOICE:
|
||||
if (x >= CTRL_X1 - 150) r |= set_value(i, *it->val + (x >= CTRL_X1 - 75 ? 1 : -1));
|
||||
if (x >= CTRL_X1 - 230) r |= set_value(i, *it->val + (x >= CTRL_X1 - 75 ? 1 : -1));
|
||||
break;
|
||||
case IT_BUTTONS: button = b; r |= activate(); break;
|
||||
}
|
||||
@@ -576,13 +615,16 @@ static void draw_switch(int y, int on, int active) {
|
||||
|
||||
static void draw_choice(int y, const Item *it, int active, int dim) {
|
||||
int cy = y + ROW_H / 2, v = *it->val;
|
||||
char buf[24];
|
||||
char buf[48];
|
||||
uint32_t col = dim ? C_MUTED : C_TEXT;
|
||||
int ty = cy - font_normal.height / 2;
|
||||
int ty = cy - font_normal.height / 2, tw, tx, left;
|
||||
if (it->names) snprintf(buf, sizeof buf, "%s", it->names[v]);
|
||||
else snprintf(buf, sizeof buf, "×%d", v);
|
||||
chevron(CTRL_X1 - 142, cy, 14, -1, v > it->lo ? (active ? C_ACCENT : C_MUTED) : C_TRACK, 255);
|
||||
text(&font_normal, CTRL_X1 - 75 - text_width(&font_normal, buf) / 2, ty, buf, col, 255);
|
||||
tw = text_width(&font_normal, buf);
|
||||
tx = tw <= 100 ? CTRL_X1 - 75 - tw / 2 : CTRL_X1 - 30 - tw; /* texte long : aligné à droite */
|
||||
left = tx - 22 < CTRL_X1 - 142 ? tx - 22 : CTRL_X1 - 142;
|
||||
chevron(left, cy, 14, -1, v > it->lo ? (active ? C_ACCENT : C_MUTED) : C_TRACK, 255);
|
||||
text(&font_normal, tx, ty, buf, col, 255);
|
||||
chevron(CTRL_X1 - 8, cy, 14, 1, v < it->hi ? (active ? C_ACCENT : C_MUTED) : C_TRACK, 255);
|
||||
if (!it->names) {
|
||||
snprintf(buf, sizeof buf, "%d×%d", 320 * v, (settings.aspect_43 ? 240 : 200) * v);
|
||||
|
||||
+6
-2
@@ -14,7 +14,9 @@ enum { FILTER_NEAREST, FILTER_SMOOTH, FILTER_XBR, FILTER_CRT, FILTER_COUNT };
|
||||
typedef struct {
|
||||
int vol[VOL_COUNT]; /* 0..100 % (courbe perceptive appliquée au mixeur) */
|
||||
int fullscreen; /* 0/1 */
|
||||
int window_scale; /* fenêtre de 320 × window_scale pixels de large */
|
||||
int window_scale; /* fenêtre de 320 × window_scale pixels de large (si window_width = 0) */
|
||||
int window_width; /* taille de la fenêtre en pixels (0 : window_scale) ; réduite si elle dépasse l'écran */
|
||||
int window_height;
|
||||
int filter; /* FILTER_* */
|
||||
int aspect_43; /* 1 = 320×200 étiré en 4:3 comme sur un écran VGA, 0 = pixels carrés */
|
||||
int vsync; /* 0/1 */
|
||||
@@ -44,7 +46,9 @@ typedef enum { MK_UP, MK_DOWN, MK_LEFT, MK_RIGHT, MK_OK, MK_BACK, MK_HOME, MK_EN
|
||||
/* ce que l'hôte doit faire après un événement */
|
||||
enum { MENU_STAY = 0, MENU_CLOSE = 1, MENU_QUIT = 2, MENU_DISPLAY = 4 /* affichage à réappliquer */ };
|
||||
|
||||
void menu_open(int max_scale);
|
||||
/* screen : résolution de l'écran ; usable : place disponible pour la fenêtre (sans barre des tâches ni titre),
|
||||
* en pixels ; sert à la liste des tailles de fenêtre */
|
||||
void menu_open(int screen_w, int screen_h, int usable_w, int usable_h);
|
||||
int menu_key(MenuKey k);
|
||||
/* souris en pixels du tampon du menu ; down/up : bouton gauche enfoncé / relâché pendant cet événement */
|
||||
int menu_mouse(int x, int y, int down, int up, int wheel);
|
||||
|
||||
Reference in new issue
Block a user