#include"CTexture.h"

#include"Core/CGraphicCore.h"
#include"Core/Driver/CPlaneTransiter.h"

#include"../Storage/Core/CStorageCore.h"

#include"../Storage/DefaultFunction/LoadTexture.h"

#include"CResourceNameGenerator.h"

namespace Maid
{


// 2 の累乗の値に変換する
inline int ExtendSize ( int size )
{
	int ret = 0;
	if( size<=  16 ) { ret=  16; }
	ef( size<=  32 ) { ret=  32; }
	ef( size<=  64 ) { ret=  64; }
	ef( size<= 128 ) { ret= 128; }
	ef( size<= 256 ) { ret= 256; }
	ef( size<= 512 ) { ret= 512; }
	ef( size<=1024 ) { ret=1024; }
	ef( size<=2048 ) { ret=2048; }
	ef( size<=4096 ) { ret=4096; }
	else { MAID_ASSERT( true, "テクスチャが大きすぎます" ); }

	return ret;
}



SIZE2DI CTexture::GetTextureSize()const
{
	return SIZE2DI(
					ExtendSize(GetSize().w),
					ExtendSize(GetSize().h)
					);
}


}

