Text tool: now has a preview.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@321 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud
2008-11-02 20:33:36 +00:00
parent de2f95863d
commit c5a3b7b3c8
3 changed files with 108 additions and 14 deletions

View File

@@ -21,6 +21,7 @@
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <string.h>
#include <stdlib.h>
#include <SDL/SDL.h>
#include "global.h"
#include "sdlscreen.h"
@@ -232,6 +233,38 @@ void Clear_brush_SDL (word Pos_X,word Pos_Y,__attribute__((unused)) word Decalag
UpdateRect(Pos_X,Pos_Y,Largeur,Hauteur);
}
// Affiche une brosse (arbitraire) à l'écran
void Affiche_brosse_SDL(byte * B, 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 = B + Decalage_Y * Largeur_brosse + Decalage_X;
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;
}
// Pixel suivant
ESI++; EDI++;
}
// On passe à la ligne suivante
EDI = EDI + Largeur_ecran - Largeur;
ESI = ESI + Largeur_brosse - Largeur;
}
}
void Remap_screen_SDL (word Pos_X,word Pos_Y,word Largeur,word Hauteur,byte * Table_de_conversion)
{
// EDI = coords a l'écran