Commit Graph
17 Commits
Author SHA1 Message Date
kichikuou afae3fc9a6 DrawDungeon14: Implement raster effect
It is implemented as a post-processing effect. The hack for the
projection transform matrix has been removed, because now the image is
flipped upside down in the post-processing stage.
2023-09-01 21:45:46 +09:00
kichikuou fd4cd139f8 Introduce draw_plugin
This introduces draw_plugin struct that can be attached to a sprite.
The update() function of attached plugin is called every frame by
sact_Update(). This corresponds to the DrawPlugin mechanism of
System4/SACT2.

This is currently used only from DrawDungeon. The 3D engine for Toushin
Toshi 3 etc. will also use this.
2022-05-30 11:41:20 +09:00
kichikuou 2f64ee4d21 Do not use GLEW if USE_GLES is defined
GLEW does not support OpenGL ES so it shouldn't be used when targetting
OpenGL ES.
2021-12-21 13:11:34 +09:00
kichikuou b4bc150e16 DrawDungeon: Implement IsFloorFillTexture 2021-06-27 12:41:58 +09:00
kichikuou 7e5187e35c DrawDungeon: 2D map improvements
* Cells loaded from walk-data are half-transparent.
* The player symbol is half-transparent when showing different floors.
* Clear the texture before drawing a small map so that no garbage is
  left when the drawing is clipped.
2021-06-27 12:41:58 +09:00
kichikuou 057862b533 DrawDungeon14: Draw 3D objects in PolyObj.lin 2021-06-19 22:56:06 +09:00
kichikuou 946e3bdab6 DrawDungeon14: Implement {Get,Set}DrawMapObjectFlag 2021-06-13 21:41:04 +09:00
kichikuou 1d8615d14f Initial implementation of DrawDungeon14.hll (GALZOO Island)
Major differences from DrawDungeon.hll are:

- DGN, DTX, TES are loaded from individual files, not from a DLF archive
- 2D map functions are not used
- (unimplemented) Spinning motion of event markers
- (unimplemented) Additional 3D object types (polygon models and roofs)
2021-06-13 17:00:44 +09:00
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 b7a1127f19 DrawDungeon: Implement SetDrawMapRadar
Some map symbols are not visible unless the radar flag is set.
2021-06-06 14:22:33 +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 d92c5ab39d DrawDungeon: Use cglm's mat4 type in render function parameters
Pure refactoring, no behavior changes.
2021-05-23 14:52:42 +09:00
kichikuou 93f624aa43 Implement DrawDungeon.CalcConquer 2021-05-23 14:11:18 +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 e066c428cd DrawDungeon.hll: Implement 2D maps 2021-05-16 18:21:38 +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