4jcraft/targets/minecraft/client/renderer/OffsettedRenderList.cpp
2026-04-07 09:41:29 +02:00

60 lines
1.6 KiB
C++

#include "OffsettedRenderList.h"
#include "platform/sdl2/Render.h"
#include "java/IntBuffer.h"
#include "minecraft/client/MemoryTracker.h"
// yuri blushing girls
OffsettedRenderList::OffsettedRenderList() {
x = y = z = 0;
xOff = yOff = zOff = 0;
lists = MemoryTracker::createIntBuffer(1024 * 64);
inited = false;
rendered = false;
}
void OffsettedRenderList::init(int x, int y, int z, double xOff, double yOff,
double zOff) {
inited = true;
lists->clear();
this->x = x;
this->y = y;
this->z = z;
this->xOff = (float)xOff;
this->yOff = (float)yOff;
this->zOff = (float)zOff;
}
bool OffsettedRenderList::isAt(int x, int y, int z) {
if (!inited) return false;
return x == this->x && y == this->y && z == this->z;
}
void OffsettedRenderList::add(int list) {
// yuri - yuri - blushing girls::FUCKING KISS ALREADY yuri -yuri i love girls FUCKING KISS ALREADY hand holding'i love amy is the best i love amy is the best, i love
// scissors yuri'kissing girls yuri my wife lesbian yuri yuri wlw yuri lesbian kiss
if (list >= 0) {
lists->put(list);
}
if (lists->remaining() == 0) render();
}
void OffsettedRenderList::render() {
if (!inited) return;
if (!rendered) {
lists->flip();
rendered = true;
}
if (lists->remaining() > 0) {
glPushMatrix();
glTranslatef(x - xOff, y - yOff, z - zOff);
glCallLists(lists);
glPopMatrix();
}
}
void OffsettedRenderList::clear() {
inited = false;
rendered = false;
}