| 
     
      
      
      From: <qr...@us...> - 2006-12-10 01:06:16
       
   | 
Revision: 290
          http://svn.sourceforge.net/opengate/?rev=290&view=rev
Author:   qrstuvw
Date:     2006-12-09 17:06:16 -0800 (Sat, 09 Dec 2006)
Log Message:
-----------
Basic ALPHA framework
Modified Paths:
--------------
    trunk/current/src/Makefile.am
Added Paths:
-----------
    trunk/current/src/Client.cpp
    trunk/current/src/Server.cpp
    trunk/current/src/client/
    trunk/current/src/client/GameState.h
    trunk/current/src/client/GameStateManager.cpp
    trunk/current/src/client/GameStateManager.h
    trunk/current/src/client/Global.h
    trunk/current/src/client/GraphicsSetup.cpp
    trunk/current/src/client/GraphicsSetup.h
    trunk/current/src/client/Makefile.am
    trunk/current/src/client/OpenGateApp.cpp
    trunk/current/src/client/OpenGateApp.h
    trunk/current/src/client/logic/
    trunk/current/src/client/logic/Makefile.am
    trunk/current/src/client/state/
    trunk/current/src/client/state/IntroState.cpp
    trunk/current/src/client/state/IntroState.h
    trunk/current/src/client/state/Makefile.am
    trunk/current/src/common/
    trunk/current/src/common/Makefile.am
    trunk/current/src/deps/
    trunk/current/src/deps/Makefile.am
    trunk/current/src/deps/tinyxml/
    trunk/current/src/deps/tinyxml/Makefile.am
    trunk/current/src/deps/tinyxml/tinyxml.cpp
    trunk/current/src/deps/tinyxml/tinyxml.h
    trunk/current/src/deps/tinyxml/tinyxmlerror.cpp
    trunk/current/src/deps/tinyxml/tinyxmlparser.cpp
    trunk/current/src/server/
    trunk/current/src/server/Makefile.am
