hoa_video::GameVideo Class Reference

Manages all the video operations and serves as the API to the video engine. More...

#include <video.h>

Inheritance diagram for hoa_video::GameVideo:

Inheritance graph
[legend]
Collaboration diagram for hoa_video::GameVideo:

Collaboration graph
[legend]
List of all members.

Public Member Functions

ParticleEffectID AddParticleEffect (const std::string &particle_effect_filename, float x, float y, bool reload=false)
 add a particle effect at the given point x and y
bool ApplyLightingOverlay ()
 call after rendering all real lights. This function renders all lights to the lighting overlay texture, Moved into ApplyLightingOverlay call after all map images are drawn to apply lighting. All menu and text rendering should occur AFTER this call, so that they are not affected by lighting.
bool ApplySettings ()
 applies any changes to video settings like resolution and fullscreen. If the changes fail, then this function returns false, and the video settings are reset to whatever the last working setting was.
ScreenRect CalculateScreenRect (float left, float right, float bottom, float top)
 converts coordinates given relative to the current coord sys into "screen coordinates", which are in pixel units with (0,0) as the top left and (w-1, h-1) as the lower-right, where w and h are the dimensions of the screen
int32 CalculateTextWidth (const std::string &font_name, const std::string &text)
 calculates the width of the given text if it were rendered with the given font If an invalid font name is passed, returns -1
int32 CalculateTextWidth (const std::string &font_name, const hoa_utils::ustring &text)
 calculates the width of the given text if it were rendered with the given font If an invalid font name is passed, returns -1
bool CaptureScreen (StillImage &id)
 captures the contents of the screen and saves it to an image descriptor
bool Clear (const Color &c)
 Clears the screen to a specific color.
bool Clear ()
 Clears the contents of the current screen.
void DEBUG_NextTexSheet ()
 These cycle through the currently loaded texture sheets so they can be viewed on screen.
void DEBUG_PrevTexSheet ()
bool DeleteImage (ImageDescriptor &id)
 decreases ref count of an image (static or animated)
void DeleteMenuSkin (std::string &skin_name)
 Deletes a menu skin that has been loaded.
void DisableFog ()
 disables fog
void DisablePointLights ()
 disables point lights
void DisableSceneLighting ()
 disables scene lighting
bool Display (int32 frame_time)
 call at end of every frame
bool Draw (const RenderedLine &line, int32 tex_index)
 Draws a rendered line object.
bool Draw (const RenderedString &string)
 Draws a rendered string object.
void DrawFPS (uint32 frame_time)
 Updates the FPS counter and draws the current average FPS to the screen The number of milliseconds that have expired since the last frame was drawn.
bool DrawFullscreenOverlay (const Color &color)
 draws a full screen overlay of the given color
void DrawGrid (float x, float y, float x_step, float y_step, const Color &c)
 draws a line grid. Used by map editor to draw a grid over all the tiles. This function will start at (x,y), and go to (xMax, yMax), with horizontal cell spacing of xstep and vertical cell spacing of ystep. The final parameter is just the color the lines should be drawn
bool DrawHalo (const StillImage &id, float x, float y, const Color &color=Color(1.0f, 1.0f, 1.0f, 1.0f))
 draws a halo at the given spot
bool DrawImage (const ImageDescriptor &id, const Color &color)
 draws an image which is modulated by a custom color
bool DrawImage (const ImageDescriptor &id)
 draws an image which is modulated by the scene's light color
bool DrawLight (const StillImage &id, float x, float y, const Color &color=Color(1.0f, 1.0f, 1.0f, 1.0f))
 draws a real light at the given spot
bool DrawLightning ()
 call this every frame to draw any lightning effects. You should make sure to place this call in an appropriate spot. In particular, you should draw the lightning before drawing the GUI.
bool DrawParticleEffects ()
 draws all active particle effects
void DrawRectangle (const float width, const float height, const Color &color)
 Draws a solid rectangle of a given color. Draws a solid rectangle of a given color. For that, the lower-left corner of the rectangle has to be specified, and also its size. The parameters depends on the current Coordinate System.
bool DrawText (const hoa_utils::ustring &uText)
 unicode version of DrawText(). This should be used for anything in the game which might need to be localized (game dialogue, interface text, etc.)
bool DrawText (const std::string &text)
 non-unicode version of DrawText(). Only use this for debug output or other things which don't have to be localized
bool EnableFog (const Color &color, float intensity)
 sets fog parameters
bool EnablePointLights ()
 call if this map uses real lights
bool EnableSceneLighting (const Color &color)
 turn on the ligt color for the scene
void EnableScissoring (bool enable)
 enables scissoring, where you can specify a rectangle of the screen which is affected by rendering operations. MAKE SURE to disable scissoring as soon as you're done using the effect, or all subsequent draw calls will get messed up
void EnableTextShadow (bool enable)
 enables/disables text shadowing
void FadeScreen (const Color &color, float fade_time)
 Begins a screen fade.
const CoordSysGetCoordSys () const
 return a reference to the coordinates system
StillImageGetDefaultCursor ()
 returns the cursor image
void GetDrawPosition (float &x, float &y)
 Gets the location of the draw cursor.
std::string GetFont () const
 get name of current font
FontPropertiesGetFontProperties (const std::string &font_name)
 Get the font properties for a previously loaded font.
int32 GetFrameChange ()
 returns the amount of animation frames that have passed since the last call to GameVideo::Display(). This number is based on VIDEO_ANIMATION_FRAME_PERIOD, and is used so that AnimatedImages know how many frames to increment themselves by.
float GetGamma ()
 Returns the gamma value.
int32 GetHeight () const
 returns height, (whatever was set with SetResolution)
bool GetImageInfo (const std::string &file_name, uint32 &rows, uint32 &cols, uint32 &bpp)
 Get information of an image file.
int32 GetNumParticles ()
 get number of live particles
ParticleEffectGetParticleEffect (ParticleEffectID id)
 get pointer to an effect given its ID
void GetPixelSize (double &x, double &y)
 Return the pixel size expressed coordinate system units.
ColorGetSceneLightingColor ()
 returns the scene lighting color
ScreenRect GetScissorRect ()
 returns scissor rect
Color GetTextColor () const
 get current text color
int32 GetWidth () const
 returns width, (whatever was set with SetResolution)
bool IsFading ()
 Determines if a fade is currently occurring.
bool IsFullscreen ()
 returns true if game is in fullscreen mode
bool IsMenuSkinAvailable (std::string &skin_name) const
 Returns true if there is a menu skin avialable corresponding to the argument name.
bool IsScissoringEnabled ()
 returns true if scissoring's enabled
bool IsShaking ()
 returns true if screen is shaking
bool IsValidFont (const std::string &name)
 Returns true if a font has already been successfully loaded.
bool LoadAnimatedImageFromElementsSize (AnimatedImage &image, const std::string &file_name, const uint32 rows, const uint32 cols)
 Loads a MultiImage in an AnimatedImage as frames. This function loads an image and cut it in pieces, loading each of that on frames of an AnimatedImage.
bool LoadAnimatedImageFromNumberElements (AnimatedImage &image, const std::string &file_name, const uint32 rows, const uint32 cols)
 Loads a MultiImage in an AnimatedImage as frames. This function loads an image and cut it in pieces, loading each of that on frames of an AnimatedImage.
bool LoadFont (const std::string &TTF_filename, const std::string &name, uint32 size)
 Loads a font from a .ttf file with a specific size.
bool LoadImage (ImageDescriptor &id)
 loads an image (static or animated image). Assumes that you have already called all the appropriate functions to initialize the image. In the case of a static image, this means setting its filename, and possibly other properties like width, height, and color. In the case of an animated image, it means calling AddFrame().
bool LoadImageGrayScale (ImageDescriptor &id)
 loads an image (static or animated image). Assumes that you have already called all the appropriate functions to initialize the image. In the case of a static image, this means setting its filename, and possibly other properties like width, height, and color. In the case of an animated image, it means calling AddFrame(). The image is loaded in grayscale.
bool LoadMultiImageFromElementsSize (std::vector< StillImage > &images, const std::string &filename, const uint32 width, const uint32 height)
 Loads a MultiImage in a vector of StillImages. This function loads an image and cut it in pieces, loading each of that on separate StillImage objects. It uses the size of the stored elements as input parameters.
bool LoadMultiImageFromNumberElements (std::vector< StillImage > &images, const std::string &filename, const uint32 rows, const uint32 cols)
 Loads a MultiImage in a vector of StillImages. This function loads an image and cut it in pieces, loading each of that on separate StillImage objects. It uses the number of stored elements as input parameters.
bool MakeLightning (const std::string &lit_file)
 call to create lightning effect
bool MakeScreenshot ()
 makes a screenshot, saves it as screenshot.jpg in the directory of the game
void Move (float x, float y)
 sets draw position to (x,y)
void MoveRelative (float dx, float dy)
 moves draw position (dx, dy) units
void PopMatrix ()
 pops the modelview transformation from the stack.
void PopState ()
 pops the most recently pushed video engine state from the stack and restores all of the old settings.
void PushMatrix ()
 saves current modelview transformation on to the stack. In English, that means the combined result of calls to Move/MoveRelative/Scale/Rotate
void PushState ()
 saves entire state of the video engine on to the stack (all draw flags, coordinate system, scissor rect, viewport, etc.) This is useful for safety purposes between two major parts of code to ensure that one part doesn't inadvertently affect the other. However, it's a very expensive function call. If you only need to push the current transformation, you should use PushMatrix() and PopMatrix()
bool ReloadTextures ()
 reloads textures that have been unloaded after a video settings change
RenderedStringRenderText (const hoa_utils::ustring &txt)
 Renders the given string to a drawable object.
void Rotate (float angle)
 rotates images counterclockwise by 'angle' radians
bool SaveImage (const std::string &file_name, const AnimatedImage &image) const
 Saves an AnimatedImage into a file.
bool SaveImage (const std::string &file_name, const StillImage &image) const
 Saves a StillImage into a file.
bool SaveImage (const std::string &file_name, const std::vector< StillImage * > &image, const uint32 rows, const uint32 columns) const
 Saves a vector of images in a single file.
void Scale (float x, float y)
 after you call this, subsequent calls to DrawImage() result in a scaled image
void SetCoordSys (const CoordSys &coordinate_system)
 sets the coordinate system. Default is (0,1024,0,768)
void SetCoordSys (float left, float right, float bottom, float top)
 sets the coordinate system. Default is (0,1024,0,768)
bool SetDefaultCursor (const std::string &cursor_image_filename)
 sets the default cursor to the image in the given filename
void SetDefaultMenuSkin (std::string &skin_name)
 Sets the default menu skin to use.
void SetDrawFlags (int32 first_flag,...)
 sets draw flags (flip, align, blending, etc). Simply pass in as many parameters as you want, as long as the last parameter is a zero. e.g. SetDrawFlags(VIDEO_X_LEFT, VIDEO_Y_CENTER, 0);
bool SetFont (const std::string &name)
 sets current font
bool SetFontShadowStyle (const std::string &font_name, TEXT_SHADOW_STYLE style)
 sets the shadow style to use for the given font
bool SetFontShadowXOffset (const std::string &font_name, int32 x)
 sets the shadow offset to use for a given font. By default, all font shadows are slightly to the right and to the bottom of the text, by an offset of fontHeight / 8. That doesn't always look good though, so use this function to adjust it if you want.
bool SetFontShadowYOffset (const std::string &font_name, int32 y)
 sets the shadow offset to use for a given font. By default, all font shadows are slightly to the right and to the bottom of the text, by an offset of fontHeight / 8. That doesn't always look good though, so use this function to adjust it if you want.
bool SetFullscreen (bool fullscreen)
 sets the game to fullscreen or windowed depending on whether true or false is passed
void SetGamma (float value)
 Sets a new gamma value using SDL_SetGamma().
bool SetResolution (int32 width, int32 height)
 sets the current resolution to the given width and height
void SetScissorRect (const ScreenRect &rect)
 sets the rectangle to use for scissorring. This version of the function expects a ScreenRect, in other words the coordinates have already been transformed to integer values (pixel unit) with (0,0) as the upper left and (w-1, h-1) as the lower right, where w and h are the current screen dimensions
void SetScissorRect (float left, float right, float bottom, float top)
 sets the rectangle to use for scissorring, where you can specify an area of the screen for draw operations to affect. Note, the coordinates you pass in are based on the current coordinate system, not screen coords
bool SetTarget (VIDEO_TARGET target)
 set the target, i.e. whether the video engine is being used to draw to an SDL window, or a QT widget. (There are some important differences, so the video engine needs to know).
void SetTextColor (const Color &color)
 sets current text color
void SetTransform (float m[16])
 sets OpenGL transform to contents of 4x4 matrix (16 values)
void SetViewport (float left, float right, float bottom, float top)
 sets the viewport, i.e. the area of the screen that gets drawn to. The default is (0, 100, 0, 100).
bool ShakeScreen (float force, float falloff_time, ShakeFalloff falloff=VIDEO_FALLOFF_NONE)
 shakes the screen
bool SingletonInitialize ()
 A method for the inheriting class to implement, which initializes the class.
void StopAllParticleEffects (bool kill_immediate=false)
 stops all active particle effects
bool StopShaking ()
 stops all shake effects
StillImage TilesToObject (std::vector< StillImage > &tiles, std::vector< std::vector< uint32 > > indices)
 converts a 2D array of tiles into one big image
bool ToggleAdvancedDisplay ()
 toggles advanced information display for video engine, shows things like number of texture switches per frame, etc.
void ToggleFPS ()
 toggles the FPS display (on by default)
bool ToggleFullscreen ()
 toggles fullscreen on and off
bool UnloadTextures ()
 unloads all texture sheets from memory when we lose the GL context, so textures can be properly reloaded
 ~GameVideo ()
Methods for loading of menu skins
These methods all attempt to load a menu skin. The differences between these implementations are whether the skin includes a background image, single background color, multiple background colors, or some combination thereof.

Parameters:
skin_name The name that will be used to refer to the skin after it is successfully loaded
border_image The filename for the multi-image that contains the menu's border images
background_image The filename for the skin's background image (optional)
top_left Sets the background color for the top left portion of the skin
top_right Sets the background color for the top right portion of the skin
bottom_left Sets the background color for the bottom left portion of the skin
bottom_right Sets the background color for the bottom right portion of the skin
make_default If this skin should be the default menu skin to be used, set this argument to true
Returns:
True if the skin was loaded successfully, or false in case of an error
A few notes about this function:
  • If you set a background image, any background colors will not be visible unless the background image has some transparency
  • If no other menu skins are loaded when this function is called, the default skin will automatically be set to this skin, regardless of the value of the make_default parameter.


