Solarus  1.6
Developer's reference
Solarus Namespace Reference

Namespaces

 CurrentQuest
 Provides access to resources and properties of the current quest.
 
 Debug
 Provides features for handling errors.
 
 Geometry
 Provides functions to make mathematical computations.
 
 Logger
 Provides features for logging output and errors.
 
 LuaTools
 Provides general Lua helpers functions.
 
 QuestFiles
 Provides access to data files of the current quest.
 
 Random
 Provides some functions to compute random numbers.
 
 String
 Provides string utility features.
 
 Video
 Draws the window and handles the video mode.
 

Classes

class  AnimatedTilePattern
 Multi-frame tile pattern. More...
 
class  Arguments
 Stores runtime arguments passed to the program. More...
 
class  Arrow
 An arrow thrown by the bow on the map. More...
 
class  Block
 A entity that the hero can push or pull. More...
 
class  Bomb
 A bomb that will explode soon. More...
 
class  Boomerang
 A boomerang thrown on the map. More...
 
class  BorderSet
 A set of borders for the autotiler. More...
 
class  Camera
 Manages the visible area of the map. More...
 
class  CarriedObject
 An item carried or thrown by the hero. More...
 
class  Chest
 Represents a chest on a map. More...
 
class  CircleMovement
 Movement that makes circles around a center. More...
 
class  Color
 Represents a color. More...
 
class  CommandsEffects
 Associate to each game key its current effect on the game. More...
 
class  Crystal
 A switch that can be activated to change the state of the crystal blocks. More...
 
class  CrystalBlock
 A block in the ground that can be raised or lowered with the help of a crystal. More...
 
class  CustomEntity
 A map entity fully controlled by Lua. More...
 
class  CustomState
 The state "custom" of the hero. More...
 
class  Destination
 A location of the map where the hero can arrive when using a teletransporter. More...
 
class  Destructible
 An entity that the hero can destroy and that may contain a pickable treasure. More...
 
class  Dialog
 A dialog that can be displayed during the game in the dialog box. More...
 
class  DialogBoxSystem
 Manages the dialog box where dialogs can be displayed. More...
 
class  DialogData
 Stores the properties of a dialog. More...
 
class  DialogResources
 Stores the content of a dialog data file. More...
 
class  Door
 A door that may be open or closed. More...
 
class  Drawable
 An object that can be drawn on a surface with additional effects. More...
 
struct  DrawInfos
 Struct used to pass drawing arguments trough the drawing pipeline. More...
 
struct  DrawProxy
 The DrawProxy is used to draw with various modifiers. More...
 
struct  DrawProxyChain
 Defines a chain of proxies to be applied. More...
 
class  DynamicTile
 A special tile that can be enabled or disabled. More...
 
class  Enemy
 Represents an enemy. More...
 
class  EnemyReaction
 Describes how an enemy reacts when it receives an attack. More...
 
class  Entities
 Manages the whole content of a map. More...
 
class  Entity
 Abstract class for all objects placed on a map. More...
 
class  EntityData
 Stores the properties of a map entity. More...
 
struct  EntityDataList
 A list of entities on a layer of the map. More...
 
struct  EntityIndex
 The layer and index of an entity in the map. More...
 
class  EntityTypeInfo
 
class  EntityZOrderComparator
 Comparator that sorts entities according to their stacking order on the map (layer and then Z index). More...
 
class  EnumInfo
 
struct  EnumInfoTraits
 
struct  EnumInfoTraits< Ability >
 
struct  EnumInfoTraits< BlendMode >
 
struct  EnumInfoTraits< CarriedObject::Behavior >
 
struct  EnumInfoTraits< CollisionMode >
 
struct  EnumInfoTraits< CommandsEffects::ActionKeyEffect >
 
struct  EnumInfoTraits< CommandsEffects::AttackKeyEffect >
 
struct  EnumInfoTraits< CommandsEffects::PauseKeyEffect >
 
struct  EnumInfoTraits< EnemyReaction::ReactionType >
 
struct  EnumInfoTraits< EntityType >
 
struct  EnumInfoTraits< Ground >
 
struct  EnumInfoTraits< InputEvent::KeyboardKey >
 
struct  EnumInfoTraits< InputEvent::MouseButton >
 
struct  EnumInfoTraits< PatternRepeatMode >
 
struct  EnumInfoTraits< PatternScrolling >
 
struct  EnumInfoTraits< ResourceType >
 
struct  EnumInfoTraits< StartingLocationMode >
 
struct  EnumInfoTraits< Transition::Style >
 
class  Equipment
 Represents the hero's equipment. More...
 
class  EquipmentItem
 An item possibly possessed by the player. More...
 
class  EquipmentItemUsage
 Represents an equipment item being used by the hero. More...
 
class  Explosion
 Represents an explosion on the map. More...
 
class  ExportableToLua
 Interface of a C++ type that can also exist as a Lua userdata. More...
 
class  FallingOnFloorMovement
 Movement of something that falls on the floor and slightly bounces. More...
 
class  Fire
 Represents some fire on the map. More...
 
class  FontResource
 Provides access to font files. More...
 
