Tileset animations.

This commit is contained in:
2022-12-07 20:13:59 -08:00
parent 5b6f9124b5
commit eb6c4c8076
16 changed files with 262 additions and 165 deletions

View File

@ -119,11 +119,11 @@ int main(int argc, char *argv[]) {
sprintf(buffer, "%i|%i|%i|%i|", cols, rows, divX, divY);
// Now prep tileset.
for(int y = 0; y < rows; y++) {
for(int x = 0; x < cols; x++) {
float ux0 = (borderX + ((float)divX * x) + ((float)gapX * x)) / w;
for(float y = 0; y < rows; y++) {
for(float x = 0; x < cols; x++) {
float ux0 = ((float)borderX + ((float)divX * x) + ((float)gapX * x)) / (float)w;
float ux1 = ux0 + tdivX;
float uy0 = (borderY + ((float)divY * y) + ((float)gapY * y)) / h;
float uy0 = ((float)borderY + ((float)divY * y) + ((float)gapY * y)) / (float)h;
float uy1 = uy0 + tdivY;
sprintf(buffer, "%s%f,%f,%f,%f|", buffer, ux0, ux1, uy0, uy1);
}