Commit Graph
5 Commits
Author SHA1 Message Date
kichikuou 9c6bf5c110 DrawDungeon: Move walk-flag management code out of map.c
So that ctx->map can just be null in DrawDungeon14 (GALZOO), where 2D
maps are not drawn by the HLL.
2021-06-13 16:33:44 +09:00
kichikuou 2ad6eba94f DrawDungeon: Implement SetDoor[NWSE]Angle
Now door animation works.
2021-06-06 14:22:33 +09:00
kichikuou 98798a6ab9 DrawDungeon: A major rewrite of dungeon renderer
Before this, all objects that share a texture were drawn at once.
Objects were not depth-sorted, so if a transparent object was drawn
first, objects behind it were not drawn.

After this, dungeon is drawn for each cell, sorted by distance from
the camera position. To reduce the number of cells to be drawn, PVS
(Potentially Visible Set) stored in dgn files is used.
2021-05-30 21:28:22 +09:00
kichikuou fa5ed2db35 Implement DrawDungeon.{Load,Save}WalkData
Also fixes compiler warnings in map.c.
2021-05-23 14:11:18 +09:00
kichikuou adb558c67c Initial implementation of DrawDungeon.hll (Rance VI)
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.
2021-05-08 22:42:57 +09:00