Commit Graph
998 Commits
Author SHA1 Message Date
Nunuhara Cabbage 7eb620aca7 Refactor asset_manager
asset_exists and asset_get now take 1-indexed IDs.

Custom CG indexing code for Shaman's Sanctuary is now removed and
replaced with a proper implementation of afa v1 archives in libsys4.
2022-06-05 12:26:18 -07:00
Nunuhara Cabbage e21111bc5f Merge pull request #53 from kichikuou/fillangle
Implement FillAngle HLL
2022-06-04 21:11:04 -07:00
kichikuou 9da9f53671 Implement FillAngle HLL
This is used in Toushin Toshi III for the "clock" effect of battle
command icons.
2022-06-05 10:06:42 +09:00
Nunuhara Cabbage 53b61fa69b Merge pull request #52 from kichikuou/3d
Initial implementation of ReignEngine HLL
2022-06-03 21:51:42 -07:00
kichikuou dca30c3aab Initial implementation of ReignEngine HLL
ReignEngine is the 3D rendering engine used in Toushin Toshi III, and is
the predecessor of the 3D engines for Rance Quest, Rance 9, Evenicle,
etc.

This implements minimal functionality to be able to draw the first 3D
dungeon scene. Many important parts such as motion and lighting are not
implemented yet.
2022-06-04 11:29:07 +09:00
Nunuhara Cabbage afc7665dc8 Merge pull request #51 from kichikuou/cglm
Update cglm to v0.8.5
2022-06-03 16:47:15 -07:00
kichikuou 7d7bc00765 Update cglm to v0.8.5 2022-06-04 08:26:45 +09:00
Nunuhara Cabbage 9f7cc44949 Merge pull request #49 from kichikuou/plugin
Introduce draw_plugin
2022-05-31 16:31:13 -07:00
kichikuou 81ff379eb8 Avoid iterating over the scene for plugins update
Now plugin is a member of sact_sprite, and sprite.c manages a list of
sprites with plugins.
2022-05-31 18:13:08 +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
Nunuhara Cabbage 7be684e9bf Merge pull request #48 from kichikuou/tt3
Add HLL implementations for Toushin Toshi III
2022-05-28 09:23:33 -07:00
kichikuou e1268262fc Add stubs for SACTDX and SystemService functions
For Toushin Toshi III.
2022-05-28 13:09:38 +09:00
kichikuou ce8d9aaf65 Implement File2 HLL library
For Toushin Toshi III.
2022-05-28 13:09:38 +09:00
kichikuou 696601abcf Implement Toushin3Loader HLL library 2022-05-28 13:09:38 +09:00
kichikuou 941cb71a49 Implement MonsterInfo HLL
For Toushin Toshi III.
2022-05-28 13:09:35 +09:00
kichikuou 9c76a24d01 Add stubs for Confirm3 and Cursor HLLs 2022-05-22 21:02:34 +09:00
Nunuhara Cabbage 7dc4898a21 Fix outline cutoff issue with .fnl fonts 2022-05-15 09:54:10 -07:00
Nunuhara Cabbage 1fd475813d Remove unused headers 2022-05-15 09:23:11 -07:00
Nunuhara Cabbage 9b83a6d09d Refactor text rendering code
.fnl fonts can now be used outside of SengokuRanceFont, and
SengokuRanceFont now uses the same text layout and caching code as
SACT2, etc.
2022-05-14 23:12:36 -07:00
Nunuhara Cabbage 128edda6c0 text: fix outline cropping issue
Fix issue where outlines would get cropped when crossing the glyph
texture boundary.

This is accomplished by adding 4 border pixels to each glyph texture.
2022-05-10 19:53:31 -07:00
Nunuhara Cabbage 6070f702fa Add option to override save folder location
The `--save-folder` command line option, or `save-folder` option in
.xsys4rc, can be used to override the default save folder location.

This is useful in cases where English and Japanese versions of the same
game share a save location, or to isolate saves from a mod, etc.
2022-05-08 17:28:01 -07:00
Nunuhara Cabbage 8068992244 Document FreeType dependency in README 2022-05-08 17:27:45 -07:00
Nunuhara Cabbage 191bde690d Merge branch 'master' of github.com:nunuhara/xsystem4 2022-05-08 16:28:26 -07:00
Nunuhara Cabbage 2262f7067c Use FreeType2 instead of SDL_ttf
SDL_ttf isn't really designed to be used with OpenGL. It caches glyph
bitmaps in memory, whereas we want to cache glyph textures on the GPU.
By using FreeType directly we avoid creating and destroying a new
texture every time a glyph is rendered.

