Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 19, 2008, 2:58:22 PM (16 years ago)
Author:
landauf
Message:

Added a command-history to the console. you can scroll through all previously entered commands by pressing [up] key.
The history is stored in orxonox.ini in the section [Shell]. You can configure the maximal amount of stored commands (default: 100).
This allows you to use the history after orxonox was restarted.
The history uses a cyclic vector (with the configured size), meaning the newest command will overwrite the oldest entry (if the maximal size was reached).

additionally I fixed some bugs in ConfigValueContainer and added a mod-function to Math.h, that does basically the same as %, but without returning a negative value in case of a negative input.

-1 % 10 = -1
-11 % 10 = -1

mod(-1, 10) = 9
mod(-11, 10) = 9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/console/src/util/Math.h

    r1062 r1324  
    121121
    122122template <typename T>
     123inline int mod(T x, int max)
     124{
     125    if (x >= 0)
     126        return (x % max);
     127    else
     128        return ((x % max) + max);
     129}
     130
     131template <typename T>
    123132T interpolate(float time, const T& start, const T& end)
    124133{
Note: See TracChangeset for help on using the changeset viewer.