|
|
|
@ -940,9 +940,21 @@ void AiL::RenderTile(vi2d pos,TilesheetData tileSheet,int tileSheetIndex,vi2d ti |
|
|
|
|
int tileSheetWidth=tileSheet.tileset->tileset->Sprite()->width/tileSheet.tileset->tilewidth; |
|
|
|
|
int tileSheetX=animatedIndex%tileSheetWidth; |
|
|
|
|
int tileSheetY=animatedIndex/tileSheetWidth; |
|
|
|
|
view.DrawPartialDecal(pos*game->GetCurrentMapData().tilewidth,{float(tileSheet.tileset->tilewidth),float(tileSheet.tileset->tileheight)},tileSheet.tileset->tileset->Decal(),vi2d{tileSheetX,tileSheetY}*tileSheet.tileset->tilewidth,{float(tileSheet.tileset->tilewidth),float(tileSheet.tileset->tileheight)},tempCol); |
|
|
|
|
if(tileSheet.tileset->tileRepeatData.count(tileSheetIndex)){ |
|
|
|
|
for(int y=0;y<tileSheet.tileset->tileRepeatData[tileSheetIndex].y;y++){ |
|
|
|
|
for(int x=0;x<tileSheet.tileset->tileRepeatData[tileSheetIndex].x;x++){ |
|
|
|
|
view.DrawPartialDecal(pos*game->GetCurrentMapData().tilewidth+vf2d{float(x),float(y)}*game->GetCurrentMapData().tilewidth/vf2d{tileSheet.tileset->tileRepeatData[tileSheetIndex]},vf2d{float(tileSheet.tileset->tilewidth),float(tileSheet.tileset->tileheight)}/vf2d{tileSheet.tileset->tileRepeatData[tileSheetIndex]},tileSheet.tileset->tileset->Decal(),vi2d{tileSheetX,tileSheetY}*tileSheet.tileset->tilewidth,{float(tileSheet.tileset->tilewidth),float(tileSheet.tileset->tileheight)},tempCol); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}else view.DrawPartialDecal(pos*game->GetCurrentMapData().tilewidth,{float(tileSheet.tileset->tilewidth),float(tileSheet.tileset->tileheight)},tileSheet.tileset->tileset->Decal(),vi2d{tileSheetX,tileSheetY}*tileSheet.tileset->tilewidth,{float(tileSheet.tileset->tilewidth),float(tileSheet.tileset->tileheight)},tempCol); |
|
|
|
|
}else{ |
|
|
|
|
view.DrawPartialDecal(pos*game->GetCurrentMapData().tilewidth,{float(tileSheet.tileset->tilewidth),float(tileSheet.tileset->tileheight)},tileSheet.tileset->tileset->Decal(),tileSheetPos*tileSheet.tileset->tilewidth,{float(tileSheet.tileset->tilewidth),float(tileSheet.tileset->tileheight)},tempCol); |
|
|
|
|
if(tileSheet.tileset->tileRepeatData.count(tileSheetIndex)){ |
|
|
|
|
for(int y=0;y<tileSheet.tileset->tileRepeatData[tileSheetIndex].y;y++){ |
|
|
|
|
for(int x=0;x<tileSheet.tileset->tileRepeatData[tileSheetIndex].x;x++){ |
|
|
|
|
view.DrawPartialDecal(pos*game->GetCurrentMapData().tilewidth+vi2d{x,y}*game->GetCurrentMapData().tilewidth/tileSheet.tileset->tileRepeatData[tileSheetIndex],{float(tileSheet.tileset->tilewidth),float(tileSheet.tileset->tileheight)},tileSheet.tileset->tileset->Decal(),tileSheetPos*tileSheet.tileset->tilewidth,vf2d{float(tileSheet.tileset->tilewidth),float(tileSheet.tileset->tileheight)}/tileSheet.tileset->tileRepeatData[tileSheetIndex],tempCol); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}else view.DrawPartialDecal(pos*game->GetCurrentMapData().tilewidth,{float(tileSheet.tileset->tilewidth),float(tileSheet.tileset->tileheight)},tileSheet.tileset->tileset->Decal(),tileSheetPos*tileSheet.tileset->tilewidth,{float(tileSheet.tileset->tilewidth),float(tileSheet.tileset->tileheight)},tempCol); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -953,9 +965,21 @@ void AiL::RenderTile(TileRenderData&tileSheet,Pixel col){ |
|
|
|
|
int tileSheetWidth=tileSheet.tileSheet.tileset->tileset->Sprite()->width/tileSheet.tileSheet.tileset->tilewidth; |
|
|
|
|
int tileSheetX=animatedIndex%tileSheetWidth; |
|
|
|
|
int tileSheetY=animatedIndex/tileSheetWidth; |
|
|
|
|
view.DrawPartialDecal(tileSheet.pos,{float(tileSheet.tileSheet.tileset->tilewidth),float(tileSheet.tileSheet.tileset->tileheight)},tileSheet.tileSheet.tileset->tileset->Decal(),vi2d{tileSheetX,tileSheetY}*vf2d{float(tileSheet.tileSheet.tileset->tilewidth),float(tileSheet.tileSheet.tileset->tileheight)},{float(tileSheet.tileSheet.tileset->tilewidth),float(tileSheet.tileSheet.tileset->tileheight)},col); |
|
|
|
|
if(tileSheet.tileSheet.tileset->tileRepeatData.count(animatedIndex)){ |
|
|
|
|
for(int y=0;y<tileSheet.tileSheet.tileset->tileRepeatData[animatedIndex].y;y++){ |
|
|
|
|
for(int x=0;x<tileSheet.tileSheet.tileset->tileRepeatData[animatedIndex].x;x++){ |
|
|
|
|
view.DrawPartialDecal(tileSheet.pos+vi2d{x,y}*game->GetCurrentMapData().tilewidth/tileSheet.tileSheet.tileset->tileRepeatData[animatedIndex],{float(tileSheet.tileSheet.tileset->tilewidth),float(tileSheet.tileSheet.tileset->tileheight)},tileSheet.tileSheet.tileset->tileset->Decal(),vi2d{tileSheetX,tileSheetY}*vf2d{float(tileSheet.tileSheet.tileset->tilewidth),float(tileSheet.tileSheet.tileset->tileheight)},vf2d{float(tileSheet.tileSheet.tileset->tilewidth),float(tileSheet.tileSheet.tileset->tileheight)}/tileSheet.tileSheet.tileset->tileRepeatData[animatedIndex],col); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}else view.DrawPartialDecal(tileSheet.pos,{float(tileSheet.tileSheet.tileset->tilewidth),float(tileSheet.tileSheet.tileset->tileheight)},tileSheet.tileSheet.tileset->tileset->Decal(),vi2d{tileSheetX,tileSheetY}*vf2d{float(tileSheet.tileSheet.tileset->tilewidth),float(tileSheet.tileSheet.tileset->tileheight)},{float(tileSheet.tileSheet.tileset->tilewidth),float(tileSheet.tileSheet.tileset->tileheight)},col); |
|
|
|
|
}else{ |
|
|
|
|
view.DrawPartialDecal(tileSheet.pos,{float(tileSheet.tileSheet.tileset->tilewidth),float(tileSheet.tileSheet.tileset->tileheight)},tileSheet.tileSheet.tileset->tileset->Decal(),tileSheet.tileSheetPos,{float(tileSheet.tileSheet.tileset->tilewidth),float(tileSheet.tileSheet.tileset->tileheight)},col); |
|
|
|
|
if(tileSheet.tileSheet.tileset->tileRepeatData.count(tileSheet.tileID)){ |
|
|
|
|
for(int y=0;y<tileSheet.tileSheet.tileset->tileRepeatData[tileSheet.tileID].y;y++){ |
|
|
|
|
for(int x=0;x<tileSheet.tileSheet.tileset->tileRepeatData[tileSheet.tileID].x;x++){ |
|
|
|
|
view.DrawPartialDecal(tileSheet.pos+vi2d{x,y}*game->GetCurrentMapData().tilewidth/tileSheet.tileSheet.tileset->tileRepeatData[tileSheet.tileID],{float(tileSheet.tileSheet.tileset->tilewidth),float(tileSheet.tileSheet.tileset->tileheight)},tileSheet.tileSheet.tileset->tileset->Decal(),tileSheet.tileSheetPos,vf2d{float(tileSheet.tileSheet.tileset->tilewidth),float(tileSheet.tileSheet.tileset->tileheight)}/tileSheet.tileSheet.tileset->tileRepeatData[tileSheet.tileID],col); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}else view.DrawPartialDecal(tileSheet.pos,{float(tileSheet.tileSheet.tileset->tilewidth),float(tileSheet.tileSheet.tileset->tileheight)},tileSheet.tileSheet.tileset->tileset->Decal(),tileSheet.tileSheetPos,{float(tileSheet.tileSheet.tileset->tilewidth),float(tileSheet.tileSheet.tileset->tileheight)},col); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2012,6 +2036,7 @@ void AiL::InitializeLevel(std::string mapFile,MapName map){ |
|
|
|
|
MAP_TILESETS["assets/maps/"+baseSourceDir].staircaseTiles=tileset.GetData().StaircaseData; |
|
|
|
|
MAP_TILESETS["assets/maps/"+baseSourceDir].animationData=tileset.GetData().AnimationData; |
|
|
|
|
MAP_TILESETS["assets/maps/"+baseSourceDir].reflectiveData=tileset.GetData().ReflectiveData; |
|
|
|
|
MAP_TILESETS["assets/maps/"+baseSourceDir].tileRepeatData=tileset.GetData().TileRepeatData; |
|
|
|
|
MAP_TILESETS["assets/maps/"+baseSourceDir].isTerrain=tileset.GetData().isTerrain; |
|
|
|
|
MAP_TILESETS["assets/maps/"+baseSourceDir].collision.SetInitialized(); |
|
|
|
|
LOG("assets/maps/"+baseSourceDir<<" Animation Data Size: "<<MAP_TILESETS["assets/maps/"+baseSourceDir].animationData.size()); |
|
|
|
|