mirror of
https://github.com/Cubitect/cubiomes.git
synced 2025-09-24 04:03:39 -04:00
Updated biome colors.
This commit is contained in:
parent
0004585edf
commit
bdceb725c0
100
util.c
100
util.c
@ -4,12 +4,20 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
void setBiomeColour(unsigned char biomeColour[256][3], int biome,
|
void setBiomeColour(unsigned char biomeColour[256][3], int id,
|
||||||
unsigned char r, unsigned char g, unsigned char b)
|
unsigned char r, unsigned char g, unsigned char b)
|
||||||
{
|
{
|
||||||
biomeColour[biome][0] = r;
|
biomeColour[id][0] = r;
|
||||||
biomeColour[biome][1] = g;
|
biomeColour[id][1] = g;
|
||||||
biomeColour[biome][2] = b;
|
biomeColour[id][2] = b;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setMutationColour(unsigned char biomeColour[256][3], int mutated, int parent)
|
||||||
|
{
|
||||||
|
unsigned int c;
|
||||||
|
biomeColour[mutated][0] = (c = biomeColour[parent][0] + 40) > 255 ? 255 : c;
|
||||||
|
biomeColour[mutated][1] = (c = biomeColour[parent][1] + 40) > 255 ? 255 : c;
|
||||||
|
biomeColour[mutated][2] = (c = biomeColour[parent][2] + 40) > 255 ? 255 : c;
|
||||||
}
|
}
|
||||||
|
|
||||||
void initBiomeColours(unsigned char biomeColours[256][3])
|
void initBiomeColours(unsigned char biomeColours[256][3])
|
||||||
@ -21,7 +29,7 @@ void initBiomeColours(unsigned char biomeColours[256][3])
|
|||||||
memset(biomeColours, 0, 256*3);
|
memset(biomeColours, 0, 256*3);
|
||||||
|
|
||||||
setBiomeColour(biomeColours, ocean, 0, 0, 112);
|
setBiomeColour(biomeColours, ocean, 0, 0, 112);
|
||||||
setBiomeColour(biomeColours, plains,141, 179, 96);
|
setBiomeColour(biomeColours, plains, 141, 179, 96);
|
||||||
setBiomeColour(biomeColours, desert, 250, 148, 24);
|
setBiomeColour(biomeColours, desert, 250, 148, 24);
|
||||||
setBiomeColour(biomeColours, mountains, 96, 96, 96);
|
setBiomeColour(biomeColours, mountains, 96, 96, 96);
|
||||||
setBiomeColour(biomeColours, forest, 5, 102, 33);
|
setBiomeColour(biomeColours, forest, 5, 102, 33);
|
||||||
@ -69,49 +77,37 @@ void initBiomeColours(unsigned char biomeColours[256][3])
|
|||||||
setBiomeColour(biomeColours, deep_cold_ocean, 32, 32, 56);
|
setBiomeColour(biomeColours, deep_cold_ocean, 32, 32, 56);
|
||||||
setBiomeColour(biomeColours, deep_frozen_ocean, 64, 64, 144);
|
setBiomeColour(biomeColours, deep_frozen_ocean, 64, 64, 144);
|
||||||
|
|
||||||
setBiomeColour(biomeColours, ocean+128, 0, 0, 112);
|
setBiomeColour(biomeColours, the_void, 0, 0, 0);
|
||||||
setBiomeColour(biomeColours, plains+128, 141, 179, 96);
|
|
||||||
setBiomeColour(biomeColours, desert+128, 250, 148, 24);
|
setMutationColour(biomeColours, sunflower_plains, plains);
|
||||||
setBiomeColour(biomeColours, mountains+128, 96, 96, 96);
|
setMutationColour(biomeColours, desert_lakes, desert);
|
||||||
setBiomeColour(biomeColours, forest+128, 5, 102, 33);
|
setMutationColour(biomeColours, gravelly_mountains, mountains);
|
||||||
setBiomeColour(biomeColours, taiga+128, 11, 102, 89);
|
setMutationColour(biomeColours, flower_forest, forest);
|
||||||
setBiomeColour(biomeColours, swamp+128, 7, 249, 178);
|
setMutationColour(biomeColours, taiga_mountains, taiga);
|
||||||
setBiomeColour(biomeColours, river+128, 0, 0, 255);
|
setMutationColour(biomeColours, swamp_hills, swamp);
|
||||||
setBiomeColour(biomeColours, hell+128, 255, 0, 0);
|
setBiomeColour(biomeColours, ice_spikes, 180, 220, 220);
|
||||||
setBiomeColour(biomeColours, sky+128, 128, 128, 255);
|
setMutationColour(biomeColours, modified_jungle, jungle);
|
||||||
setBiomeColour(biomeColours, frozen_ocean+128, 144, 144, 160);
|
setMutationColour(biomeColours, modified_jungle_edge, jungle_edge);
|
||||||
setBiomeColour(biomeColours, frozen_river+128, 160, 160, 255);
|
setMutationColour(biomeColours, tall_birch_forest, birch_forest);
|
||||||
setBiomeColour(biomeColours, snowy_tundra+128, 140, 180, 180);
|
setMutationColour(biomeColours, tall_birch_hills, birch_forest_hills);
|
||||||
setBiomeColour(biomeColours, snowy_mountains+128, 160, 160, 160);
|
setMutationColour(biomeColours, dark_forest_hills, dark_forest);
|
||||||
setBiomeColour(biomeColours, mushroom_fields+128, 255, 0, 255);
|
setMutationColour(biomeColours, snowy_taiga_mountains, snowy_taiga);
|
||||||
setBiomeColour(biomeColours, mushroom_field_shore+128, 160, 0, 255);
|
setMutationColour(biomeColours, giant_spruce_taiga, giant_tree_taiga);
|
||||||
setBiomeColour(biomeColours, beach+128, 250, 222, 85);
|
setMutationColour(biomeColours, giant_spruce_taiga_hills, giant_tree_taiga_hills);
|
||||||
setBiomeColour(biomeColours, desert_hills+128, 210, 95, 18);
|
setMutationColour(biomeColours, modified_gravelly_mountains, wooded_mountains);
|
||||||
setBiomeColour(biomeColours, wooded_hills+128, 34, 85, 28);
|
setMutationColour(biomeColours, shattered_savanna, savanna);
|
||||||
setBiomeColour(biomeColours, taiga_hills+128, 22, 57, 51);
|
setMutationColour(biomeColours, shattered_savanna_plateau, savanna_plateau);
|
||||||
setBiomeColour(biomeColours, mountain_edge+128, 114, 120, 154);
|
setMutationColour(biomeColours, eroded_badlands, badlands);
|
||||||
setBiomeColour(biomeColours, jungle+128, 83, 123, 9);
|
setMutationColour(biomeColours, modified_wooded_badlands_plateau, wooded_badlands_plateau);
|
||||||
setBiomeColour(biomeColours, jungle_hills+128, 44, 66, 5);
|
setMutationColour(biomeColours, modified_badlands_plateau, badlands_plateau);
|
||||||
setBiomeColour(biomeColours, jungleEdge+128, 98, 139, 23);
|
|
||||||
setBiomeColour(biomeColours, deep_ocean+128, 0, 0, 48);
|
|
||||||
setBiomeColour(biomeColours, stone_shore+128, 162, 162, 132);
|
|
||||||
setBiomeColour(biomeColours, snowy_beach+128, 250, 240, 192);
|
|
||||||
setBiomeColour(biomeColours, birch_forest+128, 48, 116, 68);
|
|
||||||
setBiomeColour(biomeColours, birch_forest_hills+128, 31, 95, 50);
|
|
||||||
setBiomeColour(biomeColours, dark_forest+128, 64, 81, 26);
|
|
||||||
setBiomeColour(biomeColours, snowy_taiga+128, 49, 85, 74);
|
|
||||||
setBiomeColour(biomeColours, snowy_taiga_hills+128, 36, 63, 54);
|
|
||||||
setBiomeColour(biomeColours, giant_tree_taiga+128, 89, 102, 81);
|
|
||||||
setBiomeColour(biomeColours, giant_tree_taiga_hills+128, 69, 79, 62);
|
|
||||||
setBiomeColour(biomeColours, wooded_mountains+128, 80, 112, 80);
|
|
||||||
setBiomeColour(biomeColours, savanna+128, 189, 178, 95);
|
|
||||||
setBiomeColour(biomeColours, savanna_plateau+128, 167, 157, 100);
|
|
||||||
setBiomeColour(biomeColours, badlands+128, 217, 69, 21);
|
|
||||||
setBiomeColour(biomeColours, wooded_badlands_plateau+128, 176, 151, 101);
|
|
||||||
setBiomeColour(biomeColours, badlands_plateau+128, 202, 140, 101);
|
|
||||||
|
|
||||||
setBiomeColour(biomeColours, bamboo_jungle, 118, 142, 20);
|
setBiomeColour(biomeColours, bamboo_jungle, 118, 142, 20);
|
||||||
setBiomeColour(biomeColours, bamboo_jungle_hills, 59, 71, 10);
|
setBiomeColour(biomeColours, bamboo_jungle_hills, 59, 71, 10);
|
||||||
|
|
||||||
|
setBiomeColour(biomeColours, soul_sand_valley, 82, 41, 33);
|
||||||
|
setBiomeColour(biomeColours, crimson_forest, 221, 8, 8);
|
||||||
|
setBiomeColour(biomeColours, warped_forest, 73, 144, 123);
|
||||||
|
setBiomeColour(biomeColours, basalt_deltas, 104, 95, 112); // TBD
|
||||||
}
|
}
|
||||||
|
|
||||||
void initBiomeTypeColours(unsigned char biomeColours[256][3])
|
void initBiomeTypeColours(unsigned char biomeColours[256][3])
|
||||||
@ -138,7 +134,7 @@ int biomesToImage(unsigned char *pixels,
|
|||||||
{
|
{
|
||||||
for (i = 0; i < sx; i++)
|
for (i = 0; i < sx; i++)
|
||||||
{
|
{
|
||||||
int id = biomes[j*sx+i]; //if (id != swamp) id = 100;
|
int id = biomes[j*sx+i];
|
||||||
unsigned int r, g, b;
|
unsigned int r, g, b;
|
||||||
|
|
||||||
if (id < 0 || id >= 256)
|
if (id < 0 || id >= 256)
|
||||||
@ -151,15 +147,9 @@ int biomesToImage(unsigned char *pixels,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (id < 128 || 1) {
|
r = biomeColours[id][0];
|
||||||
r = biomeColours[id][0];
|
g = biomeColours[id][1];
|
||||||
g = biomeColours[id][1];
|
b = biomeColours[id][2];
|
||||||
b = biomeColours[id][2];
|
|
||||||
} else {
|
|
||||||
r = biomeColours[id][0]+40; r = (r>0xff) ? 0xff : r&0xff;
|
|
||||||
g = biomeColours[id][1]+40; g = (g>0xff) ? 0xff : g&0xff;
|
|
||||||
b = biomeColours[id][2]+40; b = (b>0xff) ? 0xff : b&0xff;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int m, n;
|
unsigned int m, n;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user