diff --git a/Makefile b/Makefile index 889fbd3..727b9b8 100644 --- a/Makefile +++ b/Makefile @@ -122,7 +122,7 @@ $(OUTPUT) : $(OFILES) @echo $(notdir $<) $(eval CURBIN := $(patsubst %.vsh,%.shbin,$(notdir $<))) $(eval CURH := $(patsubst %.vsh,%.vsh.h,$(notdir $<))) - @picasso $(CURBIN) $< $(CURH) + @picasso -o $(CURBIN) $< -h $(CURH) @bin2s $(CURBIN) | $(AS) -o $@ @echo "extern const u8" `(echo $(CURBIN) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(CURBIN) | tr . _)`.h @echo "extern const u8" `(echo $(CURBIN) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(CURBIN) | tr . _)`.h diff --git a/examples/gputest/Makefile b/examples/gputest/Makefile index c38d65c..f5aeabf 100644 --- a/examples/gputest/Makefile +++ b/examples/gputest/Makefile @@ -162,7 +162,7 @@ $(OUTPUT).elf : $(OFILES) @echo $(notdir $<) $(eval CURBIN := $(patsubst %.shader,%.shbin,$(notdir $<))) $(eval CURH := $(patsubst %.shader,%.shader.h,$(notdir $<))) - @picasso $(CURBIN) $< $(CURH) + @picasso -o $(CURBIN) $< -h $(CURH) @bin2s $(CURBIN) | $(AS) -o $@ @echo "extern const u8" `(echo $(CURBIN) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(CURBIN) | tr . _)`.h @echo "extern const u8" `(echo $(CURBIN) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(CURBIN) | tr . _)`.h diff --git a/include/c3d/effect.h b/include/c3d/effect.h index d9ce9e9..5b2d818 100644 --- a/include/c3d/effect.h +++ b/include/c3d/effect.h @@ -3,7 +3,7 @@ void C3D_DepthMap(float zScale, float zOffset); void C3D_CullFace(GPU_CULLMODE mode); -void C3D_StencilTest(bool enable, GPU_TESTFUNC function, int ref, int mask, int replace); +void C3D_StencilTest(bool enable, GPU_TESTFUNC function, int ref, int inputMask, int writeMask); void C3D_StencilOp(GPU_STENCILOP sfail, GPU_STENCILOP dfail, GPU_STENCILOP pass); void C3D_BlendingColor(u32 color); void C3D_DepthTest(bool enable, GPU_TESTFUNC function, GPU_WRITEMASK writemask); diff --git a/source/base.c b/source/base.c index 198465f..abc24cc 100644 --- a/source/base.c +++ b/source/base.c @@ -95,7 +95,7 @@ bool C3D_Init(size_t cmdBufSize) C3D_DepthMap(-1.0f, 0.0f); C3D_CullFace(GPU_CULL_BACK_CCW); C3D_StencilTest(false, GPU_ALWAYS, 0x00, 0xFF, 0x00); - C3D_StencilOp(GPU_KEEP, GPU_KEEP, GPU_KEEP); + C3D_StencilOp(GPU_STENCIL_KEEP, GPU_STENCIL_KEEP, GPU_STENCIL_KEEP); C3D_BlendingColor(0); C3D_DepthTest(true, GPU_GREATER, GPU_WRITE_ALL); C3D_AlphaTest(false, GPU_ALWAYS, 0x00); diff --git a/source/effect.c b/source/effect.c index c703d91..3bb09ef 100644 --- a/source/effect.c +++ b/source/effect.c @@ -20,10 +20,10 @@ void C3D_CullFace(GPU_CULLMODE mode) e->cullMode = mode; } -void C3D_StencilTest(bool enable, GPU_TESTFUNC function, int ref, int mask, int replace) +void C3D_StencilTest(bool enable, GPU_TESTFUNC function, int ref, int inputMask, int writeMask) { C3D_Effect* e = getEffect(); - e->stencilMode = (!!enable) | ((function & 7) << 4) | (replace << 8) | (ref << 16) | (mask << 24); + e->stencilMode = (!!enable) | ((function & 7) << 4) | (writeMask << 8) | (ref << 16) | (inputMask << 24); } void C3D_StencilOp(GPU_STENCILOP sfail, GPU_STENCILOP dfail, GPU_STENCILOP pass)