bool LoadMenuSkin (std::string skin_name, std::string border_image, std::string background_image, Color top_left, Color top_right, Color bottom_left, Color bottom_right, bool make_default=false)
 A background image with multiple background colors.
bool LoadMenuSkin (std::string skin_name, std::string border_image, std::string background_image, Color background_color, bool make_default=false)
 A background image with a single background color.
bool LoadMenuSkin (std::string skin_name, std::string border_image, Color top_left, Color top_right, Color bottom_left, Color bottom_right, bool make_default=false)
 No background image with multiple background colors.
bool LoadMenuSkin (std::string skin_name, std::string border_image, Color background_color, bool make_default=false)
 No background image with a single background color.
bool LoadMenuSkin (std::string skin_name, std::string border_image, std::string background_image, bool make_default=false)
 A background image with no background colors.

Private Member Functions

bool _BindTexture (GLuint tex_ID)
 wraps a call to glBindTexture(), except it adds checking to eliminate redundant texture binding. Redundancy checks are already implemented by most drivers, but this is a double check "just in case"
bool _CacheGlyphs (const uint16 *uText, FontProperties *fp)
 caches glyph info and textures for rendering
void _ConvertImageToGrayscale (const private_video::ImageLoadInfo &src, private_video::ImageLoadInfo &dst) const
 Converts a color image to a grayscale one; Converts a colored image in a grayscale one. Actually, it converts not an image, but an ImageLoadInfo structure. This is used internally when creating grayscale images.
int32 _ConvertXAlign (int32 xalign)
 converts VIDEO_DRAW_LEFT or VIDEO_DRAW_RIGHT flags to a numerical offset
int32 _ConvertYAlign (int32 yalign)
 converts VIDEO_DRAW_TOP or VIDEO_DRAW_BOTTOM flags to a numerical offset
GLuint _CreateBlankGLTexture (int32 width, int32 height)
 creates a blank texture of the given width and height and returns integer used by OpenGL to refer to this texture. Returns 0xffffffff on failure.
std::string _CreateTempFilename (const std::string &extension)
 returns a filename like TEMP_abcd1234.ext, and each time you call it, it increments the alphanumeric part of the filename. This way, during any particular run of the game, each temp filename is guaranteed to be unique. Assuming you create a new temp file every second, it would take 100,000 years to get from TEMP_00000000 to TEMP_zzzzzzzz
private_video::TexSheet_CreateTexSheet (int32 width, int32 height, private_video::TexSheetType type, bool is_static)
 creates a texture sheet
bool _DEBUG_ShowAdvancedStats ()
 function solely for debugging, which shows number of texture switches made during a frame, and other statistics useful for performance tweaking, etc.
bool _DEBUG_ShowTexSheet ()
 function solely for debugging, which displays the currently selected texture sheet. By using DEBUG_NextTexSheet() and DEBUG_PrevTexSheet(), you can change the current texture sheet so the sheet shown by this function cycles through all currently loaded sheets.
bool _DeleteImage (AnimatedImage &id)
 decreases ref count of an animated image
bool _DeleteImage (StillImage &id)
 decreases ref count of an image
bool _DeleteImage (private_video::Image *const image)
 decreases the reference count of an image
bool _DeleteTempTextures ()
 deletes the temporary textures from the "temp" folder that were saved by _SaveTempTextures()
bool _DeleteTexture (GLuint tex_ID)
 wraps a call to glDeleteTextures(), except it adds some checking related to eliminating redundant texture binding.
bool _DrawElement (const private_video::ImageElement &element, const Color *color_array)
 draws an image element, i.e. one image within an image descriptor which may contain multiple images
bool _DrawStillImage (const StillImage &img, const Color &color)
 helper function to DrawImage() to do the actual work of drawing an image
bool _DrawStillImage (const StillImage &img)
 helper function to DrawImage() to do the actual work of doing an image
bool _DrawTextHelper (const uint16 *const uText)
 does the actual work of drawing text
RenderedLine_GenTexLine (uint16 *line, FontProperties *fp)
 generates a texture for a given line
void _GetBufferFromImage (hoa_video::private_video::ImageLoadInfo &buffer, hoa_video::private_video::Image *img) const
 Pass an image (video memory) to a system memory buffer.
void _GetBufferFromTexture (hoa_video::private_video::ImageLoadInfo &buffer, hoa_video::private_video::TexSheet *texture) const
 Pass a texture (video memory) to a system memory buffer.
bool _GetImageInfoJpeg (const std::string &file_name, uint32 &rows, uint32 &cols, uint32 &bpp)
 Get information of a Jpeg file.
bool _GetImageInfoPng (const std::string &file_name, uint32 &rows, uint32 &cols, uint32 &bpp)
 Get information of a Png file.
Color _GetTextShadowColor (FontProperties *fp)
 retrieves the shadow color based on the current color and shadow style
private_video::TexSheet_InsertImageInTexSheet (private_video::Image *image, private_video::ImageLoadInfo &load_info, bool is_static)
 inserts an image into a texture sheet
bool _LoadImage (AnimatedImage &id)
 loads an animated image. Assumes that you have called AddFrame for all the frames.
bool _LoadImage (StillImage &id)
 loads an image
bool _LoadImageHelper (StillImage &id)
 does the actual work of loading an image
bool _LoadMultiImage (std::vector< StillImage > &images, const std::string &file_name, const uint32 &rows, const uint32 &cols)
 Loads an image file in several StillImages.
bool _LoadRawImage (const std::string &file_name, private_video::ImageLoadInfo &load_info)
 Load raw image data from a file.
bool _LoadRawImageJpeg (const std::string &file_name, private_video::ImageLoadInfo &load_info)
 Load raw image data from a JPG file.
bool _LoadRawImagePng (const std::string &file_name, private_video::ImageLoadInfo &load_info)
 Load raw image data from a PNG file.
void _PopContext ()
 restores coord system, draw flags, and transformations
void _PushContext ()
 saves coord system, draw flags, and transformations
bool _ReloadImagesToSheet (private_video::TexSheet *tex_sheet)
 loop through all currently loaded images and if they belong to the given tex sheet, reload them into it
bool _RemoveImage (private_video::Image *image_to_remove)
 removes the image from the STL map with the same pointer as the one passed in. Returns false on failure
bool _RemoveSheet (private_video::TexSheet *sheet_to_remove)
 removes a texture sheet from our vector of sheets and deletes it
void _RGBAToRGB (const private_video::ImageLoadInfo &src, private_video::ImageLoadInfo &dst) const
 Converts a RGBA buffer to a RGB one.
float _RoundForce (float force)
 rounds a force value to the nearest integer. Rounding is based on probability. For example the number 2.85 has an 85% chance of rounding to 3 and a 15% chance of rounding to 2
bool _SaveJpeg (const std::string &file_name, hoa_video::private_video::ImageLoadInfo &info) const
 Saves Raw data in a Jpeg file.
bool _SavePng (const std::string &file_name, hoa_video::private_video::ImageLoadInfo &info) const
 Saves Raw data in a Png file.
bool _SaveTempTextures ()
 saves temporary textures to disk, in other words, textures which were not loaded to a file. This is used when the GL context is being destroyed, perhaps because we are switching from windowed to fullscreen. So, we need to save all textures to disk so we can reload them later.
int32 _ScreenCoordX (float x)
 takes an x value and converts it into screen coordinates
int32 _ScreenCoordY (float y)
 takes an x value and converts it into screen coordinates
bool _ShouldSmooth ()
 Whether textures should be smoothed for non natural resolution.
void _UpdateShake (int32 frame_time)
 updates the shaking effect
 GameVideo ()

Private Attributes

bool _advanced_display
 advanced display flag. If true, info about the video engine is shown on screen
int32 _animation_counter
 counter to keep track of milliseconds since game started for animations
int8 _blend
 blend flag which specifies normal alpha blending
std::stack< private_video::Context_context_stack
 stack containing context, i.e. draw flags plus coord sys. Context is pushed and popped by any GameVideo functions that clobber these settings
CoordSys _coord_sys
 current coordinate system
int32 _current_debug_TexSheet
 current debug texture sheet
std::string _current_font
 current font name
int32 _current_frame_diff
 keeps track of the number of frames animations should increment by for the current frame
Color _current_text_color
 current text color
StillImage _default_menu_cursor
 image which is to be used as the cursor
private_video::ScreenFader _fader
 fader class which implements screen fading
Color _fog_color
 current fog color (set by SetFog())
float _fog_intensity
 current fog intensity (set by SetFog())
std::map< std::string, FontProperties * > _font_map
 STL map containing properties for each font (includeing TTF_Font *).
bool _fps_display
 fps display flag. If true, FPS is displayed
bool _fullscreen
 true if game is currently running fullscreen
float _gamma_value
 Current gamma value.
int32 _height
 current screen height
std::map< std::string, private_video::Image * > _images
 STL map containing all the images currently being managed by the video engine.
GLuint _last_tex_ID
 ID of the last texture that was bound. Used to eliminate redundant binding of textures.
Color _light_color
 current scene lighting color (essentially just modulates vertex colors of all the images)
GLuint _light_overlay
 lighting overlay texture
bool _lightning_active
 true if a lightning effect is active
int32 _lightning_current_time
 current time of lightning effect (time since it started)
std::vector< float > _lightning_data
 intensity data for lightning effect
int32 _lightning_end_time
 how many milliseconds to do the lightning effect for
char _next_temp_file [9]
 eight character name for temp files that increments every time you create a new one so they are always unique
int32 _num_draw_calls
 keep track of number of draw calls per frame
int32 _num_tex_switches
 keep track of number of texture switches per frame
std::map< std::string, ParticleEffectDef * > _particle_effect_defs
 STL map containing all loaded particle effect definitions.
private_video::ParticleManager _particle_manager
 particle manager, does dirty work of managing particle effects
StillImage _rectangle_image
 Image used for rendering rectangles.
bool _scissor_enabled
 is scissoring enabled or not
ScreenRect _scissor_rect
 current scissor rectangle
std::list< private_video::ShakeForce_shake_forces
 current shake forces affecting screen
VIDEO_TARGET _target
 target (QT widget or SDL window)
bool _temp_fullscreen
 holds the desired fullscreen status (true=fullscreen, false=windowed). Not actually applied until ApplySettings() is called
int32 _temp_height
 holds the desired screen height. Not actually applied until ApplySettings() is called
int32 _temp_width
 holds the desired screen width. Not actually applied until ApplySettings() is called
std::vector< private_video::TexSheet * > _tex_sheets
 vector containing all texture sheets currently being managed by the video engine
bool _text_shadow
 if true, text shadow effect is enabled
bool _uses_lights
 true if real lights are enabled
ScreenRect _viewport
 current viewport
int32 _width
 current screen width
float _x
 the current draw cursor position
int8 _x_align
 x align flag which tells if images should be left, center, or right aligned
int8 _x_flip
 x flip flag. true if images should be flipped horizontally
float _x_shake
 X offset to shake the screen by (if any).
float _y
int8 _y_align
 y align flag which tells if images should be top, center, or bottom aligned
int8 _y_flip
 y flip flag. true if images should be flipped vertically
float _y_shake
 Y offset to shake the screen by (if any).

Friends

class hoa_utils::Singleton< GameVideo >
class MenuWindow
class OptionBox
class private_video::FixedTexMemMgr
class private_video::GUIElement
class private_video::GUISupervisor
class private_video::ParticleSystem
class private_video::TexSheet
class private_video::VariableTexMemMgr
class RenderedString
class StillImage
class TextBox

Detailed Description

Manages all the video operations and serves as the API to the video engine.

****************************************************************************

This is one of the largest classes in the Allacrost engine. Because it is so large, the implementation of many of the methods for this class are split up into multiple .cpp source files in the video code directory.

Definition at line 197 of file video.h.


Constructor & Destructor Documentation

hoa_video::GameVideo::~GameVideo (  ) 

Definition at line 410 of file video.cpp.

References _font_map, _images, _particle_manager, _tex_sheets, hoa_video::private_video::ParticleManager::Destroy(), hoa_video::private_video::GUIManager, hoa_utils::Singleton< T >::SingletonDestroy(), and hoa_video::VIDEO_DEBUG.

Here is the call graph for this function:

hoa_video::GameVideo::GameVideo (  )  [private]

Definition at line 112 of file video.cpp.

References _advanced_display, _animation_counter, _blend, _coord_sys, _current_debug_TexSheet, _current_frame_diff, _current_text_color, _fog_color, _fog_intensity, _fps_display, _fullscreen, _gamma_value, _height, _last_tex_ID, _light_color, _light_overlay, _lightning_active, _lightning_current_time, _lightning_end_time, _next_temp_file, _num_tex_switches, _scissor_enabled, _scissor_rect, _target, _temp_fullscreen, _temp_height, _temp_width, _text_shadow, _uses_lights, _viewport, _width, _x, _x_align, _x_flip, _x_shake, _y, _y_align, _y_flip, _y_shake, hoa_video::VIDEO_DEBUG, and hoa_video::VIDEO_TARGET_SDL_WINDOW.


Member Function Documentation

bool hoa_video::GameVideo::_BindTexture ( GLuint  tex_ID  )  [private]

wraps a call to glBindTexture(), except it adds checking to eliminate redundant texture binding. Redundancy checks are already implemented by most drivers, but this is a double check "just in case"

Parameters:
tex_ID integer handle to the OpenGL texture
Returns:
success/failure

Definition at line 1027 of file video.cpp.

References _last_tex_ID, and _num_tex_switches.

Referenced by _CreateBlankGLTexture(), _DrawElement(), _GenTexLine(), _GetBufferFromTexture(), ApplyLightingOverlay(), Draw(), hoa_video::private_video::ParticleSystem::Draw(), and SaveImage().

bool hoa_video::GameVideo::_CacheGlyphs ( const uint16 uText,
FontProperties fp 
) [private]

caches glyph info and textures for rendering

Parameters:
uText Pointer to a unicode string holding the glyphs to cache
fp Pointer to the internal FontProperties class representing the font
Returns:
success/failure