Added: trunk/current/src/Client.cpp
===================================================================
--- trunk/current/src/Client.cpp	                        (rev 0)
+++ trunk/current/src/Client.cpp	2006-12-10 01:06:16 UTC (rev 290)
@@ -0,0 +1,49 @@
+/***************************************************************************
+ *   Copyright (C) 2006 by OpenGate development team   *
+ *   eGore eg...@us...   *
+ *   Qrstuvw ab...@sl...   *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <iostream>
+#include <cstdlib>
+
+#include "OpenGateApp.h"
+
+using namespace std;
+
+int main(int argc, char *argv[])
+{
+  // Create application object
+  OpenGateApp app;
+
+  try
+    {
+      app.go();
+    }
+  catch( Exception& e )
+    {
+      fprintf(stderr, "An exception has occured: %s\n",
+              e.getFullDescription().c_str());
+    }
+
+  return EXIT_SUCCESS;
+}
Property changes on: trunk/current/src/Client.cpp
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native
Modified: trunk/current/src/Makefile.am
===================================================================
--- trunk/current/src/Makefile.am	2006-12-10 00:30:25 UTC (rev 289)
+++ trunk/current/src/Makefile.am	2006-12-10 01:06:16 UTC (rev 290)
@@ -1,5 +1,10 @@
 
 # set the include path found by configure
-INCLUDES= $(all_includes)
+INCLUDES = $(all_includes)
 
 # the library search path.
+bin_PROGRAMS = client server
+
+server_SOURCES = Server.cpp
+client_SOURCES = Client.cpp
+SUBDIRS = deps common client server
Added: trunk/current/src/Server.cpp
===================================================================
--- trunk/current/src/Server.cpp	                        (rev 0)
+++ trunk/current/src/Server.cpp	2006-12-10 01:06:16 UTC (rev 290)
@@ -0,0 +1,19 @@
+/***************************************************************************
+ *   Copyright (C) 2006 by OpenGate development team   *
+ *   eg...@us...   *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
Property changes on: trunk/current/src/Server.cpp
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native
Added: trunk/current/src/client/GameState.h
===================================================================
--- trunk/current/src/client/GameState.h	                        (rev 0)
+++ trunk/current/src/client/GameState.h	2006-12-10 01:06:16 UTC (rev 290)
@@ -0,0 +1,158 @@
+/***************************************************************************
+ *   Copyright (C) 2006 by OpenGate development team   *
+ *   Qrstuvw ab...@sl...   *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef GAMESTATE_H
+#define GAMESTATE_H
+
+#include "Global.h"
+
+class GameState;
+
+/** \class GameStateListener
+	Allows a GameStateManager to recieve callbacks from a GameState. */
+class GameStateListener
+  {
+    // Attributes ------------------------------------------------------------------------------
+
+    // Methods ---------------------------------------------------------------------------------
+  public:
+    /** Constructor */
+    GameStateListener(void)
+    {}
+    ;
+
+    /** Virtual Deconstructor */
+    virtual ~GameStateListener(void)
+    {}
+    ;
+
+    /** Store a game state to manage. */
+    virtual void ManageGameState(Ogre::String state_name, GameState* state) = 0;
+
+    /** Find a state by name. */
+    virtual GameState* findByName(Ogre::String state_name) = 0;
+
+    /** Request a change to state. */
+    virtual void changeGameState(GameState* state) = 0;
+
+    /** Push state onto the stack. */
+    virtual bool pushGameState(GameState* state) = 0;
+
+    /** Pop a game state off the stack. */
+    virtual void popGameState() = 0;
+
+    /** Cause a shutdown. */
+    virtual void Shutdown() = 0;
+  };
+
+/** \class GameState
+	Inherit this class to make a game state capable
+	of being mananged by the game state manager. 
+*/
+class GameState
+  {
+    // Attributes ------------------------------------------------------------------------------
+  protected:
+    /** Stores the GameStateManager which is managing this state. */
+    GameStateListener* parent;
+
+    /** Keeps a method of device interaction. */
+    framework_info* mFramework;
+
+    // Methods ---------------------------------------------------------------------------------
+  protected:
+    /** Constructor: This should be a private member of an inherited class. */
+    GameState(void)
+    {}
+    ;
+
+    /** Destructor: This should be a private member of an inherited class. */
+    virtual ~GameState(void)
+    {}
+    ;
+
+    /** Find a state by its name. */
+    GameState* findByName(Ogre::String state_name)
+    {
+      return parent->findByName(state_name);
+    }
+
+    /** Request a change to game state. */
+    void changeGameState(GameState* state)
+    {
+      parent->changeGameState(state);
+    }
+
+    /** Push game state onto the stack. */
+    bool pushGameState(GameState* state)
+    {
+      return parent->pushGameState(state);
+    }
+
+    /** Pop a game state off the stack. */
+    void popGameState(void)
+    {
+      parent->popGameState();
+    }
+
+    /** Cause a shutdown. */
+    void Shutdown(void)
+    {
+      parent->Shutdown();
+    }
+
+  public:
+    /** Do not inherit this directly! */
+    void Create(GameStateListener* parent, const Ogre::String name)
+    {}
+    ;
+
+    /** Destroy self. */
+    void destroy(void)
+    {
+      delete this;
+    }
+
+    /** Initialize the game state with device information. */
+    void init(framework_info* framework)
+    {
+      mFramework = framework;
+    }
+
+    /** Inherit to supply game state enter code. */
+    virtual void enter(void) = 0;
+
+    /** Inherit to supply state exit code. */
+    virtual void exit(void) = 0;
+
+    /** Inherit to supply pause code. Inherit only if this game state can be paused.
+    Return true for successful pause, or false to deny pause. */
+    virtual bool pause(void)
+    {
+      return false;
+    }
+
+    /** Inherit to supply resume code. Inherit only if this game state can be paused. */
+    virtual void resume(void)
+    {}
+    ;
+  };
+
+#endif
Property changes on: trunk/current/src/client/GameState.h
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native
Added: trunk/current/src/client/GameStateManager.cpp
===================================================================
--- trunk/current/src/client/GameStateManager.cpp	                        (rev 0)
+++ trunk/current/src/client/GameStateManager.cpp	2006-12-10 01:06:16 UTC (rev 290)
@@ -0,0 +1,193 @@
+/***************************************************************************
+ *   Copyright (C) 2006 by OpenGate development team   *
+ *   Qrstuvw ab...@sl...   *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include "GameStateManager.h"
+
+//--------------------------------------------------------------------------------//
+/** Constructs the GameStateManager. */
+GameStateManager::GameStateManager(framework_info* framework)
+{
+  mFramework = framework;
+}
+
+//--------------------------------------------------------------------------------//
+/** Cleans up the game states before the instance dies. */
+GameStateManager::~GameStateManager()
+{
+  // Clean up all the states on the stack
+  while (!mStateStack.empty())
+    {
+      cleanup(mStateStack.back());
+      mStateStack.pop_back();
+    }
+
+  // Destroy the game states
+  while(!mStates.empty())
+    {
+      mStates.back().state->destroy();
+      mStates.pop_back();
+    }
+}
+
+//--------------------------------------------------------------------------------//
+/** Store a game state to manage. */
+void GameStateManager::ManageGameState(Ogre::String state_name,GameState* state)
+{
+  state_info new_state_info;
+  new_state_info.name = state_name;
+  new_state_info.state = state;
+  new_state_info.state->init(mFramework);
+  mStates.push_back(new_state_info);
+}
+
+//--------------------------------------------------------------------------------//
+
+/** Find a game state by name.
+	@Remarks returns 0 on failure.*/
+GameState* GameStateManager::findByName(Ogre::String state_name)
+{
+  std::vector<state_info>::iterator itr;
+
+  for(itr=mStates.begin();itr!=mStates.end();itr++)
+    {
+      if(itr->name==state_name)
+        return itr->state;
+    }
+
+  return 0;
+}
+
+//--------------------------------------------------------------------------------//
+/** Start game state. This is used to start the game state
+	 manager functioning with a particular state. 
+	 This function also does the main game loop and
+	 takes care of the Windows message pump.*/
+void GameStateManager::start(GameState* state)
+{
+  changeGameState(state);
+
+  while (!mShutdown)
+    {
+      // HACK: For some reason renderOneFrame() does not work,
+      // manually updating the window. 
+      mFramework->ogreRoot->_fireFrameStarted();
+
+      // Run the message pump
+#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+      {
+        MSG msg;
+        while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
+          {
+            if (msg.message = WM_QUIT)
+              Shutdown();
+            else
+              {
+                TranslateMessage(&msg);
+                DispatchMessage(&msg);
+              }
+          }
+      }
+#endif
+
+      mFramework->renderWindow->update();
+      mFramework->ogreRoot->_fireFrameEnded();
+    }
+}
+
+//--------------------------------------------------------------------------------//
+/** Change to a game state. This replaces the current game state
+	with a new game state. The current game state ends before
+	the new begins. */
+void GameStateManager::changeGameState(GameState* state)
+{
+  // Cleanup the current game state
+  if ( !mStateStack.empty() )
+    {
+      cleanup(mStateStack.back());
+      mStateStack.back()->exit();
+      mStateStack.pop_back();
+    }
+
+  mStateStack.push_back(state);
+  init(state);
+  mStateStack.back()->enter();
+}
+
+//--------------------------------------------------------------------------------//
+/** Push a game state onto the stack. This pauses the current game state
+	and begins a new game state. If the current game state refuses to
+	be paused, this will return false. */
+bool GameStateManager::pushGameState(GameState* state)
+{
+  // Pause current game state
+  if ( !mStateStack.empty() )
+    {
+      if(!mStateStack.back()->pause())
+        return false;
+      cleanup(mStateStack.back());
+    }
+
+  // Store and init the new state
+  mStateStack.push_back(state);
+  init(state);
+  mStateStack.back()->enter();
+
+  return true;
+}
+
+//--------------------------------------------------------------------------------//
+/** Pop a game state off the stack. This destroys the current game state
+	and returns control to the previous game state. */
+void GameStateManager::popGameState(void)
+{
+  // Cleanup the current game state
+  if ( !mStateStack.empty() )
+    {
+      cleanup(mStateStack.back());
+      mStateStack.back()->exit();
+      mStateStack.pop_back();
+    }
+
+  // Resume previous game state or quit if there isn't one
+  if ( !mStateStack.empty() )
+    {
+      init(mStateStack.back());
+      mStateStack.back()->resume();
+    }
+  else
+    Shutdown();
+}
+
+//--------------------------------------------------------------------------------//
+/** Special case function to shutdown the system. */
+void GameStateManager::Shutdown()
+{
+  mShutdown = true;
+}
+
+//--------------------------------------------------------------------------------//
+/** This initializes a game state. */
+void GameStateManager::init(GameState* state)
+{}
+
+//--------------------------------------------------------------------------------//
+/** Cleans up a previous state. */
+void GameStateManager::cleanup(GameState* state)
+{}
Property changes on: trunk/current/src/client/GameStateManager.cpp
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native
Added: trunk/current/src/client/GameStateManager.h
===================================================================
--- trunk/current/src/client/GameStateManager.h	                        (rev 0)
+++ trunk/current/src/client/GameStateManager.h	2006-12-10 01:06:16 UTC (rev 290)
@@ -0,0 +1,94 @@
+/***************************************************************************
+ *   Copyright (C) 2006 by OpenGate development team   *
+ *   Qrstuvw ab...@sl...   *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef GAMESTATEMANAGER_H
+#define GAMESTATEMANAGER_H
+
+#include "GameState.h"
+
+/** \class GameStateManager
+	The GameStateManager manages changes in the game states
+	in the game. It holds a stack of all open game states
+	and maps all events. */
+class GameStateManager: public GameStateListener
+  {
+    // Attributes ------------------------------------------------------------------------------
+  protected:
+    /** Holds information about the states in order to
+    	manage them properly and provide access. */
+    typedef struct
+      {
+        Ogre::String name;
+        GameState* state;
+      }
+    state_info;
+
+    /** This is the stack where the active states are stored. */
+    std::vector<GameState*> mStateStack;
+
+    /** This holds the states that are being managed. */
+    std::vector<state_info> mStates;
+
+    /** System Information. */
+    framework_info* mFramework;
+
+    /** If this is set to true, the game state manager prepares to exit. */
+    bool mShutdown;
+
+    // Methods ---------------------------------------------------------------------------------
+  protected:
+    /** This initializes a state. */
+    void init(GameState* state);
+
+    /** Cleans up a previous state. */
+    void cleanup(GameState* state);
+
+  public:
+    /** Constructs the GameStateManager. Must have all
+	input, output, gui functions in order to manage
+	states. */
+    GameStateManager(framework_info* framework);
+
+    /** Cleans up the states before the instance dies. */
+    ~GameStateManager();
+
+    /** Store a game state to manage. */
+    void ManageGameState(Ogre::String state_name, GameState* state);
+
+    /** Find a game state by name. */
+    GameState* findByName(Ogre::String state_name);
+
+    /** Start game state */
+    void start(GameState* state);
+
+    /** Change to a new game state */
+    void changeGameState(GameState* state);
+
+    /** Push game state onto the stack. */
+    bool pushGameState(GameState* state);
+
+    /** Pop a game state off the stack. */
+    void popGameState(void);
+
+    /** This is a special case function to cause a shutdown. */
+    void Shutdown(void);
+  };
+
+#endif
Property changes on: trunk/current/src/client/GameStateManager.h
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native
Added: trunk/current/src/client/Global.h
===================================================================
--- trunk/current/src/client/Global.h	                        (rev 0)
+++ trunk/current/src/client/Global.h	2006-12-10 01:06:16 UTC (rev 290)
@@ -0,0 +1,66 @@
+/***************************************************************************
+ *   Copyright (C) 2006 by OpenGate development team   *
+ *   Qrstuvw ab...@sl...   *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef GLOBAL_H
+#define GLOBAL_H
+
+#include <OGRE/Ogre.h>
+#include <OIS/OISMouse.h>
+#include <OIS/OISKeyboard.h>
+#include <OIS/OISJoyStick.h>
+#include <OIS/OISInputManager.h>
+/** This file eases an issue CEGUI has with OGRE's memory manager. Simply include this in
+	any files that are going to be doing 'CEGUI stuff', rather than CEGUI.h, 
+	OgreCEGUIRender.h, OgreCEGUIResourceProvider.h, and OgreCEGUITexture.h (etc). 
+	You will be in for smooth(er) sailing. **/
+#include <OGRE/OgreNoMemoryMacros.h>
+#include <CEGUI/CEGUIImageset.h>
+#include <CEGUI/CEGUISystem.h>
+#include <CEGUI/CEGUILogger.h>
+#include <CEGUI/CEGUISchemeManager.h>
+#include <CEGUI/CEGUIWindowManager.h>
+#include <CEGUI/CEGUIWindow.h>
+#include <OGRE/OgreCEGUIRenderer.h>
+#include <OGRE/OgreCEGUIResourceProvider.h>
+#include <OGRE/OgreMemoryMacros.h>
+
+#include <CEGUI/elements/CEGUIEditbox.h>
+#include <CEGUI/elements/CEGUIPushButton.h>
+#include <CEGUI/elements/CEGUIEditbox.h>
+#include <CEGUI/elements/CEGUIFrameWindow.h>
+#include <CEGUI/elements/CEGUIStaticImage.h>
+#include <CEGUI/elements/CEGUIProgressBar.h>
+#include <CEGUI/elements/CEGUIStaticText.h>
+
+/** Information structure to facilitate the transfer of information between
+	GameState states. */
+typedef struct
+  {
+    Ogre::Root* ogreRoot;
+    Ogre::SceneManager* sceneMgr;
+    Ogre::Camera* camera;
+    Ogre::Viewport* viewport;
+    Ogre::RenderWindow* renderWindow;
+    CEGUI::OgreCEGUIRenderer* GUIRenderer;
+    CEGUI::System* GUISystem;
+  }
+framework_info;
+
+#endif
Property changes on: trunk/current/src/client/Global.h
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native
Added: trunk/current/src/client/GraphicsSetup.cpp
===================================================================
--- trunk/current/src/client/GraphicsSetup.cpp	                        (rev 0)
+++ trunk/current/src/client/GraphicsSetup.cpp	2006-12-10 01:06:16 UTC (rev 290)
@@ -0,0 +1,204 @@
+/***************************************************************************
+ *   Copyright (C) 2006 by OpenGate development team   *
+ *   Qrstuvw ab...@sl...   *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include "GraphicsSetup.h"
+
+/** Defaul constructor. */
+//--------------------------------------------------------------------------------//
+GraphicsSetup::GraphicsSetup()
+{}
+
+/** Default destructor. */
+//--------------------------------------------------------------------------------//
+GraphicsSetup::~GraphicsSetup()
+{}
+
+/** This function initialises Ogre and CEGUI. */
+//--------------------------------------------------------------------------------//
+bool GraphicsSetup::initGraphics(framework_info* mFramework)
+{
+  // Create root object and store a pointer to it in mFramework
+  mFramework->ogreRoot = new Ogre::Root("", "", "OpenGate.log");
+
+  // Load the render system (Linux only has OpenGL)
+  mFramework->ogreRoot->loadPlugin("/usr/local/lib/OGRE/RenderSystem_GL.so");
+
+  // Load engines settings
+  if (!loadEngineSettings(mFramework))
+    {
+      // Create the Graphics.xml file using default options
+      if (!saveEngineSettings(mFramework))
+        return false;
+      return false;
+    }
+
+  // Write all the currently available settings as comment
+  if (!saveEngineSettings(mFramework))
+    return false;
+
+  // Load all resources from XML
+  if (!setupResources())
+    return false;
+
+  // FIXME: Make this do something. Returns an empty string if options are valid
+  mRenderSystem->validateConfigOptions();
+
+  // Tell the Ogre what render system to use
+  mFramework->ogreRoot->setRenderSystem(mRenderSystem);
+
+  // Create our window
+  mFramework->renderWindow = mFramework->ogreRoot->initialise(true, "OpenGate 0.0.1ALPHA");
+
+  // Pick a scene manager
+  mFramework->sceneMgr = mFramework->ogreRoot->createSceneManager(Ogre::ST_GENERIC, "SMInstance");
+
+  // Setup CEGUI Logging
+  CEGUI::Logger::getSingleton().setLoggingLevel(CEGUI::Insane);
+  CEGUI::Logger::getSingleton().setLogFilename("OpenGate.log", true);
+
+  // Tell CEGUI about our window and what scene manager to use
+  mFramework->GUIRenderer = new CEGUI::OgreCEGUIRenderer(mFramework->renderWindow, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mFramework->sceneMgr);
+
+  // Hook the CEGUI system to the renderer
+  mFramework->GUISystem = new CEGUI::System(mFramework->GUIRenderer);
+
+  return true;
+}
+
+/** Get all the options from Graphics.xml and feed them to the RenderSystem. */
+//-----------------------------------------------------------------------------...
 
