diff --git a/src/sys/graphics/main.cpp b/src/sys/graphics/main.cpp index 75a2a95..1add3a3 100755 --- a/src/sys/graphics/main.cpp +++ b/src/sys/graphics/main.cpp @@ -6,7 +6,10 @@ TGfx0* buf=0; buf = new TGfx0(); pixfmt.BPP=8; - buf->create(400,400,&pixfmt); + buf->create(400,400,def_pixfmt_16bpp); + cout << def_pixfmt_16bpp.BPP << endl; + cout << buf->BPP << endl; + cout << buf->RedShifter << endl; if (buf) delete buf; return(0); } diff --git a/src/sys/graphics/objgfx30.cpp b/src/sys/graphics/objgfx30.cpp index 0b0bd14..7b10e7b 100755 --- a/src/sys/graphics/objgfx30.cpp +++ b/src/sys/graphics/objgfx30.cpp @@ -3,7 +3,7 @@ // TGfx0 constructor -TGfx0::TGfx0() { +TGfx0::TGfx0(void) { DataState = og_None; Buffer = 0; LineOfs = 0; @@ -26,7 +26,7 @@ } // TGfx0::TGfx0() -bool TGfx0::create(UInt32 _xRes, UInt32 _yRes, TPixelFmt* _pixformat) { +bool TGfx0::create(UInt32 _xRes, UInt32 _yRes,TPixelFmt* _pixformat) { UInt32 yy; if (DataState==og_Owner) { if (Buffer) free(Buffer); @@ -62,15 +62,15 @@ return TRUE; } // TGfx0::create -UInt32 TGfx0::getMaxX() { +UInt32 TGfx0::getMaxX(void) { return MaxX; } // TGfx0::getMaxX -UInt32 TGfx0::getMaxY() { +UInt32 TGfx0::getMaxY(void) { return MaxY; } // TGfx0::getMaxY -TGfx0::~TGfx0() { +TGfx0::~TGfx0(void) { if (DataState == og_Owner) { if (pal) free(pal); if (Buffer) free(Buffer); diff --git a/src/sys/graphics/objgfx30.h b/src/sys/graphics/objgfx30.h index af74031..1f5f571 100755 --- a/src/sys/graphics/objgfx30.h +++ b/src/sys/graphics/objgfx30.h @@ -106,9 +106,16 @@ UInt8 GreenMaskSize; } TPixelFmt; +// Default pixel formats + +const TPixelFmt def_pixfmt_8bpp = {8,0,0,0,0,0,0}; +const TPixelFmt def_pixfmt_15bpp = {15,10,5,0,5,5,5}; +const TPixelFmt def_pixfmt_16bpp = {16,11,5,0,5,6,5}; +const TPixelFmt def_pixfmt_24bpp = {24,16,8,0,8,8,8}; +const TPixelFmt def_pixfmt_32bpp = {32,16,8,0,8,8,8}; + class TGfx0 { public: - // owner TGfx0* Owner; void* Buffer; UInt32* LineOfs; @@ -127,11 +134,11 @@ UInt8 GreenShifter; UInt8 BlueShifter; public: - TGfx0(); - bool create(UInt32, UInt32, TPixelFmt*); - UInt32 getMaxX(); - UInt32 getMaxY(); - ~TGfx0(); + TGfx0(void); + bool create(UInt32, UInt32,TPixelFmt*); + UInt32 getMaxX(void); + UInt32 getMaxY(void); + ~TGfx0(void); }; // gfx0 #endif