mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
day-night loop, dynamic skybox, clock on debug panel
This commit is contained in:
parent
4a9a4ddd14
commit
c08c31b0ad
24 changed files with 599 additions and 48 deletions
|
|
@ -27,6 +27,7 @@
|
|||
#define PLAYER_FLAG_NOCLIP 0x2
|
||||
|
||||
#define WORLD_SECTION_MAIN 1
|
||||
#define WORLD_SECTION_DAYNIGHT 2
|
||||
|
||||
using glm::ivec2;
|
||||
using glm::vec3;
|
||||
|
|
@ -235,11 +236,15 @@ void WorldFiles::writeWorldInfo(const WorldInfo& info) {
|
|||
BinaryWriter out;
|
||||
out.putCStr(WORLD_FORMAT_MAGIC);
|
||||
out.put(WORLD_FORMAT_VERSION);
|
||||
|
||||
out.put(WORLD_SECTION_MAIN);
|
||||
|
||||
out.putInt64(info.seed);
|
||||
out.put(info.name);
|
||||
|
||||
out.put(WORLD_SECTION_DAYNIGHT);
|
||||
out.putFloat32(info.daytime);
|
||||
out.putFloat32(info.daytimeSpeed);
|
||||
|
||||
files::write_bytes(getWorldFile(), (const char*)out.data(), out.size());
|
||||
}
|
||||
|
||||
|
|
@ -260,6 +265,10 @@ bool WorldFiles::readWorldInfo(WorldInfo& info) {
|
|||
info.seed = inp.getInt64();
|
||||
info.name = inp.getString();
|
||||
break;
|
||||
case WORLD_SECTION_DAYNIGHT:
|
||||
info.daytime = inp.getFloat32();
|
||||
info.daytimeSpeed = inp.getFloat32();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue