Provides an intermediate refresh mode. You can activate it in sdlscreen.c
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@267 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
9770d70f2a
commit
c395578be8
56
sdlscreen.c
56
sdlscreen.c
@ -25,6 +25,7 @@
|
|||||||
#include "sdlscreen.h"
|
#include "sdlscreen.h"
|
||||||
#include "divers.h"
|
#include "divers.h"
|
||||||
#include "erreurs.h"
|
#include "erreurs.h"
|
||||||
|
#include "graph.h"
|
||||||
|
|
||||||
// Mise à jour minimaliste en nombre de pixels
|
// Mise à jour minimaliste en nombre de pixels
|
||||||
#define METHODE_UPDATE_MULTI_RECTANGLE 1
|
#define METHODE_UPDATE_MULTI_RECTANGLE 1
|
||||||
@ -497,11 +498,39 @@ void Gere_Evenement_SDL(SDL_Event * event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (METHODE_UPDATE == METHODE_UPDATE_PAR_CUMUL)
|
||||||
|
short Min_X=0;
|
||||||
|
short Min_Y=0;
|
||||||
|
short Max_X=10000;
|
||||||
|
short Max_Y=10000;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (METHODE_UPDATE == METHODE_UPDATE_PLEINE_PAGE)
|
||||||
|
int Update_necessaire=0;
|
||||||
|
#endif
|
||||||
|
|
||||||
void Flush_update(void)
|
void Flush_update(void)
|
||||||
{
|
{
|
||||||
#if (METHODE_UPDATE == METHODE_UPDATE_PLEINE_PAGE)
|
#if (METHODE_UPDATE == METHODE_UPDATE_PLEINE_PAGE)
|
||||||
// Mise à jour de la totalité de l'écran
|
// Mise à jour de la totalité de l'écran
|
||||||
|
if (Update_necessaire)
|
||||||
|
{
|
||||||
SDL_UpdateRect(Ecran_SDL, 0, 0, 0, 0);
|
SDL_UpdateRect(Ecran_SDL, 0, 0, 0, 0);
|
||||||
|
Update_necessaire=0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#if (METHODE_UPDATE == METHODE_UPDATE_PAR_CUMUL)
|
||||||
|
if (Min_X>=Max_X || Min_Y>=Max_Y)
|
||||||
|
{
|
||||||
|
; // Rien a faire
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SDL_UpdateRect(Ecran_SDL, Max(Min_X,0), Max(Min_Y,0), Min(Largeur_ecran, Max_X-Min_X), Min(Hauteur_ecran, Max_Y-Min_Y));
|
||||||
|
|
||||||
|
Min_X=Min_Y=10000;
|
||||||
|
Max_X=Max_Y=0;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -511,16 +540,27 @@ void UpdateRect(short X, short Y, unsigned short Largeur, unsigned short Hauteur
|
|||||||
#if (METHODE_UPDATE == METHODE_UPDATE_MULTI_RECTANGLE)
|
#if (METHODE_UPDATE == METHODE_UPDATE_MULTI_RECTANGLE)
|
||||||
SDL_UpdateRect(Ecran_SDL, (X), (Y), (Largeur), (Hauteur));
|
SDL_UpdateRect(Ecran_SDL, (X), (Y), (Largeur), (Hauteur));
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#if (METHODE_UPDATE == METHODE_UPDATE_MULTI_RECTANGLE)
|
|
||||||
|
|
||||||
#endif
|
|
||||||
#if (METHODE_UPDATE == METHODE_UPDATE_PAR_CUMUL)
|
#if (METHODE_UPDATE == METHODE_UPDATE_PAR_CUMUL)
|
||||||
|
if (Largeur==0 || Hauteur==0)
|
||||||
|
{
|
||||||
|
Min_X=Min_Y=0;
|
||||||
|
Max_X=Max_Y=10000;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (X < Min_X)
|
||||||
|
Min_X = X;
|
||||||
|
if (Y < Min_Y)
|
||||||
|
Min_Y = Y;
|
||||||
|
if (X+Largeur>Max_X)
|
||||||
|
Max_X=X+Largeur;
|
||||||
|
if (Y+Hauteur>Max_Y)
|
||||||
|
Max_Y=Y+Hauteur;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (METHODE_UPDATE == METHODE_UPDATE_PLEINE_PAGE)
|
#if (METHODE_UPDATE == METHODE_UPDATE_PLEINE_PAGE)
|
||||||
|
Update_necessaire=1;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user