fixes to build under vista

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@95 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Adrien Destugues
2008-08-07 19:59:00 +00:00
parent bcced2c747
commit cdf5a760b2
3 changed files with 207 additions and 182 deletions

View File

@@ -126,34 +126,34 @@ void Ligne_verticale_XOR_SDL (word Pos_X,word Pos_Y,word Hauteur)
void Display_brush_Color_SDL (word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_brosse)
{
// EDI = Position à l'écran
byte* EDI = Ecran + Pos_Y * Largeur_ecran + Pos_X;
// ESI = Position dans la brosse
byte* ESI = Brosse + Decalage_Y * Largeur_brosse + Decalage_X;
// EDI = Position à l'écran
byte* EDI = Ecran + Pos_Y * Largeur_ecran + Pos_X;
// ESI = Position dans la brosse
byte* ESI = Brosse + Decalage_Y * Largeur_brosse + Decalage_X;
word DX,CX;
word DX,CX;
// Pour chaque ligne
for(DX = Hauteur;DX > 0; DX--)
{
// Pour chaque pixel
for(CX = Largeur;CX > 0; CX--)
{
// On vérifie que ce n'est pas la transparence
if(*ESI != Couleur_de_transparence)
{
*EDI = *ESI;
}
// Pour chaque ligne
for(DX = Hauteur;DX > 0; DX--)
{
// Pour chaque pixel
for(CX = Largeur;CX > 0; CX--)
{
// On vérifie que ce n'est pas la transparence
if(*ESI != Couleur_de_transparence)
{
*EDI = *ESI;
}
// Pixel suivant
ESI++; EDI++;
}
// Pixel suivant
ESI++; EDI++;
}
// On passe à la ligne suivante
EDI = EDI + Largeur_ecran - Largeur;
ESI = ESI + Largeur_brosse - Largeur;
}
SDL_UpdateRect(Ecran_SDL,Pos_X,Pos_Y,Largeur,Hauteur);
// On passe à la ligne suivante
EDI = EDI + Largeur_ecran - Largeur;
ESI = ESI + Largeur_brosse - Largeur;
}
SDL_UpdateRect(Ecran_SDL,Pos_X,Pos_Y,Largeur,Hauteur);
}
void Display_brush_Mono_SDL (word Pos_X, word Pos_Y,
@@ -284,52 +284,52 @@ void Afficher_partie_de_l_ecran_zoomee_SDL(
void Afficher_une_ligne_transparente_a_l_ecran_SDL(word Pos_X,word Pos_Y,word Largeur,byte* Ligne,byte Couleur_transparence)
{
byte* ESI = Ligne;
byte* EDI = Ecran + Pos_Y * Largeur_ecran + Pos_X;
byte* ESI = Ligne;
byte* EDI = Ecran + Pos_Y * Largeur_ecran + Pos_X;
byte cx;
byte cx;
// Pour chaque pixel de la ligne
for(cx = Largeur;cx > 0;cx--)
{
if(*ESI!=Couleur_transparence)
*EDI = *ESI;
ESI++;
EDI++;
}
// Pour chaque pixel de la ligne
for(cx = Largeur;cx > 0;cx--)
{
if(*ESI!=Couleur_transparence)
*EDI = *ESI;
ESI++;
EDI++;
}
}
// Affiche une partie de la brosse couleur zoomée
void Display_brush_Color_zoom_SDL (word Pos_X,word Pos_Y,
word Decalage_X,word Decalage_Y,
word Largeur, // Largeur non zoomée
word Pos_Y_Fin,byte Couleur_de_transparence,
word Largeur_brosse, // Largeur réelle de la brosse
byte * Buffer)
word Decalage_X,word Decalage_Y,
word Largeur, // Largeur non zoomée
word Pos_Y_Fin,byte Couleur_de_transparence,
word Largeur_brosse, // Largeur réelle de la brosse
byte * Buffer)
{
byte* ESI = Brosse+Decalage_Y*Largeur_brosse + Decalage_X;
word DX = Pos_Y;
byte bx;
byte* ESI = Brosse+Decalage_Y*Largeur_brosse + Decalage_X;
word DX = Pos_Y;
byte bx;
// Pour chaque ligne
while(1)
{
Zoomer_une_ligne(ESI,Buffer,Loupe_Facteur,Largeur);
// On affiche facteur fois la ligne zoomée
for(bx=Loupe_Facteur;bx>0;bx--)
{
Afficher_une_ligne_transparente_a_l_ecran_SDL(Pos_X,DX,Largeur*Loupe_Facteur,Buffer,Couleur_de_transparence);
DX++;
if(DX==Pos_Y_Fin)
{
SDL_UpdateRect(Ecran_SDL,Pos_X,Pos_Y,Largeur*Loupe_Facteur,Pos_Y_Fin-Pos_Y+1);
return;
}
}
ESI += Largeur_brosse;
}
// ATTENTION zone jamais atteinte
// Pour chaque ligne
while(1)
{
Zoomer_une_ligne(ESI,Buffer,Loupe_Facteur,Largeur);
// On affiche facteur fois la ligne zoomée
for(bx=Loupe_Facteur;bx>0;bx--)
{
Afficher_une_ligne_transparente_a_l_ecran_SDL(Pos_X,DX,Largeur*Loupe_Facteur,Buffer,Couleur_de_transparence);
DX++;
if(DX==Pos_Y_Fin)
{
SDL_UpdateRect(Ecran_SDL,Pos_X,Pos_Y,Largeur*Loupe_Facteur,Pos_Y_Fin-Pos_Y+1);
return;
}
}
ESI += Largeur_brosse;
}
// ATTENTION zone jamais atteinte
}
void Display_brush_Mono_zoom_SDL (word Pos_X, word Pos_Y,
@@ -419,10 +419,11 @@ void Clear_brush_zoom_SDL (word Pos_X,word Pos_Y,word Decalage_X,word Dec
void Set_Mode_SDL()
/* On règle la résolution de l'écran */
{
#ifdef WINDOWED
#define FLAGS
#else
#define FLAGS SDL_FULLSCREEN
#ifdef WINDOWED
#define FLAGS
#else
#define FLAGS SDL_FULLSCREEN
#endif
Ecran_SDL=SDL_SetVideoMode(Largeur_ecran,Hauteur_ecran,8,FLAGS);
Ecran=Ecran_SDL->pixels;