1 /* GemRB - Infinity Engine Emulator
2 * Copyright (C) 2003 The GemRB Project
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 * Declares Sprite2D, class representing bitmap data
24 * @author The GemRB Project
31 #include "RGBAColor.h"
35 class AnimationFactory
;
39 * Class representing bitmap data.
40 * Objects of this class are usually created by Video driver.
43 class Sprite2D_BAM_Internal
{
45 Sprite2D_BAM_Internal() { pal
= 0; }
46 ~Sprite2D_BAM_Internal() { if (pal
) { pal
->Release(); pal
= 0; } }
54 // The AnimationFactory in which the data for this sprite is stored.
55 // (Used for refcounting of the data.)
56 AnimationFactory
* source
;
59 class GEM_EXPORT Sprite2D
{
63 /** Pointer to the Driver Video Structure */
67 int XPos
, YPos
, Width
, Height
, Bpp
;
70 bool IsPixelTransparent(unsigned short x
, unsigned short y
);
71 Palette
*GetPalette();
72 void SetPalette(Palette
*pal
);
73 Color
GetPixel(unsigned short x
, unsigned short y
);
74 public: // public only for SDLVideo
77 void acquire() { ++RefCount
; }
81 #endif // ! SPRITE2D_H