class  Game
 Represents the game currently running. More...
 
class  GameCommands
 Stores the mapping between the in-game high-level commands and their keyboard and joypad bindings. More...
 
struct  GlFunctions
 
class  GlRenderer
 Opengl Renderer. More...
 
class  GlShader
 Represents a shader for a driver and sampler-independant uses. More...
 
class  GlTexture
 Abstract class for internal surface pixel representation and manipulation. More...
 
class  Grid
 A collection of objects spatially located in a grid. More...
 
struct  GroundInfo
 
class  Hero
 The hero entity. More...
 
class  HeroSprites
 Manages the animations of the hero's main sprites. More...
 
class  HeroState
 The hero base state. More...
 
class  Hookshot
 The hookshot thrown by the hero. More...
 
class  Hq2xFilter
 Wrapper to the hq2x algorithm. More...
 
class  Hq3xFilter
 Wrapper to the hq3x algorithm. More...
 
class  Hq4xFilter
 Wrapper to the hq4x algorithm. More...
 
class  InputEvent
 Represents a low-level event. More...
 
class  ItDecoder
 Encapsulates the Impulse Tracker music decoding. More...
 
class  Jumper
 A sensor that makes the hero jump. More...
 
class  JumpMovement
 Movement of an entity that jumps towards a direction. More...
 
class  LuaContext
 This class represents a living Lua context that can execute quest scripts at runtime. More...
 
class  LuaData
 Abstract class for data the can be loaded and optionally saved as Lua. More...
 
class  LuaException
 Exception to indicate that a Lua error occurred. More...
 
class  MainLoop
 Main class of the game engine. More...
 
class  Map
 Represents a map where the game can take place. More...
 
class  MapData
 Stores the contents of a map data file. More...
 
class  Movement
 Abstract class for representing a movement. More...
 
class  Music
 Represents a music that can be played. More...
 
class  NonAnimatedRegions
 Manages the tiles that are in non-animated regions. More...
 
class  Npc
 A non-playing character or a more general interactive entity. More...
 
class  OggDecoder
 Encapsulates the Ogg Vorbis music decoding. More...
 
class  ParallaxScrollingTilePattern
 Tile pattern with a parallax scrolling effect. More...
 
class  PathFinding
 Implementation of the A* algorithm to compute a path. More...
 
class  PathFindingMovement
 Movement for an entity that looks for a path to another entity. More...
 
class  PathMovement
 Movement of an entity that follows a predetermined path. More...
 
class  Pickable
 An treasure placed on the ground and that the hero can take. More...
 
class  PixelBits
 Provides pixel-perfect collision checks for a surface. More...
 
class  PixelMovement
 Movement of an entity that follows a predetermined sequence of pixel-precise moves. More...
 
class  PlayerMovement
 Movement of an entity controlled by the player. More...
 
class  Point
 Represents a 2D point. More...
 
class  Quadtree
 A collection of objects spatially located in an adaptable 2D grid. More...
 
class  QuestDatabase
 Stores the list of resources and file information of a quest. More...
 
class  QuestProperties
 This class stores properties of a quest (the quest.dat file). More...
 
class  RandomMovement
 A movement that makes successive steps of random directions and (possibly) stays inside a limited rectangle. More...
 
class  RandomPathMovement
 Movement of an entity that walks randomly. More...
 
class  Rectangle
 Represents a rectangle. More...
 
class  RelativeMovement
 Movement of an entity attached to another entity. More...
 
class  Renderer
 Abstraction of the rendering device. More...
 
class  ResourceProvider
 Provides fast access to quest resources. More...
 
class  Savegame
 Manages the game data saved. More...
 
class  SavegameConverterV1
 Old format of savegames (version 1) kept for compatibility. More...
 
class  Scale
 Represent a 2D scaling. More...
 
class  Scale2xFilter
 Implementation of the Scale2x algorithm. More...
 
class  ScopedLuaRef
 Holds a Lua ref and does luaL_unref() on destruction. More...
 
class  SDLRenderer
 Legacy SDL renderer, used for window-less tests. More...
 
class  SDLShader
 Represents a shader for a driver and sampler-independant uses. More...
 
class  SDLSurfaceImpl
 Abstract class for internal surface pixel representation and manipulation. More...
 
class  SelfScrollingTilePattern
 Tile pattern that scrolls on itself when the camera moves. More...
 
class  Sensor
 An invisible entity that triggers something when it is walked on. More...
 
class  Separator
 An horizontal or vertical separation between two parts of the map. More...
 
class  Settings
 Stores built-in settings of the quest. More...
 
class  Shader
 Represents a shader for a driver and sampler-independant uses. More...
 
class  ShaderData
 Stores the content of a shader data file. More...
 
class  ShopTreasure
 A treasure the hero can buy in a shop. More...
 
class  SimpleTilePattern
 Non-animated tile pattern. More...
 
class  Size
 Represents a 2D size. More...
 
class  SoftwarePixelFilter
 Abstract class for software pixel filtering algorithms. More...
 
class  SoftwareVideoMode
 Represents a method to display the quest content on the screen. More...
 
