5#ifndef __C_GUI_MODIFIED_SPRITE_BANK_H_INCLUDED__
6#define __C_GUI_MODIFIED_SPRITE_BANK_H_INCLUDED__
8#include "IrrCompileConfig.h"
9#ifdef _IRR_COMPILE_WITH_GUI_
11#include "IGUISpriteBank.h"
12#include "utils/leak_check.hpp"
26 class IGUIEnvironment;
29class STKModifiedSpriteBank :
public IGUISpriteBank
35 STKModifiedSpriteBank(IGUIEnvironment* env);
36 virtual ~STKModifiedSpriteBank();
38 virtual core::array< core::rect<s32> >& getPositions();
39 virtual core::array< SGUISprite >& getSprites();
41 virtual u32 getTextureCount() const;
42 virtual video::ITexture* getTexture(u32 index) const;
43 virtual
void addTexture(video::ITexture* texture);
44 virtual
void setTexture(u32 index, video::ITexture* texture);
47 virtual s32 addTextureAsSprite(video::ITexture* texture);
53 virtual
void draw2DSprite(u32 index, const core::position2di& pos, const core::rect<s32>* clip=0,
54 const video::SColor& color= video::SColor(255,255,255,255),
55 u32 starttime=0, u32 currenttime=0,
bool loop=true,
bool center=false);
58 virtual
void draw2DSpriteBatch(const core::array<u32>& indices, const core::array<core::position2di>& pos,
59 const core::rect<s32>* clip=0,
60 const video::SColor& color= video::SColor(255,255,255,255),
61 u32 starttime=0, u32 currenttime=0,
62 bool loop=true,
bool center=false);
64 void setScale(
float scale)
66 assert( m_magic_number == 0xCAFEC001 );
70 void scaleToHeight(
int height);
72 void setTargetIconSize(
int width,
int height)
73 { m_target_icon_size = core::dimension2du(width, height); }
78 unsigned int m_magic_number;
85 core::array<core::position2di> positions;
86 core::array<core::recti> sourceRects;
90 core::dimension2du m_target_icon_size;
93 core::array< core::rect<s32> > copy;
95 core::array<SGUISprite> Sprites;
96 core::array< core::rect<s32> > Rectangles;
97 core::array<video::ITexture*> Textures;
98 IGUIEnvironment* Environment;
99 video::IVideoDriver* Driver;
101 s32 getScaledWidth(s32 width)
const;
102 s32 getScaledHeight(s32 height)
const;