forked from mirrors/kolyah35-minecraft-pe-0.6.1
the whole game
This commit is contained in:
parent
816e9060b4
commit
f0617a5d22
2069 changed files with 581500 additions and 0 deletions
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__*/
|
||||
Loading…
Add table
Add a link
Reference in a new issue