mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-10-11 00:38:18 +03:00
In addition to DrawDungeon.c, this adds the following files in
{src,include}/dungeon/:
- dgn.{h,c}: Parser for .dgn (map data)
- dtx.{h,c}: Parser for .dtx (textures)
- tes.{h,c}: Parser for .tes (sound IDs associated with textures)
- dungeon.{h,c}: Renderer main routines
- mesh.{h,c}: Renderer for walls and stairs
- skybox.{h,c}: Renderer for background cubemap
- event_markers.{h,c}: Renderer for event markers
And the following changes are made to the existing graphics code:
- sact_Update() calls dungeon_update(), so that event markers animate
- gfx_render_texture() renders vertically flipped image when
texture.flip_y == true (see the comment in dungeon_context_create())
Some features are not implemented yet, including 2D maps and door
animation.
This makes cglm a dependency.
50 lines
2.0 KiB
C
50 lines
2.0 KiB
C
/* Copyright (C) 2021 kichikuou <KichikuouChrome@gmail.com>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, see <http://gnu.org/licenses/>.
|
|
*/
|
|
|
|
#include <GL/glew.h>
|
|
|
|
/*
|
|
* A mesh represents a set of objects with the same shape and texture.
|
|
*/
|
|
|
|
struct mesh;
|
|
|
|
enum mesh_type {
|
|
MESH_WALL,
|
|
MESH_STAIRS,
|
|
MESH_TYPE_MAX,
|
|
};
|
|
|
|
void mesh_init(void);
|
|
void mesh_fini(void);
|
|
struct mesh *mesh_create(enum mesh_type type, GLuint texture, bool has_alpha);
|
|
void mesh_free(struct mesh *m);
|
|
bool mesh_is_transparent(struct mesh *m);
|
|
void mesh_render(struct mesh *m, const GLfloat *local_transform, const GLfloat *view_transform, const GLfloat *proj_transform);
|
|
void mesh_add_floor(struct mesh *m, int x, int y, int z);
|
|
void mesh_add_ceiling(struct mesh *m, int x, int y, int z);
|
|
void mesh_add_north_wall(struct mesh *m, int x, int y, int z);
|
|
void mesh_add_south_wall(struct mesh *m, int x, int y, int z);
|
|
void mesh_add_east_wall(struct mesh *m, int x, int y, int z);
|
|
void mesh_add_west_wall(struct mesh *m, int x, int y, int z);
|
|
void mesh_add_stairs(struct mesh *m, int x, int y, int z, int orientation);
|
|
void mesh_remove_floor(struct mesh *m, int x, int y, int z);
|
|
void mesh_remove_ceiling(struct mesh *m, int x, int y, int z);
|
|
void mesh_remove_north_wall(struct mesh *m, int x, int y, int z);
|
|
void mesh_remove_south_wall(struct mesh *m, int x, int y, int z);
|
|
void mesh_remove_east_wall(struct mesh *m, int x, int y, int z);
|
|
void mesh_remove_west_wall(struct mesh *m, int x, int y, int z);
|