~baltix/+junk/irrlicht-test

« back to all changes in this revision

Viewing changes to source/Irrlicht/CGUISpriteBank.h

  • Committer: Mantas Kriaučiūnas
  • Date: 2011-07-18 13:06:25 UTC
  • Revision ID: mantas@akl.lt-20110718130625-c5pvifp61e7kj1ol
Included whole irrlicht SVN libraries to work around launchpad recipe issue with quilt, see https://answers.launchpad.net/launchpad/+question/165193

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (C) 2002-2011 Nikolaus Gebhardt
 
2
// This file is part of the "Irrlicht Engine".
 
3
// For conditions of distribution and use, see copyright notice in irrlicht.h
 
4
 
 
5
#ifndef __C_GUI_SPRITE_BANK_H_INCLUDED__
 
6
#define __C_GUI_SPRITE_BANK_H_INCLUDED__
 
7
 
 
8
#include "IrrCompileConfig.h"
 
9
#ifdef _IRR_COMPILE_WITH_GUI_
 
10
 
 
11
#include "IGUISpriteBank.h"
 
12
 
 
13
namespace irr
 
14
{
 
15
 
 
16
namespace video
 
17
{
 
18
        class IVideoDriver;
 
19
        class ITexture;
 
20
}
 
21
 
 
22
namespace gui
 
23
{
 
24
 
 
25
        class IGUIEnvironment;
 
26
 
 
27
//! Sprite bank interface.
 
28
class CGUISpriteBank : public IGUISpriteBank
 
29
{
 
30
public:
 
31
 
 
32
        CGUISpriteBank(IGUIEnvironment* env);
 
33
        virtual ~CGUISpriteBank();
 
34
 
 
35
        virtual core::array< core::rect<s32> >& getPositions();
 
36
        virtual core::array< SGUISprite >& getSprites();
 
37
 
 
38
        virtual u32 getTextureCount() const;
 
39
        virtual video::ITexture* getTexture(u32 index) const;
 
40
        virtual void addTexture(video::ITexture* texture);
 
41
        virtual void setTexture(u32 index, video::ITexture* texture);
 
42
 
 
43
        //! Add the texture and use it for a single non-animated sprite.
 
44
        virtual s32 addTextureAsSprite(video::ITexture* texture);
 
45
 
 
46
        //! clears sprites, rectangles and textures
 
47
        virtual void clear();
 
48
 
 
49
        //! Draws a sprite in 2d with position and color
 
50
        virtual void draw2DSprite(u32 index, const core::position2di& pos, const core::rect<s32>* clip=0,
 
51
                                const video::SColor& color= video::SColor(255,255,255,255),
 
52
                                u32 starttime=0, u32 currenttime=0, bool loop=true, bool center=false);
 
53
 
 
54
        //! Draws a sprite batch in 2d using an array of positions and a color
 
55
        virtual void draw2DSpriteBatch(const core::array<u32>& indices, const core::array<core::position2di>& pos,
 
56
                        const core::rect<s32>* clip=0,
 
57
                        const video::SColor& color= video::SColor(255,255,255,255),
 
58
                        u32 starttime=0, u32 currenttime=0,
 
59
                        bool loop=true, bool center=false);
 
60
 
 
61
protected:
 
62
 
 
63
        struct SDrawBatch
 
64
        {
 
65
                core::array<core::position2di> positions;
 
66
                core::array<core::recti> sourceRects;
 
67
                u32 textureNumber;
 
68
        };
 
69
 
 
70
        core::array<SGUISprite> Sprites;
 
71
        core::array< core::rect<s32> > Rectangles;
 
72
        core::array<video::ITexture*> Textures;
 
73
        IGUIEnvironment* Environment;
 
74
        video::IVideoDriver* Driver;
 
75
 
 
76
};
 
77
 
 
78
} // end namespace gui
 
79
} // end namespace irr
 
80
 
 
81
#endif // _IRR_COMPILE_WITH_GUI_
 
82
 
 
83
#endif // __C_GUI_SPRITE_BANK_H_INCLUDED__
 
84