Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ef0f4b9c3af3
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e3f5fbf12473
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Mar 16, 2018

  1. Limit texture2d.LoadImage change to KSP 1.4.1 only

    Need to keep the old code around so versions of Principia for 1.2.2 and
    1.3.1 still build
    ts826848 committed Mar 16, 2018
    Copy the full SHA
    2cec7dd View commit details
  2. Merge pull request #1758 from aw1621107/restore-ksp-1.3.1-1.2.2-compat

    Limit texture2d.LoadImage change to KSP 1.4.1 only
    pleroy authored Mar 16, 2018
    Copy the full SHA
    e3f5fbf View commit details
Showing with 5 additions and 0 deletions.
  1. +5 −0 ksp_plugin_adapter/ksp_plugin_adapter.cs
5 changes: 5 additions & 0 deletions ksp_plugin_adapter/ksp_plugin_adapter.cs
Original file line number Diff line number Diff line change
@@ -496,8 +496,13 @@ private bool LoadTextureIfExists(out UnityEngine.Texture texture,
path;
if (File.Exists(full_path)) {
var texture2d = new UnityEngine.Texture2D(2, 2);
#if KSP_VERSION_1_4_1
bool success = UnityEngine.ImageConversion.LoadImage(
texture2d, File.ReadAllBytes(full_path));
#elif KSP_VERSION_1_2_2 || KSP_VERSION_1_3_1
bool success = texture2d.LoadImage(
File.ReadAllBytes(full_path));
#endif
if (!success) {
Log.Fatal("Failed to load texture " + full_path);
}