Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 28, 2009, 9:31:24 PM (15 years ago)
Author:
landauf
Message:

replaced most occurrences of setObject(o) in combination with createFunctor(f) with the more convenient createFunctor(f, o)

Location:
code/branches/core5/src/modules/gamestates
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core5/src/modules/gamestates/GSGraphics.cc

    r5799 r5829  
    109109
    110110        // add console command to toggle GUI
    111         FunctorMember<GSGraphics>* functor = createFunctor(&GSGraphics::toggleGUI);
    112         functor->setObject(this);
    113         this->ccToggleGUI_ = createConsoleCommand(functor, "toggleGUI");
     111        this->ccToggleGUI_ = createConsoleCommand(createFunctor(&GSGraphics::toggleGUI, this), "toggleGUI");
    114112        CommandExecutor::addConsoleCommandShortcut(this->ccToggleGUI_);
    115113
  • code/branches/core5/src/modules/gamestates/GSIOConsole.cc

    r5738 r5829  
    5050    {
    5151        {
    52             FunctorMember<GSIOConsole>* functor = createFunctor(&GSIOConsole::loadMenu);
    53             functor->setObject(this);
    54             this->ccLoadMenu_ = createConsoleCommand(functor, "loadMenu");
     52            this->ccLoadMenu_ = createConsoleCommand(createFunctor(&GSIOConsole::loadMenu, this), "loadMenu");
    5553            CommandExecutor::addConsoleCommandShortcut(this->ccLoadMenu_);
    5654        }
  • code/branches/core5/src/modules/gamestates/GSLevel.cc

    r5820 r5829  
    116116        {
    117117            // keybind console command
    118             FunctorMember<GSLevel>* functor1 = createFunctor(&GSLevel::keybind);
    119             functor1->setObject(this);
    120             ccKeybind_ = createConsoleCommand(functor1, "keybind");
     118            ccKeybind_ = createConsoleCommand(createFunctor(&GSLevel::keybind, this), "keybind");
    121119            CommandExecutor::addConsoleCommandShortcut(ccKeybind_);
    122             FunctorMember<GSLevel>* functor2 = createFunctor(&GSLevel::tkeybind);
    123             functor2->setObject(this);
    124             ccTkeybind_ = createConsoleCommand(functor2, "tkeybind");
     120            ccTkeybind_ = createConsoleCommand(createFunctor(&GSLevel::tkeybind, this), "tkeybind");
    125121            CommandExecutor::addConsoleCommandShortcut(ccTkeybind_);
    126122            // set our console command as callback for the key detector
  • code/branches/core5/src/modules/gamestates/GSMainMenu.cc

    r5817 r5829  
    7575        GraphicsManager::getInstance().setCamera(this->camera_);
    7676
    77         {
    78             FunctorMember<GSMainMenu>* functor = createFunctor(&GSMainMenu::startStandalone);
    79             functor->setObject(this);
    80             this->ccStartStandalone_ = createConsoleCommand(functor, "startGame");
    81             CommandExecutor::addConsoleCommandShortcut(this->ccStartStandalone_);
    82         }
    83         {
    84             FunctorMember<GSMainMenu>* functor = createFunctor(&GSMainMenu::startServer);
    85             functor->setObject(this);
    86             this->ccStartServer_ = createConsoleCommand(functor, "startServer");
    87             CommandExecutor::addConsoleCommandShortcut(this->ccStartServer_);
    88         }
    89         {
    90             FunctorMember<GSMainMenu>* functor = createFunctor(&GSMainMenu::startClient);
    91             functor->setObject(this);
    92             this->ccStartClient_ = createConsoleCommand(functor, "startClient");
    93             CommandExecutor::addConsoleCommandShortcut(this->ccStartClient_);
    94         }
    95         {
    96             FunctorMember<GSMainMenu>* functor = createFunctor(&GSMainMenu::startDedicated);
    97             functor->setObject(this);
    98             this->ccStartDedicated_ = createConsoleCommand(functor, "startDedicated");
    99             CommandExecutor::addConsoleCommandShortcut(this->ccStartDedicated_);
    100         }
    101         {
    102             FunctorMember<GSMainMenu>* functor = createFunctor(&GSMainMenu::startMainMenu);
    103             functor->setObject(this);
    104             this->ccStartMainMenu_ = createConsoleCommand(functor, "startMainMenu");
    105             CommandExecutor::addConsoleCommandShortcut(this->ccStartMainMenu_);
    106         }
     77        this->ccStartStandalone_ = createConsoleCommand(createFunctor(&GSMainMenu::startStandalone, this), "startGame");
     78        CommandExecutor::addConsoleCommandShortcut(this->ccStartStandalone_);
     79        this->ccStartServer_ = createConsoleCommand(createFunctor(&GSMainMenu::startServer, this), "startServer");
     80        CommandExecutor::addConsoleCommandShortcut(this->ccStartServer_);
     81        this->ccStartClient_ = createConsoleCommand(createFunctor(&GSMainMenu::startClient, this), "startClient");
     82        CommandExecutor::addConsoleCommandShortcut(this->ccStartClient_);
     83        this->ccStartDedicated_ = createConsoleCommand(createFunctor(&GSMainMenu::startDedicated, this), "startDedicated");
     84        CommandExecutor::addConsoleCommandShortcut(this->ccStartDedicated_);
     85        this->ccStartMainMenu_ = createConsoleCommand(createFunctor(&GSMainMenu::startMainMenu, this), "startMainMenu");
     86        CommandExecutor::addConsoleCommandShortcut(this->ccStartMainMenu_);
    10787
    10888        InputManager::getInstance().enterState("mainMenu");
  • code/branches/core5/src/modules/gamestates/GSRoot.cc

    r5799 r5829  
    6363        this->timeFactor_ = 1.0f;
    6464
    65         {
    66             // time factor console command
    67             FunctorMember<GSRoot>* functor = createFunctor(&GSRoot::setTimeFactor);
    68             functor->setObject(this);
    69             this->ccSetTimeFactor_ = createConsoleCommand(functor, "setTimeFactor");
    70             CommandExecutor::addConsoleCommandShortcut(this->ccSetTimeFactor_).accessLevel(AccessLevel::Offline).defaultValue(0, 1.0);
    71         }
     65        // time factor console command
     66        this->ccSetTimeFactor_ = createConsoleCommand(createFunctor(&GSRoot::setTimeFactor, this), "setTimeFactor");
     67        CommandExecutor::addConsoleCommandShortcut(this->ccSetTimeFactor_).accessLevel(AccessLevel::Offline).defaultValue(0, 1.0);
    7268
    73         {
    74             // time factor console command
    75             FunctorMember<GSRoot>* functor = createFunctor(&GSRoot::pause);
    76             functor->setObject(this);
    77             this->ccPause_ = createConsoleCommand(functor, "pause");
    78             CommandExecutor::addConsoleCommandShortcut(this->ccPause_).accessLevel(AccessLevel::Offline);
    79         }
     69        // time factor console command
     70        this->ccPause_ = createConsoleCommand(createFunctor(&GSRoot::pause, this), "pause");
     71        CommandExecutor::addConsoleCommandShortcut(this->ccPause_).accessLevel(AccessLevel::Offline);
    8072
    8173        // create the LevelManager
Note: See TracChangeset for help on using the changeset viewer.