/* This file was generated by scramble.py. */
#line 1 "src/cloud.py"
#include "cloud.h"
#line 2
#include "bumpmap.h"
#include "rgba.h"
#line 6
Tile * cloud_create(void) {
    int w = 128;
    int h = 128;
    Tile * tile = tile_create("cloud", w, h);
#line 11
    for (int y = 0; y < h; y += 1) {
        for (int x = 0; x < w; x += 1) {
            uint8_t * p = rgba_p(tile->rgba, x, y, w);
            float dx = w / 2 - (x + 0.5);
            float dy = h / 2 - (y + 0.5);
            float d = sqrt(dx * dx + dy * dy) / (w / 2);
            d *= 0.2;
            float v = 0.2 - d;
            if (v < 0) {
                v = 0;
            }
#line 21
            rgba_color(1, 1, 1, p);
            rgba_alpha(v, p);
        }
    }
#line 24
    land_image_set_rgba_data(tile->pic, tile->rgba);
    land_free(tile->rgba);
#line 27
    return tile;
}
#line 30
Tile * sparkle_create(void) {
    int w = 32;
    int h = 32;
    Tile * tile = tile_create("sparkle", w, h);
#line 35
    for (int y = 0; y < h; y += 1) {
        for (int x = 0; x < w; x += 1) {
            uint8_t * p = rgba_p(tile->rgba, x, y, w);
            float dx = w / 2 - (x + 0.5);
            float dy = h / 2 - (y + 0.5);
            float d = sqrt(dx * dx + dy * dy) / (w / 2);
            float a = atan2(dy, dx);
            float star = sin(a * 6) + 1;
            float v = 1 - d - star;
            if (v < 0) {
                v = 0;
            }
#line 46
            rgba_color(1, 1, 1, p);
            rgba_alpha(v, p);
        }
    }
#line 49
    land_image_set_rgba_data(tile->pic, tile->rgba);
    land_free(tile->rgba);
#line 52
    return tile;
}
Tile * tear_create(void) {
    int w = 32;
    int h = 32;
    Tile * tile = tile_create("tear", w, h);
#line 59
    for (int y = 0; y < h; y += 1) {
        for (int x = 0; x < w; x += 1) {
            uint8_t * p = rgba_p(tile->rgba, x, y, w);
            float dx = w / 2 - (x + 0.5);
            float dy = h / 2 - (y + 0.5);
            float d = sqrt(dx * dx + dy * dy) / (w / 2);
            float v = 1 - d * d * d * d;
            if (v < 0) {
                v = 0;
            }
#line 68
            rgba_color(0.5, 0.7, 1, p);
            rgba_alpha(v, p);
        }
    }
#line 71
    land_image_set_rgba_data(tile->pic, tile->rgba);
    land_free(tile->rgba);
#line 74
    return tile;
}
/* This file was generated by scramble.py. */
