Changeset 5558 in orxonox.OLD for branches/world_entities/src/lib
- Timestamp:
- Nov 13, 2005, 3:10:49 PM (19 years ago)
- Location:
- branches/world_entities/src/lib
- Files:
-
- 19 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/world_entities/src/lib/Makefile.am
r5463 r5558 39 39 util/color.cc \ 40 40 util/helper_functions.cc \ 41 util/multi_type.cc \ 41 42 math/vector.cc \ 42 43 math/curve.cc … … 55 56 util/color.h \ 56 57 util/helper_functions.h \ 58 util/multi_type.h \ 57 59 math/vector.h \ 58 60 math/curve.h -
branches/world_entities/src/lib/Makefile.in
r5527 r5558 57 57 base_object.$(OBJEXT) class_list.$(OBJEXT) \ 58 58 ini_parser.$(OBJEXT) substring.$(OBJEXT) color.$(OBJEXT) \ 59 helper_functions.$(OBJEXT) vector.$(OBJEXT) curve.$(OBJEXT) 59 helper_functions.$(OBJEXT) multi_type.$(OBJEXT) \ 60 vector.$(OBJEXT) curve.$(OBJEXT) 60 61 libORXlibs_a_OBJECTS = $(am_libORXlibs_a_OBJECTS) 61 62 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) … … 227 228 util/color.cc \ 228 229 util/helper_functions.cc \ 230 util/multi_type.cc \ 229 231 math/vector.cc \ 230 232 math/curve.cc … … 243 245 util/color.h \ 244 246 util/helper_functions.h \ 247 util/multi_type.h \ 245 248 math/vector.h \ 246 249 math/curve.h … … 270 273 esac; \ 271 274 done; \ 272 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/lib/Makefile'; \275 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/Makefile'; \ 273 276 cd $(top_srcdir) && \ 274 $(AUTOMAKE) -- gnusrc/lib/Makefile277 $(AUTOMAKE) --foreign src/lib/Makefile 275 278 .PRECIOUS: Makefile 276 279 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status … … 310 313 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/helper_functions.Po@am__quote@ 311 314 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ini_parser.Po@am__quote@ 315 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multi_type.Po@am__quote@ 312 316 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/null_parent.Po@am__quote@ 313 317 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p_node.Po@am__quote@ … … 440 444 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 441 445 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o helper_functions.obj `if test -f 'util/helper_functions.cc'; then $(CYGPATH_W) 'util/helper_functions.cc'; else $(CYGPATH_W) '$(srcdir)/util/helper_functions.cc'; fi` 446 447 multi_type.o: util/multi_type.cc 448 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT multi_type.o -MD -MP -MF "$(DEPDIR)/multi_type.Tpo" -c -o multi_type.o `test -f 'util/multi_type.cc' || echo '$(srcdir)/'`util/multi_type.cc; \ 449 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/multi_type.Tpo" "$(DEPDIR)/multi_type.Po"; else rm -f "$(DEPDIR)/multi_type.Tpo"; exit 1; fi 450 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='util/multi_type.cc' object='multi_type.o' libtool=no @AMDEPBACKSLASH@ 451 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 452 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o multi_type.o `test -f 'util/multi_type.cc' || echo '$(srcdir)/'`util/multi_type.cc 453 454 multi_type.obj: util/multi_type.cc 455 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT multi_type.obj -MD -MP -MF "$(DEPDIR)/multi_type.Tpo" -c -o multi_type.obj `if test -f 'util/multi_type.cc'; then $(CYGPATH_W) 'util/multi_type.cc'; else $(CYGPATH_W) '$(srcdir)/util/multi_type.cc'; fi`; \ 456 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/multi_type.Tpo" "$(DEPDIR)/multi_type.Po"; else rm -f "$(DEPDIR)/multi_type.Tpo"; exit 1; fi 457 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='util/multi_type.cc' object='multi_type.obj' libtool=no @AMDEPBACKSLASH@ 458 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 459 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o multi_type.obj `if test -f 'util/multi_type.cc'; then $(CYGPATH_W) 'util/multi_type.cc'; else $(CYGPATH_W) '$(srcdir)/util/multi_type.cc'; fi` 442 460 443 461 vector.o: math/vector.cc -
branches/world_entities/src/lib/collision_detection/Makefile.in
r5527 r5558 220 220 esac; \ 221 221 done; \ 222 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/lib/collision_detection/Makefile'; \222 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/collision_detection/Makefile'; \ 223 223 cd $(top_srcdir) && \ 224 $(AUTOMAKE) -- gnusrc/lib/collision_detection/Makefile224 $(AUTOMAKE) --foreign src/lib/collision_detection/Makefile 225 225 .PRECIOUS: Makefile 226 226 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
branches/world_entities/src/lib/event/Makefile.in
r5527 r5558 210 210 esac; \ 211 211 done; \ 212 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/lib/event/Makefile'; \212 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/event/Makefile'; \ 213 213 cd $(top_srcdir) && \ 214 $(AUTOMAKE) -- gnusrc/lib/event/Makefile214 $(AUTOMAKE) --foreign src/lib/event/Makefile 215 215 .PRECIOUS: Makefile 216 216 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
branches/world_entities/src/lib/event/event_def.h
r5477 r5558 31 31 EV_VIDEO_RESIZE, 32 32 33 EV_MAIN_QUIT, 34 33 35 EV_UNKNOWN, 34 36 -
branches/world_entities/src/lib/event/event_handler.cc
r5477 r5558 308 308 ev.resize = event.resize; 309 309 ev.type = EV_VIDEO_RESIZE; 310 break; 311 case SDL_QUIT: 312 ev.type = EV_MAIN_QUIT; 310 313 break; 311 314 default: -
branches/world_entities/src/lib/graphics/Makefile.in
r5527 r5558 227 227 esac; \ 228 228 done; \ 229 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/lib/graphics/Makefile'; \229 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/graphics/Makefile'; \ 230 230 cd $(top_srcdir) && \ 231 $(AUTOMAKE) -- gnusrc/lib/graphics/Makefile231 $(AUTOMAKE) --foreign src/lib/graphics/Makefile 232 232 .PRECIOUS: Makefile 233 233 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
branches/world_entities/src/lib/graphics/importer/Makefile.in
r5527 r5558 214 214 esac; \ 215 215 done; \ 216 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/lib/graphics/importer/Makefile'; \216 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/graphics/importer/Makefile'; \ 217 217 cd $(top_srcdir) && \ 218 $(AUTOMAKE) -- gnusrc/lib/graphics/importer/Makefile218 $(AUTOMAKE) --foreign src/lib/graphics/importer/Makefile 219 219 .PRECIOUS: Makefile 220 220 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
branches/world_entities/src/lib/graphics/spatial_separation/Makefile.in
r5527 r5558 204 204 esac; \ 205 205 done; \ 206 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/lib/graphics/spatial_separation/Makefile'; \206 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/graphics/spatial_separation/Makefile'; \ 207 207 cd $(top_srcdir) && \ 208 $(AUTOMAKE) -- gnusrc/lib/graphics/spatial_separation/Makefile208 $(AUTOMAKE) --foreign src/lib/graphics/spatial_separation/Makefile 209 209 .PRECIOUS: Makefile 210 210 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
branches/world_entities/src/lib/gui/Makefile.in
r5527 r5558 183 183 esac; \ 184 184 done; \ 185 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/lib/gui/Makefile'; \185 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/gui/Makefile'; \ 186 186 cd $(top_srcdir) && \ 187 $(AUTOMAKE) -- gnusrc/lib/gui/Makefile187 $(AUTOMAKE) --foreign src/lib/gui/Makefile 188 188 .PRECIOUS: Makefile 189 189 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
branches/world_entities/src/lib/gui/gl_gui/Makefile.in
r5527 r5558 230 230 esac; \ 231 231 done; \ 232 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/lib/gui/gl_gui/Makefile'; \232 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/gui/gl_gui/Makefile'; \ 233 233 cd $(top_srcdir) && \ 234 $(AUTOMAKE) -- gnusrc/lib/gui/gl_gui/Makefile234 $(AUTOMAKE) --foreign src/lib/gui/gl_gui/Makefile 235 235 .PRECIOUS: Makefile 236 236 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
branches/world_entities/src/lib/gui/gtk_gui/Makefile.in
r5527 r5558 232 232 esac; \ 233 233 done; \ 234 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/lib/gui/gtk_gui/Makefile'; \234 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/gui/gtk_gui/Makefile'; \ 235 235 cd $(top_srcdir) && \ 236 $(AUTOMAKE) -- gnusrc/lib/gui/gtk_gui/Makefile236 $(AUTOMAKE) --foreign src/lib/gui/gtk_gui/Makefile 237 237 .PRECIOUS: Makefile 238 238 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
branches/world_entities/src/lib/particles/Makefile.in
r5527 r5558 207 207 esac; \ 208 208 done; \ 209 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/lib/particles/Makefile'; \209 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/particles/Makefile'; \ 210 210 cd $(top_srcdir) && \ 211 $(AUTOMAKE) -- gnusrc/lib/particles/Makefile211 $(AUTOMAKE) --foreign src/lib/particles/Makefile 212 212 .PRECIOUS: Makefile 213 213 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
branches/world_entities/src/lib/physics/Makefile.in
r5527 r5558 215 215 esac; \ 216 216 done; \ 217 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/lib/physics/Makefile'; \217 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/physics/Makefile'; \ 218 218 cd $(top_srcdir) && \ 219 $(AUTOMAKE) -- gnusrc/lib/physics/Makefile219 $(AUTOMAKE) --foreign src/lib/physics/Makefile 220 220 .PRECIOUS: Makefile 221 221 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
branches/world_entities/src/lib/shell/Makefile.in
r5527 r5558 209 209 esac; \ 210 210 done; \ 211 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/lib/shell/Makefile'; \211 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/shell/Makefile'; \ 212 212 cd $(top_srcdir) && \ 213 $(AUTOMAKE) -- gnusrc/lib/shell/Makefile213 $(AUTOMAKE) --foreign src/lib/shell/Makefile 214 214 .PRECIOUS: Makefile 215 215 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
branches/world_entities/src/lib/shell/shell_command.cc
r5374 r5558 259 259 tList<ShellCommandAlias>* ShellCommandClass::aliasList = NULL; 260 260 261 262 263 264 265 266 267 268 269 270 //////////////////////// 271 // SHELL COMMAND BASE // 272 //////////////////////// 261 273 /** 262 274 * constructs and registers a new Command … … 264 276 * @param className the name of the class to apply this command to 265 277 * @param paramCount the count of parameters this command takes 266 * @return self267 278 */ 268 279 ShellCommandBase::ShellCommandBase(const char* commandName, const char* className, unsigned int paramCount, ...) … … 282 293 this->paramCount = paramCount; 283 294 this->parameters = new unsigned int[paramCount]; 295 this->defaultValue = new MultiType[paramCount]; 284 296 285 297 va_list parameterList; 286 298 va_start(parameterList, paramCount); 287 299 300 // What Parameters we have got 288 301 for (unsigned int i = 0; i < paramCount; i++) 289 {290 302 this->parameters[i] = va_arg(parameterList, int); 291 292 switch (this->parameters[i])293 {294 case ParameterBool:295 this->defaultBools[i] = va_arg(parameterList, int);296 break;297 case ParameterChar:298 this->defaultStrings[i] = new char[2];299 sprintf(this->defaultStrings[0], "%c", va_arg(parameterList, int));300 break;301 case ParameterString:302 this->defaultStrings[i] = va_arg(parameterList, char*);303 break;304 case ParameterInt:305 this->defaultInts[i] = va_arg(parameterList, int);306 break;307 case ParameterUInt:308 this->defaultInts[i] = va_arg(parameterList, unsigned int);309 break;310 case ParameterFloat:311 this->defaultFloats[i] = va_arg(parameterList, double);312 break;313 case ParameterLong:314 this->defaultInts[i] = va_arg(parameterList, long);315 break;316 default:317 break;318 }319 }320 303 } 321 304 322 305 /** 323 306 * deconstructs a ShellCommand 324 * @return325 307 */ 326 308 ShellCommandBase::~ShellCommandBase() 327 309 { 328 310 delete[] this->parameters; 311 delete[] this->defaultValue; 329 312 if (this->alias != NULL && ShellCommandClass::aliasList != NULL) 330 313 { … … 417 400 * @return true on success, false otherwise. 418 401 */ 419 #include "stdlibincl.h"420 402 bool ShellCommandBase::execute(const char* executionString) 421 403 { … … 598 580 for (unsigned int i = 0; i < count; i++) 599 581 { 582 583 600 584 switch (this->parameters[i]) 601 585 { 602 586 case ParameterBool: 603 this->default Bools[i] = va_arg(defaultList, int);587 this->defaultValue[i].setInt(va_arg(defaultList, int)); 604 588 break; 605 589 case ParameterChar: 606 this->defaultStrings[i] = new char[2]; 607 sprintf(this->defaultStrings[0], "%c", va_arg(defaultList, int)); 590 this->defaultValue[i].setChar((char)va_arg(defaultList, int)); 608 591 break; 609 592 case ParameterString: 610 this->default Strings[i] = va_arg(defaultList, char*);593 this->defaultValue[i].setString(va_arg(defaultList, char*)); 611 594 break; 612 595 case ParameterInt: 613 this->default Ints[i] = va_arg(defaultList, int);596 this->defaultValue[i].setInt(va_arg(defaultList, int)); 614 597 break; 615 598 case ParameterUInt: 616 this->default Ints[i] = va_arg(defaultList, unsigned int);599 this->defaultValue[i].setInt((int)va_arg(defaultList, unsigned int)); 617 600 break; 618 601 case ParameterFloat: 619 this->default Floats[i] = va_arg(defaultList, double);602 this->defaultValue[i].setFloat(va_arg(defaultList, double)); 620 603 break; 621 604 case ParameterLong: 622 this->default Ints[i] = va_arg(defaultList, long);605 this->defaultValue[i].setInt((int) va_arg(defaultList, long)); 623 606 break; 624 607 default: … … 626 609 } 627 610 } 628 629 611 return this; 630 612 } -
branches/world_entities/src/lib/shell/shell_command.h
r5391 r5558 10 10 11 11 #include "helper_functions.h" 12 #include "multi_type.h" 12 13 #include "substring.h" 13 14 #include "functor_list.h" … … 133 134 unsigned int paramCount; //!< the count of parameters. 134 135 unsigned int* parameters; //!< Parameters the function of this Command takes. 135 char* defaultStrings[FUNCTOR_MAX_ARGUMENTS];//!< A list of default Strings stored. 136 int defaultInts[FUNCTOR_MAX_ARGUMENTS]; //!< A list of default Ints stored. 137 float defaultFloats[FUNCTOR_MAX_ARGUMENTS]; //!< A list of default Floats stored. 138 bool defaultBools[FUNCTOR_MAX_ARGUMENTS]; //!< A list of default Bools stored. 139 136 MultiType* defaultValue; //!< Default Values. 140 137 141 138 private: … … 153 150 ///////////////////////////////// 154 151 //! where to chek for default BOOL values 155 #define l_BOOL_DEFGRAB(i) this->default Bools[i]152 #define l_BOOL_DEFGRAB(i) this->defaultValue[i].getBool() 156 153 //! where to chek for default INT values 157 #define l_INT_DEFGRAB(i) this->default Ints[i]154 #define l_INT_DEFGRAB(i) this->defaultValue[i].getInt() 158 155 //! where to chek for default UINT values 159 #define l_UINT_DEFGRAB(i) (unsigned int)this->default Ints[i]156 #define l_UINT_DEFGRAB(i) (unsigned int)this->defaultValue[i].getInt() 160 157 //! where to chek for default LONG values 161 #define l_LONG_DEFGRAB(i) (long)this->default Ints[i]158 #define l_LONG_DEFGRAB(i) (long)this->defaultValue[i].getInt() 162 159 //! where to chek for default FLOAT values 163 #define l_FLOAT_DEFGRAB(i) this->default Floats[i]160 #define l_FLOAT_DEFGRAB(i) this->defaultValue[i].getFloat() 164 161 //! where to chek for default STRING values 165 #define l_STRING_DEFGRAB(i) this->default Strings[i]162 #define l_STRING_DEFGRAB(i) this->defaultValue[i].getString() 166 163 167 164 ////////////////////////// … … 183 180 //! registers a command with 1 parameter 184 181 #define ShellCommandRegister1(t1) \ 185 static SHELLCOMMAND<T>* registerCommand(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE) , t1##_TYPE d1 = t1##_DEFAULT) \182 static SHELLCOMMAND<T>* registerCommand(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE)) \ 186 183 { \ 187 184 if (isRegistered(commandName, className, 1, t1##_PARAM)== true) \ 188 185 return NULL; \ 189 return new SHELLCOMMAND<T>(commandName, className, function , d1); \186 return new SHELLCOMMAND<T>(commandName, className, function); \ 190 187 } 191 188 192 189 //! registers a command with 2 parameters 193 190 #define ShellCommandRegister2(t1,t2) \ 194 static SHELLCOMMAND<T>* registerCommand(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE, t2##_TYPE) , t1##_TYPE d1 = t1##_DEFAULT, t2##_TYPE d2 = t2##_DEFAULT) \191 static SHELLCOMMAND<T>* registerCommand(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE, t2##_TYPE)) \ 195 192 { \ 196 193 if (isRegistered(commandName, className, 2, t1##_PARAM, t2##_PARAM)== true) \ 197 194 return NULL; \ 198 return new SHELLCOMMAND<T>(commandName, className, function , d1, d2); \195 return new SHELLCOMMAND<T>(commandName, className, function); \ 199 196 } 200 197 201 198 //! registers a command with 3 parameters 202 199 #define ShellCommandRegister3(t1,t2,t3) \ 203 static SHELLCOMMAND<T>* registerCommand(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE) , t1##_TYPE d1 = t1##_DEFAULT, t2##_TYPE d2 = t2##_DEFAULT, t3##_TYPE d3 = t3##_DEFAULT) \200 static SHELLCOMMAND<T>* registerCommand(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE)) \ 204 201 { \ 205 202 if (isRegistered(commandName, className, 3, t1##_PARAM, t2##_PARAM, t3##_PARAM)== true) \ 206 203 return NULL; \ 207 return new SHELLCOMMAND<T>(commandName, className, function , d1, d2, d3); \204 return new SHELLCOMMAND<T>(commandName, className, function); \ 208 205 } 209 206 210 207 //! registers a command with 4 parameters 211 208 #define ShellCommandRegister4(t1,t2,t3,t4) \ 212 static SHELLCOMMAND<T>* registerCommand(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE) , t1##_TYPE d1 = t1##_DEFAULT, t2##_TYPE d2 = t2##_DEFAULT, t3##_TYPE d3 = t3##_DEFAULT, t4##_TYPE d4 = t4##_DEFAULT) \209 static SHELLCOMMAND<T>* registerCommand(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE)) \ 213 210 { \ 214 211 if (isRegistered(commandName, className, 4, t1##_PARAM, t2##_PARAM, t3##_PARAM, t4##_PARAM)== true) \ 215 212 return NULL; \ 216 return new SHELLCOMMAND<T>(commandName, className, function , d1, d2, d3, d4); \213 return new SHELLCOMMAND<T>(commandName, className, function); \ 217 214 } 218 215 219 216 //! registers a command with 5 parameters 220 217 #define ShellCommandRegister5(t1,t2,t3,t4,t5) \ 221 static SHELLCOMMAND<T>* registerCommand(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE, t5##_TYPE) , t1##_TYPE d1 = t1##_DEFAULT, t2##_TYPE d2 = t2##_DEFAULT, t3##_TYPE d3 = t3##_DEFAULT, t4##_TYPE d4 = t4##_DEFAULT, t5##_TYPE d5 = t5##_DEFAULT) \218 static SHELLCOMMAND<T>* registerCommand(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE, t5##_TYPE)) \ 222 219 { \ 223 220 if (isRegistered(commandName, className, 5, t1##_PARAM, t2##_PARAM, t3##_PARAM, t4##_PARAM, t5##_PARAM)== true) \ 224 221 return NULL; \ 225 return new ShellCommand<T>(commandName, className, function, d1, d2, d3, d4, d5); \ 226 } 222 return new ShellCommand<T>(commandName, className, function); \ 223 } 224 225 /////////////////////// 226 // FUNCTION POINTERS // 227 /////////////////////// 228 #define ShellCommandFunctionPoiter0() \ 229 void SHELLCOMMANDINCLASS(*functionPointer_0)(); 230 231 #define ShellCommandFunctionPoiter1(t1) \ 232 void SHELLCOMMANDINCLASS(*functionPointer_1_##t1)(t1##_TYPE); 233 234 #define ShellCommandFunctionPoiter2(t1, t2) \ 235 void SHELLCOMMANDINCLASS(*functionPointer_2_##t1##_##t2)(t1##_TYPE, t2##_TYPE); 236 237 238 #define ShellCommandFunctionPoiter3(t1, t2, t3) \ 239 void SHELLCOMMANDINCLASS(*functionPointer_3_##t1##_##t2##_##t3)(t1##_TYPE, t2##_TYPE, t3##_TYPE); 240 241 #define ShellCommandFunctionPoiter4(t1, t2, t3, t4) \ 242 void SHELLCOMMANDINCLASS(*functionPointer_4_##t1##_##t2##_##t3##_##t4)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE); 243 244 245 #define ShellCommandFunctionPoiter5(t1, t2, t3, t4, t5) \ 246 void SHELLCOMMANDINCLASS(*functionPointer_5_##t1##_##t2##_##t3##_##t4##_##t5)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE, t5##_TYPE); \ 247 227 248 228 249 ////////////////// … … 231 252 //! creates a command that takes no parameters 232 253 #define ShellCommandConstructor0() \ 233 void SHELLCOMMANDINCLASS(*functionPointer_0)(); \234 254 SHELLCOMMAND(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)()) \ 235 255 : ShellCommandBase(commandName, className, 0) \ 236 256 { \ 237 257 this->functorType = SHELLCOMMANDTYPE; \ 238 this->f unctionPointer_0 = function; \258 this->fp.functionPointer_0 = function; \ 239 259 } 240 260 241 261 //! creates a command that takes one parameter 242 262 #define ShellCommandConstructor1(t1) \ 243 void SHELLCOMMANDINCLASS(*functionPointer_1_##t1)(t1##_TYPE); \ 244 SHELLCOMMAND(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE), t1##_TYPE d1) \ 245 : ShellCommandBase(commandName, className, 1, t1##_PARAM, d1) \ 246 { \ 247 this->functorType = SHELLCOMMANDTYPE; \ 248 this->functionPointer_1_##t1 = function; \ 263 SHELLCOMMAND(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE)) \ 264 : ShellCommandBase(commandName, className, 1, t1##_PARAM) \ 265 { \ 266 this->functorType = SHELLCOMMANDTYPE; \ 267 this->fp.functionPointer_1_##t1 = function; \ 249 268 } 250 269 251 270 //! creates a command that takes two parameters 252 271 #define ShellCommandConstructor2(t1,t2) \ 253 void SHELLCOMMANDINCLASS(*functionPointer_2_##t1##_##t2)(t1##_TYPE, t2##_TYPE); \ 254 SHELLCOMMAND(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE, t2##_TYPE), t1##_TYPE d1, t2##_TYPE d2) \ 255 : ShellCommandBase(commandName, className, 2, t1##_PARAM, d1, t2##_PARAM, d2) \ 256 { \ 257 this->functorType = SHELLCOMMANDTYPE; \ 258 this->functionPointer_2_##t1##_##t2 = function; \ 272 SHELLCOMMAND(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE, t2##_TYPE)) \ 273 : ShellCommandBase(commandName, className, 2, t1##_PARAM, t2##_PARAM) \ 274 { \ 275 this->functorType = SHELLCOMMANDTYPE; \ 276 this->fp.functionPointer_2_##t1##_##t2 = function; \ 259 277 } 260 278 261 279 //! creates a command that takes three parameter 262 280 #define ShellCommandConstructor3(t1,t2,t3) \ 263 void SHELLCOMMANDINCLASS(*functionPointer_3_##t1##_##t2##_##t3)(t1##_TYPE, t2##_TYPE, t3##_TYPE); \ 264 SHELLCOMMAND(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE), t1##_TYPE d1, t2##_TYPE d2, t3##_TYPE d3) \ 265 : ShellCommandBase(commandName, className, 3, t1##_PARAM, d1, t2##_PARAM, d2, t3##_PARAM, d3) \ 266 { \ 267 this->functorType = SHELLCOMMANDTYPE; \ 268 this->functionPointer_3_##t1##_##t2##_##t3 = function; \ 281 SHELLCOMMAND(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE)) \ 282 : ShellCommandBase(commandName, className, 3, t1##_PARAM, t2##_PARAM, t3##_PARAM) \ 283 { \ 284 this->functorType = SHELLCOMMANDTYPE; \ 285 this->fp.functionPointer_3_##t1##_##t2##_##t3 = function; \ 269 286 } 270 287 271 288 //! creates a command that takes four parameter 272 289 #define ShellCommandConstructor4(t1,t2,t3,t4) \ 273 void SHELLCOMMANDINCLASS(*functionPointer_4_##t1##_##t2##_##t3##_##t4)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE); \ 274 SHELLCOMMAND(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE), t1##_TYPE d1, t2##_TYPE d2, t3##_TYPE d3, t4##_TYPE d4) \ 275 : ShellCommandBase(commandName, className, 4, t1##_PARAM, d1, t2##_PARAM, d2, t3##_PARAM, d3, t4##_PARAM, d4) \ 276 { \ 277 this->functorType = SHELLCOMMANDTYPE; \ 278 this->functionPointer_4_##t1##_##t2##_##t3##_##t4 = function; \ 290 SHELLCOMMAND(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE)) \ 291 : ShellCommandBase(commandName, className, 4, t1##_PARAM, t2##_PARAM, t3##_PARAM, t4##_PARAM) \ 292 { \ 293 this->functorType = SHELLCOMMANDTYPE; \ 294 this->fp.functionPointer_4_##t1##_##t2##_##t3##_##t4 = function; \ 279 295 } 280 296 281 297 //! creates a command that takes five parameter 282 298 #define ShellCommandConstructor5(t1,t2,t3,t4,t5) \ 283 void SHELLCOMMANDINCLASS(*functionPointer_5_##t1##_##t2##_##t3##_##t4##_##t5)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE, t5##_TYPE); \ 284 SHELLCOMMAND(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE, t5##_TYPE), t1##_TYPE d1, t2##_TYPE d2, t3##_TYPE d3, t4##_TYPE d4, t5##_TYPE d5) \ 285 : ShellCommandBase(commandName, className, 5, t1##_PARAM, d1, t2##_PARAM, d2, t3##_PARAM, d3, t4##_PARAM, d4, t5##_PARAM, d5) \ 286 { \ 287 this->functorType = SHELLCOMMANDTYPE; \ 288 this->functionPointer_5_##t1##_##t2##_##t3##_##t4##_##t5 = function; \ 299 SHELLCOMMAND(const char* commandName, const char* className, void SHELLCOMMANDINCLASS(*function)(t1##_TYPE, t2##_TYPE, t3##_TYPE, t4##_TYPE, t5##_TYPE)) \ 300 : ShellCommandBase(commandName, className, 5, t1##_PARAM, t2##_PARAM, t3##_PARAM, t4##_PARAM, t5##_PARAM) \ 301 { \ 302 this->functorType = SHELLCOMMANDTYPE; \ 303 this->fp.functionPointer_5_##t1##_##t2##_##t3##_##t4##_##t5 = function; \ 289 304 } 290 305 … … 337 352 #undef SHELLCOMMANDEXECUTER 338 353 #endif 339 #define SHELLCOMMANDEXECUTER(nameExt) (dynamic_cast<T*>(object)->* functionPointer##nameExt)354 #define SHELLCOMMANDEXECUTER(nameExt) (dynamic_cast<T*>(object)->*(fp.functionPointer##nameExt)) 340 355 #ifdef SHELLCOMMANDINCLASS 341 356 #undef SHELLCOMMANDINCLASS … … 353 368 354 369 private: 370 //! FUNCTOR_LIST is the List of FunctionPointers 371 union FunctionPointers { 372 #define FUNCTOR_LIST(x) ShellCommandFunctionPoiter ## x 373 #include "functor_list.h" 374 #undef FUNCTOR_LIST 375 } fp; 376 355 377 //! FUNCTOR_LIST is the List of CommandConstructors 356 378 #define FUNCTOR_LIST(x) ShellCommandConstructor ## x … … 382 404 #undef SHELLCOMMANDEXECUTER 383 405 #endif 384 #define SHELLCOMMANDEXECUTER(nameExt) f unctionPointer##nameExt406 #define SHELLCOMMANDEXECUTER(nameExt) fp.functionPointer##nameExt 385 407 #ifdef SHELLCOMMANDINCLASS 386 408 #undef SHELLCOMMANDINCLASS … … 398 420 399 421 private: 422 //! FUNCTOR_LIST is the List of FunctionPointers 423 union FunctionPointers { 424 #define FUNCTOR_LIST(x) ShellCommandFunctionPoiter ## x 425 #include "functor_list.h" 426 #undef FUNCTOR_LIST 427 } fp; 428 400 429 //! FUNCTOR_LIST is the List of CommandConstructors 401 430 #define FUNCTOR_LIST(x) ShellCommandConstructor ## x -
branches/world_entities/src/lib/sound/Makefile.in
r5527 r5558 207 207 esac; \ 208 208 done; \ 209 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/lib/sound/Makefile'; \209 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/sound/Makefile'; \ 210 210 cd $(top_srcdir) && \ 211 $(AUTOMAKE) -- gnusrc/lib/sound/Makefile211 $(AUTOMAKE) --foreign src/lib/sound/Makefile 212 212 .PRECIOUS: Makefile 213 213 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
branches/world_entities/src/lib/tinyxml/Makefile.in
r5527 r5558 203 203 esac; \ 204 204 done; \ 205 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/lib/tinyxml/Makefile'; \205 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/tinyxml/Makefile'; \ 206 206 cd $(top_srcdir) && \ 207 $(AUTOMAKE) -- gnusrc/lib/tinyxml/Makefile207 $(AUTOMAKE) --foreign src/lib/tinyxml/Makefile 208 208 .PRECIOUS: Makefile 209 209 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
Note: See TracChangeset
for help on using the changeset viewer.