Definition at line 301 of file text.cpp.

References hoa_video::FontGlyph::advance, hoa_video::FontProperties::ascent, hoa_video::FontProperties::glyph_cache, hoa_video::FontGlyph::height, hoa_video::FontGlyph::max_x, hoa_video::FontGlyph::max_y, hoa_video::FontGlyph::min_x, hoa_video::FontGlyph::min_y, hoa_utils::RoundUpPow2(), hoa_video::FontGlyph::texture, hoa_video::FontGlyph::top_y, hoa_video::FontProperties::ttf_font, hoa_video::VIDEO_DEBUG, and hoa_video::FontGlyph::width.

Referenced by RenderText().

Here is the call graph for this function:

void hoa_video::GameVideo::_ConvertImageToGrayscale ( const private_video::ImageLoadInfo src,
private_video::ImageLoadInfo dst 
) const [private]

Converts a color image to a grayscale one; Converts a colored image in a grayscale one. Actually, it converts not an image, but an ImageLoadInfo structure. This is used internally when creating grayscale images.

Parameters:
src Information of a color image
dst ImageLoadInfo struct where the grayscale image will be stored

Definition at line 37 of file tex_mgmt.cpp.

References hoa_video::private_video::ImageLoadInfo::height, hoa_video::private_video::ImageLoadInfo::pixels, and hoa_video::private_video::ImageLoadInfo::width.

Referenced by _ReloadImagesToSheet(), and hoa_video::StillImage::EnableGrayScale().

int32 hoa_video::GameVideo::_ConvertXAlign ( int32  xalign  )  [private]

converts VIDEO_DRAW_LEFT or VIDEO_DRAW_RIGHT flags to a numerical offset

Parameters:
xalign the draw flag
Returns:
the numerical offset

Definition at line 1510 of file video.cpp.

References hoa_video::VIDEO_X_CENTER, and hoa_video::VIDEO_X_LEFT.

Referenced by hoa_video::TextBox::_DrawTextLines().

int32 hoa_video::GameVideo::_ConvertYAlign ( int32  yalign  )  [private]

converts VIDEO_DRAW_TOP or VIDEO_DRAW_BOTTOM flags to a numerical offset

Parameters:
yalign the draw flag
Returns:
the numerical offset

Definition at line 1492 of file video.cpp.

References hoa_video::VIDEO_Y_BOTTOM, and hoa_video::VIDEO_Y_CENTER.

GLuint hoa_video::GameVideo::_CreateBlankGLTexture ( int32  width,
int32  height 
) [private]

creates a blank texture of the given width and height and returns integer used by OpenGL to refer to this texture. Returns 0xffffffff on failure.

Parameters:
width desired width of the texture
height desired height of the texture
Returns:
OpenGL ID for this texture or 0xffffffff for failure.

Definition at line 2884 of file tex_mgmt.cpp.

References _BindTexture(), _DeleteTexture(), _ShouldSmooth(), hoa_video::VIDEO_DEBUG, and hoa_video::VideoManager.

Referenced by EnablePointLights(), and ReloadTextures().

Here is the call graph for this function:

std::string hoa_video::GameVideo::_CreateTempFilename ( const std::string &  extension  )  [private]

returns a filename like TEMP_abcd1234.ext, and each time you call it, it increments the alphanumeric part of the filename. This way, during any particular run of the game, each temp filename is guaranteed to be unique. Assuming you create a new temp file every second, it would take 100,000 years to get from TEMP_00000000 to TEMP_zzzzzzzz

Parameters:
extension The extension for the temp file. Although we could just save temp files without an extension, that might cause stupid bugs like DevIL refusing to load an image because it doesn't end with .png.
Returns:
name of the generated temp file

Definition at line 1374 of file video.cpp.

References _next_temp_file, and hoa_video::VIDEO_DEBUG.

TexSheet * hoa_video::GameVideo::_CreateTexSheet ( int32  width,
int32  height,
private_video::TexSheetType  type,
bool  is_static 
) [private]

creates a texture sheet

Parameters:
width width of the sheet
height height of the sheet
type specifies what type of images this texture sheet manages (e.g. 32x32 images, 64x64 images, any type, etc)
is_static if true, this texture sheet is meant to manage images which are not expected to be loaded and unloaded very often
Returns:
the newly created texsheet

Definition at line 1552 of file tex_mgmt.cpp.

References hoa_utils::IsPowerOfTwo(), hoa_video::VIDEO_DEBUG, and hoa_video::private_video::VIDEO_TEXSHEET_TOTAL.

Referenced by _InsertImageInTexSheet(), CaptureScreen(), and SingletonInitialize().

Here is the call graph for this function:

bool hoa_video::GameVideo::_DEBUG_ShowAdvancedStats (  )  [private]

function solely for debugging, which shows number of texture switches made during a frame, and other statistics useful for performance tweaking, etc.

Returns:
success/failure

Definition at line 864 of file video.cpp.

References _num_tex_switches, _particle_manager, DrawText(), hoa_video::private_video::ParticleManager::GetNumParticles(), Move(), and SetFont().

Referenced by Display().

Here is the call graph for this function:

bool hoa_video::GameVideo::_DEBUG_ShowTexSheet (  )  [private]

function solely for debugging, which displays the currently selected texture sheet. By using DEBUG_NextTexSheet() and DEBUG_PrevTexSheet(), you can change the current texture sheet so the sheet shown by this function cycles through all currently loaded sheets.

Returns:
success/failure

Definition at line 1667 of file tex_mgmt.cpp.

References _coord_sys, _current_debug_TexSheet, _PopContext(), _PushContext(), _tex_sheets, DrawImage(), DrawText(), hoa_video::CoordSys::GetTop(), hoa_video::private_video::TexSheet::height, hoa_video::private_video::TexSheet::is_static, Move(), MoveRelative(), SetCoordSys(), SetDrawFlags(), SetFont(), hoa_video::private_video::TexSheet::tex_ID, hoa_video::private_video::TexSheet::type, hoa_video::VIDEO_DEBUG, hoa_video::VIDEO_NO_BLEND, hoa_video::private_video::VIDEO_TEXSHEET_32x32, hoa_video::private_video::VIDEO_TEXSHEET_32x64, hoa_video::private_video::VIDEO_TEXSHEET_64x64, hoa_video::private_video::VIDEO_TEXSHEET_ANY, hoa_video::VIDEO_X_LEFT, hoa_video::VIDEO_Y_BOTTOM, and hoa_video::private_video::TexSheet::width.

Referenced by Display().

Here is the call graph for this function:

bool hoa_video::GameVideo::_DeleteImage ( AnimatedImage id  )  [private]

decreases ref count of an animated image

Parameters:
id image descriptor to decrease the reference count of
Returns:
success/failure

Definition at line 2067 of file tex_mgmt.cpp.

References _DeleteImage().

Here is the call graph for this function:

bool hoa_video::GameVideo::_DeleteImage ( StillImage id  )  [private]

decreases ref count of an image

Parameters:
id image descriptor to decrease the reference count of
Returns:
success/failure

Definition at line 2092 of file tex_mgmt.cpp.

References _DeleteImage(), hoa_video::private_video::TexSheet::FreeImage(), hoa_video::private_video::Image::height, hoa_video::private_video::Image::ref_count, hoa_video::private_video::Image::texture_sheet, hoa_video::VIDEO_DEBUG, and hoa_video::private_video::Image::width.

Here is the call graph for this function:

bool hoa_video::GameVideo::_DeleteImage ( private_video::Image *const   image  )  [private]

decreases the reference count of an image

Parameters:
image pointer to image
Returns:
success/failure

Definition at line 1805 of file tex_mgmt.cpp.

References _images, _RemoveImage(), _RemoveSheet(), hoa_video::private_video::Image::filename, hoa_video::private_video::TexSheet::FreeImage(), hoa_video::private_video::Image::grayscale, hoa_video::private_video::Image::height, hoa_video::private_video::Image::ref_count, hoa_video::private_video::Image::texture_sheet, hoa_video::VIDEO_DEBUG, and hoa_video::private_video::Image::width.

Referenced by _DeleteImage(), and DeleteImage().

Here is the call graph for this function:

bool hoa_video::GameVideo::_DeleteTempTextures (  )  [private]

deletes the temporary textures from the "temp" folder that were saved by _SaveTempTextures()

Returns:
success/failure

Definition at line 3152 of file tex_mgmt.cpp.

References hoa_utils::CleanDirectory().

Referenced by ReloadTextures().

Here is the call graph for this function:

bool hoa_video::GameVideo::_DeleteTexture ( GLuint  tex_ID  )  [private]

wraps a call to glDeleteTextures(), except it adds some checking related to eliminating redundant texture binding.

Parameters:
tex_ID integer handle to the OpenGL texture
Returns:
success/failure

Definition at line 2831 of file tex_mgmt.cpp.

References _last_tex_ID.

Referenced by _CreateBlankGLTexture(), DisablePointLights(), UnloadTextures(), and hoa_video::RenderedString::~RenderedString().

bool hoa_video::GameVideo::_DrawElement ( const private_video::ImageElement element,
const Color color_array 
) [private]

draws an image element, i.e. one image within an image descriptor which may contain multiple images

Note:
this function takes an array of vertex colors. in cases where modulation is required, copy the element.color array and modulate it, else just pass element.color as this argument.
Parameters:
element pointer to the image element to draw
color_array pointer to an 4 element array of vertex colors, modulated if necessary
Returns:
success/failure

Definition at line 145 of file draw.cpp.

References _BindTexture(), _blend, _x_flip, _y_flip, hoa_video::private_video::ImageElement::blend, hoa_video::private_video::ImageElement::image, hoa_video::private_video::ImageElement::one_color, hoa_video::private_video::TexSheet::tex_ID, hoa_video::private_video::Image::texture_sheet, hoa_video::private_video::ImageElement::u1, hoa_video::private_video::Image::u1, hoa_video::private_video::ImageElement::u2, hoa_video::private_video::Image::u2, hoa_video::private_video::ImageElement::v1, hoa_video::private_video::Image::v1, hoa_video::private_video::ImageElement::v2, hoa_video::private_video::Image::v2, and hoa_video::VIDEO_DEBUG.

Referenced by _DrawStillImage().

Here is the call graph for this function:

bool hoa_video::GameVideo::_DrawStillImage ( const StillImage img,
const Color color 
) [private]

helper function to DrawImage() to do the actual work of drawing an image

Parameters:
img static image to draw
color color to modulate image by
Returns:
success/failure

Definition at line 46 of file draw.cpp.

References _coord_sys, _DrawElement(), _fader, _height, _width, _x_align, _x_flip, _x_shake, _y_align, _y_flip, _y_shake, hoa_video::CoordSys::GetBottom(), hoa_video::private_video::ScreenFader::GetFadeModulation(), hoa_video::CoordSys::GetHorizontalDirection(), hoa_video::CoordSys::GetLeft(), hoa_video::CoordSys::GetRight(), hoa_video::CoordSys::GetTop(), hoa_video::CoordSys::GetVerticalDirection(), MoveRelative(), hoa_video::VIDEO_DEBUG, and hoa_video::Color::white.

Here is the call graph for this function:

bool hoa_video::GameVideo::_DrawStillImage ( const StillImage img  )  [private]

helper function to DrawImage() to do the actual work of doing an image

Parameters:
img static image to draw
Returns:
success/failure

Definition at line 28 of file draw.cpp.

References _light_color, _uses_lights, and hoa_video::Color::white.

Referenced by DrawImage().

bool hoa_video::GameVideo::_DrawTextHelper ( const uint16 *const   uText  )  [private]

does the actual work of drawing text

Parameters:
uText Pointer to a unicode string holding the text to draw
Returns:
success/failure

Definition at line 474 of file text.cpp.

References hoa_video::CoordSys::GetHorizontalDirection(), hoa_video::CoordSys::GetVerticalDirection(), hoa_video::FontProperties::glyph_cache, hoa_video::FontProperties::ttf_font, and hoa_video::VIDEO_DEBUG.

Referenced by DrawText().

Here is the call graph for this function:

RenderedLine * hoa_video::GameVideo::_GenTexLine ( uint16 line,
FontProperties fp 
) [private]

generates a texture for a given line

Parameters:
line Pointer to a unicode string holding the text to render
fp Pointer to the internal FontProperties class representing the font
Returns:
the line or NULL on failure

Definition at line 115 of file text.cpp.

References _BindTexture(), _current_text_color, _GetTextShadowColor(), _text_shadow, hoa_video::FontProperties::glyph_cache, hoa_utils::RoundUpPow2(), hoa_video::FontProperties::ttf_font, and hoa_video::VIDEO_DEBUG.

Referenced by RenderText().

Here is the call graph for this function:

void hoa_video::GameVideo::_GetBufferFromImage ( hoa_video::private_video::ImageLoadInfo buffer,
hoa_video::private_video::Image img 
) const [private]

Pass an image (video memory) to a system memory buffer.

Parameters:
buffer Buffer where the pixels of the image will be stored
img Image to be copied

Definition at line 1348 of file tex_mgmt.cpp.

References _GetBufferFromTexture(), hoa_video::private_video::Image::height, hoa_video::private_video::ImageLoadInfo::height, hoa_video::private_video::ImageLoadInfo::pixels, hoa_video::private_video::Image::texture_sheet, hoa_video::private_video::Image::width, hoa_video::private_video::ImageLoadInfo::width, hoa_video::private_video::Image::x, and hoa_video::private_video::Image::y.

Referenced by _SaveTempTextures(), hoa_video::StillImage::EnableGrayScale(), and SaveImage().

Here is the call graph for this function:

void hoa_video::GameVideo::_GetBufferFromTexture ( hoa_video::private_video::ImageLoadInfo buffer,
hoa_video::private_video::TexSheet texture 
) const [private]

Pass a texture (video memory) to a system memory buffer.

Parameters:
buffer Buffer where the pixels of the texture will be stored
texture TexSheet to be copied

Definition at line 1326 of file tex_mgmt.cpp.

References _BindTexture(), hoa_video::private_video::TexSheet::height, hoa_video::private_video::ImageLoadInfo::height, hoa_video::private_video::ImageLoadInfo::pixels, hoa_video::private_video::TexSheet::tex_ID, hoa_video::VideoManager, hoa_video::private_video::TexSheet::width, and hoa_video::private_video::ImageLoadInfo::width.

Referenced by _GetBufferFromImage().

