/[enigma]/enigma/src/objects.cc
ViewVC logotype

Diff of /enigma/src/objects.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.105 by reallysoft, Sat Jun 28 17:11:51 2003 UTC revision 1.106 by reallysoft, Sat Jul 5 08:27:47 2003 UTC
# Line 41  using namespace std; Line 41  using namespace std;
41  using namespace world;  using namespace world;
42  using namespace enigma;  using namespace enigma;
43    
44    // remove comment from define below to switch on verbose messaging
45    // note: VERBOSE_MESSAGES is defined in multiple source files!
46    // #define VERBOSE_MESSAGES
47    
48  /* This function is used by all triggers, switches etc. that perform  /* This function is used by all triggers, switches etc. that perform
49     some particular action when activated (like opening doors or     some particular action when activated (like opening doors or
50     switching lasers on and off). */     switching lasers on and off). */
# Line 53  world::PerformAction(Object *o, bool ono Line 57  world::PerformAction(Object *o, bool ono
57      o->string_attrib("action", &action);      o->string_attrib("action", &action);
58      o->string_attrib("target", &target);      o->string_attrib("target", &target);
59    
60  //     o->warning("PerformAction action=%s target=%s", action.c_str(), target.c_str());  #if defined(VERBOSE_MESSAGES)
61        o->warning("PerformAction action=%s target=%s", action.c_str(), target.c_str());
62    #endif // VERBOSE_MESSAGES
63    
64      if (action == "callback") {      if (action == "callback") {
65          lua::CallFunc(target.c_str(), Value(onoff));          lua::CallFunc(target.c_str(), Value(onoff));
# Line 1011  world::DisposeObject(Object *o) Line 1017  world::DisposeObject(Object *o)
1017  void  void
1018  world::SendMessage(Object *o, const std::string &msg)  world::SendMessage(Object *o, const std::string &msg)
1019  {  {
1020      if (o)      if (o) {
1021    #if defined(VERBOSE_MESSAGES)
1022            o->warning("will be sent message '%s'", msg.c_str());
1023    #endif // VERBOSE_MESSAGES
1024          o->message(msg, Value());          o->message(msg, Value());
1025        }
1026    #if defined(VERBOSE_MESSAGES)
1027        else
1028            fprintf(stderr, "Sending message '%s' to NULL-object\n", msg.c_str());
1029    #endif // VERBOSE_MESSAGES
1030  }  }
1031    
1032  void  void
1033  world::SendMessage(Object *o, const std::string &msg, const Value& value)  world::SendMessage(Object *o, const std::string &msg, const Value& value)
1034  {  {
1035      if (o)      if (o) {
1036    #if defined(VERBOSE_MESSAGES)
1037            o->warning("will be sent message '%s' (with Value)", msg.c_str());
1038    #endif // VERBOSE_MESSAGES
1039          o->message(msg, value);          o->message(msg, value);
1040        }
1041    #if defined(VERBOSE_MESSAGES)
1042        else
1043            fprintf(stderr, "Sending message '%s' to NULL-object\n", msg.c_str());
1044    #endif // VERBOSE_MESSAGES
1045  }  }
1046    
1047  // explosion messages:  // explosion messages:

Legend:
Removed from v.1.105  
changed lines
  Added in v.1.106

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26