Repository navigation
Conversation
The PS1 blends a textured texel only when its STP bit (15) is set, and the export left it clear on every colour but pure black. A sheet's new semiTransparent option (written only when on) sets STP on every drawn CLUT colour (4/8 bpp) or texel (16 bpp), leaving the transparent 0x0000 alone, so a blended Lua UI.DrawTexturedTriangle blends it; opaque drawing is unchanged (psxsplash never sets the mask bit). The VRAM packer keys on the option, so two sheets on one image, one semi-transparent, stay two textures. Inspector: a Semi-transparent toggle with a tooltip. Tests: editor_tests checks the exported CLUT/texel words at 4, 8 and 16 bpp and the dedup key; spritesheetcheck drives the toggle and its undo.
…arning lua_api.inc and psxsplash.d.lua get UI.DrawTexturedTriangle next to UI.DrawTriangle (the row gen_lua_api.py writes from psxsplash's luaapi.hh, with prose in the style of its neighbours). The export warns when a script calls UI.DrawTexturedTriangle, Sprite.Create or Sprite.SheetIndex with a string-literal sheet name the scene has no sprite sheet for (luascan: spriteSheetRefs and spriteSheetRefWarnings, one warning per call and name, with its line).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Editor side of psxsplash/psxsplash#127 (UI.DrawTexturedTriangle). A sprite sheet gets a Semi-transparent option. It sets STP on every non-transparent texel or CLUT entry of its texture, since the GPU only blends textured pixels with that bit set. Opaque drawing does not change. The option is part of the VRAM packer's dedup key, so two sheets on one image with different settings stay two textures.
The Lua tables and psxsplash.d.lua list the new call. A script that names a sprite sheet the scene does not have, as a string literal in UI.DrawTexturedTriangle, Sprite.Create or Sprite.SheetIndex, gets a build warning (core/luascan.cpp). Do not merge before psxsplash/psxsplash#127.