Here is the call graph for this function:

bool hoa_video::GameVideo::_GetImageInfoJpeg ( const std::string &  file_name,
uint32 rows,
uint32 cols,
uint32 bpp 
) [private]

Get information of a Jpeg file.

Parameters:
file_name Name of the file, without the extension
rows Rows of the image
cols Columns of the image
bpp Bits per pixel of the image
Returns:
True if the process was carried out with no problem, false otherwise

Definition at line 175 of file tex_mgmt.cpp.

Referenced by GetImageInfo().

bool hoa_video::GameVideo::_GetImageInfoPng ( const std::string &  file_name,
uint32 rows,
uint32 cols,
uint32 bpp 
) [private]

Get information of a Png file.

Parameters:
file_name Name of the file, without the extension
rows Rows of the image
cols Columns of the image
bpp Bits per pixel of the image
Returns:
True if the process was carried out with no problem, false otherwise

Definition at line 116 of file tex_mgmt.cpp.

Referenced by GetImageInfo().

Color hoa_video::GameVideo::_GetTextShadowColor ( FontProperties fp  )  [private]

retrieves the shadow color based on the current color and shadow style

Parameters:
fp Pointer to the internal FontProperties class representing the font
Returns:
the shadow color

Definition at line 976 of file text.cpp.

References _current_text_color, _text_shadow, hoa_video::Color::black, hoa_video::FontProperties::shadow_style, hoa_video::VIDEO_DEBUG, hoa_video::VIDEO_TEXT_SHADOW_BLACK, hoa_video::VIDEO_TEXT_SHADOW_COLOR, hoa_video::VIDEO_TEXT_SHADOW_DARK, hoa_video::VIDEO_TEXT_SHADOW_INVCOLOR, hoa_video::VIDEO_TEXT_SHADOW_LIGHT, hoa_video::VIDEO_TEXT_SHADOW_NONE, and hoa_video::Color::white.

Referenced by _GenTexLine().

TexSheet * hoa_video::GameVideo::_InsertImageInTexSheet ( private_video::Image image,
private_video::ImageLoadInfo load_info,
bool  is_static 
) [private]

inserts an image into a texture sheet

Parameters:
image pointer to the image to insert
load_info attributes of the image to be inserted
is_static Wether an image is static or not
Returns:
a new texsheet with the image in it

Definition at line 1447 of file tex_mgmt.cpp.

References _CreateTexSheet(), _tex_sheets, hoa_video::private_video::TexSheet::AddImage(), hoa_video::private_video::ImageLoadInfo::height, hoa_utils::RoundUpPow2(), hoa_video::VIDEO_DEBUG, hoa_video::private_video::VIDEO_TEXSHEET_32x32, hoa_video::private_video::VIDEO_TEXSHEET_32x64, hoa_video::private_video::VIDEO_TEXSHEET_64x64, hoa_video::private_video::VIDEO_TEXSHEET_ANY, and hoa_video::private_video::ImageLoadInfo::width.

Referenced by _LoadImageHelper(), _LoadMultiImage(), and hoa_video::StillImage::EnableGrayScale().

Here is the call graph for this function:

bool hoa_video::GameVideo::_LoadImage ( AnimatedImage id  )  [private]

loads an animated image. Assumes that you have called AddFrame for all the frames.

Parameters:
id image descriptor to load
Returns:
success/failure

Definition at line 249 of file tex_mgmt.cpp.

References _LoadImage().

Here is the call graph for this function:

bool hoa_video::GameVideo::_LoadImage ( StillImage id  )  [private]

loads an image

Parameters:
id image descriptor to load. Can specify filename, color, width, height, and static as its parameters
Returns:
success/failure

Definition at line 285 of file tex_mgmt.cpp.

References _height, _images, _LoadImageHelper(), _width, and hoa_video::VIDEO_DEBUG.

Referenced by _LoadImage(), and LoadImage().

Here is the call graph for this function:

bool hoa_video::GameVideo::_LoadImageHelper ( StillImage id  )  [private]

does the actual work of loading an image

Parameters:
id StillImage of the image to load. May specify a filename, color, width, height, and static
Returns:
success/failure

Definition at line 639 of file tex_mgmt.cpp.

References _height, _images, _InsertImageInTexSheet(), _LoadRawImage(), _width, hoa_video::private_video::ImageLoadInfo::height, hoa_video::private_video::ImageLoadInfo::pixels, hoa_video::private_video::Image::ref_count, hoa_video::VIDEO_DEBUG, and hoa_video::private_video::ImageLoadInfo::width.

Referenced by _LoadImage().

Here is the call graph for this function:

bool hoa_video::GameVideo::_LoadMultiImage ( std::vector< StillImage > &  images,
const std::string &  file_name,
const uint32 rows,
const uint32 cols 
) [private]

Loads an image file in several StillImages.

Parameters:
images Vector of StillImages to be loaded
file_name Name of the image file to read
rows Number of rows of StillImages
cols Number of columns of StillImages

Definition at line 433 of file tex_mgmt.cpp.

References _images, _InsertImageInTexSheet(), _LoadRawImage(), hoa_utils::DataToString(), hoa_video::private_video::ImageLoadInfo::height, hoa_video::private_video::MultiImageInfo::image, hoa_video::private_video::MultiImageInfo::multi_image, hoa_video::private_video::ImageLoadInfo::pixels, hoa_video::private_video::Image::ref_count, hoa_video::private_video::TexSheet::RestoreImage(), hoa_video::private_video::Image::texture_sheet, hoa_video::VIDEO_DEBUG, and hoa_video::private_video::ImageLoadInfo::width.

Referenced by LoadMultiImageFromElementsSize(), and LoadMultiImageFromNumberElements().

Here is the call graph for this function:

bool hoa_video::GameVideo::_LoadRawImage ( const std::string &  file_name,
private_video::ImageLoadInfo load_info 
) [private]

Load raw image data from a file.

Parameters:
file_name Filename of image to load
load_info Returns with the image file attributes and pixels
Returns:
success/failure

Definition at line 702 of file tex_mgmt.cpp.

References _LoadRawImageJpeg(), and _LoadRawImagePng().

Referenced by _LoadImageHelper(), _LoadMultiImage(), and _ReloadImagesToSheet().

Here is the call graph for this function:

bool hoa_video::GameVideo::_LoadRawImageJpeg ( const std::string &  file_name,
private_video::ImageLoadInfo load_info 
) [private]

Load raw image data from a JPG file.

Parameters:
file_name Filename of image to load
load_info Returns with the image file attributes and pixels
Returns:
success/failure

Definition at line 868 of file tex_mgmt.cpp.

References hoa_video::private_video::ImageLoadInfo::height, hoa_video::private_video::ImageLoadInfo::pixels, hoa_video::VIDEO_DEBUG, and hoa_video::private_video::ImageLoadInfo::width.

Referenced by _LoadRawImage().

bool hoa_video::GameVideo::_LoadRawImagePng ( const std::string &  file_name,
private_video::ImageLoadInfo load_info 
) [private]

Load raw image data from a PNG file.

Parameters:
file_name Filename of image to load
load_info Returns with the image file attributes and pixels
Returns:
success/failure

Definition at line 727 of file tex_mgmt.cpp.

References hoa_video::private_video::ImageLoadInfo::height, hoa_video::private_video::ImageLoadInfo::pixels, hoa_video::VIDEO_DEBUG, and hoa_video::private_video::ImageLoadInfo::width.

Referenced by _LoadRawImage().

void hoa_video::GameVideo::_PopContext (  )  [private]

restores coord system, draw flags, and transformations

Definition at line 1451 of file video.cpp.

References _blend, _context_stack, _current_font, _current_text_color, _scissor_enabled, _scissor_rect, _viewport, _x_align, _x_flip, _y_align, _y_flip, hoa_video::private_video::Context::blend, hoa_video::private_video::Context::coordinate_system, hoa_video::private_video::Context::font, hoa_video::ScreenRect::height, hoa_video::ScreenRect::left, hoa_video::private_video::Context::scissor_rectangle, hoa_video::private_video::Context::scissoring_enabled, SetCoordSys(), hoa_video::private_video::Context::text_color, hoa_video::ScreenRect::top, hoa_video::private_video::Context::viewport, hoa_video::ScreenRect::width, hoa_video::private_video::Context::x_align, hoa_video::private_video::Context::x_flip, hoa_video::private_video::Context::y_align, and hoa_video::private_video::Context::y_flip.

Referenced by _DEBUG_ShowTexSheet(), Display(), hoa_video::TextBox::Draw(), hoa_video::OptionBox::Draw(), hoa_video::MenuWindow::Draw(), DrawFPS(), DrawText(), and PopState().

Here is the call graph for this function:

void hoa_video::GameVideo::_PushContext (  )  [private]

saves coord system, draw flags, and transformations

Definition at line 1420 of file video.cpp.

References _blend, _context_stack, _coord_sys, _current_font, _current_text_color, _scissor_enabled, _scissor_rect, _viewport, _x_align, _x_flip, _y_align, _y_flip, hoa_video::private_video::Context::blend, hoa_video::private_video::Context::coordinate_system, hoa_video::private_video::Context::font, hoa_video::private_video::Context::scissor_rectangle, hoa_video::private_video::Context::scissoring_enabled, hoa_video::private_video::Context::text_color, hoa_video::private_video::Context::viewport, hoa_video::private_video::Context::x_align, hoa_video::private_video::Context::x_flip, hoa_video::private_video::Context::y_align, and hoa_video::private_video::Context::y_flip.

Referenced by _DEBUG_ShowTexSheet(), Display(), hoa_video::TextBox::Draw(), hoa_video::OptionBox::Draw(), hoa_video::MenuWindow::Draw(), DrawFPS(), DrawText(), and PushState().

bool hoa_video::GameVideo::_ReloadImagesToSheet ( private_video::TexSheet tex_sheet  )  [private]

loop through all currently loaded images and if they belong to the given tex sheet, reload them into it

Parameters:
tex_sheet pointer to the tex sheet whose images we want to load
Returns:
success/failure

Definition at line 2988 of file tex_mgmt.cpp.

References _ConvertImageToGrayscale(), _images, _LoadRawImage(), hoa_video::private_video::TexSheet::CopyRect(), hoa_video::private_video::Image::filename, hoa_video::private_video::Image::height, hoa_video::private_video::ImageLoadInfo::height, hoa_video::private_video::MultiImageInfo::image, hoa_video::private_video::MultiImageInfo::multi_image, hoa_video::private_video::ImageLoadInfo::pixels, hoa_video::private_video::Image::tags, hoa_video::private_video::Image::texture_sheet, hoa_video::VIDEO_DEBUG, hoa_video::private_video::Image::width, hoa_video::private_video::ImageLoadInfo::width, hoa_video::private_video::Image::x, and hoa_video::private_video::Image::y.

Here is the call graph for this function:

bool hoa_video::GameVideo::_RemoveImage ( private_video::Image image_to_remove  )  [private]

removes the image from the STL map with the same pointer as the one passed in. Returns false on failure

Parameters:
image_to_remove pointer to the image we want to remove
Returns:
success/failure

Definition at line 2157 of file tex_mgmt.cpp.

References _images.

Referenced by _DeleteImage().

bool hoa_video::GameVideo::_RemoveSheet ( private_video::TexSheet sheet_to_remove  )  [private]

removes a texture sheet from our vector of sheets and deletes it

Parameters:
sheet_to_remove pointer to the sheet we want to remove
Returns:
success/failure

Definition at line 1850 of file tex_mgmt.cpp.

References _tex_sheets.

Referenced by _DeleteImage(), and CaptureScreen().

void hoa_video::GameVideo::_RGBAToRGB ( const private_video::ImageLoadInfo src,
private_video::ImageLoadInfo dst 
) const [private]

Converts a RGBA buffer to a RGB one.

Parameters:
src Information of a RGBA buffer
dst ImageLoadInfo struct where the RGB buffer will be stored

Definition at line 63 of file tex_mgmt.cpp.

References hoa_video::private_video::ImageLoadInfo::height, hoa_video::private_video::ImageLoadInfo::pixels, and hoa_video::private_video::ImageLoadInfo::width.

Referenced by SaveImage().

float hoa_video::GameVideo::_RoundForce ( float  force  )  [private]

rounds a force value to the nearest integer. Rounding is based on probability. For example the number 2.85 has an 85% chance of rounding to 3 and a 15% chance of rounding to 2

Parameters:
force The force to round
Returns:
the rounded force value

Definition at line 146 of file shake.cpp.

Referenced by _UpdateShake().

bool hoa_video::GameVideo::_SaveJpeg ( const std::string &  file_name,
hoa_video::private_video::ImageLoadInfo info 
) const [private]

Saves Raw data in a Jpeg file.

Parameters:
file_name Name of the file, without the extension
info Structure of the information to store
Returns:
True if the process was carried out with no problem, false otherwise

Definition at line 1028 of file tex_mgmt.cpp.

References hoa_video::private_video::ImageLoadInfo::height, hoa_video::private_video::ImageLoadInfo::pixels, hoa_video::VIDEO_DEBUG, and hoa_video::private_video::ImageLoadInfo::width.

Referenced by MakeScreenshot(), and SaveImage().

bool hoa_video::GameVideo::_SavePng ( const std::string &  file_name,
hoa_video::private_video::ImageLoadInfo info 
) const [private]

Saves Raw data in a Png file.

Parameters:
file_name Name of the file, without the extension
info Structure of the information to store
Returns:
True if the process was carried out with no problem, false otherwise

Definition at line 963 of file tex_mgmt.cpp.

References hoa_video::private_video::ImageLoadInfo::height, hoa_video::private_video::ImageLoadInfo::pixels, and hoa_video::private_video::ImageLoadInfo::width.

Referenced by _SaveTempTextures(), and SaveImage().

bool hoa_video::GameVideo::_SaveTempTextures (  )  [private]

saves temporary textures to disk, in other words, textures which were not loaded to a file. This is used when the GL context is being destroyed, perhaps because we are switching from windowed to fullscreen. So, we need to save all textures to disk so we can reload them later.

Returns:
success/failure

Definition at line 3122 of file tex_mgmt.cpp.

References _GetBufferFromImage(), _images, _SavePng(), hoa_video::private_video::Image::filename, and hoa_video::private_video::Image::tags.

Referenced by UnloadTextures().

Here is the call graph for this function:

