mirror of
https://github.com/zetaPRIME/libstarlight.git
synced 2025-06-25 21:22:46 +00:00
implement mask blendmode
This commit is contained in:
parent
2d93b903e4
commit
c3207cc2f9
@ -152,8 +152,9 @@ void RenderCore::EndFrame() {
|
||||
namespace {
|
||||
void ApplyBlendMode(C3D_TexEnv* env, BlendMode mode) {
|
||||
switch(mode) {
|
||||
case BlendMode::Mask: // TODO: actually implement masking! this is just a copy of Blend right now
|
||||
C3D_TexEnvOp(env, C3D_RGB, 0, 0, 0);
|
||||
case BlendMode::Mask: // multiplies the buffer contents by the mask texture
|
||||
C3D_AlphaBlend(GPU_BLEND_ADD, GPU_BLEND_ADD, GPU_ZERO, GPU_SRC_COLOR, GPU_ZERO, GPU_SRC_ALPHA); // zero + (buffer * texel)
|
||||
C3D_TexEnvOp(env, C3D_RGB, 0, 0, 0); // and the rest is the same as blend
|
||||
C3D_TexEnvOp(env, C3D_Alpha, GPU_TEVOP_A_SRC_ALPHA, GPU_TEVOP_A_SRC_ALPHA, 0);
|
||||
C3D_TexEnvFunc(env, C3D_RGB, GPU_MODULATE);
|
||||
C3D_TexEnvFunc(env, C3D_Alpha, GPU_MODULATE);
|
||||
|
@ -54,6 +54,10 @@ void Label::PreDraw() {
|
||||
buffer->Clear();
|
||||
GFXManager::PushContext(buffer.get());
|
||||
textConfig.ROGet().Print(buffer->rect, text);
|
||||
static auto testmask =
|
||||
//ThemeManager::GetAsset("controls/button.idle");
|
||||
ThemeManager::GetAsset("decorations/testmask");
|
||||
testmask->Draw(buffer->rect, nullptr, nullptr, gfx::BlendMode::Mask);
|
||||
GFXManager::PopContext();
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ roadmap to v0.5.1 {
|
||||
https://github.com/citra-emu/citra/issues/2684
|
||||
implement more blend modes {
|
||||
- flat replace
|
||||
masking
|
||||
- masking
|
||||
}
|
||||
|
||||
- fix the hang on osk when pressing (L|R)+up+left
|
||||
@ -28,6 +28,7 @@ roadmap to v0.5.1 {
|
||||
Trackable sideclass for threads; float progress 0..1, etc.
|
||||
- MAKE THREADS END CLEANLY
|
||||
^ observed a single instance of being stalled on redscreen, not really sure what that was about
|
||||
lambda task thread
|
||||
}
|
||||
} then by v0.5.5 {
|
||||
event propagation system of some sort; threadsafe to whatever extent is needed on 3DS
|
||||
|
BIN
themes/default/decorations/testmask.png
Normal file
BIN
themes/default/decorations/testmask.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 540 KiB |
Loading…
x
Reference in New Issue
Block a user