xsystem4.scene: returns a list of scene entities
* all entities have an entityId that can be used in further requests
* SACT2 sprites have a 'sprite' member with a spriteId that can be
used in further requests
xsystem4.renderEntity: renders a scene entity and returns the texture
xsystem4.spriteTexture: returns the stored SACT2 sprite texture
xsystem4.renderParts: renders a parts object and returns the texture
xsystem4.partsTexture: returns the stored parts object texture
Image data in texture objects is RGB8888 encoded in base 64.
Don't allocate massive textures for each text object. Instead, allocate
a texture for each character and then compose them onto an appropriately
sized texture.
Fixes a performance issue in Rance 01.
This allows playback of videos in encodings other than MPEG-1, e.g. VC-1
used in the English version of Rance VI.
The FFmpeg dependency is optional. If it's not available, the PL_MPEG
backend will be used.
Most of the functionality of gfx_render_texture (draw method, blend
rate) is moved into sprite_render, since this was the only place using
it.
The draw method and blend rate are now stored in sact_sprite objects
instead of textures.
sact_sprite now has two renderers: the old SACT2 renderer (with blend
rate as the only shader parameter) and the new ChipmunkSpriteEngine
renderer, which supports multiply/add colors and the "surface area"
feature from PartsEngine.
Rance Quest now runs up to the first Flash-related function call
(Flash?!?!).
- Enable both alpha map and alpha mod, using the new drawing function
gfx_copy_stretch_blend_amap_alpha().
- Do not draw if `bcg->show` flag is false.
- Do not WARNING() for SetBackCGNum(0) as it's used to unload the CG.
Add a scene_print function which prints a textual representation of the
current scene. This works by attaching a `debug_print` function to each
entity in the scene. This function is implemented for SACT2 and
GUIEngine entities. A default implementation will be used of none is
provided.
This can be accessed from the debugger via the `scene` command (although
the output is typically too much to view in a terminal; it's better to
run `scene_print` somewhere and redirect stdout to a file).
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.
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.
Only unscaled glyph bitmaps are now cached in regular memory. Scaled
glyphs are stored as textures on the GPU. Only the alpha channel on
glyph textures is used, with the color being provided as an input to the
shader.
Outline and bold rendering is improved by using a simple dilate shader.
This looks okay but could be improved (the result is a bit blurry
still).
This improves the look and (especially) the performance of text
rendering in the MangaGamer version of Sengoku Rance.
There are still some bugs/unimplemented features, but the game should be
more or less bearable to play in this state.
The game now basically runs, but with very bad performance and lots of
aliasing on text.
Need to implement anti-aliasing and caching of rendered glyphs next.
System 4 has 4 font weights: light, medium, bold and heavy bold.
SDL_ttf has 2 (normal and bold). For now, xsystem4 treats light/medium
as normal and bold/heavy-bold as bold.
The method parameter of this function has a different meaning from that
of SACT2.SP_SetDrawMethod.
I've only checked it in Widenyo, but it seems 0 and 1 are valid values
and 1 is additive blending.
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.
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.