class  SolarusFatal
 Exception representing a fatal error that stops Solarus. More...
 
class  Sound
 Represents a sound effect that can be played in the program. More...
 
class  SpcDecoder
 Encapsulates the SPC music decoding. More...
 
class  Sprite
 Represents an animated sprite. More...
 
class  SpriteAnimation
 Stores the animated sequences of a sprite in a specific animation. More...
 
class  SpriteAnimationData
 Stores the properties of a sprite animation. More...
 
class  SpriteAnimationDirection
 A sequence of frames representing a sprite animated in a particular direction. More...
 
class  SpriteAnimationDirectionData
 Stores the properties of a sprite animation direction. More...
 
class  SpriteAnimationSet
 A set of animations representing a sprite. More...
 
class  SpriteData
 Stores the content of a sprite data file. More...
 
class  Stairs
 Some stairs that trigger a special animation on the hero. More...
 
class  StraightMovement
 A straight movement represented as a speed vector whose properties (speed and angle) can be changed. More...
 
class  Stream
 A special terrain where the hero is moved towards a specific direction. More...
 
class  StreamAction
 Manages a map entity being moved by a stream. More...
 
class  StringResources
 Stores the content of a string data file. More...
 
class  Surface
 Represents a graphic surface. More...
 
class  SurfaceImpl
 Abstract class for internal surface pixel representation and manipulation. More...
 
class  Switch
 A button that the hero can trigger. More...
 
class  System
 Provides low-level functions and initialization. More...
 
class  TargetMovement
 Movement of an object that goes to a target point. More...
 
class  Teletransporter
 A detector that sends the hero to a destination. More...
 
class  TextSurface
 Draws a line of text on a surface. More...
 
class  Tile
 A small fixed piece of the map, optimized for collisions and drawing. More...
 
struct  TileInfo
 Wraps construction parameters of a tile. More...
 
class  TilePattern
 Abstract class for a tile pattern. More...
 
class  TilePatternData
 Stores the properties of a tile pattern. More...
 
class  Tileset
 A set of tile patterns that are used to compose a map. More...
 
class  TilesetData
 Stores the content of a tileset data file. More...
 
class  Timer
 Represents a timer that any class can start. More...
 
class  Transform
 Wrapper class that hold transform informations. More...
 
class  Transition
 Abstract class for a transition effect between two phases. More...
 
class  TransitionFade
 Fade in or fade out transition effect. More...
 
class  TransitionImmediate
 Immediate transition effect. More...
 
class  TransitionScrolling
 Scrolling transition between two maps. More...
 
class  TraversableInfo
 Stores whether a custom entity can be traversed by or can traverse other entities. More...
 
class  Treasure
 Represents an item that the hero brandishes when he receives it. More...
 
struct  Vertex
 Solarus 2D vertex structure. More...
 
class  VertexArray
 Solarus VertexArray. More...
 
class  VerticeView
 View on a Vertex array, allowing to modify it. More...
 
class  Wall
 An invisible obstacle that stops other types of entities. More...
 

Typedefs

template<typename T >
using QuadtreeNode = typename Quadtree< T >::Node
 
using TimerPtr = std::shared_ptr< Timer >
 Alias for shared_ptr of Timer.
 
using Vecs = std::array< vec2, 4 >
 
using Interval = std::pair< float, float >
 
using CameraPtr = std::shared_ptr< Camera >
 Alias for shared_ptr of Camera.
 
using EntityList = std::list< EntityPtr >
 
using EntitySet = std::set< EntityPtr >
 
using EntityVector = std::vector< EntityPtr >
 
using ConstEntityVector = std::vector< ConstEntityPtr >
 
using EntityTree = Quadtree< EntityPtr, EntityZOrderComparator >
 
using EntityPtr = std::shared_ptr< Entity >
 Alias for shared_ptr of Entity.
 
using ConstEntityPtr = std::shared_ptr< const Entity >
 Alias for shared_ptr of const Entity.
 
using HeroPtr = std::shared_ptr< Hero >
 Alias for shared_ptr of Entity.
 
using SeparatorPtr = std::shared_ptr< Separator >
 Alias for shared_ptr of Separator.
 
using ConstSeparatorPtr = std::shared_ptr< const Separator >
 Alias for shared_ptr of const Separator.
 
using TilePtr = std::shared_ptr< Tile >
 Alias for shared_ptr of Tile.
 
using DrawablePtr = std::shared_ptr< Drawable >
 Alias for shared_ptr of Drawable.
 
using RendererPtr = std::unique_ptr< Renderer >
 
using ShaderPtr = std::shared_ptr< Shader >
 Alias for shared_ptr of Shader.
 
using SpritePtr = std::shared_ptr< Sprite >
 Alias for shared_ptr of Sprite.
 
using SurfaceImplPtr = std::shared_ptr< SurfaceImpl >
 
using SurfacePtr = std::shared_ptr< Surface >
 Alias for shared_ptr of Surface.
 
using VertexArrayPtr = std::shared_ptr< VertexArray >
 
