First drawing functions. We can see the interface !
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@25 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
42
sdlscreen.c
42
sdlscreen.c
@@ -1,14 +1,22 @@
|
||||
#include <SDL/SDL.h>
|
||||
#include "global.h"
|
||||
#include "sdlscreen.h"
|
||||
|
||||
void Pixel_SDL (word X,word Y,byte Couleur)
|
||||
{
|
||||
puts("Pixel_SDL non implémenté!\n");
|
||||
*(((Uint8 *)Ecran_SDL->pixels) + Y * Ecran_SDL->pitch + X)=Couleur;
|
||||
// SDL_UpdateRect(Ecran_SDL,X,Y,0,0);
|
||||
}
|
||||
|
||||
static inline void Pixel_SDL_Fast(word X, word Y,byte Couleur)
|
||||
{
|
||||
*(((byte *)Ecran_SDL->pixels) + Y * Ecran_SDL->pitch +X)=Couleur;
|
||||
}
|
||||
|
||||
byte Lit_Pixel_SDL (word X,word Y)
|
||||
{
|
||||
puts("Lit_Pixel_SDL non implémenté!\n");
|
||||
return 0;
|
||||
Uint8 * p = ((Uint8 *)Ecran_SDL->pixels) + Y * Ecran_SDL -> pitch + X * Ecran_SDL -> format -> BytesPerPixel;
|
||||
return *p;
|
||||
}
|
||||
|
||||
void Effacer_Tout_l_Ecran_SDL (byte Couleur)
|
||||
@@ -23,7 +31,13 @@ void Afficher_partie_de_l_ecran_SDL (word Largeur,word Hauteur,word Largeu
|
||||
|
||||
void Block_SDL (word Debut_X,word Debut_Y,word Largeur,word Hauteur,byte Couleur)
|
||||
{
|
||||
puts("Block_SDL non implémenté!\n");
|
||||
SDL_Rect rectangle;
|
||||
rectangle.x=Debut_X;
|
||||
rectangle.y=Debut_Y;
|
||||
rectangle.w=Largeur;
|
||||
rectangle.h=Hauteur;
|
||||
SDL_FillRect(Ecran_SDL,&rectangle,Couleur);
|
||||
SDL_UpdateRect(Ecran_SDL,Debut_X,Debut_Y,Largeur,Hauteur);
|
||||
}
|
||||
|
||||
void Pixel_Preview_Normal_SDL (word X,word Y,byte Couleur)
|
||||
@@ -53,7 +67,16 @@ void Display_brush_Color_SDL (word Pos_X,word Pos_Y,word Decalage_X,word Decala
|
||||
|
||||
void Display_brush_Mono_SDL (word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Hauteur,byte Couleur_de_transparence,byte Couleur,word Largeur_brosse)
|
||||
{
|
||||
puts("Display_brush_Mono_SDL non implémenté!\n");
|
||||
int i,j;
|
||||
for(i=0;i<Hauteur;i++)
|
||||
{
|
||||
for(j=0;j<Largeur;j++)
|
||||
{
|
||||
if (*(Brosse+Decalage_X+Brosse_Largeur*Decalage_Y)==Couleur_de_transparence)
|
||||
Pixel_SDL_Fast(Pos_X+j,Pos_Y+i,Couleur);
|
||||
}
|
||||
}
|
||||
SDL_UpdateRect(Ecran_SDL,Pos_X,Pos_Y,Largeur,Hauteur);
|
||||
}
|
||||
|
||||
void Clear_brush_SDL (word Pos_X,word Pos_Y,word Decalage_X,word Decalage_Y,word Largeur,word Hauteur,byte Couleur_de_transparence,word Largeur_image)
|
||||
@@ -68,7 +91,12 @@ void Remap_screen_SDL (word Pos_X,word Pos_Y,word Largeur,word Hauteur,b
|
||||
|
||||
void Afficher_une_ligne_ecran_SDL (word Pos_X,word Pos_Y,word Largeur,byte * Ligne)
|
||||
{
|
||||
puts("Afficher_une_ligne_ecran_SDL non implémenté!\n");
|
||||
int i;
|
||||
for(i=0;i<Largeur;i++)
|
||||
{
|
||||
Pixel_SDL_Fast(Ecran_SDL,Pos_X+i,Pos_Y);
|
||||
}
|
||||
SDL_UpdateRect(Ecran_SDL,Pos_X,Pos_Y,Largeur,1);
|
||||
}
|
||||
|
||||
void Lire_une_ligne_ecran_SDL (word Pos_X,word Pos_Y,word Largeur,byte * Ligne)
|
||||
@@ -98,5 +126,5 @@ void Clear_brush_zoom_SDL (word Pos_X,word Pos_Y,word Decalage_X,word Dec
|
||||
|
||||
void Set_Mode_SDL()
|
||||
{
|
||||
puts("Set_Mode_SDL non implémenté!\n");
|
||||
Ecran_SDL=SDL_SetVideoMode(Largeur_ecran,Hauteur_ecran,8,SDL_SWSURFACE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user