Camera (wip)
This commit is contained in:
parent
4ec2805a5d
commit
33a9f50b1e
12
camera.c
Normal file
12
camera.c
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
#include "camera.h"
|
||||||
|
#include "types.h"
|
||||||
|
|
||||||
|
|
||||||
|
System_Camera *camera_NewSystem(App *super) {
|
||||||
|
System_Camera *sys = zero_malloc(sizeof(System_Camera));
|
||||||
|
sys->super = super;
|
||||||
|
}
|
||||||
|
void camera_DeleteSystem(System_Camera *sys);
|
||||||
|
|
||||||
|
void camera_Advance(System_Camera *sys, Duration deltaTime);
|
30
camera.h
Normal file
30
camera.h
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "player.h"
|
||||||
|
#include "types.h"
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct _App App;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
App *super;
|
||||||
|
Component_Player *player;
|
||||||
|
|
||||||
|
Box2 cam, target; // Current & target camera
|
||||||
|
double speed; // Fraction of distance between cam & target to be covered in 1 sec
|
||||||
|
} System_Camera;
|
||||||
|
|
||||||
|
System_Camera *camera_NewSystem(App *super);
|
||||||
|
void camera_DeleteSystem(System_Camera *sys);
|
||||||
|
|
||||||
|
void camera_Advance(System_Camera *sys, Duration deltaTime);
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
Loading…
Reference in New Issue
Block a user