Commit Graph
998 Commits
Author SHA1 Message Date
kichikuou 5a5916fbd5 Make the window resizable
We don't use SDL's rendering functions, so we have to scale the screen
and translate the mouse positions ourselves.
2022-01-08 11:31:37 +09:00
Nunuhara Cabbage 0aaef31666 Merge pull request #39 from kichikuou/openweb
Use SDL_OpenURL for system.OpenWeb
2021-12-26 09:25:05 -08:00
Nunuhara Cabbage 3c8a09f3b2 Merge pull request #38 from kichikuou/use_gles
Use OpenGL ES directly if `USE_GLES` is defined
2021-12-26 09:23:56 -08:00
kichikuou 08c7b3edd1 Use SDL_OpenURL for system.OpenWeb
It opens a URL in an appropriate way for the platform.
2021-12-25 21:44:59 +09:00
kichikuou 7caf009209 Add use_gles meson build option 2021-12-21 13:37:53 +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
Nunuhara Cabbage cd34311c62 Call scene_flip() on SDL_WINDOWEVENT_EXPOSED
Fixes issue where the screen is not redrawn when the game is in an input
wait loop.
2021-12-14 19:57:38 -08:00
Nunuhara Cabbage ecb0c1607d Implement EFFECT_BLIND_DOWN
Used in GALZOO Island.
2021-12-13 18:10:54 -08:00
Nunuhara Cabbage 2046fded88 Use scene_dirty() on SDL_WINDEVENT_EXPOSED 2021-12-11 12:45:58 -08:00
Nunuhara Cabbage 8042e1af6c Set game name as window title 2021-12-11 12:20:53 -08:00
Nunuhara Cabbage 5f221d939f Add -e,--echo-message option
Add option to echo messages to standard output. Messages are prefixed
with "MSG %d:" so that they can be filtered by a script.
2021-12-11 09:57:46 -08:00
Nunuhara Cabbage 39c69423e3 Fix audio bug causing infinite loops in SR
Fix bug where SACT2.Music_IsPlay would return true after a stream
stopped playing. This was causing infinite loops in Sengoku Rance when
waiting for a fade-out to complete.
2021-12-09 20:33:19 -08:00
Nunuhara Cabbage 51d21612d2 Implement some SystemService.dll functions
For Rance 01.
2021-10-26 11:45:50 -07:00
Nunuhara Cabbage 488ccc0c74 Implmement MainEXFile HLL (Rance 01 version)
Implement the Rance 01 version of MainEXFile (later versions have a
different interface).
2021-10-22 18:34:39 -07:00
Nunuhara Cabbage 5ff042738e Initial delegates implementation
This isn't very well tested yet, but it runs Rance 01 up to the first
HLL error.
2021-10-18 10:45:10 -07:00
Nunuhara Cabbage f53184d8f7 Implement System40.ini/AliceStart.ini mixers
Implement "VolumeValancer" mixer channels from the .ini file. Mixers are
now recursive, with the master and voice channels being parent nodes
(this seems to be hardcoded in system 4, or at least I haven't found
where the hierarchy is specified).

Also implement .wai file support (needed for mixer channel info on sound
files).
2021-10-03 09:26:48 -07:00
Nunuhara Cabbage 96356094d9 Get loop info and volume from .bgi file
Music should now correctly loop in games that use .ogg audio.
2021-10-01 21:14:25 -07:00
Nunuhara Cabbage 16291d7412 Update dependencies in README 2021-10-01 16:44:26 -07:00
Nunuhara Cabbage fc8e7eee22 Replace SDL_mixer with libsndfile + sts_mixer
Replace SDL_mixer with an audio implementation using libsndfile,
sts_mixer (a single-file header library) and SDL's basic audio
interface.

This allows for much more flexibility in controlling audio playback.
Fading is now properly implemented, as well as various other functions
from the SACT2/KiwiSoundEngine interface.

sts_mixer can support recursive mixing, so it will be possible to
implement the "VolumeValancer" mixer channels specified in
System40.ini in the future (once I figure out how the mapping of audio
files to mixer channels is supposed to work).
2021-09-30 22:07:04 -07:00
Nunuhara Cabbage f145502f20 SACT2.SP_SetBrightness: don't warn default value
MangaGamer's version of Sengoku Rance calls SP_GetBrightness and then
SP_SetBrightness with the returned value, generating a lot of spurious
warnings. This just silences these warnings when setting to the default
value (255).
2021-09-20 19:34:45 -07:00
Nunuhara Cabbage ab5c86b1fa Implement joypad support 2021-09-19 20:28:51 -07:00
Nunuhara Cabbage 5ea1b871eb CrayfishLogViewer.AddText: convert to UTF-8 2021-09-19 19:16:20 -07:00
Nunuhara Cabbage bb8497e343 GoatGUIEngine: fix motion on child parts
Properly handle motions on non-root parts.
2021-07-15 20:25:12 -07:00
Nunuhara Cabbage db0922606a GoatGUIEngine: don't render hidden parts 2021-07-12 10:23:01 -07:00
Nunuhara Cabbage 8ce4ed64cf GoatGUIEngine.SetOnCursorShowLinkPartsNumber 2021-07-12 10:20:27 -07:00
Nunuhara Cabbage 6155855154 Fix bug in array.Find
Compare string values when given an array of strings.

