Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code clean-up for C++20 conformance #357

Merged
merged 130 commits into from
Jul 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
6d14357
TimeData: remove class name
dimitry-ishenko May 23, 2023
0150fe3
Vessel: remove class name
dimitry-ishenko May 23, 2023
fd6c37a
hud.h: explicit char* cast
dimitry-ishenko May 23, 2023
ab9adf1
Camera: mark string literal as const
dimitry-ishenko May 23, 2023
6dc1d24
CommandLine: marks string literals as const
dimitry-ishenko May 23, 2023
f33e92f
Config: use const char*
dimitry-ishenko May 23, 2023
fdecf4e
DlgMgr: add extern Orbiter pointer
dimitry-ishenko May 23, 2023
ccfcd04
ConsoleNG: fix title decl
dimitry-ishenko May 23, 2023
8012381
Keymap: use const char*
dimitry-ishenko May 23, 2023
a97f033
InitLog(): use const char*
dimitry-ishenko May 23, 2023
ebc0b77
Orbiter: clean-ups
dimitry-ishenko May 23, 2023
f7c608c
PlaybackEvent & children: use const char*
dimitry-ishenko May 23, 2023
d21ba6d
PlanetarySystem: fix forward decls
dimitry-ishenko May 23, 2023
37d671e
Launchpad: mark string literal as const
dimitry-ishenko May 23, 2023
56b2ec0
TabExtra.cpp: explicit char* casts
dimitry-ishenko May 23, 2023
970f700
DefVideoTab: const PSTR -> PCSTR
dimitry-ishenko May 23, 2023
aa3c65b
DlgCapture: explicit char* cast
dimitry-ishenko May 23, 2023
c70354d
DlgCamera: explicit char* casts
dimitry-ishenko May 23, 2023
325bf57
DlgFocus: explicit char* cast
dimitry-ishenko May 23, 2023
3bb777f
DlgHelp: explicit char* cast
dimitry-ishenko May 23, 2023
2b8c93c
DlgFunction: explicit char* cast
dimitry-ishenko May 23, 2023
81460fc
DlgInfo: explicit char* cast
dimitry-ishenko May 23, 2023
6d6659e
DlgMap: explicit char* cast
dimitry-ishenko May 23, 2023
ae7af09
DlgMenuCfg: explicit char* cast
dimitry-ishenko May 23, 2023
523d994
DlgRecorder: explicit char* cast
dimitry-ishenko May 23, 2023
af6b3e6
DlgTacc: explicit char* cast
dimitry-ishenko May 23, 2023
f177a08
Matrix: fix free functions
dimitry-ishenko May 23, 2023
7ce803e
CELBODY2: explicit char* cast
dimitry-ishenko May 23, 2023
55a02c7
RigidBody: fix free functions
dimitry-ishenko May 23, 2023
2a7bd2e
LogOut_Obsolete(): use const char*
dimitry-ishenko May 24, 2023
26a9652
Select: use const char*
dimitry-ishenko May 24, 2023
0e97aa1
Defpanel.cpp: mark string literal as const
dimitry-ishenko May 24, 2023
3e5185e
Vessel: L-value can't bind to a temp value
dimitry-ishenko May 31, 2023
6248991
InputBox: use const char*
dimitry-ishenko May 24, 2023
a20ebca
MenuInfoBar: explicit char* cast
dimitry-ishenko May 24, 2023
ee3b67f
Instrument_OPlanetAlign: explicit char* cast
dimitry-ishenko May 24, 2023
59547f7
Instrument_Comms: explicit char* cast
dimitry-ishenko May 24, 2023
52c5bb9
Instrument: clean-ups
dimitry-ishenko Jul 8, 2023
d9fbffc
Instrument_Docking: explicit char* cast
dimitry-ishenko May 24, 2023
05fee48
Instrument_HSI: explicit char* cast
dimitry-ishenko May 24, 2023
4602019
Instrument_Landing: explicit char* cast
dimitry-ishenko May 24, 2023
81f9811
Instrument_MapOld: explicit char* cast
dimitry-ishenko May 24, 2023
284349a
Instrument_Map: explicit char* cast
dimitry-ishenko May 24, 2023
989e962
Instrument_Orbit: explicit char* cast
dimitry-ishenko May 24, 2023
0663a58
Instrument_Surface: explicit char* cast
dimitry-ishenko May 24, 2023
5d6afee
Instrument_OSync: explicit char* cast
dimitry-ishenko May 24, 2023
a31f0b7
Instrument_Transfer: explicit char* cast
dimitry-ishenko May 24, 2023
17a550a
CelestialSphere: explicit char* cast
dimitry-ishenko May 24, 2023
224f8a1
GraphicsAPI.cpp: use explicit wchar_t* cast
dimitry-ishenko May 24, 2023
fe33be1
GDIFont: mark string literals as const
dimitry-ishenko May 24, 2023
9f19042
tilemgr2_imp.hpp: add missing extern variables
dimitry-ishenko May 24, 2023
cf3b2ff
ExtraRender.cpp: explicit char* cast
dimitry-ishenko May 24, 2023
76c1c82
VObject: mark string literal as const
dimitry-ishenko May 24, 2023
c67ad7f
D3D7Enum: use const CHAR*
dimitry-ishenko May 24, 2023
b40cc6e
OrbiterGraphics: use const TCHAR*
dimitry-ishenko May 24, 2023
662632c
Scene: mark string literals as const
dimitry-ishenko May 25, 2023
a4362ec
VSOPOBJ: use const char*
dimitry-ishenko May 25, 2023
1cbd7e9
EarthAtmosphere_*: explicit char* casts
dimitry-ishenko May 25, 2023
e74ba8e
VenusAtmosphere_2006: explicit char* casts
dimitry-ishenko May 25, 2023
9318cc7
MarsAtmosphere_2006: explicit char* casts
dimitry-ishenko May 25, 2023
6322911
CsphereManager: fix ODR violation
dimitry-ishenko May 25, 2023
1265af6
cd2com: use const char*
dimitry-ishenko May 25, 2023
827607c
ReadData: use const char*
dimitry-ishenko May 25, 2023
5c4959c
Satsat.h: mark string literal as const
dimitry-ishenko May 25, 2023
62994a6
Moon: explicit char* cast
dimitry-ishenko May 25, 2023
744b6a4
ModuleDate: explicit char* cast
dimitry-ishenko May 25, 2023
8c7a905
TabbedDialog: add forward decls
dimitry-ishenko May 26, 2023
da8f01d
Dragonfly: clean-ups
dimitry-ishenko May 27, 2023
ed4ab5c
Atlantis: clean-ups
dimitry-ishenko May 27, 2023
9c42729
DeltaGlider: clean-ups
dimitry-ishenko May 27, 2023
3146288
ShuttleA: explicit char* casts
dimitry-ishenko May 27, 2023
2d92b9e
ScriptVessel: explicit char* cast
dimitry-ishenko May 27, 2023
b1d9bd8
LuaScript: clean-ups
dimitry-ishenko May 27, 2023
35a4577
ExtMFD: explicit char* casts
dimitry-ishenko May 27, 2023
3b94e73
FlightData: explicit char* casts
dimitry-ishenko May 27, 2023
b20069e
Framerate: explicit char* casts
dimitry-ishenko May 27, 2023
84f0fc7
AtmConfig: explicit char* casts
dimitry-ishenko May 27, 2023
b327104
ConsoleCfg: explicit char* casts
dimitry-ishenko May 27, 2023
6d2dfb3
LuaConsole: explicit char* casts
dimitry-ishenko May 27, 2023
3b391c7
LuaMFD: explicit char* casts
dimitry-ishenko May 27, 2023
e6e39f4
Meshdebug: explicit char* casts
dimitry-ishenko May 27, 2023
2ce4389
Rcontrol: explicit char* casts
dimitry-ishenko May 27, 2023
9d016f7
ScnEditor: explicit char* casts
dimitry-ishenko May 27, 2023
c09e7de
ScriptMFD: explicit char* casts
dimitry-ishenko May 27, 2023
4460b72
TrackIR: explicit char* casts
dimitry-ishenko May 27, 2023
ae11baa
TransX: clean-ups
dimitry-ishenko May 28, 2023
10dffa4
HST: explicit char* casts
dimitry-ishenko May 28, 2023
cf3def0
D3D7Client: clean-ups
dimitry-ishenko May 28, 2023
ff1685a
XRSound: fix return value
dimitry-ishenko Jun 1, 2023
7fe98ac
D3D9Client: not1 and ptr_fun are deprecated
dimitry-ishenko Jun 1, 2023
c274037
D3D9Util: add ptr() function template
dimitry-ishenko Jun 2, 2023
7cb27a9
AtmoControls: explict char* casts
dimitry-ishenko Jun 2, 2023
081b9b1
CloudManager: use ptr() to take addr of a temp
dimitry-ishenko Jun 2, 2023
957c2f0
D3D9Client: use ptr() to take addr of a temp
dimitry-ishenko Jun 2, 2023
04d6384
D3D9Config: explicit char* casts
dimitry-ishenko Jun 2, 2023
059bd07
D3D9Client: explicit char* casts
dimitry-ishenko Jun 2, 2023
e1c6880
D3D9Effect: use ptr() to take addr of a temp
dimitry-ishenko Jun 2, 2023
4396698
CD3DFramework9: explicit char* casts
dimitry-ishenko Jun 2, 2023
f8dd5f9
D3D9Pad: use ptr() to take addr of a temp
dimitry-ishenko Jun 2, 2023
d0887cb
D3D9Effect: fix types
dimitry-ishenko Jun 2, 2023
2f468e9
D3D9Pad: fix types
dimitry-ishenko Jun 2, 2023
5b3da8f
D3D9Surface: explicit char* casts
dimitry-ishenko Jun 2, 2023
da0dabd
DebugControls: explicit char* casts
dimitry-ishenko Jun 2, 2023
8977fa0
HazeManager2: use ptr() to take addr of a temp
dimitry-ishenko Jun 2, 2023
ece5167
ImageProcessing: use ptr() to take addr of a temp
dimitry-ishenko Jun 2, 2023
212d693
D3D9InitLog: take const char*
dimitry-ishenko Jun 2, 2023
bf8956c
D3D9Mesh: use ptr() to take addr of a temp
dimitry-ishenko Jun 2, 2023
c069cb7
OapiExtension: explicit char* casts
dimitry-ishenko Jun 2, 2023
02bbf4e
RunwayLights: use ptr() to take addr of a temp
dimitry-ishenko Jun 2, 2023
0fc80b4
Scene: use ptr() to take addr of a temp
dimitry-ishenko Jun 2, 2023
4c06c1c
VBMESH: use ptr() to take addr of a temp
dimitry-ishenko Jun 2, 2023
9365cab
SurfaceManager: use ptr() to take addr of a temp
dimitry-ishenko Jun 2, 2023
b073e13
TileLabel: auto_ptr was deprecated
dimitry-ishenko Jun 2, 2023
a6f194b
Tile: use ptr() to take addr of a temp
dimitry-ishenko Jun 2, 2023
35e20f9
VBase: use ptr() to take addr of a temp
dimitry-ishenko Jun 2, 2023
8fe1b42
VideoTab: explicit char* casts
dimitry-ishenko Jun 2, 2023
8c197ae
vObject: use ptr() to take addr of a temp
dimitry-ishenko Jun 2, 2023
afa69e3
vPlanet: use ptr() to take addr of a temp
dimitry-ishenko Jun 2, 2023
e3d01fb
vPlanet: fixes
dimitry-ishenko Jun 2, 2023
16e3c2d
vVessel: use ptr() to take addr of a temp
dimitry-ishenko Jun 2, 2023
5882e03
D3D9Mesh: fix type
dimitry-ishenko Jun 2, 2023
9549fd9
Scene: take const param
dimitry-ishenko Jun 2, 2023
3f18985
vObject: take const params
dimitry-ishenko Jun 2, 2023
a65dc68
WindowManager: use range-based for-loop
dimitry-ishenko Jun 2, 2023
9006191
DrawOrbits: fixes
dimitry-ishenko Jun 2, 2023
dcd6fd5
DX9ExtMFD: explicit char* casts
dimitry-ishenko Jun 2, 2023
88d6b0a
GenericCamera: fixes
dimitry-ishenko Jun 2, 2023
331f9bb
TerrainToolBox: fixes
dimitry-ishenko Jun 2, 2023
5fed157
Fix tests
dimitry-ishenko Jun 12, 2023
632f1c4
Set c++ standard to c++20
dimitry-ishenko Jul 8, 2023
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
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ cmake_minimum_required(VERSION 3.19)
# Set the project name
project (Orbiter VERSION 21.7.24)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

