OSDN Git Service

deleted define of the event
authornothan <nothan87@gmail.com>
Tue, 22 Feb 2011 18:39:54 +0000 (03:39 +0900)
committernothan <nothan87@gmail.com>
Tue, 22 Feb 2011 18:39:54 +0000 (03:39 +0900)
fixed error when an event does not exist

src/livemlparser.h
src/livemlrunner.h
src/xmlparser.h

index 36811dc..1a55d8c 100644 (file)
 #include "calcu.h"
 #include "text.h"
 
-enum event_type
-{
-  EVENT_INIT = 0,
-  EVENT_RELEASE,
-  EVENT_FOCUS_ON,
-  EVENT_FOCUS_OFF,
-  EVENT_BTN_PUSH,
-  EVENT_BTN_HOLD,
-  EVENT_PTN_FREE,
-  EVENT_NUMBER
-};
+typedef size_t action_type;
+typedef size_t event_type;
 
 // variable scope
 enum
@@ -88,6 +79,11 @@ class ActionParser
 public:
   Tag *tag;
 
+  ActionParser()
+  {
+    tag = NULL;
+  }
+
   const char* getName(void)
   {
     const char* name = tag->param.getString(0);
index 660b1fd..b6b8c63 100644 (file)
@@ -230,7 +230,7 @@ public:
   {
     DCODE(printf("LMLActorObject::setAction(%d)\n", type);)
     ActionParser *action = parser->actionContainer[type];
-    if (action == NULL) return false;
+    if (action->tag == NULL) return false;
 
     setAction(action);
     return true;
@@ -258,7 +258,7 @@ public:
   {
     DCODE(printf("LMLActorObject::setEvent(%d)\n", type);)
     EventParser *event = parser->eventContainer[type];
-    if (event == NULL) return false;
+       if (event->tag == NULL) return false;
 
     return setEvent(event);
   }
index 3d6283d..3035e97 100644 (file)
@@ -53,7 +53,6 @@ typedef enum
 } XML_TAGRTN;
 
 typedef size_t tag_type;
-typedef size_t action_type;
 typedef size_t param_type;
 
 class Parameter;