Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ obj/
GameData/SCANsat/Plugins/SCAN*
GameData/SCANsat/PluginData/Settings.cfg
GameData/SCANsat/Parts/@thumbs/
Releases/
GameData/
Releases/
Binary file modified GameData/SCANsat/Resources/scan_prefabs.scan
Binary file not shown.
7 changes: 5 additions & 2 deletions GameData/SCANsat/SCANsat.version
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"NAME": "SCANsat",
"URL": "https://github.com/KSPModStewards/SCANsat/releases/latest/download/SCANsat.version",
"DOWNLOAD": "https://github.com/KSPModStewards/SCANsat/releases"

"DOWNLOAD": "https://github.com/KSPModStewards/SCANsat/releases",
"VERSION": "1.0.0.0",
"KSP_VERSION": "1.12",
"KSP_VERSION_MIN": "1.12.3",
"KSP_VERSION_MAX": "'1.12'"
}
4 changes: 3 additions & 1 deletion SCANsat.Unity/Interfaces/ISCAN_ZoomMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* S.C.A.N. Satellite
*
* ISCAN_ZoomMap - Interface for transfer of zoom map information
*
*
* Copyright (c)2013 damny;
* Copyright (c)2014 technogeeky <technogeeky@gmail.com>;
* Copyright (c)2014 DMagic
Expand Down Expand Up @@ -127,6 +127,8 @@ public interface ISCAN_ZoomMap

void VesselSync();

void ExportMap();

void MoveMap(int i);

void ZoomMap(bool zoom);
Expand Down
18 changes: 14 additions & 4 deletions SCANsat.Unity/Unity/SCAN_ZoomMap.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#region license
/*
/*
* [Scientific Committee on Advanced Navigation]
* S.C.A.N. Satellite
*
* SCAN_ZoomMap - Script for controlling the zoom map UI
*
*
* Copyright (c)2014 David Grandy <david.grandy@gmail.com>;
* Copyright (c)2014 technogeeky <technogeeky@gmail.com>;
* Copyright (c)2014 (Your Name Here) <your email here>; see LICENSE.txt for licensing details.
Expand All @@ -24,9 +24,9 @@ namespace SCANsat.Unity.Unity
public class SCAN_ZoomMap : CanvasFader, IDragHandler, IBeginDragHandler, IEndDragHandler, IPointerDownHandler
{
[SerializeField]
private float m_MaxWidth = 520;
private float m_MaxWidth = 1100;
[SerializeField]
private float m_MaxHeight = 440;
private float m_MaxHeight = 880;
[SerializeField]
private TextHandler m_Version = null;
[SerializeField]
Expand Down Expand Up @@ -1666,6 +1666,16 @@ public void RefreshMap()
UpdateMapData(false);
}

public void ExportMap()
{
if (zoomInterface == null)
{
return;
}

zoomInterface.ExportMap();
}

public void ToggleColor(bool isOn)
{
if (!loaded || zoomInterface == null)
Expand Down
23 changes: 20 additions & 3 deletions SCANsat/SCAN_Map/SCANmap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
* [Scientific Committee on Advanced Navigation]
* S.C.A.N. Satellite
*
*
* SCANmap - makes maps from data
*
* Copyright (c)2013 damny;
Expand Down Expand Up @@ -148,6 +148,16 @@ public MapProjection Projection
get { return big_heightmap; }
}

internal float[,] Big_SlopeMap
{
get { return big_slopemap; }
}

internal float[,] ResourceCache
{
get { return resourceCache; }
}

public bool UseCustomRange
{
get { return useCustomRange; }
Expand All @@ -174,6 +184,7 @@ public float CustomRange

/* MAP: Big Map height map caching */
private float[,] big_heightmap;
private float[,] big_slopemap;
private bool cache;
private double centeredLong, centeredLat;

Expand Down Expand Up @@ -464,6 +475,8 @@ internal void setSize(int w, int h, int interpolation = 2, int start = 0, int st
resourceMapWidth = mapwidth;
resourceMapHeight = mapheight;
resourceCache = new float[resourceMapWidth, resourceMapHeight];
big_heightmap = new float[mapwidth, mapheight];
big_slopemap = new float[mapwidth, mapheight];
resourceInterpolation = interpolation;
resourceMapScale = resourceMapWidth / 360;
randomEdges = false;
Expand Down Expand Up @@ -510,8 +523,9 @@ internal void setWidth(int w)
mapheight = (int)(w / 2);
startLine = 0;
stopLine = mapheight - 1;
/* big map caching */
big_heightmap = new float[mapwidth, mapheight];
big_slopemap = new float[mapwidth, mapheight];

map = null;
resetMap(resourceActive);
}
Expand Down Expand Up @@ -811,6 +825,7 @@ internal void exportPNG()

if (exporter.Exporting)
{
ScreenMessages.PostScreenMessage("SCANsat export already in progress; wait for CSV completion", 4, ScreenMessageStyle.UPPER_CENTER);
return;
}

Expand Down Expand Up @@ -1017,6 +1032,7 @@ internal Texture2D getPartialMap(bool apply = true)
else if (SCANUtil.isCovered(lon, lat, data, SCANtype.Altimetry))
{
projVal = terrainElevation(lon, lat, mapwidth, mapheight, big_heightmap, cache, data, out nowColor);
big_heightmap[i, mapstep] = projVal;
if (useCustomRange)
{
baseColor = palette.heightToColor(projVal, nowColor, data.TerrainConfig, customMin, customMax, customRange, true);
Expand Down Expand Up @@ -1059,6 +1075,7 @@ internal Texture2D getPartialMap(bool apply = true)
}

float v = Mathf.Clamp((float)Math.Abs(projVal - v1) / (1000f / (float)mapscale), 0, 2f);
big_slopemap[i, mapstep] = v;
if (!colorMap)
{
baseColor = palette.lerp(palette.Black, palette.White, v / 2f);
Expand Down Expand Up @@ -1456,7 +1473,7 @@ public float terrainElevation(double Lon, double Lat, int W, int H, float[,] hei
return terrainElevation(Lon, Lat, W, H, heightMap, true, Data, out c, export);
}

private float getResoureCache(double Lon, double Lat)
internal float getResoureCache(double Lon, double Lat)
{
double resourceLat = fixUnscale(unScaleLatitude(Lat, resourceMapScale), resourceMapHeight);
double resourceLon = fixUnscale(unScaleLongitude(Lon, resourceMapScale), resourceMapWidth);
Expand Down
Loading