mirror of
https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-04-07 07:53:32 +00:00
Added 3 Fog Choices (Pocket) (Java) (Unknown that was unused) Restored Java Beta Sky Color code that was unused that depends on biome temperature (choosable using Java fog) Tile Shadows and Entity Shadows that appear beneath them have been restored and fixed from the unused code, toggleable by turning fancy graphics on or off Entities will now render flames on themselves when on fire, including the player Added option to use Java Style Item Count text and position in tweaks - fileshredder
55 lines
1.5 KiB
C++
Executable File
55 lines
1.5 KiB
C++
Executable File
#ifndef NET_MINECRAFT_WORLD_LEVEL_DIMENSION__NormalDayCycleDimension_H__
|
|
#define NET_MINECRAFT_WORLD_LEVEL_DIMENSION__NormalDayCycleDimension_H__
|
|
|
|
//package net.minecraft.world.level.dimension;
|
|
|
|
#include "Dimension.h"
|
|
#include "../Level.h"
|
|
#include "../../../util/Mth.h"
|
|
|
|
class NormalDayCycleDimension: public Dimension {
|
|
public:
|
|
|
|
float getTimeOfDay(long time, float a) {
|
|
int dayStep = (int) (time % Level::TICKS_PER_DAY);
|
|
float td = (dayStep + a) / Level::TICKS_PER_DAY - 0.25f;
|
|
if (td < 0) td += 1;
|
|
if (td > 1) td -= 1;
|
|
float tdo = td;
|
|
td = 1 - (cos(td * Mth::PI) + 1) * 0.5f;
|
|
return tdo + (td - tdo) / 3.0f;
|
|
}
|
|
|
|
Vec3 getFogColor( float td, float a ) {
|
|
if (FogType == 1)
|
|
{
|
|
fogColor = 0xc0d8ff; // 1 returns java beta styled fog color.
|
|
}
|
|
else if (FogType == 2)
|
|
{
|
|
fogColor = 0x406fe5; // 2 returns some type of unused fog color IDK what this one was used for possibly early pe??
|
|
}
|
|
else // otherwise as default we return the mcpe fog color
|
|
{
|
|
fogColor = 0x80daff;
|
|
}
|
|
float br = cos(td * Mth::PI * 2) * 2 + 0.5f;
|
|
if (br < 0) br = 0;
|
|
if (br > 1.f) br = 1.f;
|
|
|
|
float r = ((fogColor >> 16) & 0xff) / 255.0f;
|
|
float g = ((fogColor >> 8) & 0xff) / 255.0f;
|
|
float b = ((fogColor) & 0xff) / 255.0f;
|
|
r *= br * 0.94f + 0.06f;
|
|
g *= br * 0.94f + 0.06f;
|
|
b *= br * 0.91f + 0.09f;
|
|
|
|
//LOGI("rgb: %f, %f, %f\n", r, g, b);
|
|
|
|
return Vec3(r, g, b);
|
|
}
|
|
|
|
};
|
|
|
|
#endif /*NET_MINECRAFT_WORLD_LEVEL_DIMENSION__NormalDayCycleDimension_H__*/
|