# Some functions to simplify debugging CMake scripts
include(CMakePrintHelpers)

Expand Down
28 changes: 14 additions & 14 deletions OVP/D3D7Client/D3D7Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "D3D7Config.h"
#include "orbitersdk.h"

static char *cfgfile = "D3D7Client.cfg";
static const char *cfgfile = "D3D7Client.cfg";

// ==============================================================
// default values
Expand Down Expand Up @@ -56,17 +56,17 @@ bool D3D7Config::ReadParams ()

FILEHANDLE hFile = oapiOpenFile (cfgfile, FILE_IN, ROOT);
if (!hFile) return false;
if (oapiReadItem_int (hFile, "PlanetPreloadMode", i))
if (oapiReadItem_int (hFile, (char*)"PlanetPreloadMode", i))
PlanetPreloadMode = max (0, min (1, i));
if (oapiReadItem_int (hFile, "PlanetTexLoadFreq", i))
if (oapiReadItem_int (hFile, (char*)"PlanetTexLoadFreq", i))
PlanetLoadFrequency = max (1, min (1000, i));
if (oapiReadItem_int (hFile, "PlanetMipmapMode", i))
if (oapiReadItem_int (hFile, (char*)"PlanetMipmapMode", i))
PlanetMipmapMode = max (0, min (2, i));
if (oapiReadItem_int (hFile, "PlanetAnisoMode", i))
if (oapiReadItem_int (hFile, (char*)"PlanetAnisoMode", i))
PlanetAnisoMode = max (1, min (16, i));
if (oapiReadItem_int (hFile, "PlanetTileLoadFlags", i))
if (oapiReadItem_int (hFile, (char*)"PlanetTileLoadFlags", i))
PlanetTileLoadFlags = max(1, min (3, i));
if (oapiReadItem_float (hFile, "PlanetMipmapBias", d))
if (oapiReadItem_float (hFile, (char*)"PlanetMipmapBias", d))
PlanetMipmapBias = max (-1.0, min (1.0, d));
oapiCloseFile (hFile, FILE_IN);
return true;
Expand All @@ -75,11 +75,11 @@ bool D3D7Config::ReadParams ()
void D3D7Config::WriteParams ()
{
FILEHANDLE hFile = oapiOpenFile (cfgfile, FILE_OUT, ROOT);
oapiWriteItem_int (hFile, "PlanetPreloadMode", PlanetPreloadMode);
oapiWriteItem_int (hFile, "PlanetTexLoadFreq", PlanetLoadFrequency);
oapiWriteItem_int (hFile, "PlanetAnisoMode", PlanetAnisoMode);
oapiWriteItem_int (hFile, "PlanetMipmapMode", PlanetMipmapMode);
oapiWriteItem_int (hFile, "PlanetTileLoadFlags", PlanetTileLoadFlags);
oapiWriteItem_float (hFile, "PlanetMipmapBias", PlanetMipmapBias);
oapiWriteItem_int (hFile, (char*)"PlanetPreloadMode", PlanetPreloadMode);
oapiWriteItem_int (hFile, (char*)"PlanetTexLoadFreq", PlanetLoadFrequency);
oapiWriteItem_int (hFile, (char*)"PlanetAnisoMode", PlanetAnisoMode);
oapiWriteItem_int (hFile, (char*)"PlanetMipmapMode", PlanetMipmapMode);
oapiWriteItem_int (hFile, (char*)"PlanetTileLoadFlags", PlanetTileLoadFlags);
oapiWriteItem_float (hFile, (char*)"PlanetMipmapBias", PlanetMipmapBias);
oapiCloseFile (hFile, FILE_OUT);
}
}
12 changes: 4 additions & 8 deletions OVP/D3D7Client/D3D7Extra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@

