Try to fix build errors

This commit is contained in:
KillzXGaming 2019-11-09 17:36:52 -05:00
parent fb81cc93b0
commit 622011d025
14 changed files with 160 additions and 10 deletions

View file

@ -140,6 +140,8 @@ namespace FirstPlugin
} }
} }
public GLShaderGeneric Shader;
public ShaderProgram defaultShaderProgram; public ShaderProgram defaultShaderProgram;
public ShaderProgram solidColorShaderProgram; public ShaderProgram solidColorShaderProgram;
@ -181,6 +183,12 @@ namespace FirstPlugin
gl_Position = mtxMdl * mtxCam * vec4(vPosition.xyz, 1.0); gl_Position = mtxMdl * mtxCam * vec4(vPosition.xyz, 1.0);
}"); }");
Shader = new GLShaderGeneric()
{
FragmentShader = File.ReadAllText(pathFrag),
VertexShader = File.ReadAllText(pathVert),
};
defaultShaderProgram = new ShaderProgram(defaultFrag, defaultVert, control); defaultShaderProgram = new ShaderProgram(defaultFrag, defaultVert, control);
solidColorShaderProgram = new ShaderProgram(solidColorFrag, solidColorVert, control); solidColorShaderProgram = new ShaderProgram(solidColorFrag, solidColorVert, control);

View file

@ -42,6 +42,10 @@ namespace Toolbox.Library
uint compressedOffset = reader.ReadUInt32(); uint compressedOffset = reader.ReadUInt32();
uint uncompressedOffset = reader.ReadUInt32(); uint uncompressedOffset = reader.ReadUInt32();
while (output.Count < decompressedSize)
{
}
} }
return output.ToArray(); return output.ToArray();

View file

@ -73,7 +73,9 @@ namespace Toolbox.Library
bool ExportSuccessScene = v.ExportFile(scene, FileName, formatID, PostProcessSteps.FlipUVs); bool ExportSuccessScene = v.ExportFile(scene, FileName, formatID, PostProcessSteps.FlipUVs);
if (ExportSuccessScene) if (ExportSuccessScene)
{ {
WriteExtraSkinningInfo(FileName, scene, Meshes); if (ext == ".dae")
WriteExtraSkinningInfo(FileName, scene, Meshes);
MessageBox.Show($"Exported {FileName} Successfuly!"); MessageBox.Show($"Exported {FileName} Successfuly!");
} }
else else

View file

@ -16,6 +16,27 @@ namespace Toolbox.Library
{ {
public class DAE : DAEHelper public class DAE : DAEHelper
{ {
public class ExportSettings
{
public Version FileVersion = new Version();
}
public class Version
{
public int Major = 1;
public int Minor = 4;
public int Micro = 1;
}
public static void Export(string fileName, ExportSettings exportSettings)
{
using (ColladaWriter writer = new ColladaWriter(fileName, exportSettings))
{
}
}
public List<STGenericObject> objects = new List<STGenericObject>(); public List<STGenericObject> objects = new List<STGenericObject>();
public List<STGenericMaterial> materials = new List<STGenericMaterial>(); public List<STGenericMaterial> materials = new List<STGenericMaterial>();
public STSkeleton skeleton; public STSkeleton skeleton;

View file

@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
namespace Toolbox.Library
{
public class ColladaWriter : IDisposable
{
private XmlTextWriter Writer;
private DAE.ExportSettings Settings;
private DAE.Version Version;
public ColladaWriter(string fileName, DAE.ExportSettings settings)
{
Settings = settings;
Version = settings.FileVersion;
Writer = new XmlTextWriter(fileName, Encoding.UTF8)
{
Formatting = Formatting.Indented,
Indentation = 2,
};
}
public void WriteHeader()
{
Writer.WriteStartDocument();
Writer.WriteStartElement("COLLADA");
Writer.WriteAttributeString("xmlns", "http://www.collada.org/2005/11/COLLADASchema");
Writer.WriteAttributeString("version", $"{Version.Major}.{Version.Minor}.{Version.Micro}");
}
public void WriteAsset()
{
Writer.WriteStartElement("asset");
Writer.WriteEndElement();
}
public static void WriteSectionAsset()
{
}
public void Dispose()
{
Writer.Close();
}
}
}

View file

@ -117,9 +117,15 @@ namespace Toolbox.Library
{ {
if (node is STGenericTexture) if (node is STGenericTexture)
{ {
var image = ((STGenericTexture)node).GetBitmap(); try
if (image != null) {
AddImageOnThread(image, node); var image = ((STGenericTexture)node).GetBitmap();
if (image != null)
AddImageOnThread(image, node);
}
catch
{
}
} }
} }
} }
@ -129,9 +135,16 @@ namespace Toolbox.Library
if (SingleTextureIcons[i] == null || SingleTextureIcons[i].IconTexture == null) if (SingleTextureIcons[i] == null || SingleTextureIcons[i].IconTexture == null)
continue; continue;
var image = SingleTextureIcons[i].IconTexture.GetBitmap(); try
if (image != null) {
AddImageOnThread(image, SingleTextureIcons[i].IconTexture); var image = SingleTextureIcons[i].IconTexture.GetBitmap();
if (image != null)
AddImageOnThread(image, SingleTextureIcons[i].IconTexture);
}
catch
{
}
} }
})); }));
Thread.Start(); Thread.Start();

