New: Picture effects screen, resizes / mirrors / rotates image (Issue 73)
New: Distort brush (Issue 34) New: Pixel scaler "Triple" for 3x3 zoom (Issue 147) New: Pixel scaler "Quadruple" for 4x4 zoom (Issue 151) New: Pixel scaler "Wide2" for 4x2 zoom (Issue 148) New: Pixel scaler "Tall2" for 2x4 zoom (Issue 149) Fix of very old bug: Resizing the image didn't mark the image 'modified since last save' git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@763 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
40
pxsimple.c
40
pxsimple.c
@@ -32,13 +32,13 @@
|
||||
void Pixel_simple (word x,word y,byte color)
|
||||
/* Affiche un pixel de la color aux coords x;y à l'écran */
|
||||
{
|
||||
*(Screen_pixels + x + y * Screen_width)=color;
|
||||
*(Screen_pixels + x + y * VIDEO_LINE_WIDTH)=color;
|
||||
}
|
||||
|
||||
byte Read_pixel_simple (word x,word y)
|
||||
/* On retourne la couleur du pixel aux coords données */
|
||||
{
|
||||
return *( Screen_pixels + y * Screen_width + x );
|
||||
return *( Screen_pixels + y * VIDEO_LINE_WIDTH + x );
|
||||
}
|
||||
|
||||
void Block_simple (word start_x,word start_y,word width,word height,byte color)
|
||||
@@ -67,7 +67,7 @@ void Display_part_of_screen_simple (word width,word height,word image_width)
|
||||
|
||||
// On passe à la ligne suivante
|
||||
src+=image_width;
|
||||
dest+=Screen_width;
|
||||
dest+=VIDEO_LINE_WIDTH;
|
||||
}
|
||||
//Update_rect(0,0,width,height);
|
||||
}
|
||||
@@ -112,7 +112,7 @@ void Pixel_preview_magnifier_simple (word x,word y,byte color)
|
||||
void Horizontal_XOR_line_simple(word x_pos,word y_pos,word width)
|
||||
{
|
||||
//On calcule la valeur initiale de dest:
|
||||
byte* dest=y_pos*Screen_width+x_pos+Screen_pixels;
|
||||
byte* dest=y_pos*VIDEO_LINE_WIDTH+x_pos+Screen_pixels;
|
||||
|
||||
int x;
|
||||
|
||||
@@ -126,15 +126,15 @@ void Vertical_XOR_line_simple(word x_pos,word y_pos,word height)
|
||||
byte color;
|
||||
for (i=y_pos;i<y_pos+height;i++)
|
||||
{
|
||||
color=*(Screen_pixels+x_pos+i*Screen_width);
|
||||
*(Screen_pixels+x_pos+i*Screen_width)=~color;
|
||||
color=*(Screen_pixels+x_pos+i*VIDEO_LINE_WIDTH);
|
||||
*(Screen_pixels+x_pos+i*VIDEO_LINE_WIDTH)=~color;
|
||||
}
|
||||
}
|
||||
|
||||
void Display_brush_color_simple(word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,word brush_width)
|
||||
{
|
||||
// dest = Position à l'écran
|
||||
byte* dest = Screen_pixels + y_pos * Screen_width + x_pos;
|
||||
byte* dest = Screen_pixels + y_pos * VIDEO_LINE_WIDTH + x_pos;
|
||||
// src = Position dans la brosse
|
||||
byte* src = Brush + y_offset * brush_width + x_offset;
|
||||
|
||||
@@ -157,7 +157,7 @@ void Display_brush_color_simple(word x_pos,word y_pos,word x_offset,word y_offse
|
||||
}
|
||||
|
||||
// On passe à la ligne suivante
|
||||
dest = dest + Screen_width - width;
|
||||
dest = dest + VIDEO_LINE_WIDTH - width;
|
||||
src = src + brush_width - width;
|
||||
}
|
||||
Update_rect(x_pos,y_pos,width,height);
|
||||
@@ -168,7 +168,7 @@ void Display_brush_mono_simple(word x_pos, word y_pos,
|
||||
byte transp_color, byte color, word brush_width)
|
||||
/* On affiche la brosse en monochrome */
|
||||
{
|
||||
byte* dest=y_pos*Screen_width+x_pos+Screen_pixels; // dest = adr Destination à
|
||||
byte* dest=y_pos*VIDEO_LINE_WIDTH+x_pos+Screen_pixels; // dest = adr Destination à
|
||||
// l'écran
|
||||
byte* src=brush_width*y_offset+x_offset+Brush; // src = adr ds
|
||||
// la brosse
|
||||
@@ -190,14 +190,14 @@ void Display_brush_mono_simple(word x_pos, word y_pos,
|
||||
|
||||
// On passe à la ligne suivante
|
||||
src+=brush_width-width;
|
||||
dest+=Screen_width-width;
|
||||
dest+=VIDEO_LINE_WIDTH-width;
|
||||
}
|
||||
Update_rect(x_pos,y_pos,width,height);
|
||||
}
|
||||
|
||||
void Clear_brush_simple(word x_pos,word y_pos,__attribute__((unused)) word x_offset,__attribute__((unused)) word y_offset,word width,word height,__attribute__((unused))byte transp_color,word image_width)
|
||||
{
|
||||
byte* dest=Screen_pixels+x_pos+y_pos*Screen_width; //On va se mettre en 0,0 dans l'écran (dest)
|
||||
byte* dest=Screen_pixels+x_pos+y_pos*VIDEO_LINE_WIDTH; //On va se mettre en 0,0 dans l'écran (dest)
|
||||
byte* src = ( y_pos + Main_offset_Y ) * image_width + x_pos + Main_offset_X + Main_screen; //Coords de départ ds la source (src)
|
||||
int y;
|
||||
|
||||
@@ -209,7 +209,7 @@ void Clear_brush_simple(word x_pos,word y_pos,__attribute__((unused)) word x_off
|
||||
|
||||
// On passe à la ligne suivante
|
||||
src+=image_width;
|
||||
dest+=Screen_width;
|
||||
dest+=VIDEO_LINE_WIDTH;
|
||||
}
|
||||
Update_rect(x_pos,y_pos,width,height);
|
||||
}
|
||||
@@ -218,7 +218,7 @@ void Clear_brush_simple(word x_pos,word y_pos,__attribute__((unused)) word x_off
|
||||
void Display_brush_simple(byte * brush, word x_pos,word y_pos,word x_offset,word y_offset,word width,word height,byte transp_color,word brush_width)
|
||||
{
|
||||
// dest = Position à l'écran
|
||||
byte* dest = Screen_pixels + y_pos * Screen_width + x_pos;
|
||||
byte* dest = Screen_pixels + y_pos * VIDEO_LINE_WIDTH + x_pos;
|
||||
// src = Position dans la brosse
|
||||
byte* src = brush + y_offset * brush_width + x_offset;
|
||||
|
||||
@@ -241,7 +241,7 @@ void Display_brush_simple(byte * brush, word x_pos,word y_pos,word x_offset,word
|
||||
}
|
||||
|
||||
// On passe à la ligne suivante
|
||||
dest = dest + Screen_width - width;
|
||||
dest = dest + VIDEO_LINE_WIDTH - width;
|
||||
src = src + brush_width - width;
|
||||
}
|
||||
}
|
||||
@@ -249,7 +249,7 @@ void Display_brush_simple(byte * brush, word x_pos,word y_pos,word x_offset,word
|
||||
void Remap_screen_simple(word x_pos,word y_pos,word width,word height,byte * conversion_table)
|
||||
{
|
||||
// dest = coords a l'écran
|
||||
byte* dest = Screen_pixels + y_pos * Screen_width + x_pos;
|
||||
byte* dest = Screen_pixels + y_pos * VIDEO_LINE_WIDTH + x_pos;
|
||||
int x,y;
|
||||
|
||||
// Pour chaque ligne
|
||||
@@ -262,7 +262,7 @@ void Remap_screen_simple(word x_pos,word y_pos,word width,word height,byte * con
|
||||
dest ++;
|
||||
}
|
||||
|
||||
dest = dest + Screen_width - width;
|
||||
dest = dest + VIDEO_LINE_WIDTH - width;
|
||||
}
|
||||
|
||||
Update_rect(x_pos,y_pos,width,height);
|
||||
@@ -271,7 +271,7 @@ void Remap_screen_simple(word x_pos,word y_pos,word width,word height,byte * con
|
||||
void Display_line_on_screen_simple(word x_pos,word y_pos,word width,byte * line)
|
||||
/* On affiche toute une ligne de pixels. Utilisé pour les textes. */
|
||||
{
|
||||
memcpy(Screen_pixels+x_pos+y_pos*Screen_width,line,width);
|
||||
memcpy(Screen_pixels+x_pos+y_pos*VIDEO_LINE_WIDTH,line,width);
|
||||
}
|
||||
|
||||
void Display_transparent_mono_line_on_screen_simple(
|
||||
@@ -280,7 +280,7 @@ void Display_transparent_mono_line_on_screen_simple(
|
||||
// Affiche une ligne à l'écran avec une couleur + transparence.
|
||||
// Utilisé par les brosses en mode zoom
|
||||
{
|
||||
byte* dest = Screen_pixels+ y_pos * Screen_width + x_pos;
|
||||
byte* dest = Screen_pixels+ y_pos * VIDEO_LINE_WIDTH + x_pos;
|
||||
int x;
|
||||
// Pour chaque pixel
|
||||
for(x=0;x<width;x++)
|
||||
@@ -294,7 +294,7 @@ void Display_transparent_mono_line_on_screen_simple(
|
||||
|
||||
void Read_line_screen_simple(word x_pos,word y_pos,word width,byte * line)
|
||||
{
|
||||
memcpy(line,Screen_width * y_pos + x_pos + Screen_pixels,width);
|
||||
memcpy(line,VIDEO_LINE_WIDTH * y_pos + x_pos + Screen_pixels,width);
|
||||
}
|
||||
|
||||
void Display_part_of_screen_scaled_simple(
|
||||
@@ -340,7 +340,7 @@ void Display_part_of_screen_scaled_simple(
|
||||
void Display_transparent_line_on_screen_simple(word x_pos,word y_pos,word width,byte* line,byte transp_color)
|
||||
{
|
||||
byte* src = line;
|
||||
byte* dest = Screen_pixels + y_pos * Screen_width + x_pos;
|
||||
byte* dest = Screen_pixels + y_pos * VIDEO_LINE_WIDTH + x_pos;
|
||||
|
||||
word x;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user