[xiph-commits] r10074 - trunk/planarity

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Mon Sep 26 02:48:21 PDT 2005


Author: xiphmont
Date: 2005-09-26 02:48:18 -0700 (Mon, 26 Sep 2005)
New Revision: 10074

Modified:
   trunk/planarity/dialog_level.c
   trunk/planarity/gameboard.h
   trunk/planarity/gameboard_logic.c
   trunk/planarity/gameboard_logic_button.c
   trunk/planarity/gameboard_logic_buttonbar.c
   trunk/planarity/levelstate.c
   trunk/planarity/levelstate.h
   trunk/planarity/version.h
Log:
Other delayed/triggered-deploy buttons were affected by the resize
problem; clean up the deploy marking code to handle the problem from
the source.



Modified: trunk/planarity/dialog_level.c
===================================================================
--- trunk/planarity/dialog_level.c	2005-09-26 09:29:45 UTC (rev 10073)
+++ trunk/planarity/dialog_level.c	2005-09-26 09:48:18 UTC (rev 10074)
@@ -75,7 +75,7 @@
     states[i].position=0;
 
   states[0].position = 2; //center
-  states[2].position = 0; //undeployed by default (redundant)
+  states[2].position = -2; //undeployed by default (redundant)
   states[10].position = 2; //center
 
   {

Modified: trunk/planarity/gameboard.h
===================================================================
--- trunk/planarity/gameboard.h	2005-09-26 09:29:45 UTC (rev 10073)
+++ trunk/planarity/gameboard.h	2005-09-26 09:48:18 UTC (rev 10074)
@@ -79,6 +79,7 @@
                 // 1 left
                 // 2 center
                 // 3 right
+                // negative indicates active but undeployed
   int x_target;
   int x;
 

Modified: trunk/planarity/gameboard_logic.c
===================================================================
--- trunk/planarity/gameboard_logic.c	2005-09-26 09:29:45 UTC (rev 10073)
+++ trunk/planarity/gameboard_logic.c	2005-09-26 09:48:18 UTC (rev 10074)
@@ -63,6 +63,7 @@
 void reenter_game(Gameboard *g){
   deploy_buttonbar(g);
   unpause_timer();
+  set_in_progress();
 }
 
 void enter_game(Gameboard *g){

Modified: trunk/planarity/gameboard_logic_button.c
===================================================================
--- trunk/planarity/gameboard_logic_button.c	2005-09-26 09:29:45 UTC (rev 10073)
+++ trunk/planarity/gameboard_logic_button.c	2005-09-26 09:48:18 UTC (rev 10074)
@@ -399,7 +399,7 @@
 
   for(i=0;i<NUMBUTTONS;i++){
     buttonstate *b=states+i;
-    if(b->position)
+    if(b->position>0)
       if( (b->x-x)*(b->x-x) + (b->y-y)*(b->y-y) <= BUTTON_RADIUS*BUTTON_RADIUS+4)
 	if(b->y != b->y_inactive)
 	  return b;
@@ -416,7 +416,7 @@
 
   for(i=0;i<NUMBUTTONS;i++){
     buttonstate *bb=states+i;
-    if(bb->position){
+    if(bb->position>0){
       if(bb!=b){
 	if(bb->rollover)
 	  invalidate_rollover(g,bb);
@@ -510,7 +510,7 @@
 
     buttonstate *b=states+i;
 
-    if(b->position){
+    if(b->position>0){
       GdkRectangle r = rollover_box(g,b);
       GdkRectangle br = button_box(b);
       
@@ -549,7 +549,7 @@
   buttonstate *states=g->b.states;
 
   for(i=0;i<NUMBUTTONS;i++){
-    if(states[i].position == 2){
+    if(abs(states[i].position) == 2){
 
       states[i].x+=dx;
       states[i].x_target+=dx;
@@ -565,8 +565,8 @@
   dy=h-oldh;
 
   for(i=0;i<NUMBUTTONS;i++){
-    if(states[i].position==1 || 
-       states[i].position==3){
+    if(abs(states[i].position)==1 || 
+       abs(states[i].position)==3){
       states[i].y+=dy;
       states[i].y_target+=dy;
       states[i].y_active+=dy;
@@ -575,7 +575,7 @@
   }
   
   for(i=0;i<NUMBUTTONS;i++){
-    if(states[i].position == 3){
+    if(abs(states[i].position) == 3){
       states[i].x+=dx;
       states[i].x_target+=dx;
     }

Modified: trunk/planarity/gameboard_logic_buttonbar.c
===================================================================
--- trunk/planarity/gameboard_logic_buttonbar.c	2005-09-26 09:29:45 UTC (rev 10073)
+++ trunk/planarity/gameboard_logic_buttonbar.c	2005-09-26 09:48:18 UTC (rev 10074)
@@ -115,7 +115,7 @@
 	xcount -= BUTTONBAR_SPACING;
 	dcount += SWEEP_DELTA;
       }else{
-	states[9].position = 0; //deactivate it for the deploy
+	states[9].position = -3; //deactivate it for the deploy
       }
       rollover_extents(g,states+i);
     }
@@ -146,11 +146,6 @@
     }
 
     states[9].position = 3; //activate it
-
-    states[9].x = states[9].x_target = g->g.width-BUTTONBAR_BORDER;
-    states[9].y_active = g->g.height - BUTTONBAR_Y_FROM_BOTTOM;
-    states[9].y = states[9].y_inactive = states[9].y_active + BUTTON_EXPOSE;
-    
     states[9].y_target = states[9].y_active;
     states[i].sweepdeploy = 0;
 

Modified: trunk/planarity/levelstate.c
===================================================================
--- trunk/planarity/levelstate.c	2005-09-26 09:29:45 UTC (rev 10073)
+++ trunk/planarity/levelstate.c	2005-09-26 09:48:18 UTC (rev 10074)
@@ -312,6 +312,10 @@
 
 }
 
+void set_in_progress(){
+  curr->in_progress=1;
+}
+
 long levelstate_total_hiscore(){
   long score=0;
   levelstate *l=head;
@@ -404,7 +408,7 @@
     activate_verticies(&gameboard->g);
     impress_location(&gameboard->g);
   }
-  curr->in_progress=1;
+
   graph_dirty=0;
 }
 

Modified: trunk/planarity/levelstate.h
===================================================================
--- trunk/planarity/levelstate.h	2005-09-26 09:29:45 UTC (rev 10073)
+++ trunk/planarity/levelstate.h	2005-09-26 09:48:18 UTC (rev 10074)
@@ -37,5 +37,6 @@
 extern void levelstate_go();
 extern void levelstate_resume();
 extern void levelstate_reset();
+extern void set_in_progress();
 extern int levelstate_limit();
 extern cairo_surface_t* levelstate_get_icon(int num);

Modified: trunk/planarity/version.h
===================================================================
--- trunk/planarity/version.h	2005-09-26 09:29:45 UTC (rev 10073)
+++ trunk/planarity/version.h	2005-09-26 09:48:18 UTC (rev 10074)
@@ -1,2 +1,2 @@
 #define VERSION "$Id$ "
-/* DO NOT EDIT: Automated versioning hack [Mon Sep 26 05:28:23 EDT 2005] */
+/* DO NOT EDIT: Automated versioning hack [Mon Sep 26 05:46:43 EDT 2005] */



More information about the commits mailing list