int32 hoa_video::GameVideo::_ScreenCoordX ( float  x  )  [private]

takes an x value and converts it into screen coordinates

Returns:
the converted value

Definition at line 1640 of file video.cpp.

References _coord_sys, _width, hoa_video::CoordSys::GetLeft(), and hoa_video::CoordSys::GetRight().

Referenced by CalculateScreenRect().

Here is the call graph for this function:

int32 hoa_video::GameVideo::_ScreenCoordY ( float  y  )  [private]

takes an x value and converts it into screen coordinates

Returns:
the converted value

Definition at line 1656 of file video.cpp.

References _coord_sys, _height, hoa_video::CoordSys::GetBottom(), and hoa_video::CoordSys::GetTop().

Referenced by CalculateScreenRect().

Here is the call graph for this function:

bool hoa_video::GameVideo::_ShouldSmooth (  )  [private]

Whether textures should be smoothed for non natural resolution.

Definition at line 1672 of file video.cpp.

References _height, _width, hoa_video::VIDEO_STANDARD_RES_HEIGHT, and hoa_video::VIDEO_STANDARD_RES_WIDTH.

Referenced by _CreateBlankGLTexture().

void hoa_video::GameVideo::_UpdateShake ( int32  frame_time  )  [private]

updates the shaking effect

Parameters:
frame_time elapsed time for the current rendering frame

Definition at line 165 of file shake.cpp.

References _RoundForce(), _shake_forces, _x_shake, _y_shake, hoa_video::private_video::ShakeForce::current_time, hoa_video::private_video::ShakeForce::end_time, hoa_video::Interpolator::GetValue(), hoa_video::private_video::ShakeForce::interpolator, hoa_video::RandomFloat(), hoa_video::Interpolator::Update(), and hoa_video::VIDEO_TIME_BETWEEN_SHAKE_UPDATES.

Referenced by Display().

Here is the call graph for this function:

ParticleEffectID hoa_video::GameVideo::AddParticleEffect ( const std::string &  particle_effect_filename,
float  x,
float  y,
bool  reload = false 
)

add a particle effect at the given point x and y

Parameters:
particle_effect_filename - file containing the particle effect definition
x - X coordinate of the effect
y - Y coordinate of the effect
reload - reload the effect from file if it already exists
Returns:
id corresponding to the loaded particle effect
Note:
set the reload parameter to true to reload the effect definition file every time the effect is played. This is useful if you are working on an effect and want to see how it looks. When we actually release the game, reload should be false since it adds some cost to the loading

bool hoa_video::GameVideo::ApplyLightingOverlay (  ) 

call after rendering all real lights. This function renders all lights to the lighting overlay texture, Moved into ApplyLightingOverlay call after all map images are drawn to apply lighting. All menu and text rendering should occur AFTER this call, so that they are not affected by lighting.

Returns:
success/failure

Definition at line 1194 of file video.cpp.

References _BindTexture(), _coord_sys, _height, _light_overlay, _width, hoa_video::CoordSys::GetBottom(), hoa_video::CoordSys::GetLeft(), hoa_video::CoordSys::GetRight(), hoa_video::CoordSys::GetTop(), and SetCoordSys().

Here is the call graph for this function:

bool hoa_video::GameVideo::ApplySettings (  ) 

applies any changes to video settings like resolution and fullscreen. If the changes fail, then this function returns false, and the video settings are reset to whatever the last working setting was.

Returns:
success/failure

Definition at line 555 of file video.cpp.

References _fog_color, _fog_intensity, _fullscreen, _height, _target, _temp_fullscreen, _temp_height, _temp_width, _width, EnableFog(), ReloadTextures(), UnloadTextures(), hoa_video::VIDEO_DEBUG, hoa_video::VIDEO_TARGET_QT_WIDGET, and hoa_video::VIDEO_TARGET_SDL_WINDOW.

Referenced by hoa_input::GameInput::_KeyEventHandler(), hoa_boot::BootMode::_OnVideoMode(), hoa_boot::BootMode::_SetResolution(), hoa_editor::Grid::resizeGL(), and SingletonInitialize().

Here is the call graph for this function:

ScreenRect hoa_video::GameVideo::CalculateScreenRect ( float  left,
float  right,
float  bottom,
float  top 
)

converts coordinates given relative to the current coord sys into "screen coordinates", which are in pixel units with (0,0) as the top left and (w-1, h-1) as the lower-right, where w and h are the dimensions of the screen

Returns:
the screen rectangle

Definition at line 1603 of file video.cpp.

References _ScreenCoordX(), _ScreenCoordY(), hoa_video::ScreenRect::height, hoa_video::ScreenRect::left, hoa_video::ScreenRect::top, and hoa_video::ScreenRect::width.

Referenced by SetScissorRect(), and hoa_video::MenuWindow::Update().

Here is the call graph for this function:

int32 hoa_video::GameVideo::CalculateTextWidth ( const std::string &  font_name,
const std::string &  text 
)

calculates the width of the given text if it were rendered with the given font If an invalid font name is passed, returns -1

Parameters:
font_name the font to use
text the text string in multi-byte character format
Returns:
width of the given text

Definition at line 870 of file text.cpp.

References _font_map, and IsValidFont().

Here is the call graph for this function:

int32 hoa_video::GameVideo::CalculateTextWidth ( const std::string &  font_name,
const hoa_utils::ustring text 
)

calculates the width of the given text if it were rendered with the given font If an invalid font name is passed, returns -1

Parameters:
font_name the font to use
text the text string in unicode
Returns:
width of the given text

Definition at line 853 of file text.cpp.

References _font_map, hoa_utils::ustring::c_str(), and IsValidFont().

Referenced by hoa_video::TextBox::_AddLine(), hoa_video::TextBox::_DrawTextLines(), and hoa_video::OptionBox::Draw().

Here is the call graph for this function:

bool hoa_video::GameVideo::CaptureScreen ( StillImage id  ) 

captures the contents of the screen and saves it to an image descriptor

Parameters:
id image descriptor to capture to
Returns:
success/failure

Definition at line 1260 of file video.cpp.

References _CreateTexSheet(), _height, _images, _RemoveSheet(), _width, hoa_video::private_video::TexSheet::CopyScreenRect(), hoa_video::private_video::TexMemMgr::Insert(), hoa_video::private_video::Image::ref_count, hoa_utils::RoundUpPow2(), hoa_video::private_video::TexSheet::tex_mem_manager, hoa_video::VIDEO_DEBUG, and hoa_video::private_video::VIDEO_TEXSHEET_ANY.

Referenced by hoa_pause::PauseMode::PauseMode(), hoa_quit::QuitMode::QuitMode(), and hoa_shop::ShopMode::ShopMode().

Here is the call graph for this function:

bool hoa_video::GameVideo::Clear ( const Color c  ) 

Clears the screen to a specific color.

Parameters:
c The color to set the cleared screen to.
Returns:
success/failure

Definition at line 691 of file video.cpp.

References _num_tex_switches, and SetViewport().

Here is the call graph for this function:

bool hoa_video::GameVideo::Clear (  ) 

Clears the contents of the current screen.

Returns:
success/failure
This method should be called at the beginning of every frame, before any draw operations are performed.

Definition at line 676 of file video.cpp.

References _light_color, _uses_lights, and hoa_video::Color::black.

Referenced by main(), hoa_editor::Grid::paintGL(), and SingletonInitialize().

void hoa_video::GameVideo::DEBUG_NextTexSheet (  ) 

These cycle through the currently loaded texture sheets so they can be viewed on screen.

Definition at line 2669 of file tex_mgmt.cpp.

References _current_debug_TexSheet, and _tex_sheets.

Referenced by hoa_input::GameInput::_KeyEventHandler().

void hoa_video::GameVideo::DEBUG_PrevTexSheet (  ) 

Definition at line 2687 of file tex_mgmt.cpp.

References _current_debug_TexSheet, and _tex_sheets.

bool hoa_video::GameVideo::DeleteImage ( ImageDescriptor id  ) 

decreases ref count of an image (static or animated)

Parameters:
id image descriptor to decrease the reference count of
Returns:
success/failure

Definition at line 2047 of file tex_mgmt.cpp.

References _DeleteImage().

Referenced by hoa_video::MenuWindow::_RecreateImage(), hoa_video::OptionBox::ClearOptions(), hoa_video::private_video::ParticleSystem::Destroy(), hoa_video::MenuWindow::Destroy(), Display(), hoa_global::GameGlobal::SetLocation(), hoa_battle::private_battle::ActionWindow::~ActionWindow(), hoa_battle::private_battle::BattleActor::~BattleActor(), hoa_battle::private_battle::BattleCharacterActor::~BattleCharacterActor(), hoa_battle::private_battle::BattleEnemyActor::~BattleEnemyActor(), hoa_battle::BattleMode::~BattleMode(), hoa_boot::BootMode::~BootMode(), hoa_menu::private_menu::CharacterWindow::~CharacterWindow(), hoa_menu::private_menu::EquipWindow::~EquipWindow(), hoa_video::private_video::GUISupervisor::~GUISupervisor(), hoa_map::private_map::MapSprite::~MapSprite(), hoa_menu::MenuMode::~MenuMode(), hoa_pause::PauseMode::~PauseMode(), hoa_quit::QuitMode::~QuitMode(), hoa_shop::ShopMode::~ShopMode(), hoa_menu::private_menu::StatusWindow::~StatusWindow(), and hoa_map::private_map::VirtualSprite::~VirtualSprite().

Here is the call graph for this function:

void hoa_video::GameVideo::DeleteMenuSkin ( std::string &  skin_name  )  [inline]

Deletes a menu skin that has been loaded.

Parameters:
skin_name The name of the loaded menu skin that should be removed
Before you call this function, you must delete any and all MenuWindow objects which make use of this skin, or change the skin used by those objects. Failing to do so will result in a warning message being printed and the skin will not be deleted. The function will also print a warning message and exit if it could not find a skin referred to by the argument name.

Definition at line 861 of file video.h.

References hoa_video::private_video::GUIManager.

void hoa_video::GameVideo::DisableFog (  ) 

disables fog

Definition at line 1143 of file video.cpp.

References _fog_intensity.

Referenced by hoa_boot::BootMode::_EndOpeningAnimation(), and hoa_boot::BootMode::Reset().

void hoa_video::GameVideo::DisablePointLights (  ) 

disables point lights

Definition at line 1176 of file video.cpp.

References _DeleteTexture(), _light_overlay, and _uses_lights.

Here is the call graph for this function:

void hoa_video::GameVideo::DisableSceneLighting (  ) 

disables scene lighting

Definition at line 1079 of file video.cpp.

References _light_color, and hoa_video::Color::white.

Referenced by hoa_battle::private_battle::FinishWindow::Draw().

bool hoa_video::GameVideo::Display ( int32  frame_time  ) 

call at end of every frame

Parameters:
frame_time The number of milliseconds that have passed since the last frame.
Returns:
success/failure

Definition at line 727 of file video.cpp.

References _advanced_display, _animation_counter, _current_frame_diff, _DEBUG_ShowAdvancedStats(), _DEBUG_ShowTexSheet(), _fader, _fps_display, _lightning_active, _lightning_current_time, _lightning_end_time, _particle_manager, _PopContext(), _PushContext(), _UpdateShake(), DeleteImage(), DrawFPS(), DrawImage(), hoa_video::private_video::ScreenFader::GetFadeOverlayColor(), LoadImage(), Move(), PopState(), PushState(), hoa_video::StillImage::SetColor(), SetCoordSys(), hoa_video::StillImage::SetDimensions(), SetDrawFlags(), hoa_video::private_video::ScreenFader::ShouldUseFadeOverlay(), hoa_video::private_video::ScreenFader::Update(), hoa_video::private_video::ParticleManager::Update(), hoa_video::VIDEO_ANIMATION_FRAME_PERIOD, hoa_video::VIDEO_DEBUG, hoa_video::VIDEO_X_LEFT, and hoa_video::VIDEO_Y_BOTTOM.

Referenced by main(), and SingletonInitialize().

Here is the call graph for this function:

bool hoa_video::GameVideo::Draw ( const RenderedLine line,
int32  tex_index 
)

Draws a rendered line object.

Parameters:
line The rendered line
tex_index Whether main or shadow texture

Definition at line 1049 of file text.cpp.

References _BindTexture(), hoa_video::RenderedLine::height, hoa_video::RenderedLine::NUM_TEXTURES, hoa_video::RenderedLine::texture, hoa_video::RenderedLine::u, hoa_video::RenderedLine::v, hoa_video::VIDEO_DEBUG, and hoa_video::RenderedLine::width.

Here is the call graph for this function:

bool hoa_video::GameVideo::Draw ( const RenderedString string  ) 

Draws a rendered string object.

Parameters:
string The rendered string

Definition at line 1127 of file text.cpp.

References _coord_sys, _x_align, hoa_video::CoordSys::GetHorizontalDirection(), hoa_video::RenderedString::GetLineSkip(), hoa_video::RenderedString::GetShadowX(), hoa_video::RenderedString::GetShadowY(), hoa_video::CoordSys::GetVerticalDirection(), hoa_video::RenderedString::GetWidth(), hoa_video::RenderedString::lines, hoa_video::RenderedLine::MAIN_TEXTURE, MoveRelative(), and hoa_video::RenderedLine::SHADOW_TEXTURE.

Referenced by hoa_video::RenderedString::Draw().

Here is the call graph for this function:

void hoa_video::GameVideo::DrawFPS ( uint32  frame_time  ) 

Updates the FPS counter and draws the current average FPS to the screen The number of milliseconds that have expired since the last frame was drawn.

Definition at line 342 of file draw.cpp.

References _PopContext(), _PushContext(), hoa_video::private_video::GUISupervisor::DrawFPS(), and hoa_video::private_video::GUIManager.

Referenced by Display().

Here is the call graph for this function:

bool hoa_video::GameVideo::DrawFullscreenOverlay ( const Color color  ) 

draws a full screen overlay of the given color

Note:
This is very slow, so use sparingly!
Returns:
success/failure

Definition at line 1767 of file video.cpp.

References DrawImage(), LoadImage(), Move(), PopState(), PushState(), SetCoordSys(), hoa_video::StillImage::SetDimensions(), SetDrawFlags(), hoa_video::VIDEO_BLEND, hoa_video::VIDEO_X_LEFT, and hoa_video::VIDEO_Y_BOTTOM.

