1 2 3 4 5 6 7 8 9 10
int lwidth; int lheight; int FindNearestPowerOf2 (int); void ConvertFor3dDriver (int requirePO2, int maxAspect) { int oldw = lwidth, oldh = lheight; lheight = FindNearestPowerOf2 (lheight); while (lwidth/lheight > maxAspect) lheight += lheight; }