char *D3D7ClientCfg::Name ()
{
static char *name = "D3D7 Graphics Configuration";
return name;
return (char*)"D3D7 Graphics Configuration";
}

char *D3D7ClientCfg::Description ()
{
static char *desc = "Configure the D3D7 graphics client plugin.\r\n\r\nThis allows to fine-tune rendering options and visual quality.";
return desc;
return (char*)"Configure the D3D7 graphics client plugin.\r\n\r\nThis allows to fine-tune rendering options and visual quality.";
}


Expand All @@ -39,14 +37,12 @@ D3D7PlanetRenderCfg::D3D7PlanetRenderCfg (oapi::D3D7Client *_gc)

char *D3D7PlanetRenderCfg::Name ()
{
static char *name = "Planet Rendering Options";
return name;
return (char*)"Planet Rendering Options";
}

char *D3D7PlanetRenderCfg::Description ()
{
static char *desc = "Configure the rendering options for planets and other celestial objects.";
return desc;
return (char*)"Configure the rendering options for planets and other celestial objects.";
}

bool D3D7PlanetRenderCfg::clbkOpen (HWND hLaunchpad)
Expand Down
4 changes: 2 additions & 2 deletions OVP/D3D7Client/RingMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class RingManager {

protected:
D3D7Mesh *CreateRing (double irad, double orad, int nsect);
DWORD RingManager::LoadTextures ();
DWORD LoadTextures ();

private:
static const oapi::D3D7Client *gc;
Expand All @@ -54,4 +54,4 @@ class RingManager {
double irad, orad;
};

#endif // !__RINGMGR_H
#endif // !__RINGMGR_H
6 changes: 3 additions & 3 deletions OVP/D3D7Client/TileMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ typedef struct {
class D3D7Config;
class vPlanet;

void ApplyPatchTextureCoordinates (VBMESH &mesh, LPDIRECT3DVERTEXBUFFER7 vtx, const TEXCRDRANGE &range);

class TileManager {
friend class TileBuffer;
friend class CSphereManager;
Expand Down Expand Up @@ -192,8 +194,6 @@ class TileManager {
double objsize; // planet radius
bool bfog; // distance fog flag
} RenderParam;

friend void ApplyPatchTextureCoordinates (VBMESH &mesh, LPDIRECT3DVERTEXBUFFER7 vtx, const TEXCRDRANGE &range);
};


Expand Down Expand Up @@ -243,4 +243,4 @@ class TileBuffer {
} loadqueue[MAXQUEUE];
};

#endif // !__TILEMGR_H
#endif // !__TILEMGR_H
2 changes: 1 addition & 1 deletion OVP/D3D7Client/VObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void vObject::GlobalInit (const D3D7Client *gclient)
gc = gclient;

for (int i = 0; i < 3; i++) {
static char *fname[3] = {"Ball.dds","Ball2.dds","Ball3.dds"};
static const char *fname[3] = {"Ball.dds","Ball2.dds","Ball3.dds"};
gc->GetTexMgr()->LoadTexture (fname[i], blobtex+i, 0);
}
}
Expand Down
3 changes: 2 additions & 1 deletion OVP/D3D7Client/tilemgr2_imp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#ifndef __TILEMGR2_IMP_HPP
#define __TILEMGR2_IMP_HPP