Referenced by DrawLightning().

Here is the call graph for this function:

void hoa_video::GameVideo::DrawGrid ( float  x,
float  y,
float  x_step,
float  y_step,
const Color c 
)

draws a line grid. Used by map editor to draw a grid over all the tiles. This function will start at (x,y), and go to (xMax, yMax), with horizontal cell spacing of xstep and vertical cell spacing of ystep. The final parameter is just the color the lines should be drawn

Note:
xMax and yMax are not inputs to the function- they are taken from the current coord sys
Parameters:
x x coordinate to start grid at
y y coordinate to start grid at
x_step width of grid squares
y_step height of grid squares
c color of the grid

Definition at line 1809 of file video.cpp.

References _coord_sys, hoa_video::CoordSys::GetBottom(), hoa_video::CoordSys::GetLeft(), hoa_video::CoordSys::GetRight(), hoa_video::CoordSys::GetTop(), Move(), PopState(), and PushState().

Referenced by hoa_editor::Grid::paintGL().

Here is the call graph for this function:

bool hoa_video::GameVideo::DrawHalo ( const StillImage id,
float  x,
float  y,
const Color color = Color(1.0f, 1.0f, 1.0f, 1.0f) 
)

draws a halo at the given spot

Parameters:
id image descriptor for the halo image
x x coordinate of halo
y y coordinate of halo
color color of halo
Returns:
success/failure

Definition at line 304 of file draw.cpp.

References _blend, DrawImage(), Move(), PopMatrix(), PushMatrix(), and hoa_video::VIDEO_BLEND_ADD.

Referenced by DrawLight().

Here is the call graph for this function:

bool hoa_video::GameVideo::DrawImage ( const ImageDescriptor id,
const Color color 
)

draws an image which is modulated by a custom color

Parameters:
id image descriptor to draw (either StillImage or AnimatedImage)
color Color used for modulating the image
Returns:
success/failure

Definition at line 372 of file draw.cpp.

References _DrawStillImage(), hoa_video::AnimatedImage::GetCurrentFrameIndex(), and hoa_video::AnimatedImage::GetFrame().

Here is the call graph for this function:

bool hoa_video::GameVideo::DrawImage ( const ImageDescriptor id  ) 

draws an image which is modulated by the scene's light color

Parameters:
id image descriptor to draw (either StillImage or AnimatedImage)
Returns:
success/failure

Definition at line 356 of file draw.cpp.

References _DrawStillImage(), hoa_video::AnimatedImage::GetCurrentFrameIndex(), and hoa_video::AnimatedImage::GetFrame().

Referenced by hoa_boot::BootMode::_AnimateLogo(), _DEBUG_ShowTexSheet(), hoa_battle::private_battle::ActionWindow::_DrawActionSelection(), hoa_boot::BootMode::_DrawBackgroundItems(), hoa_battle::BattleMode::_DrawBackgroundVisuals(), hoa_menu::MenuMode::_DrawBottomMenu(), hoa_battle::BattleMode::_DrawBottomMenu(), hoa_battle::BattleMode::_DrawTimeMeter(), Display(), hoa_shop::private_shop::ObjectInfoWindow::Draw(), hoa_shop::ShopMode::Draw(), hoa_quit::QuitMode::Draw(), hoa_pause::PauseMode::Draw(), hoa_video::OptionBox::Draw(), hoa_video::MenuWindow::Draw(), hoa_menu::private_menu::EquipWindow::Draw(), hoa_menu::private_menu::StatusWindow::Draw(), hoa_menu::private_menu::InventoryWindow::Draw(), hoa_menu::private_menu::CharacterWindow::Draw(), hoa_menu::MenuMode::Draw(), hoa_map::private_map::EnemySprite::Draw(), hoa_map::private_map::MapSprite::Draw(), hoa_map::private_map::VirtualSprite::Draw(), hoa_map::private_map::PhysicalObject::Draw(), hoa_map::MapMode::Draw(), hoa_video::ImageDescriptor::Draw(), DrawFullscreenOverlay(), DrawHalo(), hoa_battle::private_battle::BattleCharacterActor::DrawPortrait(), DrawRectangle(), hoa_battle::private_battle::BattleEnemyActor::DrawSprite(), hoa_battle::private_battle::BattleCharacterActor::DrawSprite(), hoa_battle::private_battle::BattleCharacterActor::DrawStatus(), hoa_battle::private_battle::BattleActor::DrawTimePortrait(), and hoa_editor::Grid::paintGL().

Here is the call graph for this function:

bool hoa_video::GameVideo::DrawLight ( const StillImage id,
float  x,
float  y,
const Color color = Color(1.0f, 1.0f, 1.0f, 1.0f) 
)

draws a real light at the given spot

Parameters:
id image descriptor for the light mask
x x coordinate of light
y y coordinate of light
color color of light
Returns:
success/failure

Definition at line 325 of file draw.cpp.

References _uses_lights, DrawHalo(), and hoa_video::VIDEO_DEBUG.

Here is the call graph for this function:

bool hoa_video::GameVideo::DrawLightning (  ) 

call this every frame to draw any lightning effects. You should make sure to place this call in an appropriate spot. In particular, you should draw the lightning before drawing the GUI.

Returns:
success/failure

Definition at line 1738 of file video.cpp.

References _lightning_active, _lightning_current_time, _lightning_data, and DrawFullscreenOverlay().

Here is the call graph for this function:

bool hoa_video::GameVideo::DrawParticleEffects (  ) 

draws all active particle effects

Returns:
success/failure

Definition at line 73 of file effects.cpp.

References _particle_manager, and hoa_video::private_video::ParticleManager::Draw().

Here is the call graph for this function:

void hoa_video::GameVideo::DrawRectangle ( const float  width,
const float  height,
const Color color 
)

Draws a solid rectangle of a given color. Draws a solid rectangle of a given color. For that, the lower-left corner of the rectangle has to be specified, and also its size. The parameters depends on the current Coordinate System.

Parameters:
width Width of the rectangle.
height Height of the rectangle.
color Color to paint the rectangle.

Definition at line 1863 of file video.cpp.

References hoa_video::StillImage::_elements, _rectangle_image, DrawImage(), and hoa_video::VideoManager.

Referenced by hoa_battle::private_battle::BattleCharacterActor::DrawStatus().

Here is the call graph for this function:

bool hoa_video::GameVideo::DrawText ( const hoa_utils::ustring uText  ) 

unicode version of DrawText(). This should be used for anything in the game which might need to be localized (game dialogue, interface text, etc.)

Parameters:
uText unicode text string to draw
Returns:
success/failure

Definition at line 639 of file text.cpp.

References _coord_sys, _current_font, _current_text_color, _DrawTextHelper(), _font_map, _PopContext(), _PushContext(), _text_shadow, hoa_video::Color::black, hoa_utils::ustring::empty(), hoa_video::CoordSys::GetHorizontalDirection(), hoa_video::CoordSys::GetVerticalDirection(), hoa_utils::ustring::length(), hoa_video::FontProperties::line_skip, MoveRelative(), SetTextColor(), hoa_video::FontProperties::shadow_style, hoa_video::FontProperties::shadow_x, hoa_video::FontProperties::shadow_y, hoa_video::FontProperties::ttf_font, hoa_video::VIDEO_DEBUG, hoa_video::VIDEO_TEXT_SHADOW_BLACK, hoa_video::VIDEO_TEXT_SHADOW_COLOR, hoa_video::VIDEO_TEXT_SHADOW_DARK, hoa_video::VIDEO_TEXT_SHADOW_INVCOLOR, hoa_video::VIDEO_TEXT_SHADOW_LIGHT, hoa_video::VIDEO_TEXT_SHADOW_NONE, and hoa_video::Color::white.

Here is the call graph for this function:

bool hoa_video::GameVideo::DrawText ( const std::string &  text  ) 

non-unicode version of DrawText(). Only use this for debug output or other things which don't have to be localized

Parameters:
text text string to draw
Returns:
success/failure

Referenced by _DEBUG_ShowAdvancedStats(), _DEBUG_ShowTexSheet(), hoa_battle::private_battle::ActionWindow::_DrawActionInformation(), hoa_battle::private_battle::ActionWindow::_DrawActionSelection(), hoa_menu::MenuMode::_DrawBottomMenu(), hoa_battle::private_battle::ActionWindow::_DrawTargetSelection(), hoa_video::TextBox::_DrawTextLines(), hoa_shop::private_shop::ConfirmWindow::Draw(), hoa_shop::private_shop::ObjectInfoWindow::Draw(), hoa_pause::PauseMode::Draw(), hoa_video::OptionBox::Draw(), hoa_menu::private_menu::EquipWindow::Draw(), hoa_menu::private_menu::SkillsWindow::Draw(), hoa_menu::private_menu::StatusWindow::Draw(), hoa_menu::private_menu::InventoryWindow::Draw(), hoa_menu::private_menu::CharacterWindow::Draw(), hoa_map::private_map::DialogueManager::Draw(), hoa_map::MapMode::Draw(), hoa_boot::BootMode::Draw(), hoa_battle::private_battle::FinishWindow::Draw(), hoa_video::private_video::GUISupervisor::DrawFPS(), hoa_battle::private_battle::BattleEnemyActor::DrawSprite(), hoa_battle::private_battle::BattleCharacterActor::DrawSprite(), hoa_battle::private_battle::BattleEnemyActor::DrawStatus(), and hoa_battle::private_battle::BattleCharacterActor::DrawStatus().

bool hoa_video::GameVideo::EnableFog ( const Color color,
float  intensity 
)

sets fog parameters

Parameters:
color Color of the fog (alpha should be 1.0)
intensity Intensity of fog from 0.0f to 1.0f
Returns:
success/failure

Definition at line 1100 of file video.cpp.

References _fog_color, _fog_intensity, hoa_video::Color::GetColors(), and hoa_video::VIDEO_DEBUG.

Referenced by hoa_boot::BootMode::_AnimateLogo(), and ApplySettings().

Here is the call graph for this function:

bool hoa_video::GameVideo::EnablePointLights (  ) 

call if this map uses real lights

Returns:
always returns true

Definition at line 1164 of file video.cpp.

References _CreateBlankGLTexture(), _light_overlay, and _uses_lights.

Here is the call graph for this function:

bool hoa_video::GameVideo::EnableSceneLighting ( const Color color  ) 

turn on the ligt color for the scene

Parameters:
color the light color to use
Returns:
success/failure

Definition at line 1062 of file video.cpp.

References _light_color, and hoa_video::VIDEO_DEBUG.

Referenced by hoa_battle::BattleMode::Draw().

void hoa_video::GameVideo::EnableScissoring ( bool  enable  ) 

enables scissoring, where you can specify a rectangle of the screen which is affected by rendering operations. MAKE SURE to disable scissoring as soon as you're done using the effect, or all subsequent draw calls will get messed up

Parameters:
enable pass true to turn on scissoring, false to disable

Definition at line 1568 of file video.cpp.

References _scissor_enabled.

Referenced by hoa_video::TextBox::_DrawTextLines(), hoa_video::private_video::ParticleManager::Draw(), hoa_video::OptionBox::Draw(), hoa_video::MenuWindow::Draw(), hoa_boot::BootMenu::Draw(), and hoa_boot::CreditsScreen::Draw().

void hoa_video::GameVideo::EnableTextShadow ( bool  enable  ) 

enables/disables text shadowing

Parameters:
enable pass true to enable, false to disable

Definition at line 887 of file text.cpp.

References _text_shadow.

Referenced by SingletonInitialize().

void hoa_video::GameVideo::FadeScreen ( const Color color,
float  fade_time 
)

Begins a screen fade.

Parameters:
color - color to fade to.
fade_time - the fade will last this number of seconds
Returns:
True if fade was successful, false otherwise.

Definition at line 152 of file fade.cpp.

References _fader, and hoa_video::private_video::ScreenFader::FadeTo().

Referenced by hoa_boot::BootMode::_OnLoadGame(), hoa_boot::BootMode::_OnNewGame(), and hoa_boot::BootMode::Update().

Here is the call graph for this function:

const CoordSys& hoa_video::GameVideo::GetCoordSys (  )  const [inline]

return a reference to the coordinates system

Returns:
Reference to the coordinates system

Definition at line 280 of file video.h.

References _coord_sys.

StillImage * hoa_video::GameVideo::GetDefaultCursor (  ) 

returns the cursor image

Returns:
the cursor image

Definition at line 1536 of file video.cpp.

References _default_menu_cursor, and hoa_video::StillImage::GetWidth().

Referenced by hoa_video::OptionBox::Draw().

Here is the call graph for this function:

void hoa_video::GameVideo::GetDrawPosition ( float &  x,
float &  y 
)

Gets the location of the draw cursor.

Parameters:
x stores x position of the cursor
y stores y position of the cursor

Definition at line 917 of file video.cpp.

References _x, and _y.

std::string hoa_video::GameVideo::GetFont (  )  const

get name of current font

Returns:
string containing the name of the font

Definition at line 97 of file text.cpp.

References _current_font.

FontProperties * hoa_video::GameVideo::GetFontProperties ( const std::string &  font_name  ) 

Get the font properties for a previously loaded font.

Parameters:
font_name The referred name of the loaded font (e.g. "courier24").
Returns:
A pointer to the FontProperties object with the requested data, or NULL if an error occurred.

Definition at line 71 of file text.cpp.

References _font_map, IsValidFont(), and hoa_video::VIDEO_DEBUG.

Referenced by hoa_video::OptionBox::SetFont().

Here is the call graph for this function:

int32 hoa_video::GameVideo::GetFrameChange (  )  [inline]

returns the amount of animation frames that have passed since the last call to GameVideo::Display(). This number is based on VIDEO_ANIMATION_FRAME_PERIOD, and is used so that AnimatedImages know how many frames to increment themselves by.

Returns:
the number of nimations frames passed since last GameVideo::Display() call

Definition at line 789 of file video.h.

References _current_frame_diff.

Referenced by hoa_video::AnimatedImage::Update().

float hoa_video::GameVideo::GetGamma (  ) 

Returns the gamma value.

Returns:
the gamma value

Definition at line 1354 of file video.cpp.

References _gamma_value.

Referenced by hoa_boot::BootMode::_OnBrightnessLeft(), hoa_boot::BootMode::_OnBrightnessRight(), hoa_boot::BootMode::_SaveSettingsFile(), and hoa_boot::BootMode::_UpdateVideoOptions().

