mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-09-26 08:57:55 +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.
51 lines
1.3 KiB
C
51 lines
1.3 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/>.
|
|
*/
|
|
|
|
#ifndef SYSTEM4_DTX_H
|
|
#define SYSTEM4_DTX_H
|
|
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
|
|
struct cg;
|
|
|
|
enum dtx_texture_type {
|
|
DTX_WALL = 0,
|
|
DTX_FLOOR = 1,
|
|
DTX_CEILING = 2,
|
|
DTX_STAIRS = 3,
|
|
DTX_DOOR = 4,
|
|
DTX_SKYBOX = 5,
|
|
};
|
|
|
|
struct dtx_entry {
|
|
uint32_t size;
|
|
uint8_t *data;
|
|
};
|
|
|
|
struct dtx {
|
|
uint32_t version; // 0: Rance IV, 1: GALZOO Island
|
|
int nr_rows;
|
|
int nr_columns;
|
|
struct dtx_entry *entries;
|
|
};
|
|
|
|
struct dtx *dtx_parse(uint8_t *data, size_t size);
|
|
void dtx_free(struct dtx *dtx);
|
|
struct cg *dtx_create_cg(struct dtx *dtx, int type, int index);
|
|
|
|
#endif /* SYSTEM4_DTX_H */
|