mirror of
https://github.com/drewcassidy/KSP-Conformal-Decals.git
synced 2024-09-01 18:23:54 +00:00
Merge branch 'master' into release
This commit is contained in:
commit
880f463ee0
@ -883,7 +883,7 @@ MonoBehaviour:
|
||||
m_InputType: 0
|
||||
m_AsteriskChar: 42
|
||||
m_KeyboardType: 0
|
||||
m_LineType: 1
|
||||
m_LineType: 2
|
||||
m_HideMobileInput: 0
|
||||
m_CharacterValidation: 0
|
||||
m_RegexValue:
|
||||
@ -1407,7 +1407,7 @@ MonoBehaviour:
|
||||
m_isVolumetricText: 0
|
||||
m_spriteAnimator: {fileID: 0}
|
||||
m_isInputParsingRequired: 0
|
||||
m_inputSource: 0
|
||||
m_inputSource: 3
|
||||
m_hasFontAssetChanged: 0
|
||||
m_subTextObjects:
|
||||
- {fileID: 0}
|
||||
@ -3679,7 +3679,7 @@ MonoBehaviour:
|
||||
m_isVolumetricText: 0
|
||||
m_spriteAnimator: {fileID: 0}
|
||||
m_isInputParsingRequired: 0
|
||||
m_inputSource: 3
|
||||
m_inputSource: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
m_subTextObjects:
|
||||
- {fileID: 0}
|
||||
@ -3838,7 +3838,7 @@ MonoBehaviour:
|
||||
m_isVolumetricText: 0
|
||||
m_spriteAnimator: {fileID: 0}
|
||||
m_isInputParsingRequired: 0
|
||||
m_inputSource: 3
|
||||
m_inputSource: 0
|
||||
m_hasFontAssetChanged: 0
|
||||
m_subTextObjects:
|
||||
- {fileID: 0}
|
||||
|
Binary file not shown.
BIN
GameData/ConformalDecals/Resources/conformaldecals.decalfont
Normal file
BIN
GameData/ConformalDecals/Resources/conformaldecals.decalfont
Normal file
Binary file not shown.
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8580f3c17793051fdc08447401fb7920665ad681ff352588508044b662a3240b
|
||||
size 364900
|
Binary file not shown.
@ -6,7 +6,7 @@
|
||||
{
|
||||
"MAJOR":0,
|
||||
"MINOR":2,
|
||||
"PATCH":0,
|
||||
"PATCH":1,
|
||||
"BUILD":0
|
||||
},
|
||||
"KSP_VERSION":
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Conformal Decals v0.2.0
|
||||
# Conformal Decals v0.2.1
|
||||
[![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)
|
||||
|
@ -36,6 +36,9 @@
|
||||
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||
<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 Include="Shabby, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||
<HintPath>dlls/Shabby.dll</HintPath>
|
||||
</Reference>
|
||||
|
@ -8,7 +8,7 @@ using UnityEngine;
|
||||
|
||||
namespace ConformalDecals.Text {
|
||||
/// KSP database loader for KSPFont files which contain TextMeshPro font assets
|
||||
[DatabaseLoaderAttrib(new[] {"kspfont"})]
|
||||
[DatabaseLoaderAttrib(new[] {"decalfont"})]
|
||||
public class FontLoader : DatabaseLoader<GameDatabase.TextureInfo> {
|
||||
private const string FallbackName = "NotoSans-Regular SDF";
|
||||
private static TMP_FontAsset _fallbackFont;
|
||||
|
@ -4,6 +4,7 @@ using ConformalDecals.Util;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.Rendering;
|
||||
|
||||
namespace ConformalDecals.Text {
|
||||
// TODO: Testing shows the job system is unnecessary, so remove job system code.
|
||||
@ -15,10 +16,11 @@ namespace ConformalDecals.Text {
|
||||
/// Texture format used for returned textures.
|
||||
/// Unfortunately due to how Unity textures work, this cannot be R8 or Alpha8,
|
||||
/// so theres always a superfluous green channel using memory
|
||||
public const TextureFormat TextTextureFormat = TextureFormat.RG16;
|
||||
public static TextureFormat textTextureFormat = TextureFormat.RG16;
|
||||
|
||||
/// Render Texture format used when rendering
|
||||
public const RenderTextureFormat TextRenderTextureFormat = RenderTextureFormat.R8;
|
||||
/// Overriden below to be ARGB32 on DirectX because DirectX is dumb
|
||||
public static RenderTextureFormat textRenderTextureFormat = RenderTextureFormat.R8;
|
||||
|
||||
/// The text renderer object within the scene which contains the TextMeshPro component used for rendering.
|
||||
public static TextRenderer Instance {
|
||||
@ -84,6 +86,15 @@ namespace ConformalDecals.Text {
|
||||
Logging.Log("Creating TextRenderer Object");
|
||||
_instance = this;
|
||||
DontDestroyOnLoad(gameObject);
|
||||
if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Direct3D11 || SystemInfo.graphicsDeviceType == GraphicsDeviceType.Direct3D12) {
|
||||
textRenderTextureFormat = RenderTextureFormat.ARGB32; // DirectX is dumb
|
||||
}
|
||||
if (!SystemInfo.SupportsTextureFormat(textTextureFormat)) {
|
||||
Logging.LogError($"Text texture format {textTextureFormat} not supported on this platform.");
|
||||
}
|
||||
if (!SystemInfo.SupportsRenderTextureFormat(textRenderTextureFormat)) {
|
||||
Logging.LogError($"Text texture format {textRenderTextureFormat} not supported on this platform.");
|
||||
}
|
||||
}
|
||||
|
||||
/// Setup this text renderer instance for rendering
|
||||
@ -227,10 +238,10 @@ namespace ConformalDecals.Text {
|
||||
|
||||
// SETUP TEXTURE
|
||||
if (texture == null) {
|
||||
texture = new Texture2D(textureSize.x, textureSize.y, TextTextureFormat, true);
|
||||
texture = new Texture2D(textureSize.x, textureSize.y, textTextureFormat, true);
|
||||
}
|
||||
else if (texture.width != textureSize.x || texture.height != textureSize.y || texture.format != TextTextureFormat) {
|
||||
texture.Resize(textureSize.x, textureSize.y, TextTextureFormat, true);
|
||||
else if (texture.width != textureSize.x || texture.height != textureSize.y || texture.format != textTextureFormat) {
|
||||
texture.Resize(textureSize.x, textureSize.y, textTextureFormat, true);
|
||||
}
|
||||
|
||||
// GENERATE PROJECTION MATRIX
|
||||
@ -239,7 +250,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);
|
||||
var renderTex = RenderTexture.GetTemporary(textureSize.x, textureSize.y, 0, textRenderTextureFormat, RenderTextureReadWrite.Linear, 1);
|
||||
renderTex.autoGenerateMips = false;
|
||||
|
||||
// RENDER
|
||||
|
@ -1,3 +1,11 @@
|
||||
v0.2.1
|
||||
------
|
||||
- Changes
|
||||
- Pressing enter in the text entry window now types a newline.
|
||||
- Fixes
|
||||
- Renamed font assetbundle. The old extension was causing the game to try to load it twice on Windows due to legacy compatability features.
|
||||
- Fixed text rendering on DirectX resulting in black boxes by using ARGB32 instead of RG16 for the render texture in DirectX.
|
||||
|
||||
v0.2.0
|
||||
------
|
||||
- New Parts:
|
||||
|
Loading…
Reference in New Issue
Block a user