View Single Post
Neobeo

JCF Member

Joined: Sep 2002

Posts: 409

Neobeo is an asset to this forumNeobeo is an asset to this forum

Oct 22, 2010, 03:01 PM
Neobeo is offline
Reply With Quote
Quote:
Originally Posted by DJazz View Post
This code is also in TilesetCompiler's updated source.
Here's some stuff I added to your updated source. In particular, the only changes I made are between lines 293 and 324. I added 4 (or 5) new lines of code and modified 2 existing ones:

PHP Code:
$isempty=true;
$curpx=0;
$tmp4=""/********** NEOBEO-CODE **********/
for ($j 0$j 32$j++) { // each row of pixels in tile
    
$tmp3="";
    for (
$k 0$k 32$k++) { // each pixel in row
    //$curpix = ord($s2[$offsets[$i+1]+32*$j+$k]); 
    
$tmp2=imagecolorat($img,$xoff+$k,$yoff+$j);
    if(
$tmp2!=0) {$isempty=false;$tmp3.="1";}
    else 
$tmp3.="0";
    
    
$curpx++;
    if(
$curpx==32) {
        
$curpx=0;
        
$tmp.=pack("V*",bindec(strrev($tmp3)));
        
$rle=preg_replace('/(0*)(1+)/e','chr(strlen("$1")).chr(strlen("$2"))',
                    
rtrim($tmp3,0),-1,$count); /********** NEOBEO-CODE **********/
        
$tmp4.=chr($count).$rle/********** NEOBEO-CODE **********/
        
$tmp3="";
    }
    }
}
$tmp.=$tmp4/********** NEOBEO-CODE **********/


if(array_search($tmp,$_TransData)===FALSE && ($isempty===false || $i==0)) {
    
    
$_TransData[$i]=$tmp;
    
    
//echo ".".$tmp."";
    
    
$_TransOffsets[$i]=$ioff/********** NEOBEO-MODIFY **********/
    
$ioff+=strlen($tmp); /********** NEOBEO-MODIFY **********/
}
elseif(
array_search($tmp,$_TransData)!==FALSE && $isempty===false) {
    
$_TransOffsets[$i]=$_TransOffsets[array_search($tmp,$_TransData)];

That should complete the data3 specifications. I'll probably update the specification in the (far) future.
__________________
<TABLE border=1><TR><TD>Facts:
Jazz Sprite Dynamite (JSD)
Tileset Extractor
Neobeo's Firetruck

</TD><TD>Myths:
Jazz Creation Station Plus (JCS+) - 10%
Coming soon - a dedicated server! - 25%
Jazz Sprite Dynamite v2 (JSDv2) - 2%
Another generic single-player level - 0%
</TD></TR></TABLE>

Last edited by Neobeo; Oct 22, 2010 at 03:05 PM. Reason: decreased code indent