Tilemap mode: Undo and Redo only refresh tilemap when image size changes. Lua scripts that change image size also refresh tilemap
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1877 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
4813314638
commit
dae1bc856b
@ -211,7 +211,6 @@ void Button_Undo(void)
|
|||||||
{
|
{
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Undo();
|
Undo();
|
||||||
Tilemap_update();
|
|
||||||
Set_palette(Main_palette);
|
Set_palette(Main_palette);
|
||||||
Compute_optimal_menu_colors(Main_palette);
|
Compute_optimal_menu_colors(Main_palette);
|
||||||
|
|
||||||
@ -226,7 +225,6 @@ void Button_Redo(void)
|
|||||||
{
|
{
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Redo();
|
Redo();
|
||||||
Tilemap_update();
|
|
||||||
Set_palette(Main_palette);
|
Set_palette(Main_palette);
|
||||||
Compute_optimal_menu_colors(Main_palette);
|
Compute_optimal_menu_colors(Main_palette);
|
||||||
|
|
||||||
|
|||||||
@ -46,6 +46,8 @@
|
|||||||
#include "filesel.h" // Read_list_of_drives()
|
#include "filesel.h" // Read_list_of_drives()
|
||||||
#include "realpath.h"
|
#include "realpath.h"
|
||||||
#include "setup.h"
|
#include "setup.h"
|
||||||
|
#include "tiles.h"
|
||||||
|
|
||||||
|
|
||||||
/// Lua scripts bound to shortcut keys.
|
/// Lua scripts bound to shortcut keys.
|
||||||
char * Bound_script[10];
|
char * Bound_script[10];
|
||||||
@ -1559,6 +1561,8 @@ void Run_script(const char *script_subdirectory, const char *script_filename)
|
|||||||
const char* message;
|
const char* message;
|
||||||
byte old_cursor_shape=Cursor_shape;
|
byte old_cursor_shape=Cursor_shape;
|
||||||
char buf[MAX_PATH_CHARACTERS];
|
char buf[MAX_PATH_CHARACTERS];
|
||||||
|
int original_image_width=Main_image_width;
|
||||||
|
int original_image_height=Main_image_height;
|
||||||
|
|
||||||
// Some scripts are slow
|
// Some scripts are slow
|
||||||
Cursor_shape=CURSOR_SHAPE_HOURGLASS;
|
Cursor_shape=CURSOR_SHAPE_HOURGLASS;
|
||||||
@ -1728,6 +1732,14 @@ void Run_script(const char *script_subdirectory, const char *script_filename)
|
|||||||
|
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Display_all_screen();
|
Display_all_screen();
|
||||||
|
|
||||||
|
// Update tilemap if image size has changed
|
||||||
|
if (original_image_width!=Main_image_width
|
||||||
|
|| original_image_height!=Main_image_height)
|
||||||
|
{
|
||||||
|
Tilemap_update();
|
||||||
|
}
|
||||||
|
|
||||||
// Update changed pen colors.
|
// Update changed pen colors.
|
||||||
if (Back_color!=Original_back_color || Fore_color!=Original_fore_color)
|
if (Back_color!=Original_back_color || Fore_color!=Original_fore_color)
|
||||||
{
|
{
|
||||||
|
|||||||
13
src/pages.c
13
src/pages.c
@ -33,6 +33,7 @@
|
|||||||
#include "loadsave.h"
|
#include "loadsave.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
|
#include "tiles.h"
|
||||||
|
|
||||||
// -- Layers data
|
// -- Layers data
|
||||||
|
|
||||||
@ -1155,6 +1156,9 @@ void Check_layers_limits()
|
|||||||
|
|
||||||
void Undo(void)
|
void Undo(void)
|
||||||
{
|
{
|
||||||
|
int width = Main_image_width;
|
||||||
|
int height = Main_image_height;
|
||||||
|
|
||||||
if (Last_backed_up_layers)
|
if (Last_backed_up_layers)
|
||||||
{
|
{
|
||||||
Free_page_of_a_list(Main_backups);
|
Free_page_of_a_list(Main_backups);
|
||||||
@ -1179,11 +1183,16 @@ void Undo(void)
|
|||||||
Check_layers_limits();
|
Check_layers_limits();
|
||||||
Redraw_layered_image();
|
Redraw_layered_image();
|
||||||
End_of_modification();
|
End_of_modification();
|
||||||
|
|
||||||
|
if (width != Main_image_width || height != Main_image_height)
|
||||||
|
Tilemap_update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Redo(void)
|
void Redo(void)
|
||||||
{
|
{
|
||||||
|
int width = Main_image_width;
|
||||||
|
int height = Main_image_height;
|
||||||
|
|
||||||
if (Last_backed_up_layers)
|
if (Last_backed_up_layers)
|
||||||
{
|
{
|
||||||
Free_page_of_a_list(Main_backups);
|
Free_page_of_a_list(Main_backups);
|
||||||
@ -1208,6 +1217,8 @@ void Redo(void)
|
|||||||
Redraw_layered_image();
|
Redraw_layered_image();
|
||||||
End_of_modification();
|
End_of_modification();
|
||||||
|
|
||||||
|
if (width != Main_image_width || height != Main_image_height)
|
||||||
|
Tilemap_update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Free_current_page(void)
|
void Free_current_page(void)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user