Add first person view.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "maths.h"
|
||||
#include "camera.h"
|
||||
#include "minimap.h"
|
||||
#include "firstperson.h"
|
||||
|
||||
#define MINIMAP_SIZE 460
|
||||
#define VIEW_SIZE MINIMAP_SIZE*2
|
||||
@@ -22,8 +23,10 @@ int view_init()
|
||||
printf("view_init()\n");
|
||||
if (!camera_init(&camera, sf::Vector2f(5.f/2.f, 5.f/2.f), 0.f, 100, 0.5f*PI)) return 0;
|
||||
if (!minimap_init(MINIMAP_SIZE)) return 0;
|
||||
if (!firstperson_init(VIEW_SIZE, MINIMAP_SIZE)) return 0;
|
||||
|
||||
minimap_setTexturePosition(0.f, 0.f);
|
||||
firstperson_setTexturePosition(MINIMAP_SIZE, 0.f);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -50,6 +53,7 @@ int view_update()
|
||||
|
||||
window.clear();
|
||||
minimap_update(&window, &camera);
|
||||
firstperson_update(&window);
|
||||
window.display();
|
||||
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user