Commit Graph
485 Commits
Author SHA1 Message Date
kichikuou 66d6fc38da Implement DrawSimpleText HLL
Used in GALZOO Island.
2021-06-13 13:14:57 +09:00
Nunuhara Cabbage c1667c5e9f Merge pull request #31 from kichikuou/SpriteCopyAMap
Implement DrawGraph.SpriteCopyAMap
2021-06-12 21:10:02 -07:00
kichikuou 4d139a0ddd Implement DrawGraph.SpriteCopyAMap
Used in GALZOO Island.
2021-06-13 11:43:27 +09:00
Nunuhara Cabbage 741717a325 Merge pull request #30 from kichikuou/SP_GetMaxZ
Fix SACT2.SP_GetMaxZ
2021-06-11 19:40:28 -07:00
kichikuou b5f226ff79 Fix SACT2.SP_GetMaxZ
It should return the maximum Z value among all sprites, not among
visible sprites.

This fixes a bug in Rance VI where some UI elements are incorrectly
Z-ordered.
2021-06-12 10:38:16 +09:00
Nunuhara Cabbage d99437e414 Merge pull request #29 from kichikuou/dungeon
More DrawDungeon improvements
2021-06-06 16:16:56 -07:00
kichikuou 1522c85e46 DrawDungeon: Tweak fog parameters 2021-06-06 14:22:33 +09:00
kichikuou 7a9cc95eef DrawDungeon: Don't warn for functions that can be safely ignored 2021-06-06 14:22:33 +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 d41d28b35d DrawDungeon: Fix minor issues
- Fix crash when dungeon_map_set_walked is called with x=0 or z=0
- Stairs' existence should be checked using stairs_texture, not
  stairs_orientation
2021-06-06 14:22:33 +09:00
kichikuou 7f326527a0 DrawDungeon: Draw map in the center of target texture
This fixes an issue where the map is drawn outside of the target
texture's boundaries.
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
Nunuhara Cabbage 74c1b38fa4 Merge branch 'master' of https://github.com/nunuhara/xsystem4 2021-05-30 18:49:49 -07:00
Nunuhara Cabbage 3b72131767 Merge pull request #28 from kichikuou/dungeon
DrawDungeon improvements
2021-05-30 18:49:03 -07:00
kichikuou c54f2493d1 DrawDungeon: Use billboarding for floating event markers
Before this, floating markers were rendered as OpenGL's point sprites.
But point sprites has an implementation-dependent maximum size, and
Intel driver's maximum (256 pixels) is too small for us.

After this, markers are drawn with the same shaders as normal objects,
using the billboarding technique.
2021-05-30 21:31:08 +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
Nunuhara Cabbage 9983ff2bc9 Implement GoatGUIEngine text rendering 2021-05-24 12:36:55 -07:00
Nunuhara Cabbage 815c1f20f0 Default font types > 1 to 0 2021-05-24 11:15:50 -07:00
Nunuhara Cabbage a4e642783b Implement ChipmunkSpriteEngine.SP_GetFontWidth
Used in Shaman's Sanctuary.
2021-05-24 11:09:49 -07:00
Nunuhara Cabbage e78a208bbd Add asset_cg_exists function 2021-05-24 11:00:56 -07:00
Nunuhara Cabbage 8eb91a235c Merge pull request #27 from kichikuou/DrawDungeon
DrawDungeon improvements
2021-05-23 10:45:21 -07: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 ca116fc3bc DrawDungeon: Add marker for event type 140 (red star) 2021-05-23 14:11:18 +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 d48c9fb5af Fix crash in dungeon_set_* when removing objects 2021-05-23 14:10:58 +09:00
Nunuhara Cabbage 29b6193542 Merge pull request #26 from kichikuou/rance6-save
Implement / fix things enough to perform save in Rance VI
2021-05-22 08:47:20 -07:00
kichikuou 021f74285c Implement SR_REF2 instruction
Used in CConfig@Save of Rance VI.
2021-05-22 17:07:14 +09:00
kichikuou ce004ee3cc Make {gamedir,savedir}_path accept absolute paths
This fixes Rance VI which passes SACT2.SP_SaveCG and
SACT2.SP_SetCGFromFile absolute paths like
`system.GetSaveFolderName() + "\\" + "ScreenA.qnt"`.

Also, now savedir_path() uses unix_path() rather than sjis2utf().
2021-05-22 17:07:14 +09:00
kichikuou ea513ca727 Implement SACT2.SaveCG
Used in Rance VI.
2021-05-22 17:07:14 +09:00
Nunuhara Cabbage 9c26a80acf Various GoatGUIEngine improvements
* button states (default, hovered, clicked)
* on-cursor and on-click sound playback
* "LoopCG" animations
2021-05-21 23:56:26 -07:00
Nunuhara Cabbage 7eb6216b80 Add audio_play_sound function
Implement a system for allocating anonymous channels so that libraries
can play sounds without having to manage channels.

