Game Development Reference
In-Depth Information
//Update variables
selScene = scn;
camera = &scn->camera;
CDIB pic;
CLWObject *obj;
TEXTURE *tex;
int i, j, srcwidth, srcheight, destwidth, destheight;
if (selScene->texTotal){
//Assign new textures. If texture quality is less than high
//then the bitmaps are sized down before being passed to OpenGL
for (i=0;i<selScene->texTotal;i++){
if (selScene->gltextures[i].pic){
srcwidth = selScene->gltextures[i].pic->GetWidth();
srcheight = selScene->gltextures[i].pic->GetHeight();
switch(selScene->m_texQuality){
case TEX_HIGH:
destwidth = srcwidth;
destheight = srcheight;
break;
case TEX_MED:
if (srcwidth > srcheight){
destwidth = srcwidth/2;
destheight = srcheight;
}else{
destwidth=srcwidth;
destheight=srcheight/2;
}
break;
case TEX_LOW:
destwidth=srcwidth/2;
destheight=srcheight/2;
break;
default:
destwidth=srcwidth/2;
destheight=srcheight/2;
break;
}
pic.Create(destwidth, destheight,
selScene->gltextures[i].pic->BitDepth());
selScene->gltextures[i].pic->CopyBits(&pic, 0, 0,
destwidth, destheight, 0,0,srcwidth,srcheight);
Search Nedrilad ::




Custom Search