//
// Asura_FMVSubtitles.h
//
// Created by Matt Clemson - 14/11/2005
// Based on RT_Subtitles, created by Richard Rice
// 
// Copyright (C) 2003 Rebellion, All Rights Reserved.
//

#ifdef ASURA_USE_PRAGMA_ONCE
    #pragma once
#endif

#ifndef __ASURA_FMVSUBTITLES_H__
#define __ASURA_FMVSUBTITLES_H__

#include "Core/Asura_Hash.h"
#include "Core/Asura_Handle.h"

#include "Core/Asura_PlatformBasics.h"

class Asura_Bounding_Rectangle;

struct Asura_FMVSubtitle
{
	float m_fStartTime;
	float m_fEndTime;
    Asura_Hash_ID m_uTextID;    
};

class Asura_FMVSubtitles
{

public :
    
    static void Initialise();
    static void Shutdown();
    
    static void RenderSubtitleByTime( float fTime );
    static void RenderSubtitle( const Asura_UnicodeChar* wszText, float fAlpha );

	// If you don't wish to use the given renderer
	static const Asura_UnicodeChar* GetSubtitleByTime( float fTime, float& fAlpha);

private :

    friend class Asura_Chunk_FMVSubtitles;

    static void  PlatformProject_GetBoundingRect( const Asura_UnicodeChar*& wszTitle, Asura_Bounding_Rectangle& xRect, u_int& uAlignFlags );
    static float PlatformProject_GetFontScale( void );
	static Asura_Handle PlatformProject_GetFontHandleForSubtitles( void );

    static u_int Project_GetTextARGB( void );
	static bool Project_ShouldDisplaySubtitles( const Asura_UnicodeChar* wszText );

    static int s_iNumSubtitles;
	static Asura_FMVSubtitle* s_pxSubtitles;

};

#endif //__ASURA_FMVSUBTITLES_H__
