#include <common/resbmp.hpp>

ResBitmap::ResBitmap(const String &strBitmapName)
: ResData<unsigned char>(strBitmapName,ResType::RtBitmap), mpBitmapData(0), mStrBitmapName(strBitmapName)
{																												 
  if(!isOkay())return;
  (BitmapInfo&)*this=*((BITMAPINFO*)(unsigned char*)(ResData<unsigned char>&)*this);
	(PurePalette&)*this=*((BITMAPINFO*)(unsigned char*)(ResData<unsigned char>&)*this);
	mpBitmapData=(unsigned char*)((ResData<unsigned char>&)*this)+sizeof(BITMAPINFOHEADER)+(sizeof(RGBQUAD)*colorImportant());
}

ResBitmap::ResBitmap(const String &strBitmapName,HMODULE hResModule)
: ResData<unsigned char>(strBitmapName,ResType::RtBitmap,hResModule), mpBitmapData(0), mStrBitmapName(strBitmapName)
{																												 
  if(!isOkay())return;
  (BitmapInfo&)*this=*((BITMAPINFO*)(unsigned char*)(ResData<unsigned char>&)*this);
	(PurePalette&)*this=*((BITMAPINFO*)(unsigned char*)(ResData<unsigned char>&)*this);
	mpBitmapData=(unsigned char*)((ResData<unsigned char>&)*this)+sizeof(BITMAPINFOHEADER)+(sizeof(RGBQUAD)*colorImportant());
}