int32 hoa_video::GameVideo::GetHeight (  )  const [inline]

returns height, (whatever was set with SetResolution)

Returns:
height of the screen

Definition at line 275 of file video.h.

References _height.

Referenced by hoa_boot::BootMode::_OnResolution1024x768(), hoa_boot::BootMode::_OnResolution640x480(), hoa_boot::BootMode::_OnResolution800x600(), hoa_boot::BootMode::_SaveSettingsFile(), hoa_boot::BootMode::_UpdateVideoOptions(), hoa_shop::ShopMode::Draw(), hoa_quit::QuitMode::Draw(), hoa_pause::PauseMode::Draw(), hoa_menu::MenuMode::Draw(), and hoa_editor::Grid::paintGL().

bool hoa_video::GameVideo::GetImageInfo ( const std::string &  file_name,
uint32 rows,
uint32 cols,
uint32 bpp 
)

Get information of an image file.

Parameters:
file_name Name of the file, without the extension
rows Rows of the image
cols Columns of the image
bpp Bits per pixel of the image
Returns:
True if the process was carried out with no problem, false otherwise

Definition at line 87 of file tex_mgmt.cpp.

References _GetImageInfoJpeg(), _GetImageInfoPng(), and hoa_video::VIDEO_DEBUG.

Referenced by LoadMultiImageFromElementsSize(), and LoadMultiImageFromNumberElements().

Here is the call graph for this function:

int32 hoa_video::GameVideo::GetNumParticles (  ) 

get number of live particles

Returns:
the number of live particles in the system

Definition at line 108 of file effects.cpp.

References _particle_manager, and hoa_video::private_video::ParticleManager::GetNumParticles().

Here is the call graph for this function:

ParticleEffect * hoa_video::GameVideo::GetParticleEffect ( ParticleEffectID  id  ) 

get pointer to an effect given its ID

Returns:
the particle effect with the given ID

Definition at line 97 of file effects.cpp.

References _particle_manager, and hoa_video::private_video::ParticleManager::GetEffect().

Here is the call graph for this function:

void hoa_video::GameVideo::GetPixelSize ( double &  x,
double &  y 
) [inline]

Return the pixel size expressed coordinate system units.

Returns:
Pixel size expressed in cordinate system units
Parameters:
x Horizontal resolution
x Vertical resolution

Definition at line 292 of file video.h.

References _coord_sys, _height, _width, hoa_video::CoordSys::GetBottom(), hoa_video::CoordSys::GetLeft(), hoa_video::CoordSys::GetRight(), and hoa_video::CoordSys::GetTop().

Referenced by hoa_map::MapMode::_CalculateDrawInfo().

Here is the call graph for this function:

Color & hoa_video::GameVideo::GetSceneLightingColor (  ) 

returns the scene lighting color

Returns:
the light color used in the scene

Definition at line 1088 of file video.cpp.

References _light_color.

Referenced by hoa_video::private_video::ParticleSystem::Draw().

ScreenRect hoa_video::GameVideo::GetScissorRect (  )  [inline]

returns scissor rect

Returns:
the scissor rectangle

Definition at line 383 of file video.h.

References _scissor_rect.

Referenced by hoa_video::OptionBox::Draw(), and hoa_video::MenuWindow::Draw().

Color hoa_video::GameVideo::GetTextColor (  )  const

get current text color

Returns:
the color fo the text

Definition at line 107 of file text.cpp.

References _current_text_color.

Referenced by hoa_video::TextBox::_DrawTextLines(), and hoa_video::TextBox::Draw().

int32 hoa_video::GameVideo::GetWidth (  )  const [inline]

returns width, (whatever was set with SetResolution)

Returns:
width of the screen

Definition at line 270 of file video.h.

References _width.

Referenced by hoa_boot::BootMode::_OnResolution1024x768(), hoa_boot::BootMode::_OnResolution640x480(), hoa_boot::BootMode::_OnResolution800x600(), hoa_boot::BootMode::_SaveSettingsFile(), hoa_boot::BootMode::_UpdateVideoOptions(), hoa_shop::ShopMode::Draw(), hoa_quit::QuitMode::Draw(), hoa_pause::PauseMode::Draw(), hoa_menu::MenuMode::Draw(), and hoa_editor::Grid::paintGL().

bool hoa_video::GameVideo::IsFading (  ) 

Determines if a fade is currently occurring.

Returns:
True if screen fade is currently in progress, false otherwise.

Definition at line 162 of file fade.cpp.

References _fader, and hoa_video::private_video::ScreenFader::IsFading().

Referenced by hoa_boot::BootMode::Update().

Here is the call graph for this function:

bool hoa_video::GameVideo::IsFullscreen (  ) 

returns true if game is in fullscreen mode

Returns:
true if in fullscreen mode, false if in windowed mode

Definition at line 808 of file video.cpp.

References _fullscreen.

Referenced by hoa_boot::BootMode::_SaveSettingsFile(), and hoa_boot::BootMode::_UpdateVideoOptions().

bool hoa_video::GameVideo::IsMenuSkinAvailable ( std::string &  skin_name  )  const [inline]

Returns true if there is a menu skin avialable corresponding to the argument name.

Definition at line 840 of file video.h.

References hoa_video::private_video::GUIManager.

bool hoa_video::GameVideo::IsScissoringEnabled (  )  [inline]

returns true if scissoring's enabled

Returns:
true if enabled, false if not

Definition at line 358 of file video.h.

References _scissor_enabled.

Referenced by hoa_video::OptionBox::Draw(), and hoa_video::MenuWindow::Draw().

bool hoa_video::GameVideo::IsShaking (  ) 

returns true if screen is shaking

Returns:
true if the screen is shaking, false if it's not

Definition at line 131 of file shake.cpp.

References _shake_forces.

bool hoa_video::GameVideo::IsValidFont ( const std::string &  name  )  [inline]

Returns true if a font has already been successfully loaded.

Parameters:
name The name which to refer to the loaded font (e.g. "courier24").
Returns:
True if font is valid, false if it is not.

Definition at line 479 of file video.h.

References _font_map.

Referenced by CalculateTextWidth(), and GetFontProperties().

bool hoa_video::GameVideo::LoadAnimatedImageFromElementsSize ( AnimatedImage image,
const std::string &  file_name,
const uint32  rows,
const uint32  cols 
)

Loads a MultiImage in an AnimatedImage as frames. This function loads an image and cut it in pieces, loading each of that on frames of an AnimatedImage.

Parameters:
image AnimatedImage where the cut images will be loaded.
file_name Name of the file.
rows Number of rows of sub-images in the MultiImage.
cols Number of columns of sub-images in the MultiImage.
Returns:
success/failure

Definition at line 628 of file tex_mgmt.cpp.

bool hoa_video::GameVideo::LoadAnimatedImageFromNumberElements ( AnimatedImage image,
const std::string &  file_name,
const uint32  rows,
const uint32  cols 
)

Loads a MultiImage in an AnimatedImage as frames. This function loads an image and cut it in pieces, loading each of that on frames of an AnimatedImage.

Parameters:
image AnimatedImage where the cut images will be loaded.
file_name Name of the file.
rows Number of rows of sub-images in the MultiImage.
cols Number of columns of sub-images in the MultiImage.
Returns:
success/failure

Definition at line 597 of file tex_mgmt.cpp.

References LoadMultiImageFromNumberElements(), and hoa_video::VIDEO_DEBUG.

Referenced by hoa_global::GlobalCharacter::GlobalCharacter().

Here is the call graph for this function:

bool hoa_video::GameVideo::LoadFont ( const std::string &  TTF_filename,
const std::string &  name,
uint32  size 
)

Loads a font from a .ttf file with a specific size.

Parameters:
TTF_filename The filename of the .ttf file to load.
name The name which to refer to the font (e.g. "courier24", "default", etc.)
size The point size of the font
Returns:
success/failure

Referenced by InitializeEngine(), and SingletonInitialize().

bool hoa_video::GameVideo::LoadImage ( ImageDescriptor id  ) 

loads an image (static or animated image). Assumes that you have already called all the appropriate functions to initialize the image. In the case of a static image, this means setting its filename, and possibly other properties like width, height, and color. In the case of an animated image, it means calling AddFrame().

Parameters:
id image descriptor to load- either a StillImage or AnimatedImage.
Returns:
success/failure

Definition at line 208 of file tex_mgmt.cpp.

References _LoadImage().

Referenced by hoa_video::OptionBox::_ConstructOption(), hoa_video::MenuWindow::_RecreateImage(), hoa_battle::BattleMode::_TEMP_LoadTestData(), hoa_menu::private_menu::EquipWindow::_UpdateEquipList(), hoa_battle::private_battle::ActionWindow::ActionWindow(), hoa_battle::private_battle::BattleActor::BattleActor(), hoa_battle::private_battle::BattleCharacterActor::BattleCharacterActor(), hoa_battle::private_battle::BattleEnemyActor::BattleEnemyActor(), hoa_battle::BattleMode::BattleMode(), hoa_boot::BootMode::BootMode(), hoa_video::private_video::ParticleSystem::Create(), Display(), DrawFullscreenOverlay(), hoa_menu::private_menu::EquipWindow::EquipWindow(), hoa_video::ImageDescriptor::Load(), hoa_menu::private_menu::CharacterWindow::SetCharacter(), SetDefaultCursor(), hoa_map::private_map::VirtualSprite::SetFacePortrait(), hoa_global::GameGlobal::SetLocation(), and hoa_menu::private_menu::StatusWindow::StatusWindow().

Here is the call graph for this function:

bool hoa_video::GameVideo::LoadImageGrayScale ( ImageDescriptor id  ) 

loads an image (static or animated image). Assumes that you have already called all the appropriate functions to initialize the image. In the case of a static image, this means setting its filename, and possibly other properties like width, height, and color. In the case of an animated image, it means calling AddFrame(). The image is loaded in grayscale.

Parameters:
id image descriptor to load- either a StillImage or AnimatedImage.
Returns:
success/failure

bool hoa_video::GameVideo::LoadMenuSkin ( std::string  skin_name,
std::string  border_image,
std::string  background_image,
Color  top_left,
Color  top_right,
Color  bottom_left,
Color  bottom_right,
bool  make_default = false 
)

A background image with multiple background colors.

Definition at line 1015 of file video.cpp.

References hoa_video::private_video::GUIManager, and hoa_video::private_video::GUISupervisor::LoadMenuSkin().

Here is the call graph for this function:

bool hoa_video::GameVideo::LoadMenuSkin ( std::string  skin_name,
std::string  border_image,
std::string  background_image,
Color  background_color,
bool  make_default = false 
)

A background image with a single background color.

Definition at line 1006 of file video.cpp.

References hoa_video::private_video::GUIManager, and hoa_video::private_video::GUISupervisor::LoadMenuSkin().

Here is the call graph for this function:

bool hoa_video::GameVideo::LoadMenuSkin ( std::string  skin_name,
std::string  border_image,
Color  top_left,
Color  top_right,
Color  bottom_left,
Color  bottom_right,
bool  make_default = false 
)

No background image with multiple background colors.

Definition at line 997 of file video.cpp.

References hoa_video::private_video::GUIManager, and hoa_video::private_video::GUISupervisor::LoadMenuSkin().

Here is the call graph for this function:

bool hoa_video::GameVideo::LoadMenuSkin ( std::string  skin_name,
std::string  border_image,
Color  background_color,
bool  make_default = false 
)

No background image with a single background color.

Definition at line 989 of file video.cpp.

References hoa_video::private_video::GUIManager, and hoa_video::private_video::GUISupervisor::LoadMenuSkin().

Here is the call graph for this function:

bool hoa_video::GameVideo::LoadMenuSkin ( std::string  skin_name,
std::string  border_image,
std::string  background_image,
bool  make_default = false 
)

A background image with no background colors.

Definition at line 981 of file video.cpp.

References hoa_video::Color::clear, hoa_video::private_video::GUIManager, and hoa_video::private_video::GUISupervisor::LoadMenuSkin().

Referenced by InitializeEngine().

Here is the call graph for this function:

bool hoa_video::GameVideo::LoadMultiImageFromElementsSize ( std::vector< StillImage > &  images,
const std::string &  filename,
const uint32  width,
const uint32  height 
)

Loads a MultiImage in a vector of StillImages. This function loads an image and cut it in pieces, loading each of that on separate StillImage objects. It uses the size of the stored elements as input parameters.

Parameters:
images Vector of StillImages where the cut images will be loaded.
filename Name of the file.
width Width of a stored element.
height Height of a stored element.
Returns:
success/failure

Definition at line 392 of file tex_mgmt.cpp.

References _LoadMultiImage(), GetImageInfo(), and hoa_video::VIDEO_DEBUG.

Here is the call graph for this function:

bool hoa_video::GameVideo::LoadMultiImageFromNumberElements ( std::vector< StillImage > &  images,
const std::string &  filename,
const uint32  rows,
const uint32  cols 
)

Loads a MultiImage in a vector of StillImages. This function loads an image and cut it in pieces, loading each of that on separate StillImage objects. It uses the number of stored elements as input parameters.

Parameters:
images Vector of StillImages where the cut images will be loaded.
filename Name of the file.
rows Number of rows of sub-images in the MultiImage.
cols Number of columns of sub-images in the MultiImage.
Returns:
success/failure

Definition at line 352 of file tex_mgmt.cpp.

References _LoadMultiImage(), GetImageInfo(), and hoa_video::VIDEO_DEBUG.

Referenced by hoa_map::MapMode::_LoadTiles(), hoa_global::GlobalCharacter::GlobalCharacter(), hoa_global::GlobalEnemy::GlobalEnemy(), LoadAnimatedImageFromNumberElements(), hoa_map::private_map::MapSprite::LoadStandardAnimations(), and hoa_editor::Tileset::Tileset().

Here is the call graph for this function:

bool hoa_video::GameVideo::MakeLightning ( const std::string &  lit_file  ) 

call to create lightning effect

Parameters:
lit_file a .lit file which contains lightning intensities stored as bytes (0-255).
Returns:
success/failure

Definition at line 1682 of file video.cpp.

References _lightning_active, _lightning_current_time, _lightning_data, and _lightning_end_time.

bool hoa_video::GameVideo::MakeScreenshot (  ) 

makes a screenshot, saves it as screenshot.jpg in the directory of the game

