Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 2, 2008, 9:23:30 PM (16 years ago)
Author:
landauf
Message:

merged console-branch back to trunk.
IMPORTANT: update your media directory!

you need TCL to compile. TCL is available here: http://www.tcl.tk/
another option is to check out https://svn.orxonox.net/ogre/tcl8.5.2/ and compile it by yourself. makefiles are in the 'macosx', 'unix' and 'win' subfolders.
FindTCL.cmake searches in the usual locations and in ../libs/tcl8.5.2/

the orxonox console can be activated with numpad-enter. whatever you enter will be parsed by TCL. if TCL doesn't know a command, it gets executed by orxonox.

simple tcl commands are: "puts text" to write "text" into the console, "expr 1+1" to calculate the result of the given expression. just try it by yourself with "puts [expr 1+1]".
[x] means: evaluate x and use the returnvalue as an argument. in this case the returned value is "2" and the resulting command therefore "puts 2".

you can combine orxonox and tcl commands. a simple orxonox command is "log text" that writes text into the console and the logfile. test it with "log [expr 1+1]" to write "2" into all output channels of orxonox. something more advanced: "log [clock seconds]" writes the seconds since 1970 into the logfile. feel free to combine both: "log [clock seconds]: 1+1 is [expr 1+1]"

TCL uses variables. to set a new variable, use "set varname value". you can use the variable wherever you want with $varname. with this we can make the above command a bit more elegant:
set myexpression 1+1
log [clock seconds]: $myexpression is [expr $myexpression]

read more about tcl in the wiki: http://wiki.tcl.tk/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/core/Functor.h

    r1064 r1214  
    284284#define FUNCTOR_EVALUATE_PARAM0
    285285#define FUNCTOR_EVALUATE_PARAM1 \
    286     if (index == 0) param = (P1)param
     286    if (index == 0) { P1 temp = param; param = temp; }
    287287#define FUNCTOR_EVALUATE_PARAM2 \
    288     if (index == 0) param = (P1)param; \
    289     else if (index == 1) param = (P2)param
     288    if (index == 0) { P1 temp = param; param = temp; } \
     289    else if (index == 1) { P2 temp = param; param = temp; }
    290290#define FUNCTOR_EVALUATE_PARAM3 \
    291     if (index == 0) param = (P1)param; \
    292     else if (index == 1) param = (P2)param; \
    293     else if (index == 2) param = (P3)param
     291    if (index == 0) { P1 temp = param; param = temp; } \
     292    else if (index == 1) { P2 temp = param; param = temp; } \
     293    else if (index == 2) { P3 temp = param; param = temp; }
    294294#define FUNCTOR_EVALUATE_PARAM4 \
    295     if (index == 0) param = (P1)param; \
    296     else if (index == 1) param = (P2)param; \
    297     else if (index == 2) param = (P3)param; \
    298     else if (index == 3) param = (P4)param
     295    if (index == 0) { P1 temp = param; param = temp; } \
     296    else if (index == 1) { P2 temp = param; param = temp; } \
     297    else if (index == 2) { P3 temp = param; param = temp; } \
     298    else if (index == 3) { P4 temp = param; param = temp; }
    299299#define FUNCTOR_EVALUATE_PARAM5 \
    300     if (index == 0) param = (P1)param; \
    301     else if (index == 1) param = (P2)param; \
    302     else if (index == 2) param = (P3)param; \
    303     else if (index == 3) param = (P4)param; \
    304     else if (index == 4) param = (P5)param
     300    if (index == 0) { P1 temp = param; param = temp; } \
     301    else if (index == 1) { P2 temp = param; param = temp; } \
     302    else if (index == 2) { P3 temp = param; param = temp; } \
     303    else if (index == 3) { P4 temp = param; param = temp; } \
     304    else if (index == 4) { P5 temp = param; param = temp; }
    305305
    306306
Note: See TracChangeset for help on using the changeset viewer.