[truncated message content] | 
| 
     
      
      
      From: <qr...@us...> - 2006-12-10 01:50:34
       
   | 
Revision: 291
          http://svn.sourceforge.net/opengate/?rev=291&view=rev
Author:   qrstuvw
Date:     2006-12-09 17:50:34 -0800 (Sat, 09 Dec 2006)
Log Message:
-----------
Modified TinyXML and some Makefiles
Modified Paths:
--------------
    trunk/current/src/client/Makefile.am
    trunk/current/src/client/state/Makefile.am
    trunk/current/src/deps/tinyxml/tinyxml.h
Modified: trunk/current/src/client/Makefile.am
===================================================================
--- trunk/current/src/client/Makefile.am	2006-12-10 01:06:16 UTC (rev 290)
+++ trunk/current/src/client/Makefile.am	2006-12-10 01:50:34 UTC (rev 291)
@@ -1,4 +1,4 @@
-INCLUDES = $(all_includes)
+INCLUDES = -I$(top_srcdir)/src/client -I$(top_srcdir)/src/deps $(all_includes)
 METASOURCES = AUTO
 SUBDIRS = logic state
 lib_LTLIBRARIES = libClient.la
Modified: trunk/current/src/client/state/Makefile.am
===================================================================
--- trunk/current/src/client/state/Makefile.am	2006-12-10 01:06:16 UTC (rev 290)
+++ trunk/current/src/client/state/Makefile.am	2006-12-10 01:50:34 UTC (rev 291)
@@ -1,4 +1,4 @@
-INCLUDES = $(all_includes)
+INCLUDES = -I$(top_srcdir)/src/client $(all_includes)
 METASOURCES = AUTO
 lib_LTLIBRARIES = libStates.la
 noinst_HEADERS = IntroState.h
