From aa7d13a3fc9ae15c728a08ba6040a4157a8736ba Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Fri, 20 Feb 2009 20:12:27 +0000 Subject: [PATCH] Resolution screen: Fixed a problem where it didn't find the current resolution, when using tall/wide/double pixels. If the cursor was not visible and you pressed OK anyway, it could crash. Resolution changes: No longer reset the mouse cursor in center of screen. Emergency save: When you run grafx2 again, the recovered images are now marked as modified (grafx2 will ask you to save before quit) git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@646 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- boutons.c | 3 --- graph.c | 21 ++++++++++++++------- main.c | 4 +++- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/boutons.c b/boutons.c index 548cd596..72cef973 100644 --- a/boutons.c +++ b/boutons.c @@ -1655,9 +1655,6 @@ void Bouton_Resol(void) Afficher_menu(); Afficher_ecran(); } - Mouse_X = Largeur_ecran >> 1; - Mouse_Y = Hauteur_ecran >> 1; - Set_mouse_position(); Pinceau_X = Mouse_X; Pinceau_Y = Mouse_Y; diff --git a/graph.c b/graph.c index 5e014492..a9eb4652 100644 --- a/graph.c +++ b/graph.c @@ -187,8 +187,14 @@ int Initialiser_mode_video(int Largeur, int Hauteur, int Fullscreen) int Indice; int Facteur; - if (Largeur_ecran!=Largeur || - Hauteur_ecran!=Hauteur || + // Pour la première entrée dans cette fonction + if (Pixel_width<1) + Pixel_width=1; + if (Pixel_height<1) + Pixel_height=1; + + if (Largeur_ecran!=Largeur/Pixel_width || + Hauteur_ecran!=Hauteur/Pixel_height || Mode_video[Resolution_actuelle].Fullscreen != Fullscreen) { switch (Pixel_ratio) @@ -347,18 +353,19 @@ int Initialiser_mode_video(int Largeur, int Hauteur, int Fullscreen) Set_palette(Principal_Palette); - if (!Fullscreen) - Resolution_actuelle=0; - else + Resolution_actuelle=0; + if (Fullscreen) + { for (Indice=1; Indice