using ExportableToLuaPtr = std::shared_ptr< ExportableToLua >
 Alias for shared_ptr of ExportableToLua.
 
using UT = GlShader::Uniform::Type
 
using RenderingMode = TextSurface::RenderingMode
 
using HorizontalAlignment = TextSurface::HorizontalAlignment
 
using VerticalAlignment = TextSurface::VerticalAlignment
 

Enumerations

enum  Ability {
  Ability::TUNIC, Ability::SWORD, Ability::SWORD_KNOWLEDGE, Ability::SHIELD,
  Ability::LIFT, Ability::SWIM, Ability::JUMP_OVER_WATER, Ability::RUN,
  Ability::PUSH, Ability::GRAB, Ability::PULL, Ability::DETECT_WEAK_WALLS
}
 The different built-in abilities managed by the engine. More...
 
enum  GameCommand {
  NONE = -1, ACTION, ATTACK, ITEM_1,
  ITEM_2, PAUSE, RIGHT, UP,
  LEFT, DOWN
}
 The built-in commands recognized by the engine during a game. More...
 
enum  ResourceType {
  MAP, TILESET, SPRITE, MUSIC,
  SOUND, ITEM, ENEMY, ENTITY,
  LANGUAGE, FONT, SHADER
}
 Types of existing resources in a quest.
 
enum  BorderKind {
  NONE = -1, RIGHT, TOP, LEFT,
  BOTTOM, TOP_RIGHT_CONVEX, TOP_LEFT_CONVEX, BOTTOM_LEFT_CONVEX,
  BOTTOM_RIGHT_CONVEX, TOP_RIGHT_CONCAVE, TOP_LEFT_CONCAVE, BOTTOM_LEFT_CONCAVE,
  BOTTOM_RIGHT_CONCAVE
}
 A kind of border for the autotiler. More...
 
enum  CollisionMode {
  COLLISION_NONE = 0x0000, COLLISION_OVERLAPPING = 0x0001, COLLISION_CONTAINING = 0x0002, COLLISION_ORIGIN = 0x0004,
  COLLISION_FACING = 0x0008, COLLISION_TOUCHING = 0x0010, COLLISION_CENTER = 0x0020, COLLISION_SPRITE = 0x0040,
  COLLISION_CUSTOM = 0x0080
}
 Collisions modes an entity can detect. More...
 
enum  EnemyAttack {
  EnemyAttack::SWORD, EnemyAttack::THROWN_ITEM, EnemyAttack::EXPLOSION, EnemyAttack::ARROW,
  EnemyAttack::HOOKSHOT, EnemyAttack::BOOMERANG, EnemyAttack::FIRE, EnemyAttack::SCRIPT
}
 Defines the types of attacks an enemy can be victim of. More...
 
enum  EntityType {
  EntityType::TILE, EntityType::DESTINATION, EntityType::TELETRANSPORTER, EntityType::PICKABLE,
  EntityType::DESTRUCTIBLE, EntityType::CHEST, EntityType::JUMPER, EntityType::ENEMY,
  EntityType::NPC, EntityType::BLOCK, EntityType::DYNAMIC_TILE, EntityType::SWITCH,
  EntityType::WALL, EntityType::SENSOR, EntityType::CRYSTAL, EntityType::CRYSTAL_BLOCK,
  EntityType::SHOP_TREASURE, EntityType::STREAM, EntityType::DOOR, EntityType::STAIRS,
  EntityType::SEPARATOR, EntityType::CUSTOM, EntityType::CAMERA, EntityType::HERO,
  EntityType::CARRIED_OBJECT, EntityType::BOOMERANG, EntityType::EXPLOSION, EntityType::ARROW,
  EntityType::BOMB, EntityType::FIRE, EntityType::HOOKSHOT
}
 Constants to identify each kind of map entity. More...
 
enum  Ground {
  Ground::EMPTY, Ground::TRAVERSABLE, Ground::WALL, Ground::LOW_WALL,
  Ground::WALL_TOP_RIGHT, Ground::WALL_TOP_LEFT, Ground::WALL_BOTTOM_LEFT, Ground::WALL_BOTTOM_RIGHT,
  Ground::WALL_TOP_RIGHT_WATER, Ground::WALL_TOP_LEFT_WATER, Ground::WALL_BOTTOM_LEFT_WATER, Ground::WALL_BOTTOM_RIGHT_WATER,
  Ground::DEEP_WATER, Ground::SHALLOW_WATER, Ground::GRASS, Ground::HOLE,
  Ground::ICE, Ground::LADDER, Ground::PRICKLE, Ground::LAVA
}
 The possible kinds of grounds on a map. More...
 
enum  StartingLocationMode { StartingLocationMode::WHEN_WORLD_CHANGES, StartingLocationMode::YES, StartingLocationMode::NO }
 Whether a destination updates the starting location when using it. More...
 
enum  PatternScrolling { PatternScrolling::NONE, PatternScrolling::SELF, PatternScrolling::PARALLAX }
 Kind of scrolling applied to a tile pattern. More...
 