Returns:
success/failure

Definition at line 361 of file video.cpp.

References _SaveJpeg(), hoa_video::private_video::ImageLoadInfo::height, hoa_video::private_video::ImageLoadInfo::pixels, hoa_video::VIDEO_DEBUG, and hoa_video::private_video::ImageLoadInfo::width.

Referenced by hoa_input::GameInput::_KeyEventHandler().

Here is the call graph for this function:

void hoa_video::GameVideo::Move ( float  x,
float  y 
)

sets draw position to (x,y)

Parameters:
x x coordinate to move to
y y coordinate to move to

Definition at line 886 of file video.cpp.

References _x, and _y.

Referenced by hoa_boot::BootMode::_AnimateLogo(), _DEBUG_ShowAdvancedStats(), _DEBUG_ShowTexSheet(), hoa_video::ParticleEffect::_Draw(), hoa_battle::private_battle::ActionWindow::_DrawActionInformation(), hoa_battle::private_battle::ActionWindow::_DrawActionSelection(), hoa_boot::BootMode::_DrawBackgroundItems(), hoa_battle::BattleMode::_DrawBackgroundVisuals(), hoa_menu::MenuMode::_DrawBottomMenu(), hoa_battle::BattleMode::_DrawBottomMenu(), hoa_battle::private_battle::ActionWindow::_DrawTargetSelection(), hoa_video::TextBox::_DrawTextLines(), hoa_battle::BattleMode::_DrawTimeMeter(), hoa_video::OptionBox::_SetupAlignment(), Display(), hoa_video::TextBox::Draw(), hoa_shop::private_shop::ConfirmWindow::Draw(), hoa_shop::private_shop::ObjectInfoWindow::Draw(), hoa_shop::ShopMode::Draw(), hoa_quit::QuitMode::Draw(), hoa_pause::PauseMode::Draw(), hoa_video::OptionBox::Draw(), hoa_video::MenuWindow::Draw(), hoa_menu::private_menu::EquipWindow::Draw(), hoa_menu::private_menu::SkillsWindow::Draw(), hoa_menu::private_menu::StatusWindow::Draw(), hoa_menu::private_menu::InventoryWindow::Draw(), hoa_menu::private_menu::CharacterWindow::Draw(), hoa_menu::MenuMode::Draw(), hoa_map::private_map::DialogueManager::Draw(), hoa_map::MapMode::Draw(), hoa_boot::WelcomeScreen::Draw(), hoa_boot::CreditsScreen::Draw(), hoa_boot::BootMode::Draw(), hoa_battle::private_battle::FinishWindow::Draw(), hoa_video::private_video::GUISupervisor::DrawFPS(), DrawFullscreenOverlay(), DrawGrid(), DrawHalo(), hoa_map::private_map::MapObject::DrawHelper(), hoa_battle::private_battle::BattleCharacterActor::DrawPortrait(), hoa_battle::private_battle::BattleEnemyActor::DrawSprite(), hoa_battle::private_battle::BattleCharacterActor::DrawSprite(), hoa_battle::private_battle::BattleEnemyActor::DrawStatus(), hoa_battle::private_battle::BattleCharacterActor::DrawStatus(), hoa_battle::private_battle::BattleActor::DrawTimePortrait(), and hoa_editor::Grid::paintGL().

void hoa_video::GameVideo::MoveRelative ( float  dx,
float  dy 
)

moves draw position (dx, dy) units

Parameters:
dx how many units to move in x direction
dy how many units to move in y direction

Definition at line 902 of file video.cpp.

References _x, and _y.

Referenced by _DEBUG_ShowTexSheet(), hoa_battle::private_battle::ActionWindow::_DrawActionInformation(), hoa_battle::private_battle::ActionWindow::_DrawActionSelection(), hoa_menu::MenuMode::_DrawBottomMenu(), hoa_battle::BattleMode::_DrawBottomMenu(), _DrawStillImage(), hoa_video::TextBox::_DrawTextLines(), hoa_menu::private_menu::InventoryWindow::_InitInventoryItems(), Draw(), hoa_shop::private_shop::ObjectInfoWindow::Draw(), hoa_video::OptionBox::Draw(), hoa_menu::private_menu::EquipWindow::Draw(), hoa_menu::private_menu::SkillsWindow::Draw(), hoa_menu::private_menu::StatusWindow::Draw(), hoa_menu::private_menu::InventoryWindow::Draw(), hoa_menu::private_menu::CharacterWindow::Draw(), hoa_map::private_map::VirtualSprite::Draw(), hoa_map::private_map::DialogueManager::Draw(), hoa_map::MapMode::Draw(), hoa_boot::BootMode::Draw(), hoa_battle::private_battle::BattleEnemyActor::DrawStatus(), hoa_battle::private_battle::BattleCharacterActor::DrawStatus(), DrawText(), and hoa_editor::Grid::paintGL().

void hoa_video::GameVideo::PopMatrix (  ) 

pops the modelview transformation from the stack.

Definition at line 1558 of file video.cpp.

Referenced by hoa_video::ParticleEffect::_Draw(), and DrawHalo().

void hoa_video::GameVideo::PopState (  ) 

pops the most recently pushed video engine state from the stack and restores all of the old settings.

Definition at line 971 of file video.cpp.

References _PopContext().

Referenced by hoa_video::TextBox::_DrawTextLines(), hoa_video::private_video::GUIControl::CalculateAlignedRect(), hoa_map::private_map::DialogueManager::DialogueManager(), Display(), hoa_shop::private_shop::ConfirmWindow::Draw(), hoa_video::private_video::ParticleManager::Draw(), hoa_map::private_map::DialogueManager::Draw(), hoa_map::MapMode::Draw(), DrawFullscreenOverlay(), DrawGrid(), and hoa_video::MenuWindow::Update().

Here is the call graph for this function:

void hoa_video::GameVideo::PushMatrix (  ) 

saves current modelview transformation on to the stack. In English, that means the combined result of calls to Move/MoveRelative/Scale/Rotate

Definition at line 1549 of file video.cpp.

Referenced by hoa_video::ParticleEffect::_Draw(), and DrawHalo().

void hoa_video::GameVideo::PushState (  ) 

saves entire state of the video engine on to the stack (all draw flags, coordinate system, scissor rect, viewport, etc.) This is useful for safety purposes between two major parts of code to ensure that one part doesn't inadvertently affect the other. However, it's a very expensive function call. If you only need to push the current transformation, you should use PushMatrix() and PopMatrix()

Definition at line 961 of file video.cpp.

References _PushContext().

Referenced by hoa_video::TextBox::_DrawTextLines(), hoa_video::private_video::GUIControl::CalculateAlignedRect(), hoa_map::private_map::DialogueManager::DialogueManager(), Display(), hoa_shop::private_shop::ConfirmWindow::Draw(), hoa_video::private_video::ParticleManager::Draw(), hoa_map::private_map::DialogueManager::Draw(), hoa_map::MapMode::Draw(), DrawFullscreenOverlay(), DrawGrid(), and hoa_video::MenuWindow::Update().

Here is the call graph for this function:

bool hoa_video::GameVideo::ReloadTextures (  ) 

reloads textures that have been unloaded after a video settings change

Returns:
success/failure

Definition at line 2706 of file tex_mgmt.cpp.

References _CreateBlankGLTexture(), _DeleteTempTextures(), _light_overlay, _tex_sheets, _uses_lights, hoa_video::private_video::TexSheet::Reload(), and hoa_video::VIDEO_DEBUG.

Referenced by ApplySettings().

Here is the call graph for this function:

RenderedString * hoa_video::GameVideo::RenderText ( const hoa_utils::ustring txt  ) 

Renders the given string to a drawable object.

Parameters:
txt The string to render

Definition at line 761 of file text.cpp.

References _CacheGlyphs(), _coord_sys, _current_font, _current_text_color, _font_map, _GenTexLine(), _text_shadow, hoa_video::RenderedString::Add(), hoa_utils::ustring::c_str(), hoa_utils::ustring::empty(), hoa_video::CoordSys::GetHorizontalDirection(), hoa_video::CoordSys::GetVerticalDirection(), hoa_video::FontProperties::line_skip, hoa_utils::MakeStandardString(), RenderedString, hoa_video::FontProperties::shadow_style, hoa_video::FontProperties::shadow_x, hoa_video::FontProperties::shadow_y, hoa_utils::ustring::size(), hoa_video::FontProperties::ttf_font, hoa_video::VIDEO_DEBUG, and hoa_video::VIDEO_TEXT_SHADOW_NONE.

Referenced by hoa_boot::WelcomeScreen::Show(), and hoa_boot::CreditsScreen::Show().

Here is the call graph for this function:

void hoa_video::GameVideo::Rotate ( float  angle  ) 

rotates images counterclockwise by 'angle' radians

Parameters:
angle how many radians to rotate by
Note:
This function should NOT be used unless you understand how transformation matrices work in OpenGL.

Definition at line 928 of file video.cpp.

Referenced by hoa_boot::BootMode::_AnimateLogo().

bool hoa_video::GameVideo::SaveImage ( const std::string &  file_name,
const AnimatedImage image 
) const

Saves an AnimatedImage into a file.

Definition at line 1235 of file tex_mgmt.cpp.

References SaveImage().

Here is the call graph for this function:

bool hoa_video::GameVideo::SaveImage ( const std::string &  file_name,
const StillImage image 
) const

Saves a StillImage into a file.

Definition at line 1256 of file tex_mgmt.cpp.

References hoa_video::StillImage::_elements, _GetBufferFromImage(), _RGBAToRGB(), _SaveJpeg(), _SavePng(), and hoa_video::VIDEO_DEBUG.

Here is the call graph for this function:

bool hoa_video::GameVideo::SaveImage ( const std::string &  file_name,
const std::vector< StillImage * > &  image,
const uint32  rows,
const uint32  columns 
) const

Saves a vector of images in a single file.

Definition at line 1079 of file tex_mgmt.cpp.

References _BindTexture(), hoa_video::private_video::TexSheet::height, hoa_video::private_video::ImageLoadInfo::height, hoa_video::private_video::ImageLoadInfo::pixels, hoa_video::private_video::TexSheet::tex_ID, hoa_video::private_video::Image::texture_sheet, hoa_video::VIDEO_DEBUG, hoa_video::VideoManager, hoa_video::private_video::TexSheet::width, hoa_video::private_video::ImageLoadInfo::width, hoa_video::private_video::Image::x, and hoa_video::private_video::Image::y.

Referenced by hoa_video::ImageDescriptor::Save(), and SaveImage().

Here is the call graph for this function:

void hoa_video::GameVideo::Scale ( float  x,
float  y 
)

after you call this, subsequent calls to DrawImage() result in a scaled image

Parameters:
x pass 1.0 for normal horizontal scaling, 2.0 for double scaling, etc.
y same, except vertical scaling
Note:
This function should NOT be used unless you understand how transformation matrices work in OpenGL.

Definition at line 943 of file video.cpp.

void hoa_video::GameVideo::SetCoordSys ( const CoordSys coordinate_system  ) 

sets the coordinate system. Default is (0,1024,0,768)

Parameters:
coordinate_system the coordinate system you want to set to

Definition at line 478 of file video.cpp.

References _coord_sys, hoa_video::CoordSys::GetBottom(), hoa_video::CoordSys::GetLeft(), hoa_video::CoordSys::GetRight(), and hoa_video::CoordSys::GetTop().

Here is the call graph for this function:

void hoa_video::GameVideo::SetCoordSys ( float  left,
float  right,
float  bottom,
float  top 
)

sets the coordinate system. Default is (0,1024,0,768)

Parameters:
left left border of screen
right right border of screen
top top border of screen
bottom bottom border of screen

Definition at line 497 of file video.cpp.

Referenced by _DEBUG_ShowTexSheet(), _PopContext(), ApplyLightingOverlay(), hoa_boot::BootMode::BootMode(), hoa_map::private_map::DialogueManager::DialogueManager(), Display(), hoa_shop::ShopMode::Draw(), hoa_quit::QuitMode::Draw(), hoa_pause::PauseMode::Draw(), hoa_video::private_video::ParticleManager::Draw(), hoa_menu::MenuMode::Draw(), hoa_map::private_map::DialogueManager::Draw(), hoa_map::MapMode::Draw(), DrawFullscreenOverlay(), hoa_editor::Grid::paintGL(), hoa_shop::ShopMode::Reset(), hoa_quit::QuitMode::Reset(), hoa_pause::PauseMode::Reset(), hoa_menu::MenuMode::Reset(), hoa_map::MapMode::Reset(), hoa_boot::BootMode::Reset(), and hoa_battle::BattleMode::Reset().

bool hoa_video::GameVideo::SetDefaultCursor ( const std::string &  cursor_image_filename  ) 

sets the default cursor to the image in the given filename

Parameters:
cursor_image_filename file containing the cursor image

Definition at line 1526 of file video.cpp.

References _default_menu_cursor, LoadImage(), and hoa_video::StillImage::SetFilename().

Referenced by SingletonInitialize().

Here is the call graph for this function:

void hoa_video::GameVideo::SetDefaultMenuSkin ( std::string &  skin_name  )  [inline]

Sets the default menu skin to use.

Parameters:
skin_name The name of the already loaded menu skin that should be made the default skin
If the skin_name does not refer to a valid skin, a warning message will be printed and no change will occur.
Note:
This method will not change the skins of any existing menu windows.

Definition at line 850 of file video.h.

References hoa_video::private_video::GUIManager.

void hoa_video::GameVideo::SetDrawFlags ( int32  first_flag,
  ... 
)

sets draw flags (flip, align, blending, etc). Simply pass in as many parameters as you want, as long as the last parameter is a zero. e.g. SetDrawFlags(VIDEO_X_LEFT, VIDEO_Y_CENTER, 0);

Parameters:
first_flag the first of many draw flags
.. specify as many draw flags as you want. Terminate with a 0.

Definition at line 512 of file video.cpp.

References _blend, _x_align, _x_flip, _y_align, _y_flip, hoa_video::VIDEO_BLEND, hoa_video::VIDEO_BLEND_ADD, hoa_video::VIDEO_DEBUG, hoa_video::VIDEO_NO_BLEND, hoa_video::VIDEO_X_CENTER, hoa_video::VIDEO_X_FLIP, hoa_video::VIDEO_X_LEFT, hoa_video::VIDEO_X_NOFLIP,