489
edits
Paradox-01 (talk | contribs) mNo edit summary |
Script 10k (talk | contribs) (got an algorithm to split the images that will compose one TXMB) |
||
Line 36: | Line 36: | ||
:Not sure what's going on. Try to use only one row and only one column of non-standard sizes, '''starting with standard max''' and in the end filling the 'holes' with non-standard. --[[User:Paradox-01|paradox-01]] ([[User talk:Paradox-01|talk]]) 21:30, 11 October 2016 (CEST) | :Not sure what's going on. Try to use only one row and only one column of non-standard sizes, '''starting with standard max''' and in the end filling the 'holes' with non-standard. --[[User:Paradox-01|paradox-01]] ([[User talk:Paradox-01|talk]]) 21:30, 11 October 2016 (CEST) | ||
::Thanks Paradox. I followed your suggestion, I created an algorithm which first uses 256 sized images to fill the TXMB. When there's a hole (this is, when we can't fit another 256 pixel image) I fill it with the remaining size which don't need to be power 2. This worked and seems that it is creating the same TXMP resolutions that Vanilla oni used. Pseudo code of the algorithm: | |||
<code> | |||
function getSplitSizes(int sideSize){ | |||
vector splitSizes; | |||
int remainingSize = sideSize; | |||
int regularSize = 256; | |||
while (remainingSize > 0){ | |||
if(remainingSize - regularSize < 0){ | |||
splitSizes.add(remainingSize); | |||
remainingSize = 0; | |||
} | |||
else{ | |||
splitSizes.add(regularSize); | |||
remainingSize = remainingSize - regularSize; | |||
} | |||
} | |||
return splitSizes; | |||
}</code> | |||
::C++ code can be found in Vago [http://svn.oni2.net/Vago/trunk/Vago/bgImageWizard/bgimagepagefinal.cpp here] ''QVector<int> BGImagePageFinal::getSplitSizes(int imageSideSize)'' function. Look at the uncommented one. |
edits