Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5740 for code/branches/ggz2


Ignore:
Timestamp:
Sep 1, 2009, 5:35:16 PM (15 years ago)
Author:
landauf
Message:

merged ggz into ggz2

Location:
code/branches/ggz2
Files:
7 edited
7 copied

Legend:

Unmodified
Added
Removed
  • code/branches/ggz2

  • code/branches/ggz2/bin/ggz/module.dsc

    • Property svn:eol-style set to native
  • code/branches/ggz2/bin/ggz/orxonox.dsc

    • Property svn:eol-style set to native
  • code/branches/ggz2/bin/ggz/orxonox.room

    • Property svn:eol-style set to native
  • code/branches/ggz2/cmake/FindGGZ.cmake

    • Property svn:eol-style set to native
  • code/branches/ggz2/cmake/LibraryConfig.cmake

    r5695 r5740  
    9191FIND_PACKAGE(ALUT            REQUIRED)
    9292FIND_PACKAGE(ZLIB            REQUIRED)
     93FIND_PACKAGE(GGZ                     )
     94IF(NOT GGZMOD_FOUND)
     95  MESSAGE(STATUS "GGZMOD not found, disabling GGZ support")
     96ENDIF(NOT GGZMOD_FOUND)
    9397IF(WIN32)
    9498  FIND_PACKAGE(DirectX       REQUIRED)
  • code/branches/ggz2/src/SpecialConfig.h.in

    r5695 r5740  
    6969#cmakedefine CMAKE_CONFIGURATION_TYPES
    7070
     71/**
     72@def GGZMOD_FOUND
     73    Macro for availability of the ggzmod library
     74*/
     75#cmakedefine GGZMOD_FOUND
     76
    7177// Handle default ConfigValues
    7278namespace orxonox { namespace specialConfig
  • code/branches/ggz2/src/modules/gamestates/GSClient.cc

    r5738 r5740  
    2424 *   Co-authors:
    2525 *      Fabian 'x3n' Landau
     26 *      Adrian Friedli
    2627 *
    2728 */
    2829
    2930#include "GSClient.h"
     31#include "SpecialConfig.h"
    3032
    3133#include "util/Exception.h"
     
    3537#include "core/GameMode.h"
    3638#include "network/Client.h"
     39#ifdef GGZMOD_FOUND
     40#include "GGZClient.h"
     41#endif /* GGZMOD_FOUND */
    3742
    3843namespace orxonox
     
    4550        : GameState(info)
    4651        , client_(0)
     52        , ggzClient(0)
    4753    {
    4854    }
     
    5662        GameMode::setIsClient(true);
    5763
    58         this->client_ = new Client(CommandLine::getValue("ip").getString(), CommandLine::getValue("port"));
     64#ifdef GGZMOD_FOUND
     65        if (GGZClient::isActive())
     66        {
     67            this->ggzClient = new GGZClient(this);
     68            return;
     69        }
     70#endif /* GGZMOD_FOUND */
     71
     72        this->connect(CommandLine::getValue("ip").getString(), CommandLine::getValue("port"));
     73    }
     74
     75    void GSClient::connect(const std::string& address, int port)
     76    {
     77        this->client_ = new Client(address, port);
    5978
    6079        if(!client_->establishConnection())
     
    6887        client_->closeConnection();
    6988
     89#ifdef GGZMOD_FOUND
     90        if (ggzClient)
     91        {
     92            delete ggzClient;
     93        }
     94#endif /* GGZMOD_FOUND */
     95
    7096        // destroy client
    7197        delete this->client_;
     
    76102    void GSClient::update(const Clock& time)
    77103    {
    78         client_->update(time);
     104        if (client_)
     105        {
     106            client_->update(time);
     107        }
    79108    }
    80109}
  • code/branches/ggz2/src/modules/gamestates/GSClient.h

    r5738 r5740  
    2323 *      Reto Grieder
    2424 *   Co-authors:
    25  *      ...
     25 *      Adrian Friedli
    2626 *
    2727 */
     
    4242        GSClient(const GameStateInfo& info);
    4343        ~GSClient();
     44        void connect(const std::string& address, int port);
    4445
    4546        void activate();
     
    4950    private:
    5051        Client* client_;
     52        GGZClient* ggzClient;
    5153    };
    5254}
  • code/branches/ggz2/src/orxonox/CMakeLists.txt

    r5738 r5740  
    3030  Scene.cc
    3131)
     32
     33IF(GGZMOD_FOUND)
     34  ADD_SOURCE_FILES(ORXONOX_SRC_FILES GGZClient.cc)
     35ENDIF(GGZMOD_FOUND)
    3236
    3337ADD_SUBDIRECTORY(collisionshapes)
     
    6569    ${VORBIS_LIBRARY}
    6670    ${OGG_LIBRARY}
     71    ${GGZMOD_LIBRARIES}
    6772    tinyxml++_orxonox
    6873    tolua++_orxonox
  • code/branches/ggz2/src/orxonox/GGZClient.cc

    • Property svn:eol-style set to native
  • code/branches/ggz2/src/orxonox/GGZClient.h

    • Property svn:eol-style set to native
  • code/branches/ggz2/src/orxonox/OrxonoxPrereqs.h

    r5738 r5740  
    193193    class SoundManager;
    194194    class SoundMainMenu;
     195
     196    // GGZ
     197    class GGZClient;
    195198}
    196199
Note: See TracChangeset for help on using the changeset viewer.