Fixes a bug in Shaman's Sanctuary that caused the prologue to loop
infinitely.
2021-07-11 15:17:45 -07:00
Nunuhara Cabbage af71a6b6ea Fix memory leak in AnteaterADVEngine 2021-07-11 15:16:52 -07:00
Nunuhara Cabbage 382b339941 Implement ZIGZAG_CROSSFADE effect
Used in Shaman's Sanctuary.

This implementation doesn't give the same result as SACT2.dll. SACT2.dll
zigzag's the image along both axes, whereas this implementation only
does the zigzag along one axis.
2021-07-11 11:58:56 -07:00
Nunuhara Cabbage 35a84ba708 Implement BLUR_CROSSFADE effect
Used in Shaman's Sanctuary.

This implementation gives a bit of a different result compared to
SACT2.dll, but it's reasonably close.
2021-07-08 20:07:43 -07:00
Nunuhara Cabbage 75539d4cdc Implement BLIND_LR effect
Very frequently used across many games.
2021-07-07 20:14:25 -07:00
Nunuhara Cabbage 5fa2c1ec63 Merge pull request #37 from kichikuou/dungeon
DrawDungeon improvements
2021-06-27 09:18:03 -07:00
kichikuou b4bc150e16 DrawDungeon: Implement IsFloorFillTexture 2021-06-27 12:41:58 +09:00
kichikuou 9bac420a82 DrawDungeon: Disable face culling for stairs
So that the back side of stairs are visible.
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
Nunuhara Cabbage 08edf8638b Merge branch 'master' of https://github.com/nunuhara/xsystem4 2021-06-20 11:00:41 -07:00
Nunuhara Cabbage b9f9995cba Merge pull request #36 from kichikuou/gles
Support OpenGL ES 3.0
2021-06-20 10:59:45 -07:00
Nunuhara Cabbage b4b85c1f75 Implement crossfade mosaic effect
This one is used quite frequently in Sengoku Rance.

The implementation here is slightly wrong, in that the anchor point for
the pixel zoom is at the lop left of the screen instead of the center.
2021-06-20 10:46:53 -07:00
kichikuou 86a5c62fc7 Fix text rendering in OpenGL ES 3
In OpenGL ES 3, glTexImage2D cannot handle GL_BGRA format. SDL_ttf
returns pixels in BGRA format (because it's the format used in
FreeType2), so it needs to be converted to RGBA before passing to
gfx_init_texture_with_pixels.
2021-06-20 17:14:40 +09:00
kichikuou da5ac4a26c Support OpenGL ES 3.0
This adds `USE_GLES` compile-time flag. If it's defined, gfx_init()
requests an OpenGL ES >=3.0 context.

This also makes the following changes to make it work with OpenGL ES:

- The USE_GLES flag also switches shader's #version directive, which is
  now provided separately from the .glsl file.
- Implicit conversion between int and float is not supported in GLSL ES.
- Use GL_RGB in gfx_copy_main_surface. Because main_surface is in GL_RGB
  format, using GL_RGBA generates GL_INVALID_OPERATION in OpenGL ES.
2021-06-20 17:12:35 +09:00
Nunuhara Cabbage 12b755ba87 Use shaders for effects
Shaders will be required to implement more complex effects (e.g. mosaic
crossfade).
2021-06-19 19:38:27 -07:00
Nunuhara Cabbage 77a13515eb Merge pull request #35 from kichikuou/dungeon
DrawDungeon14: Draw roofs and polygon objects
2021-06-19 15:50:22 -07:00
kichikuou 057862b533 DrawDungeon14: Draw 3D objects in PolyObj.lin 2021-06-19 22:56:06 +09:00
kichikuou 5adf8f090e DrawDungeon14: Draw roofs
This is used only in the first map of GALZOO.
2021-06-19 14:54:34 +09:00
Nunuhara Cabbage 6de5b52b17 Add stub for Sound_GetGroupNumFromDataNum
From KiwiSoundEngine, used in Shaman's Sanctuary.
2021-06-13 07:09:30 -07:00
Nunuhara Cabbage a48786b2e6 Merge pull request #34 from kichikuou/dungeon
Partial implementation of DrawDungeon14.hll (GALZOO Island)
2021-06-13 07:07:44 -07:00
kichikuou 946e3bdab6 DrawDungeon14: Implement {Get,Set}DrawMapObjectFlag 2021-06-13 21:41:04 +09:00
kichikuou 1fdd88ff4d DrawDungeon14: Implement spinning motion of event markers 2021-06-13 21:41:00 +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 fb94881f9f Remove flip_y field from texture
It was introduced to flip texture image rendered by DrawDungeon when
presenting on the screen. In GALZOO this approach does not work because
dungeon texture is also used as the source image of gfx functions.

After this, DrawDungeon directly generates vertically flipped image, by
tweaking the projection matrix.
2021-06-13 16:14:05 +09:00