Commit Graph
833 Commits
Author SHA1 Message Date
kichikuou c04aa8a844 TapirEngine: Outline rendering
This implements outline (called "edge" in the game config) rendering of
3D objects, using the "inverted hull" method.
2024-10-13 07:18:49 +09:00
kichikuou 87b1e2abe2 Make variable names consistent between reign.v.glsl and reign_shadow.v.glsl
Pure refactoring, no behavior changes.
2024-10-13 07:18:49 +09:00
kichikuou a0a68a022c TapirEngine: Load .opr file
A .pol file may have a corresponding .opr file, which is a text file
containing parameters for the meshes.
2024-10-13 07:18:49 +09:00
kichikuou c1ce2c88c6 3d: Increase MAX_BONES to 308
This is the maximum number of bones in a model for Rance Quest
(pasuteru_full.POL).

Now bone transform matrices are stored in a uniform buffer object,
because its size exceeds GL_MAX_VERTEX_UNIFORM_COMPONENTS in iOS Safari.
2024-10-12 07:35:51 +09:00
kichikuou dd18d68be5 CGManager.LoadArchive() should open archive in the game directory
This fixes a boot problem in Rance Quest Magnum.
2024-10-09 12:51:08 +09:00
kichikuou 899c6c02a1 3d: Fix shadow rendering in Rance Quest
- Use glm_look_anyup() to avoid singularities when the shadow light
  direction is parallel to the up vector
- Fix bounding sphere calculation when there are multiple shadow casters
2024-10-07 10:53:41 +09:00
Nunuhara Cabbage 8ff5ffe30b Merge pull request #197 from kichikuou/alphamap
3d: Ignore alpha map if same as color map
2024-10-05 21:22:58 -07:00
kichikuou 74666c9b90 3d: Ignore alpha map if same as color map
In Rance Quest (e.g. mapF_ew01), some materials use the same image for
both color map and alpha map. In that case, the alpha channel of the
color map can be used, so ignore the alpha map.
2024-10-06 07:53:15 +09:00
kichikuou 68bd33e099 IbisInputEngine: Mouse wheel support
This enables wheel operations in Rance Quest.
2024-10-06 07:38:24 +09:00
kichikuou 22a06b1da9 3d: Implement vertex colors
3D objects can have a color per vertex, which is multiplied with the
texture color.
2024-10-05 07:41:17 +09:00
kichikuou 09dc9470ae TapirEngine: Proper collision detection
Collision detection is based on a mesh named "collision" in the map's 3D
model. The "collision" mesh specifies the area in which the character
can move in the xz plane, and the y coordinate represents the height of
the map at that point.

