📄 settings.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.IO;
using Microsoft.WindowsMobile.DirectX;
using Microsoft.WindowsMobile.DirectX.Direct3D;
using PInvokeLibrary;
namespace cfWorldWind
{
public class Settings
{
private static Assembly asm;
private static string _namespace;
private static string _directory;
private static string _storageCard;
static Settings()
{
asm = Assembly.GetExecutingAssembly();
_namespace = asm.GetName().Name;
_directory = Path.GetDirectoryName(asm.GetName().CodeBase) + @"\";
_storageCard = _directory;
if (File.Exists(@"\Storage Card\"))
{
_storageCard = @"\Storage Card\";
}
else if (File.Exists(@"\SD Card\"))
{
_storageCard = @"\SD Card\";
}
else
{
DirectoryInfo rootDir = new DirectoryInfo(@"\");
foreach (FileSystemInfo fsi in rootDir.GetFileSystemInfos())
{
if ((FileAttributes.Directory | FileAttributes.Temporary) == (fsi.Attributes & (FileAttributes.Directory | FileAttributes.Temporary)))
{
_storageCard = fsi.Name + @"\";
//TODO handle multiple storage cards?
}
}
}
}
public Settings()
{
}
public static string Namespace
{
get{return _namespace;}
}
public static string Directory
{
get{return _directory;}
}
public static string StorageCard
{
get { return _storageCard; }
}
public static float Radius
{
get { return 6378137; } //meters //6366 km
}
public static int Precision
{
get { return 32; } //desktop is 64, 16 was a little blocky
}
public static string DirectoryData
{
get { return StorageCard + @"Data\"; }
}
public static string DirectoryEarth
{
get { return DirectoryData + @"Earth\"; }
}
public static string DirectoryBlueMarbleTextures
{
get { return DirectoryEarth + @"BlueMarbleTextures\"; }
}
public static string DirectoryBoundaries //countries
{
get { return DirectoryEarth + @"Boundaries\"; }
}
public static string DirectoryBoundariesCanadian
{
get { return DirectoryBoundaries + @"Canadian_Boundaries\"; }
}
public static string DirectoryBoundariesNorwegian
{
get { return DirectoryBoundaries + @"Norwegian_Boundaries\"; }
}
public static string DirectoryBoundariesSwedish
{
get { return DirectoryBoundaries + @"Swedish_Boundaries\"; }
}
public static string DirectoryBoundariesUS_State
{
get { return DirectoryBoundaries + @"US_State_Boundaries\"; }
}
public static string DirectoryPlacenames
{
get { return DirectoryEarth + @"Placenames\"; }
}
public static string DirectoryLandmark
{
get { return DirectoryEarth + @"Landmark\"; }
}
public static string DirectoryLandmarkIcon
{
get { return DirectoryLandmark + @"Icon\"; }
}
public static string DirectoryFlags
{
get { return DirectoryEarth + @"FlagsOfTheWorld\"; }
}
public static string DirectoryFlagsIcon
{
get { return DirectoryFlags + @"Icon\"; }
}
public static string PathBlueMarbleTexture
{
//get { return DirectoryBlueMarbleTextures + "land_shallow_topo_2048.dds"; } //1 meg
//get { return DirectoryBlueMarbleTextures + "land_shallow_topo_1024.dds"; } //256 //wont load
//get { return DirectoryBlueMarbleTextures + "land_shallow_topo_1024.bmp"; } //1.5 meg //didnt take long
//get { return DirectoryBlueMarbleTextures + "land_shallow_topo_1024.png"; } //277
//get { return DirectoryBlueMarbleTextures + "land_shallow_topo_1024.jpg"; } //55
//get { return DirectoryBlueMarbleTextures + "land_shallow_topo_1024.tif"; } //457 //failed
//get { return DirectoryBlueMarbleTextures + "land_shallow_topo_1024.gif"; } //85 //looks like crap
//get { return DirectoryBlueMarbleTextures + "land_shallow_topo_512.dds"; }
//get { return DirectoryBlueMarbleTextures + "land_shallow_topo_512.bmp"; }
get { return DirectoryBlueMarbleTextures + "land_shallow_topo_512.png"; }
//get { return DirectoryBlueMarbleTextures + "land_shallow_topo_512.jpg"; }
}
private static bool _renderException = true;
public static bool RenderException
{
get { return _renderException; }
set { _renderException = value; }
}
private static bool _world = true;
public static bool World
{
get { return _world; }
set { _world = value; }
}
private static bool _wireFrame = false;
public static bool WireFrame
{
get { return _wireFrame; }
set { _wireFrame = value; }
}
private static bool _crossHairs = true;
public static bool Crosshairs
{
get { return _crossHairs; }
set { _crossHairs = value; }
}
private static bool _framesPerSec = false; //true
public static bool FramesPerSecond
{
get { return _framesPerSec; }
set { _framesPerSec = value; }
}
private static bool _diagnostics = false; //true
public static bool Diagnostics
{
get { return _diagnostics; }
set { _diagnostics = value; }
}
private static bool _position = true;
public static bool Positions
{
get { return _position; }
set { _position = value; }
}
private static bool _texture = true;
public static bool Texture
{
get { return _texture; }
set { _texture = value; }
}
private static Cull _culling = Cull.Clockwise;
public static Cull Culling
{
get { return _culling; }
set { _culling = value; }
}
private static bool _latLonLines = false;
public static bool LatLonLines
{
get { return _latLonLines; }
set { _latLonLines = value; }
}
private static bool _axis = false;
public static bool Axis
{
get { return _axis; }
set { _axis = value; }
}
private static TileType _tiles = TileType.Earth; //TileType.Earth;
public static TileType Tiles
{
get { return _tiles; }
set { _tiles = value; }
}
public enum TileType
{
None,
Earth,
RowColumn,
}
public enum BoundaryType
{
Country,
Canadian,
Norwegian,
Swedish,
UsState,
}
private static bool _tileOutline = false;
public static bool TileOutline
{
get { return _tileOutline; }
set { _tileOutline = value; }
}
private static bool _boundCount = false;
public static bool BoundCount
{
get { return _boundCount; }
set { _boundCount = value; }
}
private static bool _boundCan = false;
public static bool BoundCan
{
get { return _boundCan; }
set { _boundCan = value; }
}
private static bool _boundNor = false;
public static bool BoundNor
{
get { return _boundNor; }
set { _boundNor = value; }
}
private static bool _boundSwe = false;
public static bool BoundSwe
{
get { return _boundSwe; }
set { _boundSwe = value; }
}
private static bool _boundUs = false;
public static bool BoundUs
{
get { return _boundUs; }
set { _boundUs = value; }
}
private static bool _placenames = false;
public static bool Placename
{
get { return _placenames; }
set { _placenames = value; }
}
private static bool _landmarks = false;
public static bool Landmark
{
get { return _landmarks; }
set { _landmarks = value; }
}
private static bool _flags = false;
public static bool Flag
{
get { return _flags; }
set { _flags = value; }
}
private static bool _equator = false;
public static bool Equator
{
get { return _equator; }
set { _equator = value; }
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -