灵感再次枯竭,我休息一会

This commit is contained in:
hinomori_minori
2026-09-12 13:44:15 +09:00
parent bf34acbcc4
commit ba99a4cfec
3 changed files with 21 additions and 2 deletions
+2 -1
View File
@@ -11,7 +11,8 @@ enum {
PLATE_IS_OCEAN,
PLATE_THICK,
PLATE_SPEED_X,
PLATE_SPEED_Y
PLATE_SPEED_Y,
PLATE_AGE
};
uint64_t game_hash(uint64_t seed,int type,int subtype);
+14
View File
@@ -109,6 +109,16 @@ static void plate_speed(struct Plate_list _i,uint64_t seed){
}
}
static void plate_age(struct Plate_list _i,uint64_t seed){
for(int i=0;i<_i.count;i++){
if((_i._p+i)->is_ocean){
(_i._p+i)->age=(double)game_hash(seed,PLATE_AGE,i)/UINT64_MAX*200;
}else{
(_i._p+i)->age=200+(double)game_hash(seed,PLATE_AGE,i)/UINT64_MAX*3800;
}
}
}
struct Plate_list plate_init(uint64_t seed,struct World_Block *block){
int count = plate_count(seed);
struct Plate_list list;
@@ -117,5 +127,9 @@ struct Plate_list plate_init(uint64_t seed,struct World_Block *block){
plate_seed(list,seed);
lloyd_init(block,list);
lloyd_iterate(block,list,2);
plate_is_ocean(list,seed);
plate_thick(list,seed);
plate_speed(list,seed);
plate_age(list,seed);
return list;
}
+5 -1
View File
@@ -38,7 +38,6 @@ struct Plate {
bool is_ocean;
double thick;
unsigned long age;
int rock_type;
int world_block_count;
};
@@ -50,6 +49,11 @@ struct Plate_list {
struct World_Block {
int plate_id;
double nearest_plate_dist;
int north_plate_id;
int south_plate_id;
int west_plate_id;
int east_plate_id;
};
struct World {