Changed Moved LoadBMP into the BitmapImage class
~G2k
This commit is contained in:
14
src/bmp.cpp
14
src/bmp.cpp
@@ -26,6 +26,18 @@
|
|||||||
|
|
||||||
namespace OpenArena{
|
namespace OpenArena{
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief
|
||||||
|
* Write brief comment for BitmapImage here.
|
||||||
|
*
|
||||||
|
* Write detailed description for BitmapImage here.
|
||||||
|
*
|
||||||
|
* \remarks
|
||||||
|
* Write remarks for BitmapImage here.
|
||||||
|
*
|
||||||
|
* \see
|
||||||
|
* Separate items with the '|' character.
|
||||||
|
*/
|
||||||
BitmapImage::BitmapImage()
|
BitmapImage::BitmapImage()
|
||||||
{
|
{
|
||||||
BitmapImage(1, 1);
|
BitmapImage(1, 1);
|
||||||
@@ -222,7 +234,7 @@ namespace OpenArena{
|
|||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
TextureImage* LoadBMP(const char* fn)
|
TextureImage* BitmapImage::LoadBMP(const char* fn)
|
||||||
{
|
{
|
||||||
//If anything is not perfect return NULL after cleaning up our mess
|
//If anything is not perfect return NULL after cleaning up our mess
|
||||||
|
|
||||||
|
|||||||
15
src/bmp.h
15
src/bmp.h
@@ -7,7 +7,19 @@
|
|||||||
#include "texture.h"
|
#include "texture.h"
|
||||||
|
|
||||||
namespace OpenArena{
|
namespace OpenArena{
|
||||||
TextureImage* LoadBMP(const char* Filename);
|
|
||||||
|
/*!
|
||||||
|
* \brief
|
||||||
|
* BitmapImage implements the Image interface and is used to load *.bmp files.
|
||||||
|
*
|
||||||
|
* BitmapImage implements the Image interface which replaces the soon-to-be-removed TextureImage class. When complete the texture class will accept an Image as the image to generate the texture from.
|
||||||
|
*
|
||||||
|
* \remarks
|
||||||
|
* I would like to make GetImageData return a const uint8 * but I'm not yet sure this will be possible. To create an editable image use the BufferedImage class which as yet hasn't been implemented. A created BitmapImage is expected to not change once it's created. Doing so may break functionality or cause a crash.
|
||||||
|
*
|
||||||
|
* \see
|
||||||
|
* Image
|
||||||
|
*/
|
||||||
class BitmapImage: public Image
|
class BitmapImage: public Image
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -19,6 +31,7 @@ namespace OpenArena{
|
|||||||
virtual uint32 GetHeight() const;
|
virtual uint32 GetHeight() const;
|
||||||
virtual Image::Type GetType() const;
|
virtual Image::Type GetType() const;
|
||||||
static BitmapImage* CreateFromFile(const char* filename);
|
static BitmapImage* CreateFromFile(const char* filename);
|
||||||
|
static TextureImage* LoadBMP(const char* Filename);
|
||||||
private:
|
private:
|
||||||
BitmapImage();
|
BitmapImage();
|
||||||
BitmapImage(uint32 width, uint32 height, uint32 = 24, Image::Type = Image::Type_RGB);
|
BitmapImage(uint32 width, uint32 height, uint32 = 24, Image::Type = Image::Type_RGB);
|
||||||
|
|||||||
Reference in New Issue
Block a user