Change rendering system to use function pointers, see Issue 31 c38 : preliminary work to make the same executable handle Layers or Anims. Fixed an old issue where Lasso-ing a brush with right mouse button wouldn't erase cleanly (visual). Fixed an old issue where picking colors in layer 5 would not 'see' through layers.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1906 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
8ea1ab7fc8
commit
55d0889bc8
@ -350,7 +350,7 @@ void Draw_paintbrush(short x,short y,byte color)
|
|||||||
for (yy=min_y; yy<min_y+height; yy++)
|
for (yy=min_y; yy<min_y+height; yy++)
|
||||||
for (xx=min_x; xx<min_x+width; xx++)
|
for (xx=min_x; xx<min_x+width; xx++)
|
||||||
{
|
{
|
||||||
Pixel_in_current_screen(xx,yy,color,0);
|
Pixel_in_current_screen(xx,yy,color);
|
||||||
}
|
}
|
||||||
// Feedback
|
// Feedback
|
||||||
// This part is greatly taken from Hide_paintbrush()
|
// This part is greatly taken from Hide_paintbrush()
|
||||||
@ -895,7 +895,7 @@ void Capture_brush(short start_x,short start_y,short end_x,short end_y,short cle
|
|||||||
for (y_pos=start_y;y_pos<start_y+Brush_height;y_pos++)
|
for (y_pos=start_y;y_pos<start_y+Brush_height;y_pos++)
|
||||||
for (x_pos=start_x;x_pos<start_x+Brush_width;x_pos++)
|
for (x_pos=start_x;x_pos<start_x+Brush_width;x_pos++)
|
||||||
{
|
{
|
||||||
Pixel_in_current_screen(x_pos,y_pos,Back_color,1);
|
Pixel_in_current_screen_with_preview(x_pos,y_pos,Back_color);
|
||||||
}
|
}
|
||||||
Update_part_of_screen(start_x,start_y,Brush_width,Brush_height);
|
Update_part_of_screen(start_x,start_y,Brush_width,Brush_height);
|
||||||
}
|
}
|
||||||
@ -1295,7 +1295,7 @@ void Capture_brush_with_lasso(int vertices, short * points,short clear)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Pixel_in_current_screen(x_pos,y_pos,Back_color,0);
|
Pixel_in_current_screen_with_preview(x_pos,y_pos,Back_color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -159,7 +159,7 @@ void Update_colors_during_script(void)
|
|||||||
void Pixel_figure_no_screen(short x_pos,short y_pos,byte color)
|
void Pixel_figure_no_screen(short x_pos,short y_pos,byte color)
|
||||||
{
|
{
|
||||||
if (x_pos>0 && y_pos >0 && x_pos<Main_image_width && y_pos<Main_image_height)
|
if (x_pos>0 && y_pos >0 && x_pos<Main_image_width && y_pos<Main_image_height)
|
||||||
Pixel_in_current_screen(x_pos,y_pos,color,0);
|
Pixel_in_current_screen(x_pos,y_pos,color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -379,7 +379,7 @@ int L_PutPicturePixel(lua_State* L)
|
|||||||
// Silently ignored
|
// Silently ignored
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
Pixel_in_current_screen(x, y, c, 0);
|
Pixel_in_current_screen(x, y, c);
|
||||||
return 0; // no values returned for lua
|
return 0; // no values returned for lua
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -476,7 +476,7 @@ int L_DrawFilledRect(lua_State* L)
|
|||||||
// Perform drawing
|
// Perform drawing
|
||||||
for (y_pos=min_y; y_pos<=max_y;y_pos++)
|
for (y_pos=min_y; y_pos<=max_y;y_pos++)
|
||||||
for (x_pos=min_x; x_pos<=max_x;x_pos++)
|
for (x_pos=min_x; x_pos<=max_x;x_pos++)
|
||||||
Pixel_in_current_screen(x_pos,y_pos,c,0);
|
Pixel_in_current_screen(x_pos,y_pos,c);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -539,7 +539,7 @@ int L_DrawDisk(lua_State* L)
|
|||||||
{
|
{
|
||||||
short x=(x_pos-center_x)*2-even;
|
short x=(x_pos-center_x)*2-even;
|
||||||
if (x*x+y*y <= circle_limit)
|
if (x*x+y*y <= circle_limit)
|
||||||
Pixel_in_current_screen(x_pos,y_pos,c,0);
|
Pixel_in_current_screen(x_pos,y_pos,c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
155
src/graph.c
155
src/graph.c
@ -1106,7 +1106,7 @@ void Fill_general(byte fill_color)
|
|||||||
byte filled = Read_pixel_from_current_layer(x_pos,y_pos);
|
byte filled = Read_pixel_from_current_layer(x_pos,y_pos);
|
||||||
|
|
||||||
// First, restore the color.
|
// First, restore the color.
|
||||||
Pixel_in_current_screen(x_pos,y_pos,Read_pixel_from_backup_layer(x_pos,y_pos),0);
|
Pixel_in_current_screen(x_pos,y_pos,Read_pixel_from_backup_layer(x_pos,y_pos));
|
||||||
|
|
||||||
if (filled==2)
|
if (filled==2)
|
||||||
{
|
{
|
||||||
@ -2782,7 +2782,7 @@ void Display_pixel(word x,word y,byte color)
|
|||||||
Tilemap_draw(x,y, color);
|
Tilemap_draw(x,y, color);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Pixel_in_current_screen(x,y,color,1);
|
Pixel_in_current_screen_with_preview(x,y,color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3009,6 +3009,7 @@ byte Read_pixel_from_current_screen (word x,word y)
|
|||||||
byte depth;
|
byte depth;
|
||||||
byte color;
|
byte color;
|
||||||
|
|
||||||
|
if (Constraint_mode)
|
||||||
if (Main_current_layer==4)
|
if (Main_current_layer==4)
|
||||||
return *(Main_backups->Pages->Image[Main_current_layer].Pixels + x+y*Main_image_width);
|
return *(Main_backups->Pages->Image[Main_current_layer].Pixels + x+y*Main_image_width);
|
||||||
|
|
||||||
@ -3023,11 +3024,39 @@ byte Read_pixel_from_current_screen (word x,word y)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Pixel_in_current_screen (word x,word y,byte color,int with_preview)
|
/// Paint a a single pixel in image only : as-is.
|
||||||
|
void Pixel_in_screen_direct(word x,word y,byte color)
|
||||||
{
|
{
|
||||||
#ifndef NOLAYERS
|
*((y)*Main_image_width+(x)+/*Main_backups->Pages->Image[Main_current_layer].Pixels*/Main_screen)=color;
|
||||||
if (!Constraint_mode)
|
}
|
||||||
|
|
||||||
|
/// Paint a a single pixel in image and on screen: as-is.
|
||||||
|
void Pixel_in_screen_direct_with_preview(word x,word y,byte color)
|
||||||
|
{
|
||||||
|
*((y)*Main_image_width+(x)+/*Main_backups->Pages->Image[Main_current_layer].Pixels*/Main_screen)=color;
|
||||||
|
Pixel_preview(x,y,color);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef NOLAYERS
|
||||||
|
|
||||||
|
/// Paint a a single pixel in image only : using layered display.
|
||||||
|
void Pixel_in_screen_layered(word x,word y,byte color)
|
||||||
|
{
|
||||||
|
byte depth = *(Main_visible_image_depth_buffer.Image+x+y*Main_image_width);
|
||||||
|
*(Main_backups->Pages->Image[Main_current_layer].Pixels + x+y*Main_image_width)=color;
|
||||||
|
if ( depth <= Main_current_layer)
|
||||||
{
|
{
|
||||||
|
if (color == Main_backups->Pages->Transparent_color) // transparent color
|
||||||
|
// fetch pixel color from the topmost visible layer
|
||||||
|
color=*(Main_backups->Pages->Image[depth].Pixels + x+y*Main_image_width);
|
||||||
|
|
||||||
|
*(x+y*Main_image_width+Main_screen)=color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Paint a a single pixel in image and on screen : using layered display.
|
||||||
|
void Pixel_in_screen_layered_with_preview(word x,word y,byte color)
|
||||||
|
{
|
||||||
byte depth = *(Main_visible_image_depth_buffer.Image+x+y*Main_image_width);
|
byte depth = *(Main_visible_image_depth_buffer.Image+x+y*Main_image_width);
|
||||||
*(Main_backups->Pages->Image[Main_current_layer].Pixels + x+y*Main_image_width)=color;
|
*(Main_backups->Pages->Image[Main_current_layer].Pixels + x+y*Main_image_width)=color;
|
||||||
if ( depth <= Main_current_layer)
|
if ( depth <= Main_current_layer)
|
||||||
@ -3038,29 +3067,30 @@ void Pixel_in_current_screen (word x,word y,byte color,int with_preview)
|
|||||||
|
|
||||||
*(x+y*Main_image_width+Main_screen)=color;
|
*(x+y*Main_image_width+Main_screen)=color;
|
||||||
|
|
||||||
if (with_preview)
|
|
||||||
Pixel_preview(x,y,color);
|
Pixel_preview(x,y,color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( Main_current_layer == 4)
|
|
||||||
{
|
/// Paint a a single pixel in image only : in a layer under one that acts as a layer-selector (mode 5).
|
||||||
if (color<4)
|
void Pixel_in_screen_underlay(word x,word y,byte color)
|
||||||
{
|
{
|
||||||
|
byte depth;
|
||||||
|
|
||||||
// Paste in layer
|
// Paste in layer
|
||||||
*(Main_backups->Pages->Image[Main_current_layer].Pixels + x+y*Main_image_width)=color;
|
*(Main_backups->Pages->Image[Main_current_layer].Pixels + x+y*Main_image_width)=color;
|
||||||
// Paste in depth buffer
|
// Search depth
|
||||||
*(Main_visible_image_depth_buffer.Image+x+y*Main_image_width)=color;
|
depth = *(Main_backups->Pages->Image[4].Pixels + x+y*Main_image_width);
|
||||||
// Fetch pixel color from the target raster layer
|
|
||||||
color=*(Main_backups->Pages->Image[color].Pixels + x+y*Main_image_width);
|
if ( depth == Main_current_layer)
|
||||||
|
{
|
||||||
// Draw that color on the visible image buffer
|
// Draw that color on the visible image buffer
|
||||||
*(x+y*Main_image_width+Main_screen)=color;
|
*(x+y*Main_image_width+Main_screen)=color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (with_preview)
|
/// Paint a a single pixel in image and on screen : in a layer under one that acts as a layer-selector (mode 5).
|
||||||
Pixel_preview(x,y,color);
|
void Pixel_in_screen_underlay_with_preview(word x,word y,byte color)
|
||||||
}
|
{
|
||||||
}
|
|
||||||
else if (Main_current_layer<4 && (Main_layers_visible & (1<<4)))
|
|
||||||
{
|
|
||||||
byte depth;
|
byte depth;
|
||||||
|
|
||||||
// Paste in layer
|
// Paste in layer
|
||||||
@ -3073,34 +3103,47 @@ void Pixel_in_current_screen (word x,word y,byte color,int with_preview)
|
|||||||
// Draw that color on the visible image buffer
|
// Draw that color on the visible image buffer
|
||||||
*(x+y*Main_image_width+Main_screen)=color;
|
*(x+y*Main_image_width+Main_screen)=color;
|
||||||
|
|
||||||
if (with_preview)
|
|
||||||
Pixel_preview(x,y,color);
|
Pixel_preview(x,y,color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
byte depth;
|
|
||||||
|
|
||||||
|
/// Paint a a single pixel in image only : in a layer that acts as a layer-selector (mode 5).
|
||||||
|
void Pixel_in_screen_overlay(word x,word y,byte color)
|
||||||
|
{
|
||||||
|
if (color<4)
|
||||||
|
{
|
||||||
|
// Paste in layer
|
||||||
*(Main_backups->Pages->Image[Main_current_layer].Pixels + x+y*Main_image_width)=color;
|
*(Main_backups->Pages->Image[Main_current_layer].Pixels + x+y*Main_image_width)=color;
|
||||||
depth = *(Main_visible_image_depth_buffer.Image+x+y*Main_image_width);
|
// Paste in depth buffer
|
||||||
if ( depth <= Main_current_layer)
|
*(Main_visible_image_depth_buffer.Image+x+y*Main_image_width)=color;
|
||||||
{
|
// Fetch pixel color from the target raster layer
|
||||||
if (color == Main_backups->Pages->Transparent_color) // transparent color
|
color=*(Main_backups->Pages->Image[color].Pixels + x+y*Main_image_width);
|
||||||
// fetch pixel color from the topmost visible layer
|
// Draw that color on the visible image buffer
|
||||||
color=*(Main_backups->Pages->Image[depth].Pixels + x+y*Main_image_width);
|
*(x+y*Main_image_width+Main_screen)=color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Paint a a single pixel in image and on screen : in a layer that acts as a layer-selector (mode 5).
|
||||||
|
void Pixel_in_screen_overlay_with_preview(word x,word y,byte color)
|
||||||
|
{
|
||||||
|
if (color<4)
|
||||||
|
{
|
||||||
|
// Paste in layer
|
||||||
|
*(Main_backups->Pages->Image[Main_current_layer].Pixels + x+y*Main_image_width)=color;
|
||||||
|
// Paste in depth buffer
|
||||||
|
*(Main_visible_image_depth_buffer.Image+x+y*Main_image_width)=color;
|
||||||
|
// Fetch pixel color from the target raster layer
|
||||||
|
color=*(Main_backups->Pages->Image[color].Pixels + x+y*Main_image_width);
|
||||||
|
// Draw that color on the visible image buffer
|
||||||
*(x+y*Main_image_width+Main_screen)=color;
|
*(x+y*Main_image_width+Main_screen)=color;
|
||||||
|
|
||||||
if (with_preview)
|
|
||||||
Pixel_preview(x,y,color);
|
Pixel_preview(x,y,color);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#else
|
|
||||||
*((y)*Main_image_width+(x)+Main_backups->Pages->Image[Main_current_layer].Pixels)=color;
|
|
||||||
if (with_preview)
|
|
||||||
Pixel_preview(x,y,color);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Func_pixel Pixel_in_current_screen=Pixel_in_screen_direct;
|
||||||
|
Func_pixel Pixel_in_current_screen_with_preview=Pixel_in_screen_direct_with_preview;
|
||||||
|
|
||||||
void Pixel_in_spare(word x,word y, byte color)
|
void Pixel_in_spare(word x,word y, byte color)
|
||||||
{
|
{
|
||||||
@ -3116,3 +3159,37 @@ byte Read_pixel_from_current_layer(word x,word y)
|
|||||||
{
|
{
|
||||||
return *((y)*Main_image_width+(x)+Main_backups->Pages->Image[Main_current_layer].Pixels);
|
return *((y)*Main_image_width+(x)+Main_backups->Pages->Image[Main_current_layer].Pixels);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Update_pixel_renderer(void)
|
||||||
|
{
|
||||||
|
#ifndef NOLAYERS
|
||||||
|
if (!Constraint_mode)
|
||||||
|
{
|
||||||
|
// layered
|
||||||
|
Pixel_in_current_screen = Pixel_in_screen_layered;
|
||||||
|
Pixel_in_current_screen_with_preview = Pixel_in_screen_layered_with_preview;
|
||||||
|
}
|
||||||
|
else if ( Main_current_layer == 4)
|
||||||
|
{
|
||||||
|
// overlay
|
||||||
|
Pixel_in_current_screen = Pixel_in_screen_overlay;
|
||||||
|
Pixel_in_current_screen_with_preview = Pixel_in_screen_overlay_with_preview;
|
||||||
|
}
|
||||||
|
else if (Main_current_layer<4 && (Main_layers_visible & (1<<4)))
|
||||||
|
{
|
||||||
|
// underlay
|
||||||
|
Pixel_in_current_screen = Pixel_in_screen_underlay;
|
||||||
|
Pixel_in_current_screen_with_preview = Pixel_in_screen_underlay_with_preview;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// layered (again)
|
||||||
|
Pixel_in_current_screen = Pixel_in_screen_layered;
|
||||||
|
Pixel_in_current_screen_with_preview = Pixel_in_screen_layered_with_preview;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
// direct
|
||||||
|
Pixel_in_current_screen = Pixel_in_screen_direct;
|
||||||
|
Pixel_in_current_screen_with_preview = Pixel_in_screen_direct_with_preview;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|||||||
11
src/graph.h
11
src/graph.h
@ -121,8 +121,17 @@ void Update_part_of_screen(short x, short y, short width, short height);
|
|||||||
|
|
||||||
void Redraw_grid(short x, short y, unsigned short w, unsigned short h);
|
void Redraw_grid(short x, short y, unsigned short w, unsigned short h);
|
||||||
|
|
||||||
void Pixel_in_current_screen (word x,word y,byte color,int with_preview);
|
|
||||||
void Pixel_in_spare(word x,word y, byte color);
|
void Pixel_in_spare(word x,word y, byte color);
|
||||||
void Pixel_in_current_layer(word x,word y, byte color);
|
void Pixel_in_current_layer(word x,word y, byte color);
|
||||||
byte Read_pixel_from_current_screen (word x,word y);
|
byte Read_pixel_from_current_screen (word x,word y);
|
||||||
byte Read_pixel_from_current_layer(word x,word y);
|
byte Read_pixel_from_current_layer(word x,word y);
|
||||||
|
|
||||||
|
/// Paint a single pixel in image only.
|
||||||
|
extern Func_pixel Pixel_in_current_screen;
|
||||||
|
|
||||||
|
/// Paint a single pixel in image AND on screen.
|
||||||
|
extern Func_pixel Pixel_in_current_screen_with_preview;
|
||||||
|
|
||||||
|
/// Sets ::Pixel_in_current_screen and ::Pixel_in_current_screen_with_preview
|
||||||
|
void Update_pixel_renderer(void);
|
||||||
|
|
||||||
|
|||||||
@ -89,6 +89,7 @@ void Layer_activate(int layer, short side)
|
|||||||
Update_depth_buffer(); // Only need the depth buffer
|
Update_depth_buffer(); // Only need the depth buffer
|
||||||
//Download_infos_page_main(Main_backups->Pages);
|
//Download_infos_page_main(Main_backups->Pages);
|
||||||
//Update_FX_feedback(Config.FX_Feedback);
|
//Update_FX_feedback(Config.FX_Feedback);
|
||||||
|
Update_pixel_renderer();
|
||||||
Display_all_screen();
|
Display_all_screen();
|
||||||
Display_layerbar();
|
Display_layerbar();
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
|
|||||||
@ -189,7 +189,7 @@ void Set_pixel(T_IO_Context *context, short x_pos, short y_pos, byte color)
|
|||||||
{
|
{
|
||||||
// Chargement des pixels dans l'écran principal
|
// Chargement des pixels dans l'écran principal
|
||||||
case CONTEXT_MAIN_IMAGE:
|
case CONTEXT_MAIN_IMAGE:
|
||||||
Pixel_in_current_screen(x_pos,y_pos,color,0);
|
Pixel_in_current_screen(x_pos,y_pos,color);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Chargement des pixels dans la brosse
|
// Chargement des pixels dans la brosse
|
||||||
@ -1335,6 +1335,8 @@ void Set_loading_layer(T_IO_Context *context, int layer)
|
|||||||
}
|
}
|
||||||
Main_current_layer = layer;
|
Main_current_layer = layer;
|
||||||
context->Target_address=Main_backups->Pages->Image[layer].Pixels;
|
context->Target_address=Main_backups->Pages->Image[layer].Pixels;
|
||||||
|
|
||||||
|
Update_pixel_renderer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -238,7 +238,7 @@ void Replace_a_color(byte old_color, byte new_color)
|
|||||||
for (y=0; y<Main_image_height; y++)
|
for (y=0; y<Main_image_height; y++)
|
||||||
for (x=0; x<Main_image_width; x++)
|
for (x=0; x<Main_image_width; x++)
|
||||||
if (Read_pixel_from_current_layer(x,y) == old_color)
|
if (Read_pixel_from_current_layer(x,y) == old_color)
|
||||||
Pixel_in_current_screen(x,y,new_color,0);
|
Pixel_in_current_screen(x,y,new_color);
|
||||||
Update_rect(0,0,0,0); // On peut TOUT a jour
|
Update_rect(0,0,0,0); // On peut TOUT a jour
|
||||||
// C'est pas un problème car il n'y a pas de preview
|
// C'est pas un problème car il n'y a pas de preview
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3011,13 +3011,19 @@ void Load_CM5(T_IO_Context* context)
|
|||||||
|
|
||||||
Palette_loaded(context);
|
Palette_loaded(context);
|
||||||
|
|
||||||
if (Constraint_mode != 1)
|
|
||||||
Constraint_mode = 1;
|
|
||||||
|
|
||||||
if (Read_byte(file, &value)!=1)
|
if (Read_byte(file, &value)!=1)
|
||||||
File_error = 2;
|
File_error = 2;
|
||||||
|
|
||||||
|
// This forces the creation of 5 layers total :
|
||||||
|
// Needed because the "pixel" functions will seek layer 4
|
||||||
|
Set_loading_layer(context, 4);
|
||||||
|
// Now select layer 0 again
|
||||||
Set_loading_layer(context, 0);
|
Set_loading_layer(context, 0);
|
||||||
|
|
||||||
|
if (Constraint_mode != 1)
|
||||||
|
Constraint_mode = 1;
|
||||||
|
|
||||||
for(ty=0; ty<context->Height; ty++)
|
for(ty=0; ty<context->Height; ty++)
|
||||||
for(tx=0; tx<context->Width; tx++)
|
for(tx=0; tx<context->Width; tx++)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -678,6 +678,7 @@ void Update_screen_targets(void)
|
|||||||
Main_screen=Main_backups->Pages->Image[Main_current_layer].Pixels;
|
Main_screen=Main_backups->Pages->Image[Main_current_layer].Pixels;
|
||||||
Screen_backup=Main_backups->Pages->Next->Image[Main_current_layer].Pixels;
|
Screen_backup=Main_backups->Pages->Next->Image[Main_current_layer].Pixels;
|
||||||
#endif
|
#endif
|
||||||
|
Update_pixel_renderer();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Update all the special image buffers, if necessary.
|
/// Update all the special image buffers, if necessary.
|
||||||
|
|||||||
@ -192,7 +192,11 @@ void Tilemap_draw(word x, word y, byte color)
|
|||||||
yy = (tile / Main_tilemap_width)*Snap_height+Snap_offset_Y + Snap_height - rel_y - 1;
|
yy = (tile / Main_tilemap_width)*Snap_height+Snap_offset_Y + Snap_height - rel_y - 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Pixel_in_current_screen(xx,yy,color,yy>=Limit_top&&yy<=Limit_bottom&&xx>=Limit_left&&xx<=Limit_right);
|
if (yy>=Limit_top&&yy<=Limit_bottom&&xx>=Limit_left&&xx<=Limit_right)
|
||||||
|
Pixel_in_current_screen_with_preview(xx,yy,color);
|
||||||
|
else
|
||||||
|
Pixel_in_current_screen(xx,yy,color);
|
||||||
|
|
||||||
tile = Main_tilemap[tile].Next;
|
tile = Main_tilemap[tile].Next;
|
||||||
} while (tile != first_tile);
|
} while (tile != first_tile);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user