Modified: trunk/current/src/deps/tinyxml/tinyxml.h
===================================================================
--- trunk/current/src/deps/tinyxml/tinyxml.h	2006-12-10 01:06:16 UTC (rev 290)
+++ trunk/current/src/deps/tinyxml/tinyxml.h	2006-12-10 01:50:34 UTC (rev 291)
@@ -43,6 +43,8 @@
 #define DEBUG
 #endif
 
+#define TIXML_USE_STL
+
 #ifdef TIXML_USE_STL
 	#include <string>
  	#include <iostream>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
     
      
      
      From: <qr...@us...> - 2006-12-12 16:18:50
       
   | 
Revision: 306
          http://svn.sourceforge.net/opengate/?rev=306&view=rev
Author:   qrstuvw
Date:     2006-12-12 08:18:49 -0800 (Tue, 12 Dec 2006)
Log Message:
-----------
Let there be input (again)
Modified Paths:
--------------
    trunk/current/src/Makefile.am
    trunk/current/src/client/Global.h
    trunk/current/src/client/GraphicsSetup.cpp
    trunk/current/src/client/Makefile.am
    trunk/current/src/client/OpenGateApp.cpp
Added Paths:
-----------
    trunk/current/src/client/InputManager.cpp
    trunk/current/src/client/InputManager.h
    trunk/current/src/client/IntroState.cpp
    trunk/current/src/client/IntroState.h
    trunk/current/src/client/LoginListener.h
    trunk/current/src/client/LoginState.cpp
    trunk/current/src/client/LoginState.h
Modified: trunk/current/src/Makefile.am
===================================================================
--- trunk/current/src/Makefile.am	2006-12-12 15:41:21 UTC (rev 305)
+++ trunk/current/src/Makefile.am	2006-12-12 16:18:49 UTC (rev 306)
@@ -10,4 +10,5 @@
 bin_PROGRAMS = opengate-client
 opengate_client_SOURCES = Client.cpp
 opengate_client_LDADD = $(top_builddir)/src/deps/tinyxml/libTinyXML.la \
-	$(top_builddir)/src/client/state/libStates.la -L/usr/local/lib -lOgreMain -lCEGUIOgreRenderer -lCEGUIBase
+	$(top_builddir)/src/client/libOpenGateClient.la $(top_builddir)/src/client/state/libStates.la -L/usr/local/lib -lOIS \
+	-lOgreMain -lCEGUIOgreRenderer -lCEGUIBase
Modified: trunk/current/src/client/Global.h
===================================================================
--- trunk/current/src/client/Global.h	2006-12-12 15:41:21 UTC (rev 305)
+++ trunk/current/src/client/Global.h	2006-12-12 16:18:49 UTC (rev 306)
@@ -22,10 +22,9 @@
 #define GLOBAL_H
 
 #include <OGRE/Ogre.h>
