mirror of
https://github.com/drewcassidy/KSP-Conformal-Decals.git
synced 2024-09-01 18:23:54 +00:00
Compare commits
8 Commits
d8d3d4ed92
...
1e7c6d81c9
Author | SHA1 | Date | |
---|---|---|---|
1e7c6d81c9 | |||
dda988db17 | |||
900061f7f6 | |||
e56278c6cb | |||
2793f5fcb1 | |||
833ec43a52 | |||
e6856124e7 | |||
8ed7a130ab |
1
.gitignore
vendored
1
.gitignore
vendored
@ -50,3 +50,4 @@ Source/ConformalDecals/bin
|
|||||||
*.sublime*
|
*.sublime*
|
||||||
.idea
|
.idea
|
||||||
obj
|
obj
|
||||||
|
*.swp
|
||||||
|
Binary file not shown.
@ -6,8 +6,8 @@
|
|||||||
{
|
{
|
||||||
"MAJOR":0,
|
"MAJOR":0,
|
||||||
"MINOR":2,
|
"MINOR":2,
|
||||||
"PATCH":5,
|
"PATCH":6,
|
||||||
"BUILD":0
|
"BUILD":1
|
||||||
},
|
},
|
||||||
"KSP_VERSION":
|
"KSP_VERSION":
|
||||||
{
|
{
|
||||||
|
@ -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)
|
[![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)
|
![Screenshot](http://pileof.rocks/KSP/images/ConformalDecalsHeader.png)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
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
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@ -8,9 +8,9 @@ Global
|
|||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{1ea983f9-42e5-494e-9683-fdac9c9121f4}.Debug|Any CPU.ActiveCfg = Debug|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}.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.ActiveCfg = Release|Any CPU
|
||||||
{1ea983f9-42e5-494e-9683-fdac9c9121f4}.Release|Any CPU.Build.0 = Release|Any CPU
|
{1EA983F9-42E5-494E-9683-FDAC9C9121F4}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
@ -1,115 +1,55 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)/$(MSBuildToolsVersion)/Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)/$(MSBuildToolsVersion)/Microsoft.Common.props')" />
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<TargetFramework>net48</TargetFramework>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{1ea983f9-42e5-494e-9683-fdac9c9121f4}</ProjectGuid>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<Deterministic>true</Deterministic>
|
|
||||||
<LangVersion>8</LangVersion>
|
<LangVersion>8</LangVersion>
|
||||||
<RootNamespace>ConformalDecals</RootNamespace>
|
<IsPackable>false</IsPackable>
|
||||||
</PropertyGroup>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<NoWarn>1701;1702;CS0649;CS1591</NoWarn>
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin/Debug/</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin/Release/</OutputPath>
|
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<DocumentationFile>bin/Release/ConformalDecals.xml</DocumentationFile>
|
|
||||||
<NoWarn>CS1591,CS0649</NoWarn>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||||
<HintPath>dlls/Assembly-CSharp.dll</HintPath>
|
<HintPath>dlls\Assembly-CSharp.dll</HintPath>
|
||||||
</Reference>
|
|
||||||
<Reference Include="KSPAssets, Version=1.4.0.0, Culture=neutral, PublicKeyToken=null">
|
|
||||||
<HintPath>dlls\KSPAssets.dll</HintPath>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Shabby, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
<Reference Include="Shabby, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||||
<HintPath>dlls/Shabby.dll</HintPath>
|
<HintPath>dlls\Shabby.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||||
<HintPath>dlls/UnityEngine.dll</HintPath>
|
<HintPath>dlls\UnityEngine.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="UnityEngine.AssetBundleModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
<Reference Include="UnityEngine.AssetBundleModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||||
<HintPath>dlls/UnityEngine.AssetBundleModule.dll</HintPath>
|
<HintPath>dlls\UnityEngine.AssetBundleModule.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||||
<HintPath>dlls/UnityEngine.CoreModule.dll</HintPath>
|
<HintPath>dlls\UnityEngine.CoreModule.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
<Reference Include="UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||||
<HintPath>dlls/UnityEngine.PhysicsModule.dll</HintPath>
|
<HintPath>dlls\UnityEngine.PhysicsModule.dll</HintPath>
|
||||||
</Reference>
|
|
||||||
<Reference Include="UnityEngine.TextCoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
|
||||||
<HintPath>dlls/UnityEngine.TextCoreModule.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="UnityEngine.TextRenderingModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
|
||||||
<HintPath>dlls/UnityEngine.TextRenderingModule.dll</HintPath>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
|
<Reference Include="UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||||
<HintPath>dlls/UnityEngine.UI.dll</HintPath>
|
<HintPath>dlls\UnityEngine.UI.dll</HintPath>
|
||||||
</Reference>
|
|
||||||
<Reference Include="UnityEngine.UIElementsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
|
||||||
<HintPath>dlls/UnityEngine.UIElementsModule.dll</HintPath>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="UnityEngine.UIModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
<Reference Include="UnityEngine.UIModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||||
<HintPath>dlls/UnityEngine.UIModule.dll</HintPath>
|
<HintPath>dlls\UnityEngine.UIModule.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="DecalConfig.cs" />
|
<Compile Remove="dlls\**"/>
|
||||||
<Compile Include="DecalIconFixer.cs" />
|
|
||||||
<Compile Include="DecalPropertyIDs.cs" />
|
|
||||||
<Compile Include="MaterialProperties/MaterialColorProperty.cs" />
|
|
||||||
<Compile Include="MaterialProperties/MaterialFloatProperty.cs" />
|
|
||||||
<Compile Include="MaterialProperties/MaterialKeywordProperty.cs" />
|
|
||||||
<Compile Include="MaterialProperties/MaterialProperty.cs" />
|
|
||||||
<Compile Include="MaterialProperties/MaterialPropertyCollection.cs" />
|
|
||||||
<Compile Include="MaterialProperties/MaterialTextureProperty.cs" />
|
|
||||||
<Compile Include="ModuleConformalFlag.cs" />
|
|
||||||
<Compile Include="ModuleConformalText.cs" />
|
|
||||||
<Compile Include="ProjectionTarget.cs" />
|
|
||||||
<Compile Include="ModuleConformalDecal.cs" />
|
|
||||||
<Compile Include="Properties/AssemblyInfo.cs" />
|
|
||||||
<Compile Include="Text/DecalFont.cs" />
|
|
||||||
<Compile Include="Text/FontLoader.cs" />
|
|
||||||
<Compile Include="Text/TextRenderer.cs" />
|
|
||||||
<Compile Include="Text/DecalText.cs" />
|
|
||||||
<Compile Include="Text\TextRenderOutput.cs" />
|
|
||||||
<Compile Include="Text\TextRenderJob.cs" />
|
|
||||||
<Compile Include="UI/ColorPickerController.cs" />
|
|
||||||
<Compile Include="UI/FontMenuController.cs" />
|
|
||||||
<Compile Include="UI/FontMenuItem.cs" />
|
|
||||||
<Compile Include="UI/TextEntryController.cs" />
|
|
||||||
<Compile Include="UI/UILoader.cs" />
|
|
||||||
<Compile Include="UI/UITag.cs" />
|
|
||||||
<Compile Include="UI\ColorBoxSlider.cs" />
|
|
||||||
<Compile Include="UI\ColorChannelSlider.cs" />
|
|
||||||
<Compile Include="Util/Logging.cs" />
|
|
||||||
<Compile Include="Util/OrientedBounds.cs" />
|
|
||||||
<Compile Include="Util/ParseUtil.cs" />
|
|
||||||
<Compile Include="UI/BoxSlider.cs" />
|
|
||||||
<Compile Include="Util\ColorHSL.cs" />
|
|
||||||
<Compile Include="Util\ColorHSV.cs" />
|
|
||||||
<Compile Include="Util\ColorUtil.cs" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)/Microsoft.CSharp.targets" />
|
|
||||||
<PropertyGroup>
|
<ItemGroup>
|
||||||
<PostBuildEvent>sh -e -c "cp -v '$(TargetPath)' '$(SolutionDir)/../GameData/ConformalDecals/Plugins'"</PostBuildEvent>
|
<EmbeddedResource Remove="dlls\**"/>
|
||||||
</PropertyGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Remove="dlls\**"/>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
|
<Exec Command="/bin/cp -v '$(OutDir)ConformalDecals.dll' '$(SolutionDir)../GameData/ConformalDecals/Plugins'" IgnoreExitCode="true"/>
|
||||||
|
<!--Fuck you MSBuild stop trying to run CMD.exe on macOS-->
|
||||||
|
</Target>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
||||||
|
@ -41,7 +41,13 @@ namespace ConformalDecals.MaterialProperties {
|
|||||||
public Vector2 Dimensions => new Vector2(_texture.width, _texture.height);
|
public Vector2 Dimensions => new Vector2(_texture.width, _texture.height);
|
||||||
public Vector2 MaskedDimensions => _hasTile ? _tileRect.size : Dimensions;
|
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;
|
||||||
|
return MaskedHeight / (float) MaskedWidth;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override void ParseNode(ConfigNode node) {
|
public override void ParseNode(ConfigNode node) {
|
||||||
base.ParseNode(node);
|
base.ParseNode(node);
|
||||||
|
@ -400,7 +400,7 @@ namespace ConformalDecals {
|
|||||||
protected void UpdateScale() {
|
protected void UpdateScale() {
|
||||||
scale = Mathf.Max(0.01f, scale);
|
scale = Mathf.Max(0.01f, scale);
|
||||||
depth = Mathf.Max(0.01f, depth);
|
depth = Mathf.Max(0.01f, depth);
|
||||||
var aspectRatio = materialProperties.AspectRatio;
|
var aspectRatio = Mathf.Max(0.01f, materialProperties.AspectRatio);
|
||||||
Vector2 size;
|
Vector2 size;
|
||||||
|
|
||||||
switch (scaleMode) {
|
switch (scaleMode) {
|
||||||
|
@ -1,38 +1 @@
|
|||||||
using System.Reflection;
|
[assembly: KSPAssembly("ConformalDecals", 0, 2, 6)]
|
||||||
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)]
|
|
@ -255,8 +255,7 @@ namespace ConformalDecals.Text {
|
|||||||
bounds.center.y - halfSize.y, bounds.center.y + halfSize.y, -1, 1);
|
bounds.center.y - halfSize.y, bounds.center.y + halfSize.y, -1, 1);
|
||||||
|
|
||||||
// GET RENDERTEX
|
// GET RENDERTEX
|
||||||
var renderTex = RenderTexture.GetTemporary(textureSize.x, textureSize.y, 0, textRenderTextureFormat, RenderTextureReadWrite.Linear, 1);
|
var renderTex = new RenderTexture(textureSize.x, textureSize.y, 0, textRenderTextureFormat, RenderTextureReadWrite.Linear) {autoGenerateMips = false};
|
||||||
renderTex.autoGenerateMips = false;
|
|
||||||
|
|
||||||
// RENDER
|
// RENDER
|
||||||
Graphics.SetRenderTarget(renderTex);
|
Graphics.SetRenderTarget(renderTex);
|
||||||
@ -273,15 +272,17 @@ namespace ConformalDecals.Text {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// COPY TEXTURE BACK INTO RAM
|
// COPY TEXTURE BACK INTO RAM
|
||||||
|
var prevRT = RenderTexture.active;
|
||||||
RenderTexture.active = renderTex;
|
RenderTexture.active = renderTex;
|
||||||
texture.ReadPixels(new Rect(0, 0, textureSize.x, textureSize.y), 0, 0, true);
|
texture.ReadPixels(new Rect(0, 0, textureSize.x, textureSize.y), 0, 0, true);
|
||||||
texture.Apply();
|
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();
|
GL.PopMatrix();
|
||||||
|
|
||||||
// RELEASE RENDERTEX
|
// RELEASE RENDERTEX
|
||||||
RenderTexture.ReleaseTemporary(renderTex);
|
renderTex.Release();
|
||||||
|
RenderTexture.Destroy(renderTex);
|
||||||
|
|
||||||
// CLEAR SUBMESHES
|
// CLEAR SUBMESHES
|
||||||
_tmp.text = "";
|
_tmp.text = "";
|
||||||
|
@ -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
|
v0.2.5
|
||||||
------
|
------
|
||||||
- Fixes:
|
- Fixes:
|
||||||
|
Loading…
Reference in New Issue
Block a user