mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-10 07:04:36 +00:00
Fix build errors please
This commit is contained in:
parent
ed78d46545
commit
9dc4aeccc5
4 changed files with 56 additions and 36 deletions
|
@ -886,6 +886,26 @@ namespace LayoutBXLYT.Cafe
|
|||
|
||||
}
|
||||
|
||||
public bool UseOneMaterialForAll
|
||||
{
|
||||
get { return Convert.ToBoolean(_flag & 1); }
|
||||
}
|
||||
|
||||
public bool UseVertexColorForAll
|
||||
{
|
||||
get { return Convert.ToBoolean((_flag >> 1) & 1); }
|
||||
}
|
||||
|
||||
public bool WindowKind
|
||||
{
|
||||
get { return Convert.ToBoolean((_flag >> 2) & 3); }
|
||||
}
|
||||
|
||||
public bool NotDrawnContent
|
||||
{
|
||||
get { return Convert.ToBoolean((_flag >> 4) & 1); }
|
||||
}
|
||||
|
||||
public ushort StretchLeft;
|
||||
public ushort StretchRight;
|
||||
public ushort StretchTop;
|
||||
|
|
|
@ -101,42 +101,8 @@ namespace LayoutBXLYT
|
|||
{
|
||||
get
|
||||
{
|
||||
StringBuilder frag = new StringBuilder();
|
||||
frag.AppendLine("uniform vec4 blackColor;");
|
||||
frag.AppendLine("uniform vec4 whiteColor;");
|
||||
frag.AppendLine("uniform int hasTexture0;");
|
||||
frag.AppendLine("uniform int debugShading;");
|
||||
frag.AppendLine("uniform int numTextureMaps;");
|
||||
frag.AppendFormat("uniform sampler2D textures{0};\n", 0);
|
||||
frag.AppendLine("uniform sampler2D uvTestPattern;");
|
||||
|
||||
frag.AppendLine("void main()");
|
||||
frag.AppendLine("{");
|
||||
|
||||
frag.AppendLine("vec4 textureMap0 = vec4(1);");
|
||||
frag.AppendLine("if (numTextureMaps > 0)");
|
||||
frag.AppendLine("{");
|
||||
frag.AppendLine("if (hasTexture0 == 1)");
|
||||
frag.AppendLine(" textureMap0 = texture2D(textures0, gl_TexCoord[0].st);");
|
||||
frag.AppendLine("}");
|
||||
frag.AppendLine("if (debugShading == 0)");
|
||||
frag.AppendLine("{");
|
||||
frag.AppendLine("vec4 colorFrag = gl_Color * textureMap0;");
|
||||
frag.AppendLine("vec4 colorBlend = colorFrag * whiteColor;");
|
||||
frag.AppendLine("gl_FragColor = colorBlend;");
|
||||
|
||||
frag.AppendLine("}");
|
||||
frag.AppendLine("else if (debugShading == 1)");
|
||||
frag.AppendLine(" gl_FragColor = vec4(textureMap0.rgb, 1);");
|
||||
frag.AppendLine("else if (debugShading == 2)");
|
||||
frag.AppendLine(" gl_FragColor = whiteColor;");
|
||||
frag.AppendLine("else if (debugShading == 3)");
|
||||
frag.AppendLine(" gl_FragColor = blackColor;");
|
||||
frag.AppendLine("else if (debugShading == 4)");
|
||||
frag.AppendLine(" gl_FragColor = texture2D(uvTestPattern, gl_TexCoord[0].st);");
|
||||
frag.AppendLine("}");
|
||||
|
||||
return frag.ToString();
|
||||
string path = System.IO.Path.Combine(Runtime.ExecutableDir, "Shader", "Layout", "Bflyt.frag");
|
||||
return System.IO.File.ReadAllText(path);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
31
Toolbox/Shader/Layout/Bflyt.frag
Normal file
31
Toolbox/Shader/Layout/Bflyt.frag
Normal file
|
@ -0,0 +1,31 @@
|
|||
uniform vec4 blackColor;
|
||||
uniform vec4 whiteColor;
|
||||
uniform int hasTexture0;
|
||||
uniform int debugShading;
|
||||
uniform int numTextureMaps;
|
||||
uniform sampler2D textures0;
|
||||
uniform sampler2D uvTestPattern;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 textureMap0 = vec4(1);
|
||||
if (numTextureMaps > 0)
|
||||
{
|
||||
if (hasTexture0 == 1)
|
||||
textureMap0 = texture2D(textures0, gl_TexCoord[0].st);;
|
||||
}
|
||||
if (debugShading == 0)
|
||||
{
|
||||
vec4 colorFrag = gl_Color * textureMap0;
|
||||
vec4 colorBlend = colorFrag * whiteColor;
|
||||
gl_FragColor = colorBlend;
|
||||
}
|
||||
if (debugShading == 1)
|
||||
gl_FragColor = vec4(textureMap0.rgb, 1);
|
||||
if (debugShading == 2)
|
||||
gl_FragColor = whiteColor;
|
||||
if (debugShading == 3)
|
||||
gl_FragColor = blackColor;
|
||||
if (debugShading == 4)
|
||||
gl_FragColor = texture2D(uvTestPattern, gl_TexCoord[0].st);
|
||||
}
|
|
@ -245,6 +245,9 @@
|
|||
<None Include="Shader\KCL.vert">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Shader\Layout\Bflyt.frag">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Shader\Layout\Bflyt.vert">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
|
Loading…
Reference in a new issue