From: <geo...@us...> - 2003-12-19 08:52:57
|
Update of /cvsroot/timewarp/source/twgui In directory sc8-pr-cvs1:/tmp/cvs-serv29070/twgui Modified Files: twbuttontypes.cpp twbuttontypes.h twwindow.cpp twwindow.h Log Message: map editing Index: twbuttontypes.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twbuttontypes.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** twbuttontypes.cpp 15 Dec 2003 20:51:12 -0000 1.2 --- twbuttontypes.cpp 19 Dec 2003 08:52:54 -0000 1.3 *************** *** 81,84 **** --- 81,86 ---- { init_pos_size(&backgr, "backgr"); + + markfordeletion = true; } *************** *** 86,90 **** Area::~Area() { ! if (backgr) destroy_bitmap(backgr); } --- 88,92 ---- Area::~Area() { ! if (markfordeletion && backgr) destroy_bitmap(backgr); } *************** *** 97,102 **** if (newb) { ! destroy_bitmap(backgr); backgr = newb; } } --- 99,120 ---- if (newb) { ! if (markfordeletion && backgr) ! destroy_bitmap(backgr); ! ! backgr = newb; ! markfordeletion = true; // locally initialized, hence locally destroyed... ! } ! } ! ! ! void Area::changebackgr(BITMAP *newb) ! { ! if (newb) ! { ! if (markfordeletion && backgr) ! destroy_bitmap(backgr); // hmm, well, don't do this, leave that to the program that created it !! ! backgr = newb; + markfordeletion = false; // not locally initialized, hence not locally destroyed... } } Index: twbuttontypes.h =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twbuttontypes.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** twbuttontypes.h 15 Dec 2003 20:51:12 -0000 1.4 --- twbuttontypes.h 19 Dec 2003 08:52:54 -0000 1.5 *************** *** 36,39 **** --- 36,40 ---- public: BITMAP *backgr; + bool markfordeletion; Area(TWindow *menu, char *identbranch, int asciicode = 0, bool akeepkey = 0); *************** *** 41,44 **** --- 42,46 ---- virtual void changebackgr(char *fname); + virtual void changebackgr(BITMAP *newb); virtual void animate(); // shouldn't be changed. Index: twwindow.cpp =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twwindow.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** twwindow.cpp 15 Dec 2003 20:51:12 -0000 1.4 --- twwindow.cpp 19 Dec 2003 08:52:54 -0000 1.5 *************** *** 141,144 **** --- 141,145 ---- exclusive = false; + layer = 0; } // ok, this provides a working space *************** *** 259,262 **** --- 260,270 ---- root = tree_root(); + // check layers, you're not allowed to focus in a "lower" layer + while (root && root->layer < layer) + root = root->next; + + if (!root || root == this) // apparently you're alone/ already focus in your own layer ... + return; + // remove "this" from the list if (prev) *************** *** 675,679 **** // also copy transparent color! ! // this takes about 1 ms blit(backgr, drawarea, 0, 0, 0, 0, W, H); --- 683,687 ---- // also copy transparent color! ! // this takes about 1 ms on geo's comp if it's in video mem blit(backgr, drawarea, 0, 0, 0, 0, W, H); *************** *** 683,688 **** while (button) { - // "hyperspace" --> this takes 10 ms !! That's a lot for just that bitmap ... - // it's slow cause it goes from RAM to video-memory. button->animate(); button = button->next; --- 691,694 ---- *************** *** 694,698 **** if (screen) { ! // this takes about 2 ms. masked_blit(drawarea, screen, 0, 0, x, y, W, H); } --- 700,704 ---- if (screen) { ! // this takes about 2 ms on geo's comp if it's in video mem masked_blit(drawarea, screen, 0, 0, x, y, W, H); } Index: twwindow.h =================================================================== RCS file: /cvsroot/timewarp/source/twgui/twwindow.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** twwindow.h 14 Dec 2003 22:19:56 -0000 1.3 --- twwindow.h 19 Dec 2003 08:52:54 -0000 1.4 *************** *** 10,13 **** --- 10,18 ---- + exclusive = when focused, all other windows are disabled. Default=false. + layer = you can only change focus within your own layer. Default=0. In this way you can cause a set of windows to always appear above another set of windows. + disabled = that window does no calculate (use ... to do this ?) + hidden = that window does not animate (use hide() to stop activity, or show() to restore activity) + */ *************** *** 134,137 **** --- 139,143 ---- bool exclusive; + int layer; // you can only switch focus within a layer... }; |