Now cglm 0.9.2 is required, for 2D AABB operations.
2024-09-30 09:11:54 +09:00
kichikuou 73f7acde40 Implement FileOperation HLL functions for Rance Quest 2024-09-28 11:07:43 +09:00
kichikuou 8f69f1911a Fix A_SORT
* Fix sorting of strings and floats
* Avoid overflow in integer comparison
2024-09-25 13:20:03 +09:00
kichikuou 9a76d472db Implement StoatSpriteEngine.SP_SetDashTextSprite
This implementation creates a temporary "glyph" texture and draws it to
the sprite using gfx_draw_glyph().
2024-09-21 10:35:42 +09:00
kichikuou 49b85f885d StoatSpriteEngine: Make SP_GetMaxZ consider multisprites
This fixes a problem in Vanish! where the opening movie was hidden
behind other sprites.
2024-09-20 20:39:20 +09:00
kichikuou 217c4d5d65 Add guard against division by zero in vmDrawGauge.Draw()
When `max` is 0, the gauge is drawn as empty.
2024-09-19 07:32:30 +09:00
Nunuhara Cabbage ea762de937 Merge pull request #186 from kichikuou/DrawDungeon
Implement DrawDungeon.SetWalkedAll
2024-09-17 20:05:31 -07:00
kichikuou 7a87ffc20a Implement DrawDungeon.SetWalkedAll
In GALZOO Island, there are non-debugging code paths that use this.
2024-09-17 15:43:07 +09:00
kichikuou f53ad7d557 Initial implementation of TapirEngine.CalcInstance2DDetection
This is used for collision detection between a map object and the player
character. The current implementation is very simple, only performing
AABB intersection tests, but it is enough to allow the player to walk
around the first dungeon in Rance Quest.
2024-09-16 15:27:11 +09:00
kichikuou 9e2f03d8be Add support for group save format v7
V5 is used until Daiteikoku, and v7 since Rance Quest. Since both are
Ain v6, the save version is determined by the presence of the "MainVM"
field in AliceStart.ini.
2024-09-16 09:01:49 +09:00
kichikuou 71debfbb65 Rance Quest: Do not render suspended TapirEngine sprites 2024-09-15 08:04:14 +09:00
kichikuou 34258511b9 Rance Quest: GetPartsCGName() returns the name specified by SetPartsCG()
This fixes a graphical bug mentioned in
https://github.com/nunuhara/xsystem4/issues/180#issuecomment-2351079908 .
2024-09-15 07:57:40 +09:00
Nunuhara Cabbage 0f121860fe Merge pull request #182 from kichikuou/msgskip
Android: Call msgskip_save() when app goes to the background
2024-09-14 10:39:50 -07:00
Nunuhara Cabbage 70a6f547cf parts: use separate sprite for each parts
Each parts object is now its own entity in the scene so that entities
are rendered in the correct order when mixing sprites and parts.

Fixes #180
2024-09-14 10:22:51 -07:00
kichikuou 886f15aa9f Android: Call msgskip_save() when app goes to the background
This ensures that msgskip file is saved even if the app is killed.
2024-09-13 14:43:46 +09:00
Nunuhara Cabbage da52b312ca Use git describe for version number
Use `git describe` instead of `git rev-parse` for the version number,
since this command will report the latest tagged version in addition to
the current commit.
2024-08-25 10:26:55 -07:00
Nunuhara Cabbage 8cc2334692 windows: use 'windows' subsystem for release build
Only show the console on debug builds.

Fixes item 2 in #177.
2024-08-25 10:10:46 -07:00
Nunuhara Cabbage 486d89669f Reduce window size on small displays
Reduce the window size if the display resolution is smaller than the
game resolution.

Fixes item 1 of #177.
2024-08-25 10:03:10 -07:00
kichikuou 240c2c9395 Update rsave_read() parameters to specify read mode 2024-08-25 08:00:16 +09:00
Nunuhara Cabbage 88236b5a0b Merge branch 'master' of github.com:nunuhara/xsystem4 2024-08-18 13:00:21 -07:00
kichikuou c5b0916279 Add guard against division by zero in sact_QuakeScreen()
GALZOO calls this with amp_x = 0, to shake the screen vertically.
2024-08-13 18:27:48 +09:00
Nunuhara Cabbage 3c61f7cebf dap: draw origin/bounds of parts 2024-08-10 18:54:13 -07:00
Nunuhara Cabbage a13bd155dc dap: send correct reason for stopped event 2024-08-10 18:52:08 -07:00
kichikuou 1f0fc09294 Implement SoundFilePlayer HLL
Using this, Widenyo plays user-provided BGM files in the
SaveData/MusicData directory.
2024-08-11 07:18:19 +09:00
kichikuou 0cdf793b42 Fix FileOperation.Get{File,Folder}List
They should return base names, not full paths.
2024-08-10 09:20:13 +09:00
kichikuou ade7ea9235 Fix signature mismatch in HLL_EXPORT functions
Notable changes:

* The numerator / denominator parameters of AddMotion[HV]GaugeRate are
  int in GoatGUIEngine but float in GUIEngine and PartsEngine.
* AnteaterADVEngine.ADVLogList_AddText has second parameter
  (int WindowNo) since Oyako Rankan.