enum  PatternRepeatMode { PatternRepeatMode::ALL, PatternRepeatMode::HORIZONTAL, PatternRepeatMode::VERTICAL, PatternRepeatMode::NONE }
 Kind of scrolling applied to a tile pattern. More...
 
enum  BlendMode { BlendMode::NONE, BlendMode::BLEND, BlendMode::ADD, BlendMode::MULTIPLY }
 Possible blend modes for drawable objects. More...
 
enum  PrimitiveType {
  POINTS = GL_POINTS, LINES = GL_LINES, LINE_STRIP = GL_LINE_STRIP, TRIANGLES = GL_TRIANGLES,
  TRIANGLE_STRIP = GL_TRIANGLE_STRIP, TRIANGLE_FAN = GL_TRIANGLE_FAN
}
 Primitive type, specifying how vertex should be drawn. More...
 
enum  FallingHeight { FALLING_NONE = 0, FALLING_LOW = 1, FALLING_MEDIUM = 2, FALLING_HIGH = 3 }
 Indicates from which height an entity falls. More...
 

Functions

template<typename E >
const std::string & enum_to_name (E value)
 Returns the name corresponding to an enum value. More...
 
template<typename E >
name_to_enum (const std::string &name)
 Returns an enum value from its name. More...
 
template<typename E >
name_to_enum (const std::string &name, E default_value)
 Returns an enum value from its name. More...
 
template<typename E >
name_to_enum (const std::string &name, E default_value, bool &success)
 Returns an enum value from its name. More...
 
constexpr bool operator== (const Point &lhs, const Point &rhs)
 Returns whether two points are equal. More...
 
constexpr bool operator!= (const Point &lhs, const Point &rhs)
 Returns whether two points are different. More...
 
constexpr Point operator+ (const Point &point)
 Unary plus operator. More...
 
constexpr Point operator- (const Point &point)
 Unary minus operator. More...
 
constexpr Point operator+ (const Point &lhs, const Point &rhs)
 Adds two points. More...
 
constexpr Point operator- (const Point &lhs, const Point &rhs)
 Subtracts two points. More...
 
constexpr Point operator* (const Point &point, int factor)
 Multiples a point by a number. More...
 
constexpr Point operator* (int factor, const Point &point)
 Multiples a point by a number. More...
 
constexpr Point operator/ (const Point &point, int divisor)
 Divides a point by a number. More...
 
std::ostream & operator<< (std::ostream &stream, const Point &point)
 Prints a point to an output stream. More...
 
bool operator== (const Rectangle &lhs, const Rectangle &rhs)
 Compares two rectangles. More...
 
bool operator!= (const Rectangle &lhs, const Rectangle &rhs)
 Compares two rectangles. More...
 
SOLARUS_API std::ostream & operator<< (std::ostream &stream, const Rectangle &rectangle)
 Prints a rectangle to an output stream. More...
 
constexpr Size operator* (const Size &size, const Scale &scale)
 multiply a Size by a scale More...
 
constexpr Point operator* (const Point &point, const Scale &scale)
 Multiply a Point by a scale, like a vector. More...
 
constexpr Scale operator* (const Scale &a, const Scale &b)
 
constexpr Scale operator* (const Scale &a, float b)
 
constexpr Scale operator/ (const Size &size, const Size &other)
 
constexpr bool operator== (const Size &lhs, const Size &rhs)
 Returns whether two sizes are equal. More...
 
constexpr bool operator!= (const Size &lhs, const Size &rhs)
 Returns whether two sizes are different. More...
 
constexpr Size operator+ (const Size &lhs, const Size &rhs)
 Adds two sizes. More...
 
constexpr Size operator- (const Size &lhs, const Size &rhs)
 Substracts two sizes. More...
 
constexpr Size operator* (const Size &size, int factor)
 Multiplies a size by a value. More...
 
constexpr Size operator* (int factor, const Size &size)
 Multiplies a size by a value. More...
 
constexpr Size operator/ (const Size &size, int divisor)
 Divides a size by a value. More...
 
std::ostream & operator<< (std::ostream &stream, const Size &size)
 Prints a point to an output stream. More...
 
constexpr bool operator== (const Color &lhs, const Color &rhs)
 Equality operator. More...
 
constexpr bool operator!= (const Color &lhs, const Color &rhs)
 Compare two colors. More...
 
void GLAPIENTRY MessageCallback (GLenum, GLenum type, GLuint id, GLenum severity, GLsizei, const GLchar *message, const void *)
 Function that serve as a callback for opengl debugging. More...
 
glm::mat3 uv_view (int width, int height)
 
SDL_Texture * create_texture_from_renderer (SDL_Renderer *renderer, int width, int height)
 

Detailed Description

Copyright (C) 2006-2018 Christopho, Solarus - http://www.solarus-games.org

Solarus 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 3 of the License, or (at your option) any later version.

Solarus 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, see http://www.gnu.org/licenses/.

Enumeration Type Documentation

◆ Ability

enum Solarus::Ability
strong

The different built-in abilities managed by the engine.

Enumerator
TUNIC 

Tunic of the hero. Determines his sprite.

SWORD 

Sword of the hero. 0 means no sword, a greater values determine the sword sprite.