-#include <OIS/OISMouse.h>
-#include <OIS/OISKeyboard.h>
-#include <OIS/OISJoyStick.h>
-#include <OIS/OISInputManager.h>
+
+#include "InputManager.h"
+
 /** This file eases an issue CEGUI has with OGRE's memory manager. Simply include this in
 	any files that are going to be doing 'CEGUI stuff', rather than CEGUI.h, 
 	OgreCEGUIRender.h, OgreCEGUIResourceProvider.h, and OgreCEGUITexture.h (etc). 
@@ -60,6 +59,7 @@
     Ogre::RenderWindow* renderWindow;
     CEGUI::OgreCEGUIRenderer* GUIRenderer;
     CEGUI::System* GUISystem;
+    InputManager *inputMgr;
   }
 framework_info;
 
Modified: trunk/current/src/client/GraphicsSetup.cpp
===================================================================
--- trunk/current/src/client/GraphicsSetup.cpp	2006-12-12 15:41:21 UTC (rev 305)
+++ trunk/current/src/client/GraphicsSetup.cpp	2006-12-12 16:18:49 UTC (rev 306)
@@ -39,7 +39,7 @@
 
   // Load the render system (Linux only has OpenGL)
   mFramework->ogreRoot->loadPlugin("/usr/local/lib/OGRE/RenderSystem_GL.so");
-    return false;
+
   // Load engines settings
   if (!loadEngineSettings(mFramework))
     return false;
Added: trunk/current/src/client/InputManager.cpp
===================================================================
--- trunk/current/src/client/InputManager.cpp	                        (rev 0)
+++ trunk/current/src/client/InputManager.cpp	2006-12-12 16:18:49 UTC (rev 306)
@@ -0,0 +1,476 @@
+/***************************************************************************
+ *   Copyright (C) 2006 by OpenGate development team   *
+ *   Qrstuvw ab...@sl...   *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include "InputManager.h"
+
+InputManager *InputManager::mInputManager;
+
+InputManager::InputManager( void ) :
+    mMouse( 0 ),
+    mKeyboard( 0 ),
+    mInputSystem( 0 )
+{}
+
+InputManager::~InputManager( void )
+{
+  if( mInputSystem )
+    {
+      if( mMouse )
+        {
+          mInputSystem->destroyInputObject( mMouse );
+          mMouse = 0;
+        }
+
+      if( mKeyboard )
+        {
+          mInputSystem->destroyInputObject( mKeyboard );
+          mKeyboard = 0;
+        }
+
+      if( mJoysticks.size() > 0 )
+        {
+          itJoystick = mJoysticks.begin();
+          itJoystickEnd = mJoysticks.end();
+          for(; itJoystick != itJoystickEnd; ++itJoystick )
+            {
+              mInputSystem->destroyInputObject( *itJoystick );
+            }
+
+          mJoysticks.clear();
+        }
+
+      mInputSystem->destroyInputSystem();
+      mInputSystem = 0;
+
+      // Clear Listeners
+      mKeyListeners.clear();
+      mMouseListeners.clear();
+      mJoystickListeners.clear();
+    }
+}
+
+void InputManager::initialise( Ogre::RenderWindow *renderWindow )
+{
+  if( !mInputSystem )
+    {
+      // Setup basic variables
+      OIS::ParamList paramList;
+      size_t windowHnd = 0;
+      std::ostringstream windowHndStr;
+
+      // Get window handle
+#if defined OIS_WIN32_PLATFORM
+
+      renderWindow->getCustomAttribute( "HWND", &windowHnd );
+#elif defined OIS_LINUX_PLATFORM
+
+      renderWindow->getCustomAttribute( "GLXWINDOW", &windowHnd );
+#endif
+
+      // Fill parameter list
+      windowHndStr << (unsigned int) windowHnd;
+      paramList.insert( std::make_pair( std::string( "WINDOW" ), windowHndStr.str() ) );
+
+      // Create inputsystem
+      mInputSystem = OIS::InputManager::createInputSystem( paramList );
+
+      // If possible create a buffered keyboard
+      if( mInputSystem->numKeyBoards() > 0 )
+        {
+          mKeyboard = static_cast<OIS::Keyboard*>( mInputSystem->createInputObject( OIS::OISKeyboard, true ) );
+          mKeyboard->setEventCallback( this );
+        }
+
+      // If possible create a buffered mouse
+      if( mInputSystem->numMice() > 0 )
+        {
+          mMouse = static_cast<OIS::Mouse*>( mInputSystem->createInputObject( OIS::OISMouse, true ) );
+          mMouse->setEventCallback( this );
+
+          // Get window size
+          unsigned int width, height, depth;
+          int left, top;
+          renderWindow->getMetrics( width, height, depth, left, top );
+
+          // Set mouse region
+          this->setWindowExtents( width, height );
+        }
+
+      // If possible create all joysticks in buffered mode
+      if( mInputSystem->numJoysticks() > 0 )
+        {
+          mJoysticks.resize( mInputSystem->numJoysticks() );
+
+          itJoystick = mJoysticks.begin();
+          itJoystickEnd = mJoysticks.end();
+          for(; itJoystick != itJoystickEnd; ++itJoystick )
+            {
+              (*itJoystick) = static_cast<OIS::JoyStick*>( mInputSystem->createInputObject( OIS::OISJoyStick, true ) );
+              (*itJoystick)->setEventCallback( this );
+            }
+        }
+    }
+}
+
+void InputManager::capture( void )
+{
+  // Need to capture / update each device every frame
+  if( mMouse )
+    {
+      mMouse->capture();
+    }
+
+  if( mKeyboard )
+    {
+      mKeyboard->capture();
+    }
+
+  if( mJoysticks.size() > 0 )
+    {
+      itJoystick = mJoysticks.begin();
+      itJoystickEnd = mJoysticks.end();
+      for(; itJoystick != itJoystickEnd; ++itJoystick )
+        {
+          (*itJoystick)->capture();
+        }
+    }
+}
+
+void InputManager::addKeyListener( OIS::KeyListener *keyListener, const std::string& instanceName )
+{
+  if( mKeyboard )
+    {
+      // Check for duplicate items
+      itKeyListener = mKeyListeners.find( instanceName );
+      if( itKeyListener == mKeyListeners.end() )
+        {
+          mKeyListeners[ instanceName ] = keyListener;
+        }
+      else
+        {
+          // Duplicate Item
+        }
+    }
+}
+
+void InputManager::addMouseListener( OIS::MouseListener *mouseListener, const std::string& instanceName )
+{
+  if( mMouse )
+    {
+      // Check for duplicate items
+      itMouseListener = mMouseListeners.find( instanceName );
+      if( itMouseListener == mMouseListeners.end() )
+        {
+          mMouseListeners[ instanceName ] = mouseListener;
+        }
+      else
+        {
+          // Duplicate Item
+        }
+    }
+}
+
+void InputManager::addJoystickListener( OIS::JoyStickListener *joystickListener, const std::string& instanceName )
+{
+  if( mJoysticks.size() > 0 )
+    {
+      // Check for duplicate items
+      itJoystickListener = mJoystickListeners.find( instanceName );
+      if( itJoystickListener != mJoystickListeners.end() )
+        {
+          mJoystickListeners[ instanceName ] = joystickListener;
+        }
+      else
+        {
+          // Duplicate Item
+        }
+    }
+}
+
+void InputManager::removeKeyListener( const std::string& instanceName )
+{
+  // Check if item exists
+  itKeyListener = mKeyListeners.find( instanceName );
+  if( itKeyListener != mKeyListeners.end() )
+    {
+      mKeyListeners.erase( itKeyListener );
+    }
+  else
+    {
+      // Doesn't Exist
+    }
+}
+
+void InputManager::removeMouseListener( const std::string& instanceName )
+{
+  // Check if item exists
+  itMouseListener = mMouseListeners.find( instanceName );
+  if( itMouseListener != mMouseListeners.end() )
+    {
+      mMouseListeners.erase( itMouseListener );
+    }
+  else
+    {
+      // Doesn't Exist
+    }
+}
+
+void InputManager::removeJoystickListener( const std::string& instanceName )
+{
+  // Check if item exists
+  itJoystickListener = mJoystickListeners.find( instanceName );
+  if( itJoystickListener != mJoystickListeners.end() )
+    {
+      mJoystickListeners.erase( itJoystickListener );
+    }
+  else
+    {
+      // Doesn't Exist
+    }
+}
+
+void InputManager::removeKeyListener( OIS::KeyListener *keyListener )
+{
+  itKeyListener = mKeyListeners.begin();
+  itKeyListenerEnd = mKeyListeners.end();
+  for(; itKeyListener != itKeyListenerEnd; ++itKeyListener )
+    {
+      if( itKeyListener->second == keyListener )
+        {
+          mKeyListeners.erase( itKeyListener );
+          break;
+        }
+    }
+}
+
+void InputManager::removeMouseListener( OIS::MouseListener *mouseListener )
+{
+  itMouseListener = mMouseListeners.begin();
+  itMouseListenerEnd = mMouseListeners.end();
+  for(; itMouseListener != itMouseListenerEnd; ++itMouseListener )
+    {
+      if( itMouseListener->second == mouseListener )
+        {
+          mMouseListeners.erase( itMouseListener );
+          break;
+        }
+    }
+}
+
+void InputManager::removeJoystickListener( OIS::JoyStickListener *joystickListener )
+{
+  itJoystickListener = mJoystickListeners.begin();
+  itJoystickListenerEnd = mJoystickListeners.end();
+  for(; itJoystickListener != itJoystickListenerEnd; ++itJoystickListener )
+    {
+      if( itJoystickListener->second == joystickListener )
+        {
+          mJoystickListeners.erase( itJoystickListener );
+          break;
+        }
+    }
+}
+
+void InputManager::removeAllListeners( void )
+{
+  mKeyListeners.clear();
+  mMouseListeners.clear();
+  mJoystickListeners.clear();
+}
+
+void InputManager::removeAllKeyListeners( void )
+{
+  mKeyListeners.clear();
+}
+
+void InputManager::removeAllMouseListeners( void )
+{
+  mMouseListeners.clear();
+}
+
+void InputManager::removeAllJoystickListeners( void )
+{
+  mJoystickListeners.clear();
+}
+
+void InputManager::setWindowExtents( int width, int height )
+{
+  // Set mouse region (if window resizes, we should alter this to reflect as well)
+  const OIS::MouseState &mouseState = mMouse->getMouseState();
+  mouseState.width = width;
+  mouseState.height = height;
+}
+
+OIS::Mouse* InputManager::getMouse( void )
+{
+  return mMouse;
+}
+
+OIS::Keyboard* InputManager::getKeyboard( void )
+{
+  return mKeyboard;
+}
+
+OIS::JoyStick* InputManager::getJoystick( unsigned int index )
+{
+  // Make sure it's a valid index
+  if( index < mJoysticks.size() )
+    {
+      return mJoysticks[ index ];
+    }
+
+  return 0;
+}
+
+int InputManager::getNumOfJoysticks( void )
+{
+  // Cast to keep compiler happy ^^
+  return (int) mJoysticks.size();
+}
+
+bool InputManager::keyPressed( const OIS::KeyEvent &e )
+{
+  itKeyListener = mKeyListeners.begin();
+  itKeyListenerEnd = mKeyListeners.end();
+  for(; itKeyListener != itKeyListenerEnd; ++itKeyListener )
+    {
+      itKeyListener->second->keyPressed( e );
+    }
+
+  return true;
+}
+
+bool InputManager::keyReleased( const OIS::KeyEvent &e )
+{
+  itKeyListener = mKeyListeners.begin();
+  itKeyListenerEnd = mKeyListeners.end();
+  for(; itKeyListener != itKeyListenerEnd; ++itKeyListener )
+    {
+      itKeyListener->second->keyReleased( e );
+    }
+
+  return true;
+}
+
+bool InputManager::mouseMoved( const OIS::MouseEvent &e )
+{
+  itMouseListener = mMouseListeners.begin();
+  itMouseListenerEnd = mMouseListeners.end();
+  for(; itMouseListener != itMouseListenerEnd; ++itMouseListener )
+    {
+      itMouseListener->second->mouseMoved( e );
+    }
+
+  return true;
+}
+
+bool InputManager::mousePressed( const OIS::MouseEvent &e, OIS::MouseButtonID id )
+{
+  itMouseListener = mMouseListeners.begin();
+  itMouseListenerEnd = mMouseListeners.end();
+  for(; itMouseListener != itMouseListenerEnd; ++itMouseListener )
+    {
+      itMouseListener->second->mousePressed( e, id );
+    }
+
+  return true;
+}
+
+bool InputManager::mouseReleased( const OIS::MouseEvent &e, OIS::MouseButtonID id )
+{
+  itMouseListener = mMouseListeners.begin();
+  itMouseListenerEnd = mMouseListeners.end();
+  for(; itMouseListener != itMouseListenerEnd; ++itMouseListener )
+    {
+      itMouseListener->second->mouseReleased( e, id );
+    }
+
+  return true;
+}
+
+bool InputManager::povMoved( const OIS::JoyStickEvent &e, int pov )
+{
+  itJoystickListener = mJoystickListeners.begin();
+  itJoystickListenerEnd = mJoystickListeners.end();
+  for(; itJoystickListener != itJoystickListenerEnd; ++itJoystickListener )
+    {
+      itJoystickListener->second->povMoved( e, pov );
+    }
+
+  return true;
+}
+
+bool InputManager::axisMoved( const OIS::JoyStickEvent &e, int axis )
+{
+  itJoystickListener = mJoystickListeners.begin();
+  itJoystickListenerEnd = mJoystickListeners.end();
+  for(; itJoystickListener != itJoystickListenerEnd; ++itJoystickListener )
+    {
+      itJoystickListener->second->axisMoved( e, axis );
+    }
+
+  return true;
+}
+
+bool InputManager::sliderMoved( const OIS::JoyStickEvent &e, int sliderID )
+{
+  itJoystickListener = mJoystickListeners.begin();
+  itJoystickListenerEnd = mJoystickListeners.end();
+  for(; itJoystickListener != itJoystickListenerEnd; ++itJoystickListener )
+    {
+      itJoystickListener->second->sliderMoved( e, sliderID );
+    }
+
+  return true;
+}
+
+bool InputManager::buttonPressed( const OIS::JoyStickEvent &e, int button )
+{
+  itJoystickListener = mJoystickListeners.begin();
+  itJoystickListenerEnd = mJoystickListeners.end();
+  for(; itJoystickListener != itJoystickListenerEnd; ++itJoystickListener )
+    {
+      itJoystickListener->second->buttonPressed( e, button );
+    }
+
+  return true;
+}
+
+bool InputManager::buttonReleased( const OIS::JoyStickEvent &e, int button )
+{
+  itJoystickListener = mJoystickListeners.begin();
+  itJoystickListenerEnd = mJoystickListeners.end();
+  for(; itJoystickListener != itJoystickListenerEnd; ++itJoystickListener )
+    {
+      itJoystickListener->second->buttonReleased( e, button );
+    }
+
+  return true;
+}
+
+InputManager* InputManager::getSingletonPtr( void )
+{
+  if( !mInputManager )
+    {
+      mInputManager = new InputManager();
+    }
+
+  return mInputManager;
+}
Property changes on: trunk/current/src/client/InputManager.cpp
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native
Added: trunk/current/src/client/InputManager.h
===================================================================
--- trunk/current/src/client/InputManager.h	                        (rev 0)
+++ trunk/current/src/client/InputManager.h	2006-12-12 16:18:49 UTC (rev 306)
@@ -0,0 +1,110 @@
+/***************************************************************************
+ *   Copyright (C) 2006 by OpenGate development team   *
+ *   Qrstuvw ab...@sl...   *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+
+#ifndef INPUTMANAGER_H
+#define INPUTMANAGER_H
+
+#include <OIS/OISMouse.h>
+#include <OIS/OISKeyboard.h>
+#include <OIS/OISJoyStick.h>
+#include <OIS/OISInputManager.h>
+
+#include <OGRE/OgreRenderWindow.h>
+
+/** Basic Global Input */
+class InputManager : public OIS::KeyListener, OIS::MouseListener, OIS::JoyStickListener
+  {
+  public:
+    virtual ~InputManager( void );
+
+    void initialise( Ogre::RenderWindow *renderWindow );
+    void capture( void );
+
+    void addKeyListener( OIS::KeyListener *keyListener, const std::string& instanceName );
+    void addMouseListener( OIS::MouseListener *mouseListener, const std::string& instanceName );
+    void addJoystickListener( OIS::JoyStickListener *joystickListener, const std::string& instanceName );
+
+    void removeKeyListener( const std::string& instanceName );
+    void removeMouseListener( const std::string& instanceName );
+    void removeJoystickListener( const std::string& instanceName );
+
+    void removeKeyListener( OIS::KeyListener *keyListener );
+    void removeMouseListener( OIS::MouseListener *mouseListener );
+    void removeJoystickListener( OIS::JoyStickListener *joystickListener );
+
+    void removeAllListeners( void );
+    void removeAllKeyListeners( void );
+    void removeAllMouseListeners( void );
+    void removeAllJoystickListeners( void );
+
+    void setWindowExtents( int width, int height );
+
+    OIS::Mouse* getMouse( void );
+    OIS::Keyboard* getKeyboard( void );
+    OIS::JoyStick* getJoystick( unsigned int index );
+
+    int getNumOfJoysticks( void );
+
+    static InputManager* getSingletonPtr( void );
+
+    OIS::InputManager *mInputSystem;
+    OIS::Mouse *mMouse;
+    OIS::Keyboard *mKeyboard;
+
+    std::vector<OIS::JoyStick*> mJoysticks;
+    std::vector<OIS::JoyStick*>::iterator itJoystick;
+    std::vector<OIS::JoyStick*>::iterator itJoystickEnd;
+
+  private:
+    InputManager( void );
+    InputManager( const InputManager& )
+    { }
+    InputManager & operator = ( const InputManager& );
+
+    bool keyPressed( const OIS::KeyEvent &e );
+    bool keyReleased( const OIS::KeyEvent &e );
+
+    bool mouseMoved( const OIS::MouseEvent &e );
+    bool mousePressed( const OIS::MouseEvent &e, OIS::MouseButtonID id );
+    bool mouseReleased( const OIS::MouseEvent &e, OIS::MouseButtonID id );
+
+    bool povMoved( const OIS::JoyStickEvent &e, int pov );
+    bool axisMoved( const OIS::JoyStickEvent &e, int axis );
+    bool sliderMoved( const OIS::JoyStickEvent &e, int sliderID );
+    bool buttonPressed( const OIS::JoyStickEvent &e, int button );
+    bool buttonReleased( const OIS::JoyStickEvent &e, int button );
+
+    std::map<std::string, OIS::KeyListener*> mKeyListeners;
+    std::map<std::string, OIS::MouseListener*> mMouseListeners;
+    std::map<std::string, OIS::JoyStickListener*> mJoystickListeners;
+
+    std::map<std::string, OIS::KeyListener*>::iterator itKeyListener;
+    std::map<std::string, OIS::MouseListener*>::iterator itMouseListener;
+    std::map<std::string, OIS::JoyStickListener*>::iterator itJoystickListener;
+
+    std::map<std::string, OIS::KeyListener*>::iterator itKeyListenerEnd;
+    std::map<std::string, OIS::MouseListener*>::iterator itMouseListenerEnd;
+    std::map<std::string, OIS::JoyStickListener*>::iterator itJoystickListenerEnd;
+
+    static InputManager *mInputManager;
+  };
+
+#endif
Property changes on: trunk/current/src/client/InputManager.h
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native
Added: trunk/current/src/client/IntroState.cpp
===================================================================
--- trunk/current/src/client/IntroState.cpp	                        (rev 0)
+++ trunk/current/src/client/IntroState.cpp	2006-12-12 16:18:49 UTC (rev 306)
@@ -0,0 +1,31 @@
+/***************************************************************************
+ *   Copyright (C) 2006 by OpenGate development team   *
+ *   Qrstuvw ab...@sl...   *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include "IntroState.h"
+
+//--------------------------------------------------------------------------------//
+/** Game state enter code. */
+void IntroState::enter()
+{}
+
+//--------------------------------------------------------------------------------//
+/** Game state exit code. */
+void IntroState::exit()
+{}
Property changes on: trunk/current/src/client/IntroState.cpp
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native
Added: trunk/current/src/client/IntroState.h
===================================================================
--- trunk/current/src/client/IntroState.h	                        (rev 0)
+++ trunk/current/src/client/IntroState.h	2006-12-12 16:18:49 UTC (rev 306)
@@ -0,0 +1,59 @@
+/***************************************************************************
+ *   Copyright (C) 2006 by OpenGate development team   *
+ *   Qrstuvw ab...@sl...   *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+
+#ifndef INTROSTATE_H
+#define INTROSTATE_H
+
+#include "GameState.h"
+
+class IntroState : public GameState
+  {
+    // Self-creation & registering function ----------------------------------------------------
+  public:
+    /** Create and register the state so that it can be managed by the GameStateManager. */
+    static void Create(GameStateListener *parent,const Ogre::String name)
+    {
+      IntroState *myGameState = new IntroState();
+      myGameState->parent = parent;
+      parent->ManageGameState(name,myGameState);
+    }
+
+    // Attributes ------------------------------------------------------------------------------
+
+    // Methods ---------------------------------------------------------------------------------
+  public:
+    /** Default constructor. */
+    IntroState()
+    {}
+
+    /** Default destructor. */
+    ~IntroState()
+    {}
+
+    /** Game state enter code. */
+    void enter();
+
+    /** Game state exit code. */
+    void exit();
+
+  };
+
+#endif
Property changes on: trunk/current/src/client/IntroState.h
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native
Added: trunk/current/src/client/LoginListener.h
===================================================================
Property changes on: trunk/current/src/client/LoginListener.h
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native
Added: trunk/current/src/client/LoginState.cpp
===================================================================
--- trunk/current/src/client/LoginState.cpp	                        (rev 0)
+++ trunk/current/src/client/LoginState.cpp	2006-12-12 16:18:49 UTC (rev 306)
@@ -0,0 +1,19 @@
+/***************************************************************************
+ *   Copyright (C) 2006 by OpenGate development team   *
+ *   Qrstuvw ab...@sl...   *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
Property changes on: trunk/current/src/client/LoginState.cpp
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native
Added: trunk/current/src/client/LoginState.h
===================================================================
--- trunk/current/src/client/LoginState.h	                        (rev 0)
+++ trunk/current/src/client/LoginState.h	2006-12-12 16:18:49 UTC (rev 306)
@@ -0,0 +1,59 @@
+/***************************************************************************
+ *   Copyright (C) 2006 by OpenGate development team   *
+ *   Qrstuvw ab...@sl...   *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it ...
 
[truncated message content] | 
| 
     
      
      
      From: <qr...@us...> - 2006-12-13 16:08:31
       
   | 
Revision: 307
          http://svn.sourceforge.net/opengate/?rev=307&view=rev
Author:   qrstuvw
Date:     2006-12-13 08:01:34 -0800 (Wed, 13 Dec 2006)
Log Message:
-----------
Makefile.am changed
Modified Paths:
--------------
    trunk/current/src/Makefile.am
    trunk/current/src/client/Makefile.am
Modified: trunk/current/src/Makefile.am
===================================================================
--- trunk/current/src/Makefile.am	2006-12-12 16:18:49 UTC (rev 306)
+++ trunk/current/src/Makefile.am	2006-12-13 16:01:34 UTC (rev 307)
@@ -10,5 +10,4 @@
 bin_PROGRAMS = opengate-client
 opengate_client_SOURCES = Client.cpp
 opengate_client_LDADD = $(top_builddir)/src/deps/tinyxml/libTinyXML.la \
-	$(top_builddir)/src/client/libOpenGateClient.la $(top_builddir)/src/client/state/libStates.la -L/usr/local/lib -lOIS \
-	-lOgreMain -lCEGUIOgreRenderer -lCEGUIBase
+	$(top_builddir)/src/client/libOpenGateClient.la -L/usr/local/lib -lOIS -lOgreMain -lCEGUIOgreRenderer -lCEGUIBase
Modified: trunk/current/src/client/Makefile.am
===================================================================
--- trunk/current/src/client/Makefile.am	2006-12-12 16:18:49 UTC (rev 306)
+++ trunk/current/src/client/Makefile.am	2006-12-13 16:01:34 UTC (rev 307)
@@ -7,3 +7,4 @@
 lib_LTLIBRARIES = libOpenGateClient.la
 libOpenGateClient_la_SOURCES = GameStateManager.cpp GraphicsSetup.cpp \
 		OpenGateApp.cpp IntroState.cpp LoginState.cpp InputManager.cpp
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 |