ld33_umonster

annotate src/room.cc @ 3:93ff21458a16

fixed stuff
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 23 Aug 2015 02:51:39 +0300
parents 35349df5392d
children 3b4460b34d43
rev   line source
nuclear@2 1 #include <stdio.h>
nuclear@2 2 #include "opengl.h"
nuclear@2 3 #include "room.h"
nuclear@2 4 #include "game.h"
nuclear@2 5 #include "object.h"
nuclear@2 6 #include "scene.h"
nuclear@2 7 #include "meshgen.h"
nuclear@2 8
nuclear@2 9 static Scene scn;
nuclear@2 10
nuclear@2 11 bool init_room()
nuclear@2 12 {
nuclear@2 13 Matrix4x4 xform;
nuclear@2 14
nuclear@2 15 // generate room
nuclear@2 16 Mesh *mroom = new Mesh;
nuclear@3 17 gen_box(mroom, 50, 25, 50);
nuclear@3 18 xform.set_translation(Vector3(0, 12.5, 0));
nuclear@2 19 mroom->apply_xform(xform);
nuclear@2 20 mroom->flip();
nuclear@2 21
nuclear@2 22 Object *oroom = new Object;
nuclear@2 23 oroom->set_mesh(mroom);
nuclear@2 24 oroom->rop.cast_shadows = false;
nuclear@2 25
nuclear@2 26 scn.add_object(oroom);
nuclear@2 27 return true;
nuclear@2 28 }
nuclear@2 29
nuclear@2 30 void cleanup_room()
nuclear@2 31 {
nuclear@2 32 scn.clear();
nuclear@2 33 }
nuclear@2 34
nuclear@2 35 void draw_room()
nuclear@2 36 {
nuclear@2 37 scn.draw();
nuclear@2 38 }