diff --git a/.gitignore b/.gitignore index 45bb007..5b4dea1 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,4 @@ Source/ConformalDecals/bin *.sublime* .idea obj +*.swp diff --git a/GameData/ConformalDecals/Plugins/ConformalDecals.dll b/GameData/ConformalDecals/Plugins/ConformalDecals.dll index f5e6fe0..d5b6789 100644 Binary files a/GameData/ConformalDecals/Plugins/ConformalDecals.dll and b/GameData/ConformalDecals/Plugins/ConformalDecals.dll differ diff --git a/GameData/ConformalDecals/Versioning/ConformalDecals.version b/GameData/ConformalDecals/Versioning/ConformalDecals.version index d1c4139..503d33d 100644 --- a/GameData/ConformalDecals/Versioning/ConformalDecals.version +++ b/GameData/ConformalDecals/Versioning/ConformalDecals.version @@ -6,7 +6,7 @@ { "MAJOR":0, "MINOR":2, - "PATCH":5, + "PATCH":6, "BUILD":0 }, "KSP_VERSION": diff --git a/README.md b/README.md index 5e6663a..febd796 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Conformal Decals v0.2.5 +# Conformal Decals v0.2.6 [![Build Status](https://travis-ci.org/drewcassidy/KSP-Conformal-Decals.svg?branch=release)](https://travis-ci.org/drewcassidy/KSP-Conformal-Decals) [![Art: CC BY-SA 4.0](https://img.shields.io/badge/Art%20License-CC%20BY--SA%204.0-orange.svg)](https://creativecommons.org/licenses/by-sa/4.0/) [![Code: GPL v3](https://img.shields.io/badge/Code%20License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) ![Screenshot](http://pileof.rocks/KSP/images/ConformalDecalsHeader.png) diff --git a/Source/ConformalDecals.sln b/Source/ConformalDecals.sln index 5962f05..2e27ad0 100644 --- a/Source/ConformalDecals.sln +++ b/Source/ConformalDecals.sln @@ -1,6 +1,6 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConformalDecals", "ConformalDecals/ConformalDecals.csproj", "{1ea983f9-42e5-494e-9683-fdac9c9121f4}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConformalDecals", "ConformalDecals/ConformalDecals.csproj", "{1EA983F9-42E5-494E-9683-FDAC9C9121F4}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -8,9 +8,9 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1ea983f9-42e5-494e-9683-fdac9c9121f4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1ea983f9-42e5-494e-9683-fdac9c9121f4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1ea983f9-42e5-494e-9683-fdac9c9121f4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1ea983f9-42e5-494e-9683-fdac9c9121f4}.Release|Any CPU.Build.0 = Release|Any CPU + {1EA983F9-42E5-494E-9683-FDAC9C9121F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1EA983F9-42E5-494E-9683-FDAC9C9121F4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1EA983F9-42E5-494E-9683-FDAC9C9121F4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1EA983F9-42E5-494E-9683-FDAC9C9121F4}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/Source/ConformalDecals/ConformalDecals.csproj b/Source/ConformalDecals/ConformalDecals.csproj index f4c47b7..ab0a0dd 100644 --- a/Source/ConformalDecals/ConformalDecals.csproj +++ b/Source/ConformalDecals/ConformalDecals.csproj @@ -1,115 +1,55 @@ - - - + - Debug - AnyCPU - {1ea983f9-42e5-494e-9683-fdac9c9121f4} - Library - Properties - v4.6 - 512 - true + net48 8 - ConformalDecals - - - true - full - false - bin/Debug/ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin/Release/ - TRACE - prompt - 4 - bin/Release/ConformalDecals.xml - CS1591,CS0649 + false + x64 + 1701;1702;CS0649;CS1591 + - dlls/Assembly-CSharp.dll - - - dlls\KSPAssets.dll + dlls\Assembly-CSharp.dll - dlls/Shabby.dll + dlls\Shabby.dll - - dlls/UnityEngine.dll + dlls\UnityEngine.dll - dlls/UnityEngine.AssetBundleModule.dll + dlls\UnityEngine.AssetBundleModule.dll - dlls/UnityEngine.CoreModule.dll + dlls\UnityEngine.CoreModule.dll - dlls/UnityEngine.PhysicsModule.dll - - - dlls/UnityEngine.TextCoreModule.dll - - - dlls/UnityEngine.TextRenderingModule.dll + dlls\UnityEngine.PhysicsModule.dll - dlls/UnityEngine.UI.dll - - - dlls/UnityEngine.UIElementsModule.dll + dlls\UnityEngine.UI.dll - dlls/UnityEngine.UIModule.dll + dlls\UnityEngine.UIModule.dll + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - sh -e -c "cp -v '$(TargetPath)' '$(SolutionDir)/../GameData/ConformalDecals/Plugins'" - + + + + + + + + + + + + + + + diff --git a/Source/ConformalDecals/MaterialProperties/MaterialTextureProperty.cs b/Source/ConformalDecals/MaterialProperties/MaterialTextureProperty.cs index cfd018b..9f578c4 100644 --- a/Source/ConformalDecals/MaterialProperties/MaterialTextureProperty.cs +++ b/Source/ConformalDecals/MaterialProperties/MaterialTextureProperty.cs @@ -41,7 +41,14 @@ namespace ConformalDecals.MaterialProperties { public Vector2 Dimensions => new Vector2(_texture.width, _texture.height); public Vector2 MaskedDimensions => _hasTile ? _tileRect.size : Dimensions; - public float AspectRatio => MaskedHeight / (float) MaskedWidth; + public float AspectRatio { + get { + if (_texture == null) return 1; + if (_textureUrl?.Contains("Squad/Flags") == true) return 0.625f; + if (_hasTile) return MaskedHeight / (float) MaskedWidth; + return _texture.height / _texture.width; + } + } public override void ParseNode(ConfigNode node) { base.ParseNode(node); diff --git a/Source/ConformalDecals/Properties/AssemblyInfo.cs b/Source/ConformalDecals/Properties/AssemblyInfo.cs index 3eab961..f2a1459 100644 --- a/Source/ConformalDecals/Properties/AssemblyInfo.cs +++ b/Source/ConformalDecals/Properties/AssemblyInfo.cs @@ -1,38 +1 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ConformalDecals")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Cineboxandrew")] -[assembly: AssemblyProduct("ConformalDecals")] -[assembly: AssemblyCopyright("Copyright © Andrew Cassidy 2020")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("1ea983f9-42e5-494e-9683-fdac9c9121f4")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] - -[assembly: KSPAssembly("ConformalDecals", 0, 1, 0)] +[assembly: KSPAssembly("ConformalDecals", 0, 2, 6)] \ No newline at end of file diff --git a/Source/ConformalDecals/Text/TextRenderer.cs b/Source/ConformalDecals/Text/TextRenderer.cs index c1b098d..6c1206a 100644 --- a/Source/ConformalDecals/Text/TextRenderer.cs +++ b/Source/ConformalDecals/Text/TextRenderer.cs @@ -255,8 +255,7 @@ namespace ConformalDecals.Text { bounds.center.y - halfSize.y, bounds.center.y + halfSize.y, -1, 1); // GET RENDERTEX - var renderTex = RenderTexture.GetTemporary(textureSize.x, textureSize.y, 0, textRenderTextureFormat, RenderTextureReadWrite.Linear, 1); - renderTex.autoGenerateMips = false; + var renderTex = new RenderTexture(textureSize.x, textureSize.y, 0, textRenderTextureFormat, RenderTextureReadWrite.Linear) {autoGenerateMips = false}; // RENDER Graphics.SetRenderTarget(renderTex); @@ -273,15 +272,17 @@ namespace ConformalDecals.Text { } // COPY TEXTURE BACK INTO RAM + var prevRT = RenderTexture.active; RenderTexture.active = renderTex; texture.ReadPixels(new Rect(0, 0, textureSize.x, textureSize.y), 0, 0, true); texture.Apply(); + RenderTexture.active = prevRT; - GL.Clear(false, true, Color.black); //KSP doesnt clear render textures before using them so we need to clear afterwards, as well. Thanks Squad. GL.PopMatrix(); // RELEASE RENDERTEX - RenderTexture.ReleaseTemporary(renderTex); + renderTex.Release(); + RenderTexture.Destroy(renderTex); // CLEAR SUBMESHES _tmp.text = ""; diff --git a/changelog.txt b/changelog.txt index 9e062d3..dbaba71 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,9 @@ +v0.2.6 +------ +- Fixes: + - Fixed stock flags appearing stretched by forcing their aspect ratio to be correct. + - Another attempted fix for the planet text glitch. + v0.2.5 ------ - Fixes: