Nooncraft/src/main.cpp

54 lines
993 B
C++

#include "render.h"
#include "world.h"
#include "graphics.h"
#include <gint/keyboard.h>
#include <string.h>
int main(void)
{
World *world = Nooncraft::mkWorld(128, 128);
if(!world)
return 0;
Nooncraft::genWorld(world);
Camera *camera = new Camera(world);
camera->region = WorldRect(-13, 14, -6, 6);
// -
char separator[57];
memset(separator, '-', 56);
separator[56] = 0;
renderClear();
Nooncraft::renderCamera(26, 12, camera);
// HUD
GlyphCluster invLeft(' ', GLYPH_PARALLEL_TO, ' ', GLYPH_PARALLEL_TO);
GlyphCluster invRight(GLYPH_PARALLEL_TO, ' ', GLYPH_PARALLEL_TO, ' ');
int hudY = 27;
renderText(0, hudY, separator);
renderText(24, hudY+1, "COBBLESTONE");
renderCluster(0, hudY+1, invLeft);
renderCluster(2, hudY+1, Nooncraft::getBlockInfo(2)->cluster);
renderCluster(20, hudY+1, invRight);
renderText(2, hudY+3, "1 2 3 4 5 6 7 8 9");
// -
renderText(0, 0, "NOONCRAFT");
renderUpdate();
getkey();
//-
delete camera;
delete world;
return 1;
}