A library that uses audio_play_sound must ensure that audio_update is
called periodically to garbage collect finished channels.
2021-05-21 23:30:16 -07:00
Nunuhara Cabbage dd985a3769 Refactor sprite/scene management code
Create a separate interface for managing the scene. The sact_sprite
interface is implemented on top of this, as is GoatGUIEngine (which is
now independent of sact_sprite).

This will allow more specialized graphics interfaces to be implemented
without adding to the complexity of the sact_sprite interace. (For
example, GoatGUIEngine needs to store multiple textures per sprite for
button states; this is not supported by sact_sprite.)
2021-05-21 18:56:33 -07:00
Nunuhara Cabbage b1c55d6f03 Implement basic GoatGUIEngine input handling 2021-05-21 15:22:16 -07:00
Nunuhara Cabbage 439a393836 Merge pull request #25 from kichikuou/leak
Fix texture leak in sprite_set_cg(_from_file)
2021-05-21 12:46:28 -07:00
kichikuou 2c262f7060 Fix texture leak in sprite_set_cg(_from_file) 2021-05-21 22:34:03 +09:00
Nunuhara Cabbage eba29786bc Partial implementation of GoatGUIEngine
Enough to get to the main menu in Shaman's Sanctuary.
2021-05-20 18:19:52 -07:00
Nunuhara Cabbage 512c1dee2a Implement DrawGraph.CopyStretchBlend{AMap}
Used in Haru Urare.

Also, redirect DrawGraph.CopyStretch{AMap}Interp to the regular
implementations (bilinar interpolation is default).
2021-05-17 09:01:11 -07:00
Nunuhara Cabbage d7286a2f30 Implement DrawGraph.CopyRotateY{UseAMap}
Used in Haru Urare.
2021-05-17 08:01:35 -07:00
Nunuhara Cabbage 3b7fb2c60c Use mat4 type from cglm instead of GLfloat[16]
Also reimplement DrawGraph.CopyRotZoom using cglm functions.
2021-05-16 17:34:42 -07:00
Nunuhara Cabbage f768fed99c Merge branch 'master' of https://github.com/nunuhara/xsystem4 2021-05-16 12:18:39 -07:00
Nunuhara Cabbage f25e26ecf4 Refactor archive management code
Implement a new interface for managing archives. This is mainly to
support loading afa archives alongside ald archives.

Also included here is some code for creating an index for afa CG
archives (the numbers used to reference CGs in afa archives correspond
to the file name, not the position in the archive).
2021-05-16 08:06:40 -07:00
Nunuhara Cabbage 770b517f07 Merge pull request #24 from kichikuou/blur
Implement DrawGraph.Copy{,AMap}{Width,Height}Blur
2021-05-16 07:26:51 -07:00
Nunuhara Cabbage 6f4cc339a3 Merge pull request #23 from kichikuou/DrawDungeon
DrawDungeon.hll: Implement 2D maps
2021-05-16 07:25:32 -07:00
kichikuou 91213785a7 Implement DrawGraph.Copy{,AMap}{Width,Height}Blur 2021-05-16 22:04:40 +09:00
kichikuou e066c428cd DrawDungeon.hll: Implement 2D maps 2021-05-16 18:21:38 +09:00
Nunuhara Cabbage 92b81f21ee Add stubs for ChipmunkSpriteEngine
Used in Shaman's Sanctuary. Mostly identical to StoatSpriteEngine, but
with a few additions and some removed functions (notably, the
MultiSprite functions were removed).
2021-05-15 18:55:24 -07:00
Nunuhara Cabbage 654e0b4737 Implement various instructions
Implement:
    SH_SASSIGN_STRUCTSREF
    SH_SASSIGN_GLOBALSREF
    SH_STRUCTSREF_NE_STR0
    SH_GLOBALSREF_NE_STR0
    SH_LOC_LT_IMM_OR_LOC_GE_IMM

Also, fix an bug in A_EMPTY and SH_IF_STRUCT_A_NOT_EMPTY.
2021-05-14 22:38:32 -07:00
Nunuhara Cabbage 9582ad6129 Fix memory leak in VSFile 2021-05-14 21:05:07 -07:00
Nunuhara Cabbage e208f146b9 Fix VSFile
This is actually used for static data shipped with some games, so the
binary format needs to match the original implementation.
2021-05-14 20:30:40 -07:00