Cleanup maze code
This commit is contained in:
parent
64c61ab856
commit
819f7e7f76
19
maze.c
19
maze.c
@ -102,8 +102,6 @@ int maze_visited(uint8_t *maze, int x, int y, int size) {
|
||||
}
|
||||
|
||||
int maze_connected(uint8_t *maze, int x, int y, int size, uint8_t move) {
|
||||
// eprintf("CHECKING DIR %d at (%d,%d), it is %d\n", move, x, y,
|
||||
// maze[x + y * size]);
|
||||
if (move == DIREAST) {
|
||||
return (maze[x + y * size] & MAZEEAST) == 0;
|
||||
} else if (move == DIRWEST) {
|
||||
@ -283,12 +281,6 @@ typedef struct {
|
||||
struct vec2 rot; // x is yaw, y is pitch
|
||||
} ecs_placement;
|
||||
|
||||
// A component representing movement through the scene.
|
||||
// typedef struct {
|
||||
// struct vec3 posvel;
|
||||
// mfloat_t yawvel;
|
||||
// } ecs_movement;
|
||||
|
||||
// A component which links back to a camera
|
||||
typedef struct {
|
||||
haloo3d_camera *camera;
|
||||
@ -348,11 +340,6 @@ void sys_billboard(ecs_billboard *bb) {
|
||||
bb->obj->lookvec.x = -(bb->lookat->x - bb->obj->pos.x);
|
||||
bb->obj->lookvec.y = 0;
|
||||
bb->obj->lookvec.z = -(bb->lookat->z - bb->obj->pos.z);
|
||||
// if (bb->obj->pos.y != 0) {
|
||||
// printf("BBY: %f LXYZ: (%f, %f, %f) S: %f,%f\n", bb->obj->pos.y,
|
||||
// bb->obj->lookvec.x, bb->obj->lookvec.y, bb->obj->lookvec.z,
|
||||
// bb->obj->scale.x, bb->obj->scale.y);
|
||||
// }
|
||||
}
|
||||
|
||||
void sys_syncgrow(ecs_syncgrow *sg) {
|
||||
@ -408,8 +395,6 @@ void sys_camera(ecs_camera *cam, ecs_placement *p) {
|
||||
cam->camera->pos = p->pos;
|
||||
cam->camera->yaw = p->rot.x;
|
||||
cam->camera->pitch = p->rot.y;
|
||||
// eprintf("CAM: %f %f POS: %f %f %f\n", cam->camera->yaw, cam->camera->pitch,
|
||||
// cam->camera->pos.x, cam->camera->pos.y, cam->camera->pos.z);
|
||||
}
|
||||
|
||||
void sys_world(ecs_world *w) {
|
||||
@ -847,9 +832,6 @@ int main() { // int argc, char **argv) {
|
||||
ECS_SETCOMPONENT(&ecs, startid, ecs_billboard){.obj = starti,
|
||||
.lookat = &render.camera.pos};
|
||||
ecs_eid endid = mecs_newentity(&ecs, 0);
|
||||
// endi->scale.y = endi->scale.x;
|
||||
// endi->lookvec.x = -1;
|
||||
// endi->lookvec.z = 0;
|
||||
ECS_SETCOMPONENT(&ecs, endid, ecs_syncgrow){.obj = endi,
|
||||
.scale = &eworld->scaleto,
|
||||
.basescale = endi->scale.x,
|
||||
@ -860,7 +842,6 @@ int main() { // int argc, char **argv) {
|
||||
// Player is ofc most complicated
|
||||
ecs_eid playerid = mecs_newentity(&ecs, 0);
|
||||
eprintf("Player eid: %d\n", playerid);
|
||||
// ECS_SETCOMPONENT(&ecs, playerid, ecs_worldstate){.state = &wstate};
|
||||
ECS_SETCOMPONENT(&ecs, playerid, ecs_placement){
|
||||
.pos = render.camera.pos,
|
||||
.rot = {.x = render.camera.yaw, .y = render.camera.pitch}};
|
||||
|
Loading…
Reference in New Issue
Block a user