SWORD_KNOWLEDGE 

Allows to do the super spin attack.

SHIELD 

Allows to stop attacks from enemies.

LIFT 

Lifting destructible objects.

SWIM 

Swimming in deep water.

JUMP_OVER_WATER 

Automatically jumping when arriving in water without the SWIM ability.

RUN 

Running faster.

PUSH 

Pushing obstacles.

GRAB 

Grabbing obstacles.

PULL 

Pulling obstacles.

DETECT_WEAK_WALLS 

Be notified of weak walls nearby.

◆ BlendMode

enum Solarus::BlendMode
strong

Possible blend modes for drawable objects.

Enumerator
NONE 

No blending: the destination is replaced by the source.

BLEND 

Alpha blending (default).

ADD 

Additive blending.

MULTIPLY 

Multiplicative blending (color modulate).

◆ BorderKind

enum Solarus::BorderKind
strong

A kind of border for the autotiler.

Indicates whether a border tile is for a side or a corner and which one.

◆ CollisionMode

Collisions modes an entity can detect.

Enumerator
COLLISION_NONE 

No collision will be detected (the detector doesn't detect any entity).

COLLISION_OVERLAPPING 

Collision if the entity's rectangle overlaps the detector's rectangle.

COLLISION_CONTAINING 

Collision if the entity's rectangle is inside the detector's rectangle.

COLLISION_ORIGIN 

Collision if the entity's origin point is inside the detector's rectangle.

COLLISION_FACING 

Collision if the entity's facing point corresponding to its current direction is inside the detector's rectangle.

COLLISION_TOUCHING 

Collision if any entity's facing point (i.e. in any of the four main directions) is inside the detector's rectangle.

COLLISION_CENTER 

Collision if the entity's center point is inside the detector's rectangle.

COLLISION_SPRITE 

Collision if an entity's sprite has pixels overlapping pixels of the detector's sprite.

COLLISION_CUSTOM 

Custom collision function, defined by a subclass of Entity.

◆ EnemyAttack

enum Solarus::EnemyAttack
strong

Defines the types of attacks an enemy can be victim of.

Enumerator
SWORD 

attacked by the sword (for a spin attack, the life lost is multiplied by 2)

THROWN_ITEM 

hit by an item thrown (bush, pot, stone...)

EXPLOSION 

explosion of a bomb or something else

ARROW 

hit by an arrow

HOOKSHOT 

hit by the hookshot

BOOMERANG 

hit by the boomerang

FIRE 

burned by fire

SCRIPT 

a script decided to hurt the enemy

◆ EntityType

enum Solarus::EntityType
strong

Constants to identify each kind of map entity.

Each constant correspond to a subclass of Entity. They can be stored in the map file (tiles, teletransporters, chests, stairs, doors, etc.). or generated dynamically during the game (hero, explosion, boomerang, etc.).

Enumerator
TILE 

a tile on the map, obstacle or not

DESTINATION 

a destination point on the map

TELETRANSPORTER 

a teletransporter: the hero is transported to a destination point when walking on it

PICKABLE 

a treasure that the hero can pick up: a rupee, a heart, a fairy...

DESTRUCTIBLE 

something that the hero can cut or lift: a pot, a bush, a stone...

CHEST 

a chest (small or big) with a treasure

JUMPER 

a sensor that makes the hero jump in a direction

ENEMY 

an enemy

NPC 

an entity the hero can interact with by pressing the action key in front of it (not necessarily a person)

BLOCK 

a block or a statue that the hero can push

DYNAMIC_TILE 

a dynamic tile (that can be enabled or disabled)

SWITCH 

a switch

WALL 

an invisible obstacle for some type of entities

SENSOR 

a sensor that triggers something when the hero overlaps it

CRYSTAL 

a switch that lowers or raises the blue and orange blocks

CRYSTAL_BLOCK 

the blue or orange blocks that are changed by the crystals

SHOP_TREASURE 

a treasure the hero can buy in a shop

STREAM 

a special terrain that moves the hero

DOOR 

a door to open with a key or another action

STAIRS 

stairs between two maps or inside a single map

SEPARATOR 

an horizontal or vertical separation for the camera

CUSTOM 

a entity fully controlled by the scripts

CAMERA 

the camera

HERO 

the hero

CARRIED_OBJECT 

item carried and thrown by the hero (comes from a destructible item)

BOOMERANG 

a boomerang thrown

EXPLOSION 

an explosion, that may be caused by a bomb, a bomb flower, an enemy, etc.

ARROW 

an arrow thrown by the bow

BOMB 

a bomb that will explode soon

FIRE 

some fire

HOOKSHOT 

the hookshot thrown by the hero

◆ FallingHeight

Indicates from which height an entity falls.

This enumeration is used by the FallingOnFloorMovement class, typically to make pickable items fall on the ground when an enemy is killed or when a pot is lifted.

◆ GameCommand

enum Solarus::GameCommand
strong

The built-in commands recognized by the engine during a game.

These high-level commands can be mapped onto the keyboard and the joypad.

◆ Ground

enum Solarus::Ground
strong

The possible kinds of grounds on a map.

The ground of a point of the map is the one of the tile, dynamic tile or destructible entity placed there. If several entities are present at that point (like a traversable dynamic tile over a hole tile), the highest one whose ground is not GROUND_EMPTY wins.

Enumerator
EMPTY 

Keep unchanged the ground of entities below.

TRAVERSABLE 

Normal travsersable ground.

WALL 

Obstacle entity.

LOW_WALL 

Can only be traversed by projectiles like arrows, boomerang, thrown items, etc.

WALL_TOP_RIGHT 

The upper-right half of the entity is an obstacle.

WALL_TOP_LEFT 

The upper-left half of the entity is an obstacle.

WALL_BOTTOM_LEFT 

The lower-left half of the entity is an obstacle.

WALL_BOTTOM_RIGHT 

The lower-right half of the entity is an obstacle.

WALL_TOP_RIGHT_WATER 

The upper-right half of the entity is an obstacle and the rest is deep water.

WALL_TOP_LEFT_WATER 

The upper-left half of the entity is an obstacle and the rest is deep water.

WALL_BOTTOM_LEFT_WATER 

The lower-left half of the entity is an obstacle and the rest is deep water.

WALL_BOTTOM_RIGHT_WATER 

The lower-right half of the entity is an obstacle and the rest is deep water.

DEEP_WATER 

Deep water where the hero drowns or swims.

SHALLOW_WATER 

Shallow water where the hero can walk but slower.

GRASS 

Grass where the hero walks slower.

HOLE 

A hole where the hero can fall.

ICE 

Ice terrain where the hero slides.

LADDER 

A ladder that slows down the hero.

PRICKLE 

Some untraversable prickles that hurt the hero.

LAVA 

Some lava where the hero drowns and gets hurt.

◆ PatternRepeatMode

Kind of scrolling applied to a tile pattern.

Enumerator
ALL 

Repeatable in both directions.

HORIZONTAL 

Repeatable only horizontally.

VERTICAL 

Repeatable only vertically.

NONE 

Not repeatable.

◆ PatternScrolling

Kind of scrolling applied to a tile pattern.

Enumerator
NONE 

No scrolling.

SELF 

Scrolling on itself.

PARALLAX 

Parallax scrolling.

◆ PrimitiveType

Primitive type, specifying how vertex should be drawn.

Enumerator
POINTS 

Draw each vertex as a single pixel

LINES 

Draw each couple of vertex as a line

LINE_STRIP 

Draw a line through all vertices

TRIANGLES 

Draw a triangle with each vertices trio

TRIANGLE_STRIP 

Draw a triangle strip

TRIANGLE_FAN 

Draw a triangle fan

◆ StartingLocationMode

Whether a destination updates the starting location when using it.

Enumerator
WHEN_WORLD_CHANGES 

Update if the current world has just changed.

YES 

Update the starting location.

NO 

Don't update the starting location.

Function Documentation

◆ enum_to_name()

template<typename E >
const std::string & Solarus::enum_to_name ( value)

Returns the name corresponding to an enum value.

Parameters
valueAn enum value.
Returns
The corresponding name.

◆ MessageCallback()

void GLAPIENTRY Solarus::MessageCallback ( GLenum  ,
GLenum  type,
GLuint  id,
GLenum  severity,
GLsizei  ,
const GLchar *  message,
const void *   
)

Function that serve as a callback for opengl debugging.

Parameters
type
id
severity
message

◆ name_to_enum() [1/3]

template<typename E >
E Solarus::name_to_enum ( const std::string &  name)

Returns an enum value from its name.

Parameters
nameAn enum name.
Returns
The corresponding value.

◆ name_to_enum() [2/3]

template<typename E >
E Solarus::name_to_enum ( const std::string &  name,
default_value 
)

Returns an enum value from its name.

Parameters
nameAn enum name.
default_valueThe default value to return if name is not found.
Returns
The corresponding value if found, otherwise default_value.

◆ name_to_enum() [3/3]

template<typename E >
E Solarus::name_to_enum ( const std::string &  name,
default_value,
bool &  success 
)

Returns an enum value from its name.

Parameters
nameAn enum name.
default_valueThe default value to return if name is not found.
successSet to true if the name is found.
Returns
The corresponding value if found, otherwise default_value.

◆ operator!=() [1/4]

constexpr bool Solarus::operator!= ( const Point lhs,
const Point rhs 
)

Returns whether two points are different.

Parameters
lhsA point.
rhsAnother point.
Returns
true if the points are not equal.

◆ operator!=() [2/4]

constexpr bool Solarus::operator!= ( const Size lhs,
const Size rhs 
)

Returns whether two sizes are different.

Parameters
lhsA size.
rhsAnother size.
Returns
true if the sizes are not equal.

◆ operator!=() [3/4]

constexpr bool Solarus::operator!= ( const Color lhs,
const Color rhs 
)

Compare two colors.

Parameters
lhsA color.
rhsAnother color.
Returns
true if both colors are equal.

◆ operator!=() [4/4]

bool Solarus::operator!= ( const Rectangle lhs,
const Rectangle rhs 
)
inline

Compares two rectangles.

Parameters
lhsfirst rectangle
rhssecond rectangle
Returns
true if the rectangles are not equal

◆ operator*() [1/6]

constexpr Size Solarus::operator* ( const Size size,
const Scale scale 
)
inline

multiply a Size by a scale

Parameters
sizea size
scalea scale
Returns
a new Size with component multiplied by the scale

◆ operator*() [2/6]

constexpr Point Solarus::operator* ( const Point point,
const Scale scale 
)
inline

Multiply a Point by a scale, like a vector.

Parameters
pointa point
scalea scale
Returns
a new Point with compenents multiplied by the scale

◆ operator*() [3/6]

constexpr Size Solarus::operator* ( const Size size,
int  factor 
)

Multiplies a size by a value.

Parameters
sizeA size.
factorThe multiplication factor.
Returns
A size with width and height multiplied by the factor.

◆ operator*() [4/6]

constexpr Point Solarus::operator* ( const Point point,
int  factor 
)

Multiples a point by a number.

Parameters
pointA point.
factorThe factor.
Returns
A point with coordinates multiplied by the factor.

◆ operator*() [5/6]

constexpr Size Solarus::operator* ( int  factor,
const Size size 
)

Multiplies a size by a value.

Parameters
factorThe multiplication factor.
sizeA size.
Returns
A size with width and height multiplied by the factor.

◆ operator*() [6/6]

constexpr Point Solarus::operator* ( int  factor,
const Point point 
)

Multiples a point by a number.

Parameters
factorThe factor.
pointA point.
Returns
A point with coordinates multiplied by the factor.

◆ operator+() [1/3]

constexpr Point Solarus::operator+ ( const Point point)

Unary plus operator.

Parameters
pointA point.
Returns
A copy of the point.

◆ operator+() [2/3]

constexpr Size Solarus::operator+ ( const Size lhs,
const Size rhs 
)

Adds two sizes.

Parameters
lhsA size.
rhsAnother size.
Returns
The sum of both sizes.

◆ operator+() [3/3]

constexpr Point Solarus::operator+ ( const Point lhs,
const Point rhs 
)

Adds two points.

Parameters
lhsA point.
rhsAnother point.
Returns
A point with the sum of their coordinates.

◆ operator-() [1/3]

constexpr Point Solarus::operator- ( const Point point)

Unary minus operator.

Parameters
pointA point.
Returns
A point with opposite coordinates.

◆ operator-() [2/3]

constexpr Size Solarus::operator- ( const Size lhs,
const Size rhs 
)

Substracts two sizes.

Parameters
lhsA size.
rhsThe size to subtract.
Returns
The difference of both sizes.

◆ operator-() [3/3]

constexpr Point Solarus::operator- ( const Point lhs,
const Point rhs 
)

Subtracts two points.

Parameters
lhsA point.
rhsThe point to subtract.
Returns
A point with the difference of their coordinates.

◆ operator/() [1/2]

constexpr Size Solarus::operator/ ( const Size size,
int  divisor 
)

Divides a size by a value.

Parameters
sizeA size.
divisorThe divisor.
Returns
A size with width and height divided by the divisor.

◆ operator/() [2/2]

constexpr Point Solarus::operator/ ( const Point point,
int  divisor 
)

Divides a point by a number.

Parameters
pointA point.
divisorThe divisor.
Returns
A point with coordinates divided by the divisor.

◆ operator<<() [1/3]

std::ostream & Solarus::operator<< ( std::ostream &  stream,
const Size size 
)

Prints a point to an output stream.

Parameters
streamThe stream.
sizeA size object.
Returns
The output stream.

◆ operator<<() [2/3]

std::ostream & Solarus::operator<< ( std::ostream &  stream,
const Point point 
)

Prints a point to an output stream.

Parameters
streamThe stream.
pointA point.
Returns
The output stream.

◆ operator<<() [3/3]

std::ostream & Solarus::operator<< ( std::ostream &  stream,
const Rectangle rectangle 
)

Prints a rectangle to an output stream.

Parameters
streamThe stream.
rectangleA rectangle.
Returns
The output stream.

◆ operator==() [1/4]

constexpr bool Solarus::operator== ( const Point lhs,
const Point rhs 
)

Returns whether two points are equal.

Parameters
lhsA point.
rhsAnother point.
Returns
true if the points are equal.

◆ operator==() [2/4]

constexpr bool Solarus::operator== ( const Size lhs,
const Size rhs 
)

Returns whether two sizes are equal.

Parameters
lhsA size.
rhsAnother size.
Returns
true if the sizes are equal.

◆ operator==() [3/4]

constexpr bool Solarus::operator== ( const Color lhs,
const Color rhs 
)

Equality operator.

Parameters
lhsA color.
rhsAnother color.
Returns
true if both colors are equal.

◆ operator==() [4/4]

bool Solarus::operator== ( const Rectangle lhs,
const Rectangle rhs 
)
inline

Compares two rectangles.

Parameters
lhsfirst rectangle
rhssecond rectangle
Returns
true if both rectangles have the same coordinates and size