65 lines
1.7 KiB
C
65 lines
1.7 KiB
C
|
#include "haloo3d/haloo3d.h"
|
||
|
#include "haloo3d/haloo3dex_easy.h"
|
||
|
#include "haloo3d/haloo3dex_gen.h"
|
||
|
#include "haloo3d/haloo3dex_obj.h"
|
||
|
|
||
|
#include "unigi/unigi.headers/src/main.h"
|
||
|
#include "unigi/unigi.platform.sdl1/src/main.c"
|
||
|
|
||
|
#include "ecs2.h"
|
||
|
#include "terrain_ecstypes.h"
|
||
|
|
||
|
#include <stdlib.h>
|
||
|
|
||
|
#define WIDTH 480
|
||
|
#define HEIGHT 300
|
||
|
#define ASPECT ((float)WIDTH / HEIGHT)
|
||
|
#define SCREENSCALE 2
|
||
|
#define SWIDTH (WIDTH * SCREENSCALE)
|
||
|
#define SHEIGHT (HEIGHT * SCREENSCALE)
|
||
|
#define NEARCLIP 0.01
|
||
|
#define FARCLIP 100.0
|
||
|
#define AVGWEIGHT 0.85
|
||
|
|
||
|
#define CAM_INITPITCH MPI_2
|
||
|
|
||
|
// Try 0.5 and 3.5 or something
|
||
|
#define DITHERSTART 10000
|
||
|
#define DITHEREND 10000
|
||
|
|
||
|
int main() { // int argc, char **argv) {
|
||
|
srand(clock());
|
||
|
|
||
|
// Init unigi system. Can use anything here that can render to screen
|
||
|
unigi_type_event event;
|
||
|
unigi_type_resolution res;
|
||
|
res.width = SWIDTH;
|
||
|
res.height = SHEIGHT;
|
||
|
res.depth = 0;
|
||
|
|
||
|
unigi_graphics_init();
|
||
|
unigi_window_create(res, "terrain.exe"); // render.printbuf);
|
||
|
|
||
|
eprintf("Initialized unigi system\n");
|
||
|
|
||
|
haloo3d_easystore storage;
|
||
|
haloo3d_easystore_init(&storage);
|
||
|
haloo3d_fb *palettetex = haloo3d_easystore_addtex(&storage, "palette");
|
||
|
haloo3d_gen_palettetex(palettetex);
|
||
|
|
||
|
eprintf("Initialized storage and default textures/etc\n");
|
||
|
|
||
|
haloo3d_fb screen;
|
||
|
haloo3d_fb_init(&screen, SWIDTH, SHEIGHT);
|
||
|
|
||
|
haloo3d_easytimer frametimer, drawtimer, sdltimer, filltimer, logictimer;
|
||
|
haloo3d_easytimer_init(&frametimer, AVGWEIGHT);
|
||
|
haloo3d_easytimer_init(&drawtimer, AVGWEIGHT);
|
||
|
haloo3d_easytimer_init(&sdltimer, AVGWEIGHT);
|
||
|
haloo3d_easytimer_init(&filltimer, AVGWEIGHT);
|
||
|
haloo3d_easytimer_init(&logictimer, AVGWEIGHT);
|
||
|
|
||
|
haloo3d_easystore_deleteallobj(&storage, haloo3d_obj_free);
|
||
|
haloo3d_easystore_deletealltex(&storage, haloo3d_fb_free);
|
||
|
}
|