#include "Camera.h"
#include "tilemgr2.h"

// -----------------------------------------------------------------------
Expand Down Expand Up @@ -292,4 +293,4 @@ void TileManager2<TileType>::CheckCoverage (const QuadTreeNode<TileType> *node,
}
}

#endif // !__TILEMGR2_IMP_HPP
#endif // !__TILEMGR2_IMP_HPP
4 changes: 2 additions & 2 deletions OVP/D3D7Client/ztreemgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class TreeFileHeader {

public:
TreeFileHeader();
size_t TreeFileHeader::fwrite(FILE *f);
bool TreeFileHeader::fread(FILE *f);
size_t fwrite(FILE *f);
bool fread(FILE *f);

private:
BYTE magic[4]; // file ID and version
Expand Down
42 changes: 21 additions & 21 deletions OVP/D3D9Client/AtmoControls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void Create()
vObj = NULL;
hDlg = NULL;

dwCmd = oapiRegisterCustomCmd("D3D9 Atmospheric Controls", "This dialog allows to control various atmospheric parameters and effects", OpenDlgClbk, NULL);
dwCmd = oapiRegisterCustomCmd((char*)"D3D9 Atmospheric Controls", (char*)"This dialog allows to control various atmospheric parameters and effects", OpenDlgClbk, NULL);

memset(Slider,0,sizeof(Slider));

Expand Down Expand Up @@ -238,30 +238,30 @@ void OpenDlgClbk(void *context)
ConfigSlider(IDC_ATM_AUX4, 0.0, 8.0); // Mie Phase-B
ConfigSlider(IDC_ATM_AUX5, 0.0, 5.0, 8); // Clouds intensity
// -------------------------------------------------------
CreateToolTip(IDC_ATM_TW_DST, hDlg, "Light travel distance behind terminator");
CreateToolTip(IDC_ATM_GREEN, hDlg, "Green wave lenght. (Green balance)");
CreateToolTip(IDC_ATM_TW_BRI, hDlg, "Terrain brightness during twilight");
CreateToolTip(IDC_ATM_RPOW, hDlg, "Main control for atmospheric rayleigh color composition (4.0 for the Earth)");
CreateToolTip(IDC_ATM_MPOW, hDlg, "Main control for atmospheric mie color composition");
CreateToolTip(IDC_ATM_HEIGHT, hDlg, "Atmosphere Ray scale height (7km - 9km for the Earth)");
CreateToolTip(IDC_ATM_M_HEIGHT, hDlg, "Atmosphere Mie scale height (0.6km - 2km for the Earth)");
CreateToolTip(IDC_ATM_TW_DST, hDlg, (char*)"Light travel distance behind terminator");
CreateToolTip(IDC_ATM_GREEN, hDlg, (char*)"Green wave lenght. (Green balance)");
CreateToolTip(IDC_ATM_TW_BRI, hDlg, (char*)"Terrain brightness during twilight");
CreateToolTip(IDC_ATM_RPOW, hDlg, (char*)"Main control for atmospheric rayleigh color composition (4.0 for the Earth)");
CreateToolTip(IDC_ATM_MPOW, hDlg, (char*)"Main control for atmospheric mie color composition");
CreateToolTip(IDC_ATM_HEIGHT, hDlg, (char*)"Atmosphere Ray scale height (7km - 9km for the Earth)");
CreateToolTip(IDC_ATM_M_HEIGHT, hDlg, (char*)"Atmosphere Mie scale height (0.6km - 2km for the Earth)");
// -------------------------------------------------------
CreateToolTip(IDC_ATM_TRB, hDlg, "Terrain/Ocean brightness control (default 1.0)");
CreateToolTip(IDC_ATM_TRGAMMA, hDlg, "Terrain/Ocean gamma control value (default 1.0)");
CreateToolTip(IDC_ATM_TRLIGHTSHAD, hDlg, "Terrain light and shadow boost");
CreateToolTip(IDC_ATM_TRB, hDlg, (char*)"Terrain/Ocean brightness control (default 1.0)");
CreateToolTip(IDC_ATM_TRGAMMA, hDlg, (char*)"Terrain/Ocean gamma control value (default 1.0)");
CreateToolTip(IDC_ATM_TRLIGHTSHAD, hDlg, (char*)"Terrain light and shadow boost");
// -------------------------------------------------------
CreateToolTip(IDC_ATM_RAY, hDlg, "Overall control for rayleigh scattering (i.e. Haze stickness, atmosphere transparency, optical depth");
CreateToolTip(IDC_ATM_IN, hDlg, "Rayleigh in-scatter out-scatter ratio (1.0 nominal)");
CreateToolTip(IDC_ATM_RPHASE, hDlg, "Ambient light level for buildings");
CreateToolTip(IDC_ATM_RAY, hDlg, (char*)"Overall control for rayleigh scattering (i.e. Haze stickness, atmosphere transparency, optical depth");
CreateToolTip(IDC_ATM_IN, hDlg, (char*)"Rayleigh in-scatter out-scatter ratio (1.0 nominal)");
CreateToolTip(IDC_ATM_RPHASE, hDlg, (char*)"Ambient light level for buildings");
// -------------------------------------------------------
CreateToolTip(IDC_ATM_MIE, hDlg, "Overall scale factor for mie scattering. (Mie-particle density)");
CreateToolTip(IDC_ATM_MPHASE, hDlg, "Directional strength of Henyey-Greenstein phase function");
CreateToolTip(IDC_ATM_MIEIN, hDlg, "Mie in-scatter out-scatter ratio (1.0 nominal)");
CreateToolTip(IDC_ATM_MIE, hDlg, (char*)"Overall scale factor for mie scattering. (Mie-particle density)");
CreateToolTip(IDC_ATM_MPHASE, hDlg, (char*)"Directional strength of Henyey-Greenstein phase function");
CreateToolTip(IDC_ATM_MIEIN, hDlg, (char*)"Mie in-scatter out-scatter ratio (1.0 nominal)");
// -------------------------------------------------------
CreateToolTip(IDC_ATM_AUX2, hDlg, "Altitude for cloud lighting calculations");
CreateToolTip(IDC_ATM_AUX3, hDlg, "'HDR' Exposure factor");
CreateToolTip(IDC_ATM_AUX4, hDlg, "Omnidirectional mie scattering scale factor");
CreateToolTip(IDC_ATM_AUX5, hDlg, "[Dual purpose] Clouds intensity [on surface]. Multiscatter light level [on orbit]");
CreateToolTip(IDC_ATM_AUX2, hDlg, (char*)"Altitude for cloud lighting calculations");
CreateToolTip(IDC_ATM_AUX3, hDlg, (char*)"'HDR' Exposure factor");
CreateToolTip(IDC_ATM_AUX4, hDlg, (char*)"Omnidirectional mie scattering scale factor");
CreateToolTip(IDC_ATM_AUX5, hDlg, (char*)"[Dual purpose] Clouds intensity [on surface]. Multiscatter light level [on orbit]");

SendDlgItemMessageA(hDlg, IDC_ATM_MODE, CB_RESETCONTENT, 0, 0);
SendDlgItemMessageA(hDlg, IDC_ATM_MODE, CB_ADDSTRING, 0, (LPARAM)"Auto");
Expand Down
4 changes: 2 additions & 2 deletions OVP/D3D9Client/CloudMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ void CloudManager::RenderTile (int lvl, int hemisp, int ilat, int nlat, int ilng
VBMESH &mesh = PATCH_TPL[lvl][ilat]; // patch template

if (range.tumin == 0 && range.tumax == 1) {
HR(FX->SetVector(eTexOff, &D3DXVECTOR4(1.0f, 0.0f, 1.0f, 0.0f)));
HR(FX->SetVector(eTexOff, ptr(D3DXVECTOR4(1.0f, 0.0f, 1.0f, 0.0f))));
}
else {
float tuscale = range.tumax-range.tumin, tuofs = range.tumin;
float tvscale = range.tvmax-range.tvmin, tvofs = range.tvmin;
HR(FX->SetVector(eTexOff, &D3DXVECTOR4(tuscale,tuofs,tvscale,tvofs)));
HR(FX->SetVector(eTexOff, ptr(D3DXVECTOR4(tuscale,tuofs,tvscale,tvofs))));
}
HR(FX->SetMatrix(eW, &mWorld));
HR(FX->SetTexture(eTex0, tex)); // Diffuse Texture
Expand Down
22 changes: 11 additions & 11 deletions OVP/D3D9Client/D3D9Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -708,26 +708,26 @@ void D3D9Client::SketchPadTest()
pSkp->QuickPen(0xA0000000, 3.0f);
pSkp->PushWorldTransform();

pSkp->SetWorldScaleTransform2D(&FVECTOR2(100.0f, 100.0f), &pos0);
pSkp->SetWorldScaleTransform2D(ptr(FVECTOR2(100.0f, 100.0f)), &pos0);
pSkp->DrawPoly(hColors);
pSkp->DrawPoly(hOutline);

pSkp->SetWorldScaleTransform2D(&FVECTOR2(100.0f, 100.0f), &pos1);
pSkp->SetWorldScaleTransform2D(ptr(FVECTOR2(100.0f, 100.0f)), &pos1);
pSkp->DrawPoly(hOutline2);

pSkp->SetWorldScaleTransform2D(&FVECTOR2(100.0f, 100.0f), &pos2);
pSkp->SetWorldScaleTransform2D(ptr(FVECTOR2(100.0f, 100.0f)), &pos2);
pSkp->DrawPoly(hStrip);

pSkp->SetWorldScaleTransform2D(&FVECTOR2(100.0f, 100.0f), &pos3);
pSkp->SetWorldScaleTransform2D(ptr(FVECTOR2(100.0f, 100.0f)), &pos3);
pSkp->DrawPoly(hStrip2);

pSkp->SetWorldScaleTransform2D(&FVECTOR2(100.0f, 100.0f), &pos4);
pSkp->SetWorldScaleTransform2D(ptr(FVECTOR2(100.0f, 100.0f)), &pos4);
pSkp->QuickPen(0xFF000000, 25.0f);
pSkp->DrawPoly(hOutline);

hSrc = clbkLoadSurface("generic/noisep.dds", OAPISURFACE_TEXTURE);

pSkp->SetWorldScaleTransform2D(&FVECTOR2(1.0f, 1.0f), &pos5);
pSkp->SetWorldScaleTransform2D(ptr(FVECTOR2(1.0f, 1.0f)), &pos5);

FVECTOR2 pt[4];
pt[0] = FVECTOR2(-100.0f, -100.0f);
Expand Down Expand Up @@ -823,7 +823,7 @@ void D3D9Client::clbkCloseSession(bool fastclose)
void D3D9Client::clbkDestroyRenderWindow (bool fastclose)
{
_TRACE;
oapiWriteLog("D3D9: [Destroy Render Window Called]");
oapiWriteLog((char*)"D3D9: [Destroy Render Window Called]");
LogAlw("============= clbkDestroyRenderWindow ===========");

#ifdef _NVAPI_H
Expand Down Expand Up @@ -986,7 +986,7 @@ void D3D9Client::PushSketchpad(SURFHANDLE surf, D3D9Pad *pSkp) const

void D3D9Client::PushRenderTarget(LPDIRECT3DSURFACE9 pColor, LPDIRECT3DSURFACE9 pDepthStencil, int code) const
{
static char *labels[] = { "NULL", "MAIN", "ENV", "CUSTOMCAM", "SHADOWMAP", "PICK", "SKETCHPAD", "OVERLAY" };
static const char *labels[] = { "NULL", "MAIN", "ENV", "CUSTOMCAM", "SHADOWMAP", "PICK", "SKETCHPAD", "OVERLAY" };

RenderTgtData data;
data.pColor = pColor;
Expand Down Expand Up @@ -1025,7 +1025,7 @@ void D3D9Client::AlterRenderTarget(LPDIRECT3DSURFACE9 pColor, LPDIRECT3DSURFACE9

void D3D9Client::PopRenderTargets() const
{
static char *labels[] = { "NULL", "MAIN", "ENV", "CUSTOMCAM", "SHADOWMAP", "PICK", "SKETCHPAD", "OVERLAY" };
static const char *labels[] = { "NULL", "MAIN", "ENV", "CUSTOMCAM", "SHADOWMAP", "PICK", "SKETCHPAD", "OVERLAY" };

assert(RenderStack.empty() == false);

Expand Down Expand Up @@ -2324,7 +2324,7 @@ bool D3D9Client::clbkScaleBlt (SURFHANDLE tgt, DWORD tgtx, DWORD tgty, DWORD tgt
SURFHANDLE src, DWORD srcx, DWORD srcy, DWORD srcw, DWORD srch, DWORD flag) const
{

if (src==NULL) { oapiWriteLog("ERROR: oapiBlt() Source surface is NULL"); return false; }
if (src==NULL) { oapiWriteLog((char*)"ERROR: oapiBlt() Source surface is NULL"); return false; }

if (tgt==NULL) tgt = pFramework->GetBackBufferHandle();

Expand Down Expand Up @@ -2893,7 +2893,7 @@ void D3D9Client::SplashScreen()
SetTextColor(hDC, 0xE0A0A0);
SetBkMode(hDC,TRANSPARENT);

char *months[]={"???","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","???"};
const char *months[]={"???","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","???"};

DWORD d = oapiGetOrbiterVersion();
DWORD y = d/10000; d-=y*10000;
Expand Down
Loading