r128 - trunk/src

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Wed Aug 31 11:44:55 EDT 2005


Author: jonas
Date: 2005-08-31 11:44:55 -0400 (Wed, 31 Aug 2005)
New Revision: 128

Modified:
   trunk/src/editor.cpp
   trunk/src/input.cpp
   trunk/src/input.h
Log:
minor editing changes (faster shift speed)

Modified: trunk/src/editor.cpp
===================================================================
--- trunk/src/editor.cpp	2005-08-31 15:10:27 UTC (rev 127)
+++ trunk/src/editor.cpp	2005-08-31 15:44:55 UTC (rev 128)
@@ -19,7 +19,7 @@
 }
 
 void Editor::run_action(Uint32 action, Uint16 x, Uint16 y) {
-    if (action==EDIT_RESET_ACTIONS) {
+    if (action&EDIT_RESET_ACTIONS) {
         for (Uint8 i=0; i<6; i++) {
             action_mouse_pressed[i]=NOTHING;
             action_mouse_released[i]=NOTHING;
@@ -27,16 +27,16 @@
         action_mouse_pressed[SDL_BUTTON_LEFT]=EDIT_ACT_BOX;
         action_mouse_pressed[SDL_BUTTON_RIGHT]=EDIT_BOX;
         action_mouse_released[SDL_BUTTON_RIGHT]=EDIT_ACT_BOX;
-    } else if (action==EDIT_BOX) {
+    } else if (action&EDIT_BOX) {
         setBox(new EditBox(x,y));
-    } else if (action==EDIT_ACT_BOX) {
+    } else if (action&EDIT_ACT_BOX) {
         if (box) box->act(box->getCurrentEntry(x,y));
-    } else if (action==EDIT_PLACE_OBJECT) {
+    } else if (action&EDIT_PLACE_OBJECT) {
         string next_name=scenario->pool->getNextObjectName(place_name);
         if (scenario->pool->addObjectbyName(place_name,place_image,x,y,next_name)) {
             appendtoBuf(place_name+" "+place_image+" "+itos(x)+" "+itos(y)+" "+next_name);
         }
-        action_mouse_pressed[SDL_BUTTON_LEFT]=EDIT_ACT_BOX;
+//        action_mouse_pressed[SDL_BUTTON_LEFT]=EDIT_ACT_BOX;
     } else { }
 }
 
@@ -246,7 +246,6 @@
             editor->place_image="";
         }
         editor->action_mouse_pressed[SDL_BUTTON_LEFT]=EDIT_PLACE_OBJECT;
-        editor->action_mouse_released[SDL_BUTTON_LEFT]=EDIT_RESET_ACTIONS;
         editor->closeBox();
     }
 }

Modified: trunk/src/input.cpp
===================================================================
--- trunk/src/input.cpp	2005-08-31 15:10:27 UTC (rev 127)
+++ trunk/src/input.cpp	2005-08-31 15:44:55 UTC (rev 128)
@@ -221,12 +221,12 @@
     }    
     keystate = SDL_GetKeyState(NULL);
     if (keyState(KEY_LEFT)) {
-        gfxeng->addShift(-1,0);
+        gfxeng->addShift(-SHIFT_SPEED,0);
     } else if (keyState(KEY_RIGHT)) {
-        gfxeng->addShift(1,0);
+        gfxeng->addShift(SHIFT_SPEED,0);
     } else if (keyState(KEY_UP)) {
-        gfxeng->addShift(0,-1);   
+        gfxeng->addShift(0,-SHIFT_SPEED);   
     } else if (keyState(KEY_DOWN)) {
-        gfxeng->addShift(0,1);
+        gfxeng->addShift(0,SHIFT_SPEED);
     }
 }

Modified: trunk/src/input.h
===================================================================
--- trunk/src/input.h	2005-08-31 15:10:27 UTC (rev 127)
+++ trunk/src/input.h	2005-08-31 15:44:55 UTC (rev 128)
@@ -1,6 +1,8 @@
 #ifndef DEF_INPUT_H
 #define DEF_INPUT_H 1
 
+#define SHIFT_SPEED 10
+
 /** \brief Handels keyboard events
 
     \remark A key release event which is passed on to the PhysicHandler




More information about the lostpenguins-commits mailing list