Lots of small changes to make the output Doxygen file much more useful
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5249 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
183ff21c91
commit
2810193fb2
@ -20,6 +20,10 @@
|
||||
#ifndef HEADER_ANIMATION_BASE_HPP
|
||||
#define HEADER_ANIMATION_BASE_HPP
|
||||
|
||||
/**
|
||||
* \defgroup animations
|
||||
*/
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "irrlicht.h"
|
||||
@ -30,7 +34,10 @@ using namespace irr;
|
||||
class XMLNode;
|
||||
class Ipo;
|
||||
|
||||
/** A base class for all animations. */
|
||||
/**
|
||||
* \brief A base class for all animations.
|
||||
* \ingroup animations
|
||||
*/
|
||||
class AnimationBase : public TrackObject
|
||||
{
|
||||
private:
|
||||
|
@ -27,7 +27,10 @@ class AnimationBase;
|
||||
class Track;
|
||||
class XMLNode;
|
||||
|
||||
/** Controls all animations of a track. */
|
||||
/**
|
||||
* \brief Controls all animations of a track.
|
||||
* \ingroup animations
|
||||
*/
|
||||
class AnimationManager
|
||||
{
|
||||
private:
|
||||
|
@ -27,7 +27,10 @@
|
||||
class Track;
|
||||
class XMLNode;
|
||||
|
||||
/** A 2d billboard animation. */
|
||||
/**
|
||||
* \brief A 2d billboard animation.
|
||||
* \ingroup animations
|
||||
*/
|
||||
class BillboardAnimation : public AnimationBase
|
||||
{
|
||||
private:
|
||||
|
@ -30,7 +30,9 @@ using namespace irr;
|
||||
|
||||
class XMLNode;
|
||||
|
||||
/** A class to manage a single blender IPO curve. */
|
||||
/** \brief A class to manage a single blender IPO curve.
|
||||
* \ingroup animations
|
||||
*/
|
||||
class Ipo
|
||||
{
|
||||
public:
|
||||
|
@ -34,7 +34,9 @@ class BezierCurve;
|
||||
class Track;
|
||||
class XMLNode;
|
||||
|
||||
/** A virtual base class for all animations. */
|
||||
/** \brief A virtual base class for all animations.
|
||||
* \ingroup animations
|
||||
*/
|
||||
class ThreeDAnimation : public AnimationBase
|
||||
{
|
||||
private:
|
||||
|
@ -22,6 +22,10 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
/**
|
||||
* \brief Abstract interface for classes that can handle music playback
|
||||
* \ingroup audio
|
||||
*/
|
||||
class Music
|
||||
{
|
||||
public:
|
||||
|
@ -26,6 +26,12 @@
|
||||
|
||||
class Music;
|
||||
|
||||
/**
|
||||
* \brief Wrapper around an instance of the Music interface
|
||||
* Adds information like composer, song title, etc...
|
||||
* Delegates many calls to the underlying Music instance.
|
||||
* \ingroup audio
|
||||
*/
|
||||
class MusicInformation
|
||||
{
|
||||
private:
|
||||
@ -42,16 +48,17 @@ private:
|
||||
|
||||
float m_gain;
|
||||
float m_adjustedGain;
|
||||
float m_faster_time; // Either time for fading faster
|
||||
// music in, or time to change pitch
|
||||
float m_max_pitch; // maximum pitch for faster music
|
||||
|
||||
/** Either time for fading faster music in, or time to change pitch */
|
||||
float m_faster_time;
|
||||
float m_max_pitch; //!< maximum pitch for faster music
|
||||
static const int LOOP_FOREVER=-1;
|
||||
Music *m_normal_music,
|
||||
*m_fast_music;
|
||||
enum {SOUND_NORMAL, // normal music is played
|
||||
SOUND_FADING, // normal music fading out, faster fading in
|
||||
SOUND_FASTER, // change pitch of normal music
|
||||
SOUND_FAST} // playing faster music or max pitch reached
|
||||
enum {SOUND_NORMAL, //!< normal music is played
|
||||
SOUND_FADING, //!< normal music fading out, faster fading in
|
||||
SOUND_FASTER, //!< change pitch of normal music
|
||||
SOUND_FAST} //!< playing faster music or max pitch reached
|
||||
m_mode;
|
||||
float m_time_since_faster;
|
||||
|
||||
|
@ -30,6 +30,10 @@
|
||||
|
||||
class Vec3;
|
||||
|
||||
/**
|
||||
* \brief Central place to request for musics to be loaded, played, stopped, etc...
|
||||
* \ingroup audio
|
||||
*/
|
||||
class MusicManager
|
||||
{
|
||||
private:
|
||||
|
@ -39,6 +39,10 @@
|
||||
#endif
|
||||
#include "audio/music.hpp"
|
||||
|
||||
/**
|
||||
* \brief ogg files based implementation of the Music interface
|
||||
* \ingroup audio
|
||||
*/
|
||||
class MusicOggStream : public Music
|
||||
{
|
||||
public:
|
||||
|
@ -23,13 +23,20 @@
|
||||
|
||||
#include "audio/sfx_manager.hpp"
|
||||
|
||||
/**
|
||||
* \defgroup audio
|
||||
*/
|
||||
|
||||
class Vec3;
|
||||
|
||||
/** The base class for sound effects. It gets a sound buffer from the sound
|
||||
/**
|
||||
* \brief The base class for sound effects.
|
||||
* It gets a sound buffer from the sound
|
||||
* manager, which is shared between all instances. Do create a new sound
|
||||
* effect object, use sfx_manager->getSFX(...); do not create an instance
|
||||
* with new, since SFXManager makes sure to stop/restart all SFX (esp.
|
||||
* looping sfx like engine sounds) when necessary.
|
||||
* \ingroup audio
|
||||
*/
|
||||
class SFXBase
|
||||
{
|
||||
|
@ -34,9 +34,12 @@
|
||||
class SFXBase;
|
||||
class XMLNode;
|
||||
|
||||
/** Manager of all sound effects. The manager reads all sound effects and
|
||||
/**
|
||||
* \brief Manager of all sound effects.
|
||||
* The manager reads all sound effects and
|
||||
* maintains the corresponding buffers. Each sound effect objects uses
|
||||
* on of the (shared) buffers from the sound manager.
|
||||
* \ingroup audio
|
||||
*/
|
||||
class SFXManager
|
||||
{
|
||||
|
@ -29,6 +29,10 @@
|
||||
#include "audio/sfx_base.hpp"
|
||||
#include "audio/sfx_manager.hpp"
|
||||
|
||||
/**
|
||||
* \brief OpenAL implementation of the abstract SFXBase interface
|
||||
* \ingroup audio
|
||||
*/
|
||||
class SFXOpenAL : public SFXBase
|
||||
{
|
||||
private:
|
||||
|
@ -20,6 +20,11 @@
|
||||
#ifndef HEADER_CHALLENGE_HPP
|
||||
#define HEADER_CHALLENGE_HPP
|
||||
|
||||
/**
|
||||
* \defgroup challenges
|
||||
*/
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <fstream>
|
||||
@ -43,7 +48,10 @@ struct UnlockableFeature
|
||||
const irr::core::stringw getUnlockedMessage() const;
|
||||
};
|
||||
|
||||
// A base class for all challenges
|
||||
/**
|
||||
* \brief A class for all challenges
|
||||
* \ingroup challenges
|
||||
*/
|
||||
class Challenge
|
||||
{
|
||||
private:
|
||||
|
@ -28,6 +28,9 @@
|
||||
#include "challenges/challenge.hpp"
|
||||
#include "race/race_manager.hpp"
|
||||
|
||||
/**
|
||||
* \ingroup challenges
|
||||
*/
|
||||
class ChallengeData : public Challenge
|
||||
{
|
||||
private:
|
||||
|
@ -28,6 +28,10 @@
|
||||
class XMLNode;
|
||||
class SFXBase;
|
||||
|
||||
/**
|
||||
* \brief main class to handle locking/challenges
|
||||
* \ingroup challenges
|
||||
*/
|
||||
class UnlockManager
|
||||
{
|
||||
private:
|
||||
|
@ -8,6 +8,9 @@
|
||||
#include "io/xml_node.hpp"
|
||||
#include <irrString.h>
|
||||
|
||||
/**
|
||||
* \ingroup config
|
||||
*/
|
||||
struct KeyBinding
|
||||
{
|
||||
|
||||
@ -20,13 +23,16 @@ struct KeyBinding
|
||||
|
||||
//==== D E V I C E C O N F I G =================================================
|
||||
|
||||
/**
|
||||
* \brief contains the key bindings information related to one input device
|
||||
* \ingroup config
|
||||
*/
|
||||
class DeviceConfig
|
||||
{
|
||||
private:
|
||||
|
||||
KeyBinding m_bindings[PA_COUNT];
|
||||
bool m_inuse; // Is there a device connected to the system
|
||||
// which uses this config?
|
||||
bool m_inuse; //!< Is there a device connected to the system which uses this config?
|
||||
|
||||
protected:
|
||||
|
||||
@ -49,7 +55,11 @@ public:
|
||||
void setInUse (bool inuse) {m_inuse = inuse;}
|
||||
bool isInUse () {return m_inuse;}
|
||||
|
||||
// Don't call this directly unless you are KeyboardDevice or GamepadDevice
|
||||
/**
|
||||
* Don't call this directly unless you are KeyboardDevice or GamepadDevice
|
||||
* \param[out] action the result, only set if method returned true
|
||||
* \return whether finding an action associated to this input was successful
|
||||
*/
|
||||
bool getAction (Input::InputType type,
|
||||
const int id,
|
||||
const int value,
|
||||
@ -62,24 +72,28 @@ public:
|
||||
|
||||
//==== K E Y B O A R D C O N F I G =============================================
|
||||
|
||||
/**
|
||||
* \brief specialisation of DeviceConfig for keyboard type devices
|
||||
* \ingroup config
|
||||
*/
|
||||
class KeyboardConfig : public DeviceConfig
|
||||
{
|
||||
private:
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
public:
|
||||
|
||||
void setDefaultBinds ();
|
||||
void serialize (std::ofstream& stream);
|
||||
|
||||
// KeyboardConfig (irr::io::IrrXMLReader* xml);
|
||||
KeyboardConfig ();
|
||||
};
|
||||
|
||||
|
||||
//==== G A M E P A D C O N F I G ===============================================
|
||||
|
||||
/**
|
||||
* \brief specialisation of DeviceConfig for gamepad type devices
|
||||
* \ingroup config
|
||||
*/
|
||||
class GamepadConfig : public DeviceConfig
|
||||
{
|
||||
|
||||
|
@ -24,9 +24,10 @@
|
||||
#include "config/user_config.hpp"
|
||||
|
||||
/**
|
||||
* class for managing player profiles (name, control configuration, etc.)
|
||||
* \brief Class for managing player profiles (name, control configuration, etc.)
|
||||
* A list of all possible players is stored as PlayerProfiles in the user config.
|
||||
* A list of currently playing players will be stored somewhere else (FIXME : complete comment)
|
||||
* \ingroup config
|
||||
*/
|
||||
class PlayerProfile
|
||||
{
|
||||
|
@ -20,16 +20,22 @@
|
||||
#ifndef HEADER_STK_CONFIG_HPP
|
||||
#define HEADER_STK_CONFIG_HPP
|
||||
|
||||
/**
|
||||
* \defgroup config
|
||||
*/
|
||||
|
||||
#include "karts/kart_properties.hpp"
|
||||
|
||||
//class Lisp;
|
||||
class XMLNode;
|
||||
class MusicInformation;
|
||||
|
||||
/** Global STK configuration information. Parameters here can be tuned without
|
||||
* recompilation, but the user shouldn't actually modify them. It also
|
||||
* includes the list of default kart physics parameters which are used for
|
||||
* each kart (but which can be overwritten for each kart, too).
|
||||
/**
|
||||
* \brief Global STK configuration information.
|
||||
* Parameters here can be tuned without recompilation, but the user shouldn't actually modify
|
||||
* them. It also includes the list of default kart physics parameters which are used for
|
||||
* each kart (but which can be overwritten for each kart, too).
|
||||
* \ingroup config
|
||||
*/
|
||||
class STKConfig
|
||||
{
|
||||
|
@ -172,6 +172,10 @@ public:
|
||||
#define PARAM_DEFAULT(X)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Contains all parameters that are stored in the user's config file
|
||||
* \ingroup config
|
||||
*/
|
||||
namespace UserConfigParams
|
||||
{
|
||||
|
||||
@ -302,7 +306,10 @@ namespace UserConfigParams
|
||||
#undef PARAM_PREFIX
|
||||
#undef PARAM_SUFFIX
|
||||
|
||||
/** Class for managing general STK user configuration data. */
|
||||
/**
|
||||
* \brief Class for managing general STK user configuration data.
|
||||
* \ingroup config
|
||||
*/
|
||||
class UserConfig
|
||||
{
|
||||
private:
|
||||
|
@ -28,14 +28,18 @@ using namespace irr;
|
||||
|
||||
class Kart;
|
||||
|
||||
/**
|
||||
* \brief Handles the game camera
|
||||
* \ingroup graphics
|
||||
*/
|
||||
class Camera
|
||||
{
|
||||
public:
|
||||
enum Mode {
|
||||
CM_NORMAL, // Normal camera mode
|
||||
CM_CLOSEUP, // Closer to kart
|
||||
CM_REVERSE, // Looking backwards
|
||||
CM_LEADER_MODE, // for deleted player karts in follow the leader
|
||||
CM_NORMAL, //!< Normal camera mode
|
||||
CM_CLOSEUP, //!< Closer to kart
|
||||
CM_REVERSE, //!< Looking backwards
|
||||
CM_LEADER_MODE, //!< for deleted player karts in follow the leader
|
||||
CM_SIMPLE_REPLAY
|
||||
};
|
||||
|
||||
|
@ -26,6 +26,9 @@ using namespace irr;
|
||||
class Vec3;
|
||||
class SFXBase;
|
||||
|
||||
/**
|
||||
* \ingroup graphics
|
||||
*/
|
||||
class Explosion
|
||||
{
|
||||
private:
|
||||
|
@ -20,6 +20,10 @@
|
||||
#ifndef HEADER_IRR_DRIVER_HPP
|
||||
#define HEADER_IRR_DRIVER_HPP
|
||||
|
||||
/**
|
||||
* \defgroup graphics
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -37,6 +41,10 @@ struct VideoMode
|
||||
int width, height;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief class that creates the irrLicht device and offers higher-level ways to manage the 3D scene
|
||||
* \ingroup graphics
|
||||
*/
|
||||
class IrrDriver : public IEventReceiver
|
||||
{
|
||||
private:
|
||||
|
@ -27,6 +27,9 @@ using namespace irr;
|
||||
|
||||
class XMLNode;
|
||||
|
||||
/**
|
||||
* \ingroup graphics
|
||||
*/
|
||||
class Material
|
||||
{
|
||||
public:
|
||||
|
@ -29,6 +29,9 @@ using namespace irr;
|
||||
class Material;
|
||||
class XMLReader;
|
||||
|
||||
/**
|
||||
* \ingroup graphics
|
||||
*/
|
||||
class MaterialManager
|
||||
{
|
||||
private:
|
||||
|
@ -25,6 +25,9 @@ using namespace irr;
|
||||
|
||||
#include "utils/vec3.hpp"
|
||||
|
||||
/**
|
||||
* \ingroup graphics
|
||||
*/
|
||||
namespace MeshTools
|
||||
{
|
||||
void minMax3D(scene::IMesh* mesh, Vec3 *min, Vec3 *max);
|
||||
|
@ -26,6 +26,10 @@ using namespace irr;
|
||||
|
||||
class XMLNode;
|
||||
|
||||
/**
|
||||
* \brief Handles animated textures (textures that move)
|
||||
* \ingroup graphics
|
||||
*/
|
||||
class MovingTexture
|
||||
{
|
||||
private:
|
||||
|
@ -25,10 +25,14 @@ using namespace irr;
|
||||
|
||||
class Kart;
|
||||
|
||||
/**
|
||||
* \brief Handles nitro particle effects
|
||||
* \ingroup graphics
|
||||
*/
|
||||
class Nitro
|
||||
{
|
||||
private:
|
||||
/** The kart to which this smoke belongs. */
|
||||
/** The kart to which this nitro belongs. */
|
||||
Kart *m_kart;
|
||||
/** Irrlicht's particle systems. */
|
||||
scene::IParticleSystemSceneNode *m_node;
|
||||
|
@ -25,9 +25,11 @@
|
||||
#include "irrlicht.h"
|
||||
using namespace irr;
|
||||
|
||||
/** This class is used to enable a shadow for a kart. For now it uses
|
||||
* a simple texture to simulate the shadow, real time shadows will be
|
||||
* added later.
|
||||
/**
|
||||
* \brief This class is used to enable a shadow for a kart.
|
||||
* For now it uses a simple texture to simulate the shadow, real time shadows might
|
||||
* be added later.
|
||||
* \ingroup graphics
|
||||
*/
|
||||
class Shadow
|
||||
{
|
||||
|
@ -29,7 +29,9 @@ using namespace irr;
|
||||
|
||||
class Kart;
|
||||
|
||||
/** This class is responsible for drawing skid marks for a kart. */
|
||||
/** \brief This class is responsible for drawing skid marks for a kart.
|
||||
* \ingroup graphics
|
||||
*/
|
||||
class SkidMarks
|
||||
{
|
||||
private:
|
||||
|
@ -26,6 +26,9 @@ using namespace irr;
|
||||
#include "graphics/moving_texture.hpp"
|
||||
class Kart;
|
||||
|
||||
/**
|
||||
* \ingroup graphics
|
||||
*/
|
||||
class SlipStream : public MovingTexture
|
||||
{
|
||||
private:
|
||||
|
@ -25,6 +25,10 @@ using namespace irr;
|
||||
|
||||
class Kart;
|
||||
|
||||
/**
|
||||
* \brief manages smoke particle effects
|
||||
* \ingroup graphics
|
||||
*/
|
||||
class Smoke
|
||||
{
|
||||
private:
|
||||
|
@ -23,7 +23,8 @@
|
||||
using namespace irr;
|
||||
|
||||
/**
|
||||
* This class is used to display rotating stars around a kart's head.
|
||||
* \brief This class is used to display rotating stars around a kart's head.
|
||||
* \ingroup graphics
|
||||
*/
|
||||
class Stars
|
||||
{
|
||||
|
@ -25,6 +25,10 @@ using namespace irr;
|
||||
|
||||
class Kart;
|
||||
|
||||
/**
|
||||
* \brief Handles a water-splash particle effect
|
||||
* \ingroup graphics
|
||||
*/
|
||||
class WaterSplash
|
||||
{
|
||||
private:
|
||||
|
@ -4,11 +4,17 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
/**
|
||||
* \ingroup guiengine
|
||||
*/
|
||||
namespace GUIEngine
|
||||
{
|
||||
class Widget;
|
||||
class Screen;
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup guiengine
|
||||
*/
|
||||
enum GameState
|
||||
{
|
||||
MENU,
|
||||
@ -16,60 +22,61 @@ namespace GUIEngine
|
||||
INGAME_MENU
|
||||
};
|
||||
|
||||
/**
|
||||
* Abstract base class you must override from to use the GUI engine
|
||||
*/
|
||||
class AbstractStateManager
|
||||
{
|
||||
protected:
|
||||
/**
|
||||
* Whether we are in game mode
|
||||
*/
|
||||
GameState m_game_mode;
|
||||
|
||||
/**
|
||||
* This stack will contain menu names (e.g. main.stkgui), and/or 'race'.
|
||||
* \brief Abstract base class you must override from to use the GUI engine
|
||||
* \ingroup guiengine
|
||||
*/
|
||||
std::vector<std::string> m_menu_stack;
|
||||
class AbstractStateManager
|
||||
{
|
||||
protected:
|
||||
/**
|
||||
* Whether we are in game mode
|
||||
*/
|
||||
GameState m_game_mode;
|
||||
|
||||
/**
|
||||
* This stack will contain menu names (e.g. main.stkgui), and/or 'race'.
|
||||
*/
|
||||
std::vector<std::string> m_menu_stack;
|
||||
|
||||
void pushMenu(std::string name);
|
||||
|
||||
void setGameState(GameState state);
|
||||
|
||||
public:
|
||||
AbstractStateManager();
|
||||
virtual ~AbstractStateManager() { }
|
||||
|
||||
void pushScreen(Screen* screen);
|
||||
|
||||
void replaceTopMostScreen(Screen* screen);
|
||||
void popMenu();
|
||||
void resetAndGoToScreen(Screen* screen);
|
||||
|
||||
/**
|
||||
* Sets the whole menu stack. Only the topmost screen will be inited/shown, but others remain
|
||||
* under for cases where the user wants to go back.
|
||||
* @param screens an array containing the menus that should go into stack. The first item will be
|
||||
* the bottom item in the stack, the last item will be the stack top. Array must be
|
||||
* NULL-terminated.
|
||||
*/
|
||||
void resetAndSetStack(Screen* screens[]);
|
||||
void enterGameState();
|
||||
|
||||
GameState getGameState();
|
||||
|
||||
void reshowTopMostMenu();
|
||||
|
||||
/* ***********************************
|
||||
* methods to override in children *
|
||||
*********************************** */
|
||||
|
||||
/**
|
||||
* callback called whenever escape was pressed (or any similar cancel operation)
|
||||
*/
|
||||
virtual void escapePressed() = 0;
|
||||
|
||||
};
|
||||
|
||||
void pushMenu(std::string name);
|
||||
|
||||
void setGameState(GameState state);
|
||||
|
||||
public:
|
||||
AbstractStateManager();
|
||||
virtual ~AbstractStateManager() { }
|
||||
|
||||
void pushScreen(Screen* screen);
|
||||
|
||||
void replaceTopMostScreen(Screen* screen);
|
||||
void popMenu();
|
||||
void resetAndGoToScreen(Screen* screen);
|
||||
|
||||
/**
|
||||
* Sets the whole menu stack. Only the topmost screen will be inited/shown, but others remain
|
||||
* under for cases where the user wants to go back.
|
||||
* @param screens an array containing the menus that should go into stack. The first item will be
|
||||
* the bottom item in the stack, the last item will be the stack top. Array must be
|
||||
* NULL-terminated.
|
||||
*/
|
||||
void resetAndSetStack(Screen* screens[]);
|
||||
void enterGameState();
|
||||
|
||||
GameState getGameState();
|
||||
|
||||
void reshowTopMostMenu();
|
||||
|
||||
/* ***********************************
|
||||
* methods to override in children *
|
||||
*********************************** */
|
||||
|
||||
/**
|
||||
* callback called whenever escape was pressed (or any similar cancel operation)
|
||||
*/
|
||||
virtual void escapePressed() = 0;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
|
@ -19,6 +19,11 @@
|
||||
#ifndef HEADER_ENGINE_HPP
|
||||
#define HEADER_ENGINE_HPP
|
||||
|
||||
/**
|
||||
* \defgroup guiengine
|
||||
*/
|
||||
|
||||
|
||||
#include <irrlicht.h>
|
||||
#include <string>
|
||||
|
||||
@ -26,6 +31,10 @@
|
||||
#include "guiengine/widgets.hpp"
|
||||
#include "utils/ptr_vector.hpp"
|
||||
|
||||
/**
|
||||
* \ingroup guiengine
|
||||
* \brief Contains all GUI engine related classes
|
||||
*/
|
||||
namespace GUIEngine
|
||||
{
|
||||
class Screen;
|
||||
|
@ -21,9 +21,15 @@
|
||||
#include "irrlicht.h"
|
||||
#include "input/input.hpp"
|
||||
|
||||
/**
|
||||
* \ingroup guiengine
|
||||
*/
|
||||
namespace GUIEngine
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup guiengine
|
||||
*/
|
||||
enum EventPropagation
|
||||
{
|
||||
EVENT_BLOCK,
|
||||
@ -32,43 +38,46 @@ namespace GUIEngine
|
||||
|
||||
class Widget;
|
||||
|
||||
/**
|
||||
* Class to handle irrLicht events (GUI and input as well : input events will be redirected to the input
|
||||
* module in game mode). In menu mode, input is mapped to game actions with the help of the input
|
||||
* module, then calls are made to move focus / trigger an event / etc.
|
||||
*
|
||||
* This is really only the irrLicht events bit, not to be confused with my own simple events dispatched
|
||||
* mainly through AbstractStateManager, and also to widgets (this class is some kind of bridge between
|
||||
* the base irrLicht GUI engine and the STK layer on top of it)
|
||||
*/
|
||||
class EventHandler : public irr::IEventReceiver
|
||||
{
|
||||
EventPropagation onGUIEvent(const irr::SEvent& event);
|
||||
EventPropagation onWidgetActivated(Widget* w, const int playerID);
|
||||
void navigateUp(const int playerID, Input::InputType type, const bool pressedDown);
|
||||
void navigateDown(const int playerID, Input::InputType type, const bool pressedDown);
|
||||
|
||||
public:
|
||||
EventHandler();
|
||||
~EventHandler();
|
||||
|
||||
/**
|
||||
* All irrLicht events will go through this (input as well GUI; input events are
|
||||
* immediately delegated to the input module, GUI events are processed here)
|
||||
*/
|
||||
bool OnEvent (const irr::SEvent &event);
|
||||
* \brief Class to handle irrLicht events (GUI and input as well)
|
||||
* input events will be redirected to the input module in game mode.
|
||||
* In menu mode, input is mapped to game actions with the help of the input
|
||||
* module, then calls are made to move focus / trigger an event / etc.
|
||||
*
|
||||
* This is really only the irrLicht events bit, not to be confused with my own simple events dispatched
|
||||
* mainly through AbstractStateManager, and also to widgets (this class is some kind of bridge between
|
||||
* the base irrLicht GUI engine and the STK layer on top of it)
|
||||
*
|
||||
* \ingroup guiengine
|
||||
*/
|
||||
class EventHandler : public irr::IEventReceiver
|
||||
{
|
||||
EventPropagation onGUIEvent(const irr::SEvent& event);
|
||||
EventPropagation onWidgetActivated(Widget* w, const int playerID);
|
||||
void navigateUp(const int playerID, Input::InputType type, const bool pressedDown);
|
||||
void navigateDown(const int playerID, Input::InputType type, const bool pressedDown);
|
||||
|
||||
public:
|
||||
EventHandler();
|
||||
~EventHandler();
|
||||
|
||||
/**
|
||||
* All irrLicht events will go through this (input as well GUI; input events are
|
||||
* immediately delegated to the input module, GUI events are processed here)
|
||||
*/
|
||||
bool OnEvent (const irr::SEvent &event);
|
||||
|
||||
/**
|
||||
* When the input module is done processing an input and mapped it to an action,
|
||||
* and this action needs to be applied to the GUI (e.g. fire pressed, left
|
||||
* pressed, etc.) this method is called back by the input module.
|
||||
*/
|
||||
void processAction(const int action, const unsigned int value, Input::InputType type, const int playerID);
|
||||
|
||||
/** singleton access */
|
||||
static EventHandler* get();
|
||||
};
|
||||
|
||||
/**
|
||||
* When the input module is done processing an input and mapped it to an action,
|
||||
* and this action needs to be applied to the GUI (e.g. fire pressed, left
|
||||
* pressed, etc.) this method is called back by the input module.
|
||||
*/
|
||||
void processAction(const int action, const unsigned int value, Input::InputType type, const int playerID);
|
||||
|
||||
// singleton
|
||||
static EventHandler* get();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -25,62 +25,66 @@
|
||||
|
||||
class PlayerProfile;
|
||||
|
||||
/**
|
||||
* \ingroup guiengine
|
||||
*/
|
||||
namespace GUIEngine
|
||||
{
|
||||
class Widget;
|
||||
class TextBoxWidget;
|
||||
class ButtonWidget;
|
||||
|
||||
/**
|
||||
* Base class, derive your own.
|
||||
* Only once instance at a time (if you create a 2nd the first will be destroyed).
|
||||
* You can call static function 'dismiss' to simply close current dialog (so you don't
|
||||
* need to keep track of instances yourself)
|
||||
*/
|
||||
class ModalDialog : public SkinWidgetContainer
|
||||
{
|
||||
protected:
|
||||
irr::gui::IGUIWindow* m_irrlicht_window;
|
||||
irr::core::rect< irr::s32 > m_area;
|
||||
|
||||
/**
|
||||
* Creates a modal dialog with given percentage of screen width and height
|
||||
* \brief Abstract base class representing a modal dialog.
|
||||
* Only once instance at a time (if you create a 2nd the first will be destroyed).
|
||||
* You can call static function 'dismiss' to simply close current dialog (so you don't
|
||||
* need to keep track of instances yourself)
|
||||
* \ingroup guiengine
|
||||
*/
|
||||
ModalDialog(const float percentWidth, const float percentHeight);
|
||||
|
||||
virtual void onEnterPressedInternal();
|
||||
void clearWindow();
|
||||
|
||||
public:
|
||||
ptr_vector<Widget> m_children;
|
||||
|
||||
virtual ~ModalDialog();
|
||||
|
||||
/** Returns whether to block event propagation (usually, you will want to block events you processed) */
|
||||
virtual EventPropagation processEvent(const std::string& eventSource){ return EVENT_LET; }
|
||||
|
||||
bool isMyChild(Widget* widget) const { return m_children.contains(widget); }
|
||||
bool isMyChild(irr::gui::IGUIElement* widget) const { return m_irrlicht_window->isMyChild(widget); }
|
||||
|
||||
Widget* getFirstWidget();
|
||||
Widget* getLastWidget();
|
||||
|
||||
irr::gui::IGUIWindow* getIrrlichtElement()
|
||||
class ModalDialog : public SkinWidgetContainer
|
||||
{
|
||||
return m_irrlicht_window;
|
||||
}
|
||||
|
||||
static void dismiss();
|
||||
static void onEnterPressed();
|
||||
static ModalDialog* getCurrent();
|
||||
static bool isADialogActive();
|
||||
|
||||
/** Override to change what happens on escape pressed */
|
||||
virtual void escapePressed() { dismiss(); }
|
||||
|
||||
/** Override to be notified of updates */
|
||||
virtual void onUpdate(float dt) { }
|
||||
};
|
||||
protected:
|
||||
irr::gui::IGUIWindow* m_irrlicht_window;
|
||||
irr::core::rect< irr::s32 > m_area;
|
||||
|
||||
/**
|
||||
* Creates a modal dialog with given percentage of screen width and height
|
||||
*/
|
||||
ModalDialog(const float percentWidth, const float percentHeight);
|
||||
|
||||
virtual void onEnterPressedInternal();
|
||||
void clearWindow();
|
||||
|
||||
public:
|
||||
ptr_vector<Widget> m_children;
|
||||
|
||||
virtual ~ModalDialog();
|
||||
|
||||
/** Returns whether to block event propagation (usually, you will want to block events you processed) */
|
||||
virtual EventPropagation processEvent(const std::string& eventSource){ return EVENT_LET; }
|
||||
|
||||
bool isMyChild(Widget* widget) const { return m_children.contains(widget); }
|
||||
bool isMyChild(irr::gui::IGUIElement* widget) const { return m_irrlicht_window->isMyChild(widget); }
|
||||
|
||||
Widget* getFirstWidget();
|
||||
Widget* getLastWidget();
|
||||
|
||||
irr::gui::IGUIWindow* getIrrlichtElement()
|
||||
{
|
||||
return m_irrlicht_window;
|
||||
}
|
||||
|
||||
static void dismiss();
|
||||
static void onEnterPressed();
|
||||
static ModalDialog* getCurrent();
|
||||
static bool isADialogActive();
|
||||
|
||||
/** Override to change what happens on escape pressed */
|
||||
virtual void escapePressed() { dismiss(); }
|
||||
|
||||
/** Override to be notified of updates */
|
||||
virtual void onUpdate(float dt) { }
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
|
@ -30,22 +30,27 @@
|
||||
#include "input/input.hpp"
|
||||
#include "utils/ptr_vector.hpp"
|
||||
|
||||
/**
|
||||
* \ingroup guiengine
|
||||
*/
|
||||
namespace GUIEngine
|
||||
{
|
||||
#define DEFINE_SCREEN_SINGLETON( ClassName ) template<> ClassName* GUIEngine::ScreenSingleton< ClassName >::singleton = NULL
|
||||
|
||||
|
||||
/**
|
||||
* Declares a class to be a singleton. Normally, all screens will be singletons.
|
||||
* Note that you need to use the 'DEFINE_SCREEN_SINGLETON' macro in a .cpp file to
|
||||
* actually define the instance (as this can't be done in a .h)
|
||||
*/
|
||||
* \brief Declares a class to be a singleton.
|
||||
* Normally, all screens will be singletons.
|
||||
* Note that you need to use the 'DEFINE_SCREEN_SINGLETON' macro in a .cpp file to
|
||||
* actually define the instance (as this can't be done in a .h)
|
||||
* \ingroup guiengine
|
||||
*/
|
||||
template<typename SCREEN>
|
||||
class ScreenSingleton
|
||||
{
|
||||
static SCREEN* singleton;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
~ScreenSingleton()
|
||||
{
|
||||
singleton = NULL;
|
||||
@ -64,14 +69,20 @@ namespace GUIEngine
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* \ingroup guiengine
|
||||
*/
|
||||
void parseScreenFileDiv(irr::io::IrrXMLReader* xml, ptr_vector<Widget>& append_to);
|
||||
|
||||
/**
|
||||
* Represents a single screen. Mainly responsible of its children widgets; Screen lays them
|
||||
* out, asks them to add themselves, asks them to remove themselves, etc.
|
||||
*
|
||||
* Also initiates the read of GUI files, even though most of that work is done in "screen_loader.cpp"
|
||||
*/
|
||||
* \brief Represents a single GUI screen.
|
||||
* Mainly responsible of its children widgets; Screen lays them
|
||||
* out, asks them to add themselves, asks them to remove themselves, etc.
|
||||
*
|
||||
* Also initiates the read of GUI files, even though most of that work is done in "screen_loader.cpp"
|
||||
*
|
||||
* \ingroup guiengine
|
||||
*/
|
||||
class Screen
|
||||
{
|
||||
friend class Skin;
|
||||
@ -79,7 +90,7 @@ namespace GUIEngine
|
||||
bool m_loaded;
|
||||
std::string m_filename;
|
||||
void loadFromFile();
|
||||
|
||||
|
||||
static void addWidgetsRecursively(ptr_vector<Widget>& widgets, Widget* parent=NULL);
|
||||
void calculateLayout(ptr_vector<Widget>& widgets, Widget* parent=NULL);
|
||||
|
||||
@ -92,17 +103,17 @@ namespace GUIEngine
|
||||
bool throttleFPS;
|
||||
|
||||
ptr_vector<Widget, HOLD> m_widgets;
|
||||
|
||||
|
||||
// current mouse position, read-only...
|
||||
int m_mouse_x, m_mouse_y;
|
||||
|
||||
/** this variable is not used by the Screen object itself; it's the routines creating
|
||||
* screens that may use it to perform some operations only once. initialized to false.
|
||||
*/
|
||||
* screens that may use it to perform some operations only once. initialized to false.
|
||||
*/
|
||||
bool m_inited;
|
||||
|
||||
/** Next time this menu needs to be shown, don't use cached values, re-calculate everything.
|
||||
(useful e.g. on reschange, when sizes have changed and must be re-calculated) */
|
||||
(useful e.g. on reschange, when sizes have changed and must be re-calculated) */
|
||||
virtual void forgetWhatWasLoaded();
|
||||
|
||||
Screen(); /**< creates a dummy incomplete object; only use to override behaviour in sub-class */
|
||||
@ -122,7 +133,7 @@ namespace GUIEngine
|
||||
if (out != NULL && outCasted == NULL)
|
||||
{
|
||||
fprintf(stderr, "Screen::getWidget : Widget '%s' of type '%s' cannot be casted to "
|
||||
"requested type '%s'!\n", name, typeid(*out).name(), typeid(T).name());
|
||||
"requested type '%s'!\n", name, typeid(*out).name(), typeid(T).name());
|
||||
}
|
||||
return outCasted;
|
||||
}
|
||||
@ -135,10 +146,10 @@ namespace GUIEngine
|
||||
|
||||
virtual void addWidgets();
|
||||
virtual void calculateLayout();
|
||||
|
||||
|
||||
void manualAddWidget(Widget* w);
|
||||
void manualRemoveWidget(Widget* w);
|
||||
|
||||
|
||||
const std::string& getName() const { return m_filename; }
|
||||
|
||||
void elementsWereDeleted(ptr_vector<Widget>* within_vector = NULL);
|
||||
@ -151,7 +162,7 @@ namespace GUIEngine
|
||||
virtual void tearDown() = 0;
|
||||
|
||||
/** Called when escape is pressed.
|
||||
* @return true if the screen should be closed, false if you handled the press another way */
|
||||
* @return true if the screen should be closed, false if you handled the press another way */
|
||||
virtual bool onEscapePressed() { return true; }
|
||||
|
||||
/**
|
||||
|
@ -23,42 +23,54 @@
|
||||
#include "utils/ptr_vector.hpp"
|
||||
|
||||
/**
|
||||
Here lies the skin handling. It loads images and their sizing from a XML file.
|
||||
Since the irrLicht way of handling skin is quite "boxy" and results in games
|
||||
\page skin Overview of GUI skin
|
||||
|
||||
The GUIEngine::Skin is the one handling skinning. It loads images and their sizing from a XML
|
||||
file. Since the irrLicht way of handling skin is quite "boxy" and results in games
|
||||
looking like Window 95, this class overrides it very much; in pretty much all
|
||||
callbacks, rather drawing plainly what irrLicht asks it to draw, it first
|
||||
checks which widget we're asked to render and redirects the call to a more
|
||||
specific method.
|
||||
|
||||
Furthermore, since irrLicht widgets were quite basic, a few widgets were created
|
||||
by combining several irrLicht widgets (e.g. 2 buttons and a label in a box make
|
||||
a spinner). Because of this, some jumping through hoops is performed (we get a
|
||||
callback for each of these sub-widgets, but want to draw the whole thing as a single
|
||||
block)
|
||||
|
||||
= Rendering =
|
||||
There are two types of images : some will be simply stretched as a whole, others will
|
||||
have non-stretchable borders (you cannot choose which one you must use, it's hardcoded
|
||||
for each element type; though, as you will see below, for all "advanced stretching" images
|
||||
you can easily fake "simple stretch")
|
||||
|
||||
\section Describing a skin in a XML file
|
||||
|
||||
All elements will have at least 2 properties :
|
||||
type="X" sets what you're skinning with this entry
|
||||
image="skinDirectory/imageName.png" sets which image is used for this element
|
||||
\li \c type="X" : sets what you're skinning with this entry
|
||||
\li \c image="skinDirectory/imageName.png" : sets which image is used for this element
|
||||
|
||||
For more information, I highly recommend simply looking at existing skins, they will show
|
||||
the format of the XML file describing a skin quite well.
|
||||
|
||||
\section states Widget States
|
||||
|
||||
Most elements also support states :
|
||||
state="neutral"
|
||||
state="focused"
|
||||
state="down"
|
||||
\li \c state="neutral"
|
||||
\li \c state="focused"
|
||||
\li \c state="down"
|
||||
|
||||
You can thus give different looks for different states. Not all widgets support all states,
|
||||
see entries and comments below to know what's supported.
|
||||
Note that checkboxes are an exception and have the following styles :
|
||||
"neutral+unchecked"
|
||||
"neutral+checked"
|
||||
"focused+unchecked"
|
||||
"focused+checked"
|
||||
\li \lc "neutral+unchecked"
|
||||
\li \lc "neutral+checked"
|
||||
\li \lc "focused+unchecked"
|
||||
\li \lc "focused+checked"
|
||||
|
||||
\section stretch Advanced stretching
|
||||
"Advanced stretching" images are split this way :
|
||||
|
||||
\code
|
||||
+----+--------------------+----+
|
||||
| | | |
|
||||
+----+--------------------+----+
|
||||
@ -68,6 +80,7 @@
|
||||
+----+--------------------+----+
|
||||
| | | |
|
||||
+----+--------------------+----+
|
||||
\endcode
|
||||
|
||||
The center border will be stretched in all directions. The 4 corners will not stretch at all.
|
||||
Horizontal borders will stretch horizontally, verticallt borders will stretch vertically.
|
||||
@ -85,18 +98,23 @@
|
||||
area (this might include stuff like shadows, etc.). The 'h' one is for horizontal borders,
|
||||
the 'v' one is for vertical borders.
|
||||
|
||||
Finnally : the image is split, as shown above, into 9 areas. In osme cases, you may not want
|
||||
Finnally : the image is split, as shown above, into 9 areas. In some cases, you may not want
|
||||
all areas to be rendered. Then you can pass parameter areas="body+left+right+top+bottom"
|
||||
and explicitely specify which parts you want to see. The 4 corner areas are only visible
|
||||
when the border that intersect at this corner are enabled.
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
* \ingroup guiengine
|
||||
*/
|
||||
namespace GUIEngine
|
||||
{
|
||||
|
||||
/**
|
||||
* In order to avoid calculating render information every frame, it's stored in a
|
||||
* SkinWidgetContainer for each widget (or each widget part if it requires many)
|
||||
* \ingroup guiengine
|
||||
*/
|
||||
class SkinWidgetContainer
|
||||
{
|
||||
@ -152,7 +170,10 @@ namespace GUIEngine
|
||||
|
||||
class Widget;
|
||||
|
||||
/** class containing render params for the 'drawBoxFromStretchableTexture' function */
|
||||
/**
|
||||
* \brief class containing render params for the 'drawBoxFromStretchableTexture' function
|
||||
* \ingroup guiengine
|
||||
*/
|
||||
class BoxRenderParams
|
||||
{
|
||||
irr::video::ITexture* image;
|
||||
@ -208,6 +229,10 @@ namespace GUIEngine
|
||||
void calculateYFlipIfNeeded();
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Object used to render the GUI widgets
|
||||
* \ingroup guiengine
|
||||
*/
|
||||
class Skin : public irr::gui::IGUISkin
|
||||
{
|
||||
irr::gui::IGUISkin* m_fallback_skin;
|
||||
|
@ -88,8 +88,9 @@ namespace GUIEngine
|
||||
void setWithinATextBox(bool in);
|
||||
|
||||
/**
|
||||
* The nearly-abstract base of all widgets (not fully abstract since a bare Widget
|
||||
* can be created for the sore goal of containing children widgets in a group)
|
||||
* \brief The nearly-abstract base of all widgets
|
||||
* (not fully abstract since a bare Widget can be created for the sore goal of containing
|
||||
* children widgets in a group)
|
||||
*
|
||||
* Provides basic common functionnality, as well as providing a few callbacks
|
||||
* for children to override if they need to do something special on event.
|
||||
@ -98,6 +99,8 @@ namespace GUIEngine
|
||||
* and also optionally one or many children.
|
||||
*
|
||||
* Each widget also has a set of properties stored in a map (see enum above)
|
||||
*
|
||||
* \ingroup guiengine
|
||||
*/
|
||||
class Widget : public SkinWidgetContainer
|
||||
{
|
||||
|
@ -20,6 +20,10 @@
|
||||
#ifndef HEADER_BUTTON_HPP
|
||||
#define HEADER_BUTTON_HPP
|
||||
|
||||
/**
|
||||
* \defgroup widgets Guiengine/Widgets
|
||||
*/
|
||||
|
||||
#include <irrlicht.h>
|
||||
|
||||
#include "guiengine/widget.hpp"
|
||||
@ -27,7 +31,10 @@
|
||||
|
||||
namespace GUIEngine
|
||||
{
|
||||
/** A text button widget. See guiengine/engine.hpp for a detailed overview */
|
||||
/**
|
||||
* \brief A text button widget.
|
||||
* \ingroup widgets
|
||||
*/
|
||||
class ButtonWidget : public Widget
|
||||
{
|
||||
/** When inferring widget size from its label length, this method will be called to
|
||||
|
@ -27,7 +27,10 @@
|
||||
|
||||
namespace GUIEngine
|
||||
{
|
||||
/** A checkbox widget. See guiengine/engine.hpp for a detailed overview */
|
||||
/**
|
||||
* \brief A checkbox widget.
|
||||
* \ingroup widgets
|
||||
*/
|
||||
class CheckBoxWidget : public Widget
|
||||
{
|
||||
bool m_state;
|
||||
|
@ -57,8 +57,12 @@ namespace GUIEngine
|
||||
unsigned int m_badges;
|
||||
};
|
||||
|
||||
/** A dynamic ribbon (builds upon RibbonWidget, adding dynamic contents creation and sizing, scrolling, multiple-row
|
||||
layouts). See guiengine/engine.hpp for a detailed overview */
|
||||
/**
|
||||
* \brief An extended version of RibbonWidget, with more capabilities.
|
||||
* A dynamic ribbon builds upon RibbonWidget, adding dynamic contents creation and sizing,
|
||||
* scrolling, multiple-row layouts.
|
||||
* \ingroup widgets
|
||||
*/
|
||||
class DynamicRibbonWidget : public Widget, public RibbonWidget::IRibbonListener
|
||||
{
|
||||
friend class RibbonWidget;
|
||||
|
@ -27,8 +27,9 @@
|
||||
|
||||
namespace GUIEngine
|
||||
{
|
||||
/** A button widget with an icon and optionnaly a label beneath (from its properties in base class Widget)
|
||||
See guiengine/engine.hpp for a detailed overview */
|
||||
/** \brief A button widget with an icon and optionnaly a label beneath
|
||||
* \ingroup widgets
|
||||
*/
|
||||
class IconButtonWidget : public Widget
|
||||
{
|
||||
public:
|
||||
|
@ -27,7 +27,9 @@
|
||||
|
||||
namespace GUIEngine
|
||||
{
|
||||
/** A simple label widget. See guiengine/engine.hpp for a detailed overview. */
|
||||
/** \brief A simple label widget.
|
||||
* \ingroup widgets
|
||||
*/
|
||||
class LabelWidget : public Widget
|
||||
{
|
||||
bool m_has_color;
|
||||
|
@ -27,7 +27,9 @@
|
||||
|
||||
namespace GUIEngine
|
||||
{
|
||||
/** A vertical list widget with text entries. See guiengine/engine.hpp for a detailed overview */
|
||||
/** \brief A vertical list widget with text entries
|
||||
* \ingroup widgets
|
||||
*/
|
||||
class ListWidget : public Widget
|
||||
{
|
||||
bool m_use_icons;
|
||||
|
@ -28,7 +28,9 @@
|
||||
|
||||
namespace GUIEngine
|
||||
{
|
||||
/** A model view widget. See guiengine/engine.hpp for a detailed overview */
|
||||
/** \brief A model view widget.
|
||||
* \ingroup widgets
|
||||
*/
|
||||
class ModelViewWidget : public IconButtonWidget
|
||||
{
|
||||
enum RotationMode
|
||||
|
@ -35,8 +35,10 @@ namespace GUIEngine
|
||||
RIBBON_TABS /* a tab bar */
|
||||
};
|
||||
|
||||
/** A static text/icons/tabs bar widget. The contents of this ribbon are static.
|
||||
See guiengine/engine.hpp for a detailed overview */
|
||||
/** \brief A static text/icons/tabs bar widget.
|
||||
* The contents of this ribbon are static.
|
||||
* \ingroup widgets
|
||||
*/
|
||||
class RibbonWidget : public Widget
|
||||
{
|
||||
public:
|
||||
|
@ -27,7 +27,9 @@
|
||||
|
||||
namespace GUIEngine
|
||||
{
|
||||
/** A spinner or gauge widget (to select numbers / percentages). See guiengine/engine.hpp for a detailed overview */
|
||||
/** \brief A spinner or gauge widget (to select numbers / percentages).
|
||||
* \ingroup widgets
|
||||
*/
|
||||
class SpinnerWidget : public Widget
|
||||
{
|
||||
int m_value, m_min, m_max;
|
||||
|
@ -27,7 +27,9 @@
|
||||
|
||||
namespace GUIEngine
|
||||
{
|
||||
/** A text field widget. See guiengine/engine.hpp for a detailed overview */
|
||||
/** \brief A text field widget.
|
||||
* \ingroup widgets
|
||||
*/
|
||||
class TextBoxWidget : public Widget
|
||||
{
|
||||
/** When inferring widget size from its label length, this method will be called to
|
||||
|
@ -13,16 +13,19 @@ enum PlayerAssignMode
|
||||
};
|
||||
|
||||
/**
|
||||
* This class holds the list of all known devices (ands their configurations), as well as the list
|
||||
* of currently plugged (used) devices. It thus takes care of finding to which device any given
|
||||
* input belongs, and what action each keypress is bound to, if any (and, since each device is associated
|
||||
* to a player, it also finds which player triggered this action)
|
||||
* \brief This class holds the list of all known devices (ands their configurations), as well as the
|
||||
* list of currently plugged (used) devices.
|
||||
* It thus takes care of finding to which device any given
|
||||
* input belongs, and what action each keypress is bound to, if any (and, since each device is
|
||||
* associated to a player, it also finds which player triggered this action)
|
||||
* These input mapping capabilities should *only* be used through the InputManager, not directly.
|
||||
*
|
||||
* The device manager starts in "no-assign" mode, which means no input configuration is associated
|
||||
* to any player. So all devices will react. This is used in menus before player set-up is done.
|
||||
* Switching back to no-assign mode will also clear anything in devices that was associated with
|
||||
* players in assign mode.
|
||||
*
|
||||
* \ingroup input
|
||||
*/
|
||||
class DeviceManager
|
||||
{
|
||||
|
@ -20,6 +20,8 @@
|
||||
#ifndef HEADER_INPUT_HPP
|
||||
#define HEADER_INPUT_HPP
|
||||
|
||||
/** \defgroup input */
|
||||
|
||||
#include <string>
|
||||
#include <irrString.h>
|
||||
|
||||
@ -28,17 +30,22 @@ const int DEADZONE_MOUSE_SENSE = 200;
|
||||
const int DEADZONE_JOYSTICK = 2000;
|
||||
const int MULTIPLIER_MOUSE = 750;
|
||||
|
||||
/**
|
||||
* \ingroup input
|
||||
*/
|
||||
struct Input
|
||||
{
|
||||
static const int MAX_VALUE = 32768;
|
||||
|
||||
enum AxisDirection {
|
||||
enum AxisDirection
|
||||
{
|
||||
AD_NEGATIVE,
|
||||
AD_POSITIVE,
|
||||
AD_NEUTRAL
|
||||
};
|
||||
|
||||
enum InputType {
|
||||
enum InputType
|
||||
{
|
||||
IT_NONE = 0,
|
||||
IT_KEYBOARD,
|
||||
IT_STICKMOTION,
|
||||
@ -93,6 +100,10 @@ struct Input
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief types of input events / what actions the players can do
|
||||
* \ingroup input
|
||||
*/
|
||||
enum PlayerAction
|
||||
{
|
||||
PA_FIRST = -1,
|
||||
@ -110,6 +121,10 @@ enum PlayerAction
|
||||
PA_COUNT
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief human-readable strings for each PlayerAction
|
||||
* \ingroup input
|
||||
*/
|
||||
static std::string KartActionStrings[PA_COUNT] = {std::string("left"),
|
||||
std::string("right"),
|
||||
std::string("accel"),
|
||||
|
@ -10,12 +10,20 @@
|
||||
#include "io/xml_node.hpp"
|
||||
#include "states_screens/state_manager.hpp"
|
||||
|
||||
/**
|
||||
* \brief Input device type
|
||||
* \ingroup input
|
||||
*/
|
||||
enum DeviceType
|
||||
{
|
||||
DT_KEYBOARD,
|
||||
DT_GAMEPAD
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief base class for input devices
|
||||
* \ingroup input
|
||||
*/
|
||||
class InputDevice
|
||||
{
|
||||
friend class DeviceManager;
|
||||
@ -35,12 +43,12 @@ public:
|
||||
|
||||
void setPlayer(StateManager::ActivePlayer* owner);
|
||||
StateManager::ActivePlayer *getPlayer() { return m_player; }
|
||||
|
||||
/**
|
||||
* returns a human-readable string for the key binded with the given action
|
||||
*/
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief specialisation of InputDevice for keyboard type devices
|
||||
* \ingroup input
|
||||
*/
|
||||
class KeyboardDevice : public InputDevice
|
||||
{
|
||||
public:
|
||||
@ -59,6 +67,10 @@ public:
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief specialisation of Inputdevice for gamepad type devices
|
||||
* \ingroup input
|
||||
*/
|
||||
class GamePadDevice : public InputDevice
|
||||
{
|
||||
void resetAxisDirection(const int axis, Input::AxisDirection direction, StateManager::ActivePlayer* player);
|
||||
|
@ -30,12 +30,15 @@
|
||||
|
||||
class DeviceManager;
|
||||
|
||||
/** Class to handle input.
|
||||
*/
|
||||
/**
|
||||
* \brief Class to handle input.
|
||||
* \ingroup input
|
||||
*/
|
||||
class InputManager
|
||||
{
|
||||
public:
|
||||
enum InputDriverMode {
|
||||
enum InputDriverMode
|
||||
{
|
||||
MENU = 0,
|
||||
INGAME,
|
||||
INPUT_SENSE_KEYBOARD,
|
||||
|
@ -20,6 +20,10 @@
|
||||
#ifndef HEADER_FILE_MANAGER_HPP
|
||||
#define HEADER_FILE_MANAGER_HPP
|
||||
|
||||
/**
|
||||
* \defgroup io
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
@ -29,6 +33,10 @@ using namespace irr;
|
||||
|
||||
#include "io/xml_node.hpp"
|
||||
|
||||
/**
|
||||
* \brief class handling files and paths
|
||||
* \ingroup io
|
||||
*/
|
||||
class FileManager
|
||||
{
|
||||
private:
|
||||
|
@ -28,6 +28,10 @@ using namespace irr;
|
||||
|
||||
class Vec3;
|
||||
|
||||
/**
|
||||
* \brief utility class used to parse XML files
|
||||
* \ingroup io
|
||||
*/
|
||||
class XMLNode
|
||||
{
|
||||
private:
|
||||
|
@ -40,20 +40,22 @@ enum attachmentType
|
||||
ATTACH_NOTHING
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup items
|
||||
*/
|
||||
class Attachment
|
||||
{
|
||||
private:
|
||||
attachmentType m_type; // attachment type
|
||||
Kart *m_kart; // kart the attachment is attached to
|
||||
float m_time_left; // time left till attachment expires
|
||||
float m_initial_speed; // for parachutes only
|
||||
attachmentType m_type; //!< attachment type
|
||||
Kart *m_kart; //!< kart the attachment is attached to
|
||||
float m_time_left; //!< time left till attachment expires
|
||||
float m_initial_speed; //!< for parachutes only
|
||||
/** Scene node of the attachment, which will be attached to the kart's
|
||||
* scene node. */
|
||||
scene::IAnimatedMeshSceneNode
|
||||
*m_node;
|
||||
Kart *m_previous_owner; // used by bombs so that it's not passed
|
||||
// back to previous owner
|
||||
Kart *m_previous_owner; //!< used by bombs so that it's not passed
|
||||
//!< back to previous owner
|
||||
RandomGenerator m_random;
|
||||
public:
|
||||
Attachment(Kart* _kart);
|
||||
@ -83,9 +85,9 @@ public:
|
||||
|
||||
/** Randomly selects the new attachment. For a server process, the
|
||||
* attachment can be passed into this function.
|
||||
\param item The item that was collected.
|
||||
\param new_attachment Optional: only used on the clients, it
|
||||
specifies the new attachment to use
|
||||
* \param item The item that was collected.
|
||||
* \param new_attachment Optional: only used on the clients, it
|
||||
* specifies the new attachment to use
|
||||
*/
|
||||
void hitBanana(const Item &item, int new_attachment=-1);
|
||||
void update (float dt);
|
||||
|
@ -22,6 +22,9 @@
|
||||
#include "irrlicht.h"
|
||||
#include "items/attachment.hpp"
|
||||
|
||||
/**
|
||||
* \ingroup items
|
||||
*/
|
||||
class AttachmentManager
|
||||
{
|
||||
private:
|
||||
|
@ -27,6 +27,9 @@ using namespace irr;
|
||||
|
||||
class XMLNode;
|
||||
|
||||
/**
|
||||
* \ingroup items
|
||||
*/
|
||||
class Bowling : public Flyable
|
||||
{
|
||||
private:
|
||||
|
@ -29,6 +29,9 @@
|
||||
|
||||
class XMLNode;
|
||||
|
||||
/**
|
||||
* \ingroup items
|
||||
*/
|
||||
class Cake : public Flyable
|
||||
{
|
||||
private:
|
||||
|
@ -36,6 +36,9 @@ class Kart;
|
||||
class PhysicalObject;
|
||||
class XMLNode;
|
||||
|
||||
/**
|
||||
* \ingroup items
|
||||
*/
|
||||
class Flyable : public Moveable, public TerrainInfo
|
||||
{
|
||||
public:
|
||||
|
@ -20,18 +20,28 @@
|
||||
#ifndef HEADER_ITEM_HPP
|
||||
#define HEADER_ITEM_HPP
|
||||
|
||||
/**
|
||||
* \defgroup items
|
||||
*/
|
||||
|
||||
#include "irrlicht.h"
|
||||
using namespace irr;
|
||||
|
||||
#include "karts/kart.hpp"
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* \ingroup items
|
||||
*/
|
||||
class Item
|
||||
{
|
||||
public:
|
||||
// The list of all items. Important for the switch item function:
|
||||
// bubblegum must be the last item (since bubble gum can't be
|
||||
// switched with any other item, since it's a different objecct).
|
||||
/**
|
||||
* The list of all items. Important for the switch item function:
|
||||
* bubblegum must be the last item (since bubble gum can't be
|
||||
* switched with any other item, since it's a different objecct).
|
||||
*/
|
||||
enum ItemType
|
||||
{
|
||||
ITEM_FIRST,
|
||||
|
@ -28,6 +28,9 @@
|
||||
|
||||
class Kart;
|
||||
|
||||
/**
|
||||
* \ingroup items
|
||||
*/
|
||||
class ItemManager
|
||||
{
|
||||
|
||||
|
@ -32,6 +32,9 @@ class PhysicalObject;
|
||||
class RubberBand;
|
||||
class XMLNode;
|
||||
|
||||
/**
|
||||
* \ingroup items
|
||||
*/
|
||||
class Plunger : public Flyable
|
||||
{
|
||||
private:
|
||||
|
@ -29,6 +29,9 @@ class Kart;
|
||||
class Item;
|
||||
class SFXBase;
|
||||
|
||||
/**
|
||||
* \ingroup items
|
||||
*/
|
||||
class Powerup
|
||||
{
|
||||
private:
|
||||
|
@ -41,6 +41,9 @@ enum PowerupType {POWERUP_NOTHING,
|
||||
POWERUP_LAST=POWERUP_ANVIL,
|
||||
POWERUP_MAX};
|
||||
|
||||
/**
|
||||
* \ingroup items
|
||||
*/
|
||||
class PowerupManager
|
||||
{
|
||||
private:
|
||||
|
@ -31,6 +31,9 @@ class Kart;
|
||||
class Explosion;
|
||||
class Flyable;
|
||||
|
||||
/**
|
||||
* \ingroup items
|
||||
*/
|
||||
class ProjectileManager
|
||||
{
|
||||
private:
|
||||
|
@ -20,14 +20,16 @@
|
||||
#ifndef HEADER_RUBBER_BAND_HPP
|
||||
#define HEADER_RUBBER_BAND_HPP
|
||||
|
||||
/** This class is used together with the pluger to display a rubber band from
|
||||
* the shooting kart to the plunger.
|
||||
*/
|
||||
|
||||
|
||||
#include "utils/vec3.hpp"
|
||||
class Kart;
|
||||
class Plunger;
|
||||
|
||||
/** This class is used together with the pluger to display a rubber band from
|
||||
* the shooting kart to the plunger.
|
||||
* \ingroup items
|
||||
*/
|
||||
class RubberBand
|
||||
{
|
||||
private:
|
||||
|
@ -24,7 +24,8 @@
|
||||
|
||||
class Kart;
|
||||
|
||||
/** This class is a 'mixin' for kart, and handles the animated explosion.
|
||||
/**
|
||||
* \brief This class is a 'mixin' for kart, and handles the animated explosion.
|
||||
* I.e. it will throw the kart a certain amount in the air, rotate it
|
||||
* randomly, and after the specified time period let it land at the
|
||||
* same spot where it was hit, therefore avoiding any problems of
|
||||
@ -33,6 +34,7 @@ class Kart;
|
||||
* a benefit by pushing you forwards.
|
||||
* The object is a base class for kart, but will only be used if an
|
||||
* explosion happens.
|
||||
* \ingroup karts
|
||||
*/
|
||||
class EmergencyAnimation
|
||||
{
|
||||
|
@ -21,6 +21,8 @@
|
||||
#ifndef HEADER_KART_HPP
|
||||
#define HEADER_KART_HPP
|
||||
|
||||
/** \defgroup karts */
|
||||
|
||||
#include "btBulletDynamicsCommon.h"
|
||||
|
||||
#include "graphics/camera.hpp"
|
||||
@ -55,6 +57,7 @@ class Stars;
|
||||
* Kart has two base classes: the most important one is moveable (which
|
||||
* is an object that is moved on the track, and has position and rotations)
|
||||
* and TerrainInfo, which manages the terrain the kart is on.
|
||||
* \ingroup karts
|
||||
*/
|
||||
class Kart : public TerrainInfo, public Moveable, public EmergencyAnimation
|
||||
{
|
||||
|
@ -31,10 +31,13 @@ using namespace irr;
|
||||
class KartProperties;
|
||||
class XMLNode;
|
||||
|
||||
/** This class stores a 3D kart model. It takes especially care of attaching
|
||||
/**
|
||||
* \brief This class stores a 3D kart model.
|
||||
* It takes especially care of attaching
|
||||
* the wheels, which are loaded as separate objects. The wheels can turn
|
||||
* and (for the front wheels) rotate. The implementation is dependent on the
|
||||
* OpenGL library used.
|
||||
* \ingroup karts
|
||||
*/
|
||||
class KartModel
|
||||
{
|
||||
|
@ -35,9 +35,13 @@ using namespace irr;
|
||||
class Material;
|
||||
class XMLNode;
|
||||
|
||||
/** This class stores the properties of a kart. This includes size, name,
|
||||
* identifier, physical properties etc. It is atm also the base class for
|
||||
* STKConfig, which stores the default values for all physics constants.
|
||||
/**
|
||||
* \brief This class stores the properties of a kart.
|
||||
* This includes size, name, identifier, physical properties etc.
|
||||
* It is atm also the base class for STKConfig, which stores the default values
|
||||
* for all physics constants.
|
||||
*
|
||||
* \ingroup karts
|
||||
*/
|
||||
class KartProperties
|
||||
{
|
||||
|
@ -26,6 +26,9 @@
|
||||
|
||||
class KartProperties;
|
||||
|
||||
/**
|
||||
* \ingroup karts
|
||||
*/
|
||||
class KartPropertiesManager
|
||||
{
|
||||
private:
|
||||
|
@ -36,7 +36,9 @@ class Material;
|
||||
|
||||
#define MAX_ITEMS_COLLECTED 20
|
||||
|
||||
|
||||
/**
|
||||
* \ingroup karts
|
||||
*/
|
||||
class Moveable
|
||||
{
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user