From 83fff59f66ecb3252c23a4a6c7e10a7464df6fef Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Fri, 11 Nov 2011 17:23:26 +0000 Subject: [PATCH] Tilemap: waiting window during computation, shows tile count when done git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1865 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/tiles.c | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/src/tiles.c b/src/tiles.c index 10e8edc2..0a3bd4c7 100644 --- a/src/tiles.c +++ b/src/tiles.c @@ -23,6 +23,10 @@ #include "global.h" #include "graph.h" #include "sdlscreen.h" +#include "engine.h" +#include "windows.h" +#include "input.h" +#include "misc.h" #include "tiles.h" @@ -248,13 +252,17 @@ int Tile_is_same_flipped_xy(int t1, int t2) return 1; } -/// Create or update a tilemap based on current screen pixels. +/// Create or update a tilemap based on current screen (layer)'s pixels. void Tilemap_create(void) { int width; int height; int tile; + int count=1; T_Tile * tile_ptr; + + int wait_window=0; + byte old_cursor; width=(Main_image_width-Snap_offset_X)/Snap_width; height=(Main_image_height-Snap_offset_Y)/Snap_height; @@ -290,6 +298,18 @@ void Tilemap_create(void) Main_tilemap_width=width; Main_tilemap_height=height; + if (width*height > 1000 || 1) + { + wait_window=1; + Open_window(180,36,"Creating tileset"); + Print_in_window(26, 20, "Please wait...",MC_Black,MC_Light); + old_cursor=Cursor_shape; + Cursor_shape=CURSOR_SHAPE_HOURGLASS; + Update_window_area(0,0,Window_width, Window_height); + Display_cursor(); + Get_input(0); + } + // Initialize array with all tiles unique by default for (tile=0; tile