mirror of
https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-03-21 07:23:31 +00:00
the whole game
This commit is contained in:
27
src/client/renderer/DistanceChunkSorter.h
Executable file
27
src/client/renderer/DistanceChunkSorter.h
Executable file
@@ -0,0 +1,27 @@
|
||||
#ifndef NET_MINECRAFT_CLIENT_RENDERER__DistanceChunkSorter_H__
|
||||
#define NET_MINECRAFT_CLIENT_RENDERER__DistanceChunkSorter_H__
|
||||
|
||||
//package net.minecraft.client.renderer;
|
||||
|
||||
#include "../../world/entity/Entity.h"
|
||||
#include "Chunk.h"
|
||||
|
||||
class DistanceChunkSorter
|
||||
{
|
||||
Entity* player;
|
||||
|
||||
public:
|
||||
DistanceChunkSorter(Entity* player) {
|
||||
this->player = player;
|
||||
}
|
||||
|
||||
bool operator() (const Chunk* c0, const Chunk* c1) {
|
||||
float d0 = c0->distanceToSqr(player);
|
||||
float d1 = c1->distanceToSqr(player);
|
||||
if (d0 > 32 * 32 && c0->y < 64) d0 *= 10.0f;
|
||||
if (d1 > 32 * 32 && c1->y < 64) d1 *= 10.0f;
|
||||
return d0 < d1;//? -1 : 1;
|
||||
}
|
||||
};
|
||||
|
||||
#endif /*NET_MINECRAFT_CLIENT_RENDERER__DistanceChunkSorter_H__*/
|
||||
Reference in New Issue
Block a user