Beispiel #1
0
int main(int argc, char* argv[])
{
    printf("Generating vmap...\n");
    FMAP vmap = genmap_sin(.8, 440.0, 0.1, 2.0, 1e-5);
    printf("Generated.\n");
    if (!savemap(vmap, "test"))
    {
        printf("Could not save...\n");
        return 1;
    }
    freemap(vmap);
    printf("Finished!\n");
    return 0;
}
Beispiel #2
0
void generalcommands(void)
{
    /* Block selecting */
    if (key == KEY_Z) blk--;
    if (key == KEY_X) blk++;
    if (key == KEY_A) blk -= 10;
    if (key == KEY_S) blk += 10;
    if (blk < 0) blk = 0;
    if (blk > (int)gfx_nblocks) blk = gfx_nblocks;

    /* General commands */
    if (key == KEY_SCROLLLOCK) scrolllock ^= 1;
    if (key == KEY_1)
    {
        cl = 0;
        mark = 0;
    }
    if (key == KEY_2)
    {
        cl = 1;
        mark = 0;
    }
    if (key == KEY_3)
    {
        cl = 2;
        mark = 0;
    }
    if (key == KEY_4)
    {
        cl = 3;
        mark = 0;
    }
    if (key == KEY_5) layervisible[0] ^=1;
    if (key == KEY_6) layervisible[1] ^=1;
    if (key == KEY_7) layervisible[2] ^=1;
    if (key == KEY_8) layervisible[3] ^=1;
    if (key == KEY_L) layeroptions();
    if (key == KEY_F3) loadblocks();
    if (key == KEY_F4) loadpalette();
    if (key == KEY_F1) loadmapname();
    if (key == KEY_F2) savemap();
    if (key == KEY_F10) help();
    if (key == KEY_F12)
    {
        screenmode++;
        if (screenmode > GFX_DOUBLESIZE) screenmode = 0;
        setscreenmode();
    }
}
Beispiel #3
0
main()
{
	int gencount, xforms;

	maprows = 64;
	mapcols = 64;

    srand48(time(NULL));

	genmap();

	gencount = 1;

	while((xforms = generation()) > (maprows*mapcols/30)
	&& gencount < 11)
		fprintf(stderr,
			"Generation %4d -- %5d Transforms\n", gencount++, xforms);

	fprintf(stderr,
		"Generation %4d -- %5d Transforms\n", gencount++, xforms);

	savemap();
}