Additionally, all glyph textures (including fnl-derived glyphs) now use
the GL_RED internal format instead of GL_RGBA.
2022-05-08 16:11:25 -07:00
Nunuhara Cabbage c09836e551 Use sprite draw method/blend rate for text also 2022-05-08 13:52:16 -07:00
Nunuhara Cabbage a7ca9430e8 Merge pull request #47 from kichikuou/datetime
Fix date/time getter functions
2022-05-07 22:59:18 -07:00
kichikuou 03f23c4339 Fix date/time getter functions
Values returned by SACT2.System_GetDate etc. should correspond to the
Windows SYSTEMTIME structure, not struct tm.

This also fixes a bug where get_time() returns a value greater than 60
for `sec`.
2022-05-08 14:20:45 +09:00
Nunuhara Cabbage 39ce914bf9 Optimize error checks in hot functions
Use `unlikely` (__builtin_expect) to help the compiler optimize error
checks in some hot functions (in my testing, stack_pop_var was one of
the hottest functions, right behind execute_instruction).
2022-05-06 20:43:30 -07:00
Nunuhara Cabbage 0b98e57938 Don't decode little endian on x86/x86_64 2022-05-06 19:27:30 -07:00
Nunuhara Cabbage b499c432fd Update game compatibility table
MangaGamer version of Sengoku Rance is now supported.
2022-05-05 21:11:25 -07:00
Nunuhara Cabbage fa4cdc81d0 Use gfx_draw_glyph for SACT2 (etc.) text rendering
This greatly improves the look of outlines, especially at larger font
sizes (such as in Haruurare).
2022-05-05 18:12:18 -07:00
Nunuhara Cabbage 0b52a4baa0 Fix issue with text blend mode
The source alpha was being multiplied by itself, making text look
thinner than it should. Now we just take the max alpha.
2022-05-05 18:09:51 -07:00
Nunuhara Cabbage 6080af3621 Implement Sound_GetGroupNumFromDataNum
Part of StoatSpriteEngine and KiwiSoundEngine.

This fixes an issue with per-channel volume settings not working
correctly in Haruurare (and presumably other games).
2022-05-04 20:30:03 -07:00
Nunuhara Cabbage 5924225bc2 Implement DrawGraph.BrightDestOnly 2022-05-03 21:08:01 -07:00
Nunuhara Cabbage 7fc60f6607 Implement DrawGraph.ScreenDA_DAxSA 2022-05-03 20:48:21 -07:00
Nunuhara Cabbage 44891458f1 Implement DrawGraph.SaturDP_DPxSA 2022-05-03 20:01:48 -07:00
Nunuhara Cabbage 703a66106f Implement DrawGraph.FillMultiply 2022-05-03 18:57:06 -07:00
Nunuhara Cabbage af33413826 Implement DrawGraph.FillScreen 2022-05-03 18:53:55 -07:00
Nunuhara Cabbage 54f6ece82d Implement DrawGraph.FillAMapGradationUD 2022-05-03 18:49:40 -07:00
Nunuhara Cabbage 3b75b6b545 Implement DrawGraph.BlendScreenAlpha
This completes the full suite of DrawGraph blending functions.
2022-05-02 21:18:49 -07:00
Nunuhara Cabbage e65560b67a Implement DrawGraph.BlendMultiply 2022-05-02 20:48:42 -07:00
Nunuhara Cabbage 2fd081234b Implement DrawGraph.BlendScreen 2022-05-02 20:43:16 -07:00
Nunuhara Cabbage 65be47e05b Implement DrawGraph.BlendUseAMapColor 2022-05-02 20:35:02 -07:00
Nunuhara Cabbage 9108ce19ea Implement DrawGraph.BlendAMapAlphaSrcBright 2022-05-02 18:19:09 -07:00
Nunuhara Cabbage 2f573803c4 Implement DrawGraph.BlendAMapBright 2022-05-02 17:01:23 -07:00
Nunuhara Cabbage 6d745054a4 Implement DrawGraph.BlendAMapSrcOnly 2022-05-02 16:20:40 -07:00
Nunuhara Cabbage 0fc5442e42 Implement DrawGraph.BlendAddSatur 2022-05-02 15:38:53 -07:00
Nunuhara Cabbage d482e165d6 Implement DrawGraph.BlendSrcBright 2022-05-02 15:12:40 -07:00
Nunuhara Cabbage d085951f68 Implement EFFECT_BLUR_FADEOUT
Used in Sengoku Rance (when Ran summons Suzaku).
2022-05-02 11:25:42 -07:00
Nunuhara Cabbage f3969e7d7e Implement EFFECT_ZOOM_IN_CROSSFADE
Used in Sengoku Rance (when Ran summons Suzaku).

The scale curve in this implementation is a bit off compared to
AliceSoft's implementation (theirs looks a bit sharper at the end), but
it's only really noticable with a very long effect time.

AliceSoft's implementation also has a lot more jitter, but I don't think
this is intentional.
2022-05-02 09:41:05 -07:00