forked from jaildesigner-jailgames/jaildoctors_dilemma
- Canvis que vaig fer fa 2 messos, però no sé en què estava pensant, he de arreglar-ho.
This commit is contained in:
@@ -1,16 +1,30 @@
|
||||
#include "destsurface.h"
|
||||
#include "systempalette.h"
|
||||
|
||||
namespace DestSurface
|
||||
{
|
||||
void Init(SDL_Renderer *renderer, SDL_Texture *texture) {
|
||||
uint8_t *pixels = nullptr;
|
||||
int width, height;
|
||||
|
||||
void init(int width, int height)
|
||||
{
|
||||
if (pixels==nullptr) pixels = new uint8_t[width*height];
|
||||
DestSurface::width = width;
|
||||
DestSurface::height = height;
|
||||
}
|
||||
|
||||
void Clear() {
|
||||
|
||||
void clear(uint32_t color)
|
||||
{
|
||||
SDL_memset(pixels, SystemPalette::getEntry(color), width*height);
|
||||
}
|
||||
|
||||
uint32_t *getPixels() {
|
||||
|
||||
uint8_t *getPixels()
|
||||
{
|
||||
return pixels;
|
||||
}
|
||||
|
||||
int getWidth()
|
||||
{
|
||||
return width;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user