This also avoids using non-void functions where a void function is
expected. It is fine in most ABIs, but raises a runtime error in wasm32.
2024-08-07 09:14:38 +09:00
Nunuhara Cabbage 7365e8a7ca Merge pull request #172 from kichikuou/RSMv9
resume: Support RSM v9 format
2024-08-05 21:33:52 -07:00
kichikuou c4207e4226 Store struct_ptr in local page
It is currently only used to populate a field in RSM v9 save file.

As far as I can tell from examining Rance 01's resume save, this
reference does not seem to increment the target's refcount.
2024-08-06 07:15:54 +09:00
kichikuou ddaef07fb5 resume: Support RSM v9 format
This enables using --save-format=rsm for games that use delegates.
2024-08-06 07:02:21 +09:00
Nunuhara Cabbage f8174231cb parts: implement flash blend modes
Implement the add, multiply and screen blend modes.
2024-08-05 14:52:13 -07:00
Nunuhara Cabbage 0c8e52f18c parts: ignore invalid state in PE_SetInputState
Fixes bug with disappearing frame on choices in Drapeko.
2024-08-05 13:56:11 -07:00
Nunuhara Cabbage 559ccae1ad Fix text issue in Daibanchou EN
Fix issue where black boxes would appear in the action list text.
Glyph textures are now *at least* as wide as the duospace block width
(e.g. 16/8 on a 16px font), but can be larger to accomodate proportional
fonts with larger glyphs.
2024-08-05 12:37:28 -07:00
Nunuhara Cabbage 3f36bf29b1 Gpx2Plus: use shaders for fullscreen effects
Use the normal effect system for fullscreen effects. This allows effects
that are implemented via shaders to be used, such as the blind effects
which are used frequently in Daibanchou.
2024-08-05 10:48:22 -07:00
Nunuhara Cabbage c6e1f8f155 Fix NewFont layout issues
Ensure that our FT_Face has the correct size before calling
FT_Get_Advance. This fixes the backscene issue mentioned in #154 as well
as some other spacing issues.
2024-08-05 09:12:21 -07:00
Nunuhara Cabbage 65c178c04c Sleep less in ChipmunkSpriteEngine.Sleep
Take delta from previous frame into account when deciding how long to
sleep. And leave a few ms headroom.

This is not how this function works in AliceSoft's implementation. On a
(nearly) empty scene, they start by sleeping 1ms and gradually ramp up.
The largest delay I observed was 11ms.
2024-08-05 08:44:12 -07:00
Nunuhara Cabbage 69ab413676 Remove random print at movie end
Oops.
2024-08-05 08:10:00 -07:00
kichikuou 2046ad4d06 Remove delegate field from struct function_call
Now dg_index in the stack is incremented by delegate_call().
2024-08-05 16:25:08 +09:00
kichikuou 12ddb585fb Rework delegate implementation
Delegates "weakly" reference objects, meaning that referenced objects
can be deleted. Delegate invocations must not invoke on deleted objects.
This is achieved as follows:

* Each heap object has a sequential number.
* Each delegate object is backed by a page storing (object, function,
  seq) triples.
* Deleted objects can be detected by comparing the sequential number
  stored in the delegate with the sequential number of the object
  currently on the heap.

This is consistent with the AliceSoft's implementation (presumed from
the contents of resume save).

This implementation removes dead objects from the delegate in DG_CALL
and DG_NUMOF instructions. (We could do that more often, e.g. when an
object is added to a delegate.)

This breaks existing resume saves that contain delegates. For games that
predate delegate support, this does not affect the save format.
2024-08-05 16:25:08 +09:00
kichikuou 0a78489993 Revert delegate memory management changes
This reverts the following commits:

* 4b1257f "Fix delegate memory management"
* 9bb4665 "Add changes to vm.h" (partial revert)
* 75d6386 "Fix ResumeSave/ResumeLoad bugs with delegates" (partial
  revert)

We are going to take a different approach to implementing weak
references in delegates.
2024-08-05 16:25:08 +09:00
Nunuhara Cabbage 21abe6ff9a movie: load case-insensitive filename 2024-08-04 22:25:17 -07:00