summaryrefslogtreecommitdiff
path: root/src/client/screen.c
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-07-18 19:19:10 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-07-18 19:19:10 +0000
commit8b93dd8dac51e28bb25ad341f594d21a955c3adb (patch)
treee04e9ea1d2d9b57c77617614283fc8756c96d53c /src/client/screen.c
parenta5a03e684b5ed3e8781ce30e5ffd4f73b59c3e97 (diff)
- bezpecnejsie prepiannie screenov ( uz sa to nedeje v event() daneho screenu aj ked to on vyvolal )
- do laveho horneho rohu s nevypisuju blbiny - moduly pouzivaju funkcie actionSpace a actionSpaceFromLocation - dane funkcie sa pouzivaju aj pri vykreslovani objektov - btw. je jedno kolko zeru tuxanci top, na kerneli-2.6.25.* to zralo X a na kerneli 2.6.26 to zere 2*X git-svn-id: http://opensvn.csie.org/tuxanci_ng@159 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/client/screen.c')
-rw-r--r--src/client/screen.c67
1 files changed, 43 insertions, 24 deletions
diff --git a/src/client/screen.c b/src/client/screen.c
index a96dd9e..f08d89a 100644
--- a/src/client/screen.c
+++ b/src/client/screen.c
@@ -13,6 +13,8 @@
//#define DEBUG_TIME_DRAW
static screen_t *currentScreen;
+static screen_t *futureScreen;
+
static list_t *listScreen;
static bool_t isScreenInit = FALSE;
@@ -63,24 +65,17 @@ void registerScreen(screen_t *p)
void initScreen()
{
listScreen = newList();
+
currentScreen = NULL;
+ futureScreen = NULL;
+
isScreenInit = TRUE;
}
-void setScreen(char *name)
+static screen_t* findScreen(char *name)
{
- int i;
screen_t *this;
-
- assert( name != NULL );
-
- if( currentScreen != NULL &&
- strcmp(currentScreen->name, name) == 0 )
- {
- return;
- }
-
- printf("switch screen %s..\n", name);
+ int i;
for( i = 0 ; i < listScreen->count ; i++ )
{
@@ -89,23 +84,47 @@ void setScreen(char *name)
if( strcmp(name, this->name) == 0 )
{
- flushLayer();
+ return this;
+ }
+ }
+
+ return NULL;
+}
+
+void setScreen(char *name)
+{
+ futureScreen = findScreen(name);
+ assert( futureScreen != NULL );
+}
- if( currentScreen != NULL )
- {
- printf("stop screen %s..\n", currentScreen->name);
- currentScreen->fce_stop();
- }
+void switchScreen()
+{
+ if( futureScreen == NULL )
+ {
+ return;
+ }
- currentScreen = this;
- printf("start screen %s..\n", currentScreen->name);
- currentScreen->fce_start();
+ flushLayer();
- return;
- }
+ if( currentScreen != NULL )
+ {
+ printf("stop screen %s..\n", currentScreen->name);
+ currentScreen->fce_stop();
}
- assert( ! "screen sa nenasiel !" );
+ currentScreen = futureScreen;
+ futureScreen = NULL;
+
+ //printf("switch screen %s..\n", currentScreen->name);
+
+ printf("start screen %s..\n", currentScreen->name);
+ currentScreen->fce_start();
+}
+
+void startScreen(char *name)
+{
+ setScreen(name);
+ switchScreen();
}
char* getScreen()