View file

@ -12,8 +12,15 @@ using ScintillaNET_FindReplaceDialog;
namespace Toolbox.Library.Forms namespace Toolbox.Library.Forms
{ {
public partial class TextEditor : UserControl public partial class TextEditor : UserControl, IFIleEditor
{ {
public IFileFormat FileFormat;
public List<IFileFormat> GetFileFormats()
{
return new List<IFileFormat>() { FileFormat };
}
FindReplace findReplaceDialog; FindReplace findReplaceDialog;
private void ResetTypes() private void ResetTypes()

View file

@ -248,11 +248,11 @@ namespace Toolbox.Library
var skybox = new DrawableSkybox(); var skybox = new DrawableSkybox();
var background = new DrawableBackground(); var background = new DrawableBackground();
scene.staticObjects.Add(floor); /* scene.staticObjects.Add(floor);
scene.staticObjects.Add(xyzLnes); scene.staticObjects.Add(xyzLnes);
scene.staticObjects.Add(skybox); scene.staticObjects.Add(skybox);
scene.staticObjects.Add(background); scene.staticObjects.Add(background);
*/
// scene.objects.Add(new SingleObject(new Vector3(0, 0, 0))); // scene.objects.Add(new SingleObject(new Vector3(0, 0, 0)));
// LoadFog(); // LoadFog();

View file

@ -6,6 +6,16 @@ using System.Threading.Tasks;
namespace Toolbox.Library namespace Toolbox.Library
{ {
public enum STPrimativeType
{
Points = 0,
Lines = 1,
LineStrips = 2,
Triangles = 3,
TrangleStrips,
Quads,
}
public class STGenericPolygonGroup public class STGenericPolygonGroup
{ {
public int Offset { get; set; } public int Offset { get; set; }
@ -14,6 +24,8 @@ namespace Toolbox.Library
public List<int> faces = new List<int>(); public List<int> faces = new List<int>();
public STPrimativeType PrimativeType = STPrimativeType.Triangles;
public int strip = 0x40; public int strip = 0x40;
public int displayFaceSize = 0; public int displayFaceSize = 0;

View file

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Toolbox.Library
{
public class ShaderManager
{
}
}

View file

@ -760,6 +760,16 @@ namespace Toolbox.Library.Properties {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap MissingTexture {
get {
object obj = ResourceManager.GetObject("MissingTexture", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>

View file

@ -415,4 +415,7 @@
<data name="AnimationTrackZ" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="AnimationTrackZ" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AnimationTrackZ.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\AnimationTrackZ.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="MissingTexture" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\MissingTexture.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -247,6 +247,7 @@
<Compile Include="Compression\Formats\Zlib.cs" /> <Compile Include="Compression\Formats\Zlib.cs" />
<Compile Include="Config.cs" /> <Compile Include="Config.cs" />
<Compile Include="Enums\CompressionType.cs" /> <Compile Include="Enums\CompressionType.cs" />
<Compile Include="FileFormats\DAE\DAE_Writer.cs" />
<Compile Include="FileFormats\DDS\RGBAPixelDecoder.cs" /> <Compile Include="FileFormats\DDS\RGBAPixelDecoder.cs" />
<Compile Include="FileSystem\VirtualFileTreeNode.cs" /> <Compile Include="FileSystem\VirtualFileTreeNode.cs" />
<Compile Include="FileSystem\VirtualTreeNode.cs" /> <Compile Include="FileSystem\VirtualTreeNode.cs" />
@ -399,6 +400,7 @@
<Compile Include="OpenGL\IPickableObject.cs" /> <Compile Include="OpenGL\IPickableObject.cs" />
<Compile Include="OpenGL\OpenGL2DEnums.cs" /> <Compile Include="OpenGL\OpenGL2DEnums.cs" />
<Compile Include="OpenGL\Render2D.cs" /> <Compile Include="OpenGL\Render2D.cs" />
<Compile Include="OpenGL\ShaderManager.cs" />
<Compile Include="OpenGL\STRectangle.cs" /> <Compile Include="OpenGL\STRectangle.cs" />
<Compile Include="OpenGL\Viewport2D.cs"> <Compile Include="OpenGL\Viewport2D.cs">
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
@ -1389,6 +1391,7 @@
<Folder Include="FileFormats\Compression\" /> <Folder Include="FileFormats\Compression\" />
<Folder Include="FileFormats\DAE\COLLADA\" /> <Folder Include="FileFormats\DAE\COLLADA\" />
<Folder Include="FileFormats\DAE\Custom\" /> <Folder Include="FileFormats\DAE\Custom\" />
<Folder Include="OpenGL\Engine\Camera\" />
<Folder Include="Rendering\Shaders\" /> <Folder Include="Rendering\Shaders\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -1496,6 +1499,9 @@
<ItemGroup> <ItemGroup>
<None Include="Resources\AnimationTrackW.png" /> <None Include="Resources\AnimationTrackW.png" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="Resources\MissingTexture.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>