Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/orbitersim/orbiter into sta…
Browse files Browse the repository at this point in the history
…rtup_cleanup
  • Loading branch information
jarmonik committed Jan 9, 2024
2 parents eb8e1c0 + 205f8dd commit ccfccb0
Show file tree
Hide file tree
Showing 25 changed files with 8,829 additions and 7,423 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,30 @@ jobs:
- name: Install
working-directory: ${{ github.workspace }}/out/build/windows-${{ matrix.architecture }}-release
run: cmake --install . --prefix ${{ github.workspace }}/out/install

- name: List exports
working-directory: ${{ github.workspace }}/out/install/Orbiter
shell: cmd
run: |
dumpbin /EXPORTS Modules\Server\Orbiter.exe /OUT:exports_tmp0.txt
type exports_tmp0.txt | find " ?" > exports_tmp1.txt
for /F "tokens=4" %%F in (exports_tmp1.txt) do @echo %%F >> exports_tmp2.txt
undname exports_tmp2.txt | sort > exports.txt
del /Q exports_tmp*.txt
- name: Diff exports with Orbiter 2016
if: ${{ matrix.architecture == 'x86' }}
shell: cmd
continue-on-error: true
run: git diff -U0 --ignore-cr-at-eol --ignore-space-at-eol --no-index exports.2016.txt out/install/Orbiter/exports.txt

- name: Upload exports
uses: actions/upload-artifact@v4
with:
name: exports-${{ matrix.architecture }}
path: ${{ github.workspace }}/out/install/Orbiter/exports.txt
retention-days: 1

- name: Pack
if: ${{ github.ref == 'refs/heads/main' }}
working-directory: ${{ github.workspace }}/out/install/Orbiter
Expand All @@ -87,7 +110,7 @@ jobs:

- name: Upload Build Artifact
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/upload-artifact@v3.1.3
uses: actions/upload-artifact@v4
with:
name: Orbiter-${{ matrix.architecture }}
# A file, directory or wildcard pattern that describes what to upload
Expand All @@ -111,7 +134,7 @@ jobs:
uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: ./out

Expand Down
7,381 changes: 0 additions & 7,381 deletions GravityModels/jgmro_120d_sha.tab

This file was deleted.

7,381 changes: 7,381 additions & 0 deletions GravityModels/jgmro_120f_sha.tab

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions OVP/D3D9Client/D3D9Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,14 @@ void D3D9Client::clbkDestroyRenderWindow (bool fastclose)

}

// ==============================================================

void D3D9Client::clbkDebugString(const char* str)
{
D3D9DebugLog("%s", str);
}


// ==============================================================

void D3D9Client::PushSketchpad(SURFHANDLE surf, D3D9Pad *pSkp) const
Expand Down
2 changes: 2 additions & 0 deletions OVP/D3D9Client/D3D9Client.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ class D3D9Client : public GraphicsClient
*/
void clbkOptionChanged(DWORD cat, DWORD item);

void clbkDebugString(const char* str);

/**
* \brief Texture request
*
Expand Down
7 changes: 2 additions & 5 deletions OVP/D3D9Client/Surfmgr2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,6 @@ INT16 *SurfTile::ReadElevationFile (const char *name, int lvl, int ilat, int iln

if (e) {

//
//for (i = 0; i < ndat; i++) elev[i] = (trunc(float(e[i]) * (ehdr.scale / tgt_res)) + trunc(ehdr.offset / tgt_res)) * tgt_res;

if (ehdr.scale != tgt_res) { // rescale the data
double rescale = ehdr.scale / tgt_res;
for (i = 0; i < ndat; i++)
Expand Down Expand Up @@ -371,8 +368,8 @@ INT16 *SurfTile::ReadElevationFile (const char *name, int lvl, int ilat, int iln
phdr->scale = 1.0;
#endif
p += phdr->hdrsize;
rescale = (do_rescale = (phdr->scale != 1.0)) ? phdr->scale : 1.0;
offset = (do_shift = (phdr->offset != 0.0)) ? INT16(phdr->offset) : 0;
rescale = (do_rescale = (phdr->scale != tgt_res)) ? phdr->scale/tgt_res : 1.0;
offset = (do_shift = (phdr->offset != 0.0)) ? INT16(phdr->offset/tgt_res) : 0;

switch(phdr->dtype) {
case 0:
Expand Down
7 changes: 2 additions & 5 deletions OVP/D3D9Client/VPlanet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,12 +377,9 @@ vPlanet::vPlanet (OBJHANDLE _hObj, const Scene *scene) :
physics_patchres = *(DWORD*)oapiGetObjectParam (_hObj, OBJPRM_PLANET_SURFACEMAXLEVEL);
physics_patchres = min (physics_patchres, *(DWORD*)gc->GetConfigParam (CFGPRM_SURFACEMAXLEVEL));

// Push the graphics resolution higher than the one used for physics
// to enable more accurate bilinear interpolation of the terrain.
max_patchres = physics_patchres + 4;
//if (elev_mode == 1) max_patchres = physics_patchres + 4; // Push the graphics resolution higher than the one used for physics
//else max_patchres = physics_patchres; // to enable more accurate bilinear interpolation of the terrain.
// Works well on the Moon, not so well on high-res KSC.

max_patchres = min(max_patchres, *(DWORD*)gc->GetConfigParam(CFGPRM_SURFACEMAXLEVEL));

tilever = *(int*)oapiGetObjectParam (_hObj, OBJPRM_PLANET_TILEENGINE);
if (tilever < 2) {
Expand Down
4 changes: 4 additions & 0 deletions Orbitersdk/include/DrawAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
#include <assert.h>
#include <xmmintrin.h>

#if defined(_MSC_VER) && (_MSC_VER < 1920 ) // Microsoft Visual Studio Version 2017 and lower
#include <algorithm>
#endif

#ifdef D3D9CLIENT_EXPORTS
#include "d3dx9.h"
#endif
Expand Down
6 changes: 6 additions & 0 deletions Orbitersdk/include/GraphicsAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,12 @@ class OAPIFUNC GraphicsClient: public Module {
*/
virtual void clbkOptionChanged(DWORD cat, DWORD item) {}

/**
* \brief Print multiple debug strings onto a screen, will be cleared when printed on screen.
* \param str Text string to print
*/
virtual void clbkDebugString(const char *str) {}

/**
* \brief Texture request
*
Expand Down
11 changes: 11 additions & 0 deletions Orbitersdk/include/OrbiterAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
#include <math.h>
#include <vector>

#if defined(_MSC_VER) && (_MSC_VER < 1920 ) // Microsoft Visual Studio Version 2017 and lower
#include <algorithm>
#endif

extern "C" {
#include "Lua/lua.h"
}
Expand Down Expand Up @@ -2446,6 +2450,13 @@ OAPIFUNC void oapiRegisterModule (oapi::Module *module);
OAPIFUNC char *oapiDebugString ();


/**
* \brief Print multiple debug strings onto a screen, will be cleared when printed on screen.
* \param str Text string to print
*/
OAPIFUNC void oapiDebugString(const char*);


// ======================================================================
/**
* \defgroup ObjectAccess Object access functions
Expand Down
4 changes: 4 additions & 0 deletions Orbitersdk/include/VesselAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
#ifndef __VESSELAPI_H
#define __VESSELAPI_H

#if defined(_MSC_VER) && (_MSC_VER < 1920 ) // Microsoft Visual Studio Version 2017 and lower
#include <algorithm>
#endif

// reference frame flags
#define FRAME_ECL 0
#define FRAME_EQU 1
Expand Down
2 changes: 1 addition & 1 deletion Src/Celbody/Moon/Config/Moon.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ SidRotPeriod = 2360588.15
; === Visualisation Parameters ===
TileFormat = 2
LabelFormat = 2
MaxPatchResolution = 16 ; highest sphere patch level
MaxPatchResolution = 20 ; highest sphere patch level
ElevationResolution = 0.5 ; target resolution of elevation data [m]
HorizonExcess = 0.015 ; prevent mountain tops beyond sphere horizon from disappearing
MaxElevation = 10800
Expand Down
2 changes: 1 addition & 1 deletion Src/Celbody/Vsop87/Earth/Config/Earth.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ CloudMicrotextureAlt = 35e3 300e3
TileFormat = 2
CloudFormat = 2
LabelFormat = 2
MaxPatchResolution = 19 ; surface texture resolution limit (1-19)
MaxPatchResolution = 21 ; surface texture resolution limit (1-19)
MinCloudResolution = 1 ; cloud layer from this resolution
MaxCloudResolution = 9 ; highest cloud resolution level
ElevationResolution = 0.5 ; target resolution of elevation data [m]
Expand Down
2 changes: 1 addition & 1 deletion Src/Celbody/Vsop87/Mars/Config/Mars.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ AtmFogColor = 0.5 0.40 0.3
TileFormat = 2
LabelFormat = 2
AlbedoRGB = 0.52 0.36 0.16
MaxPatchResolution = 16 ; highest sphere patch level
MaxPatchResolution = 20 ; highest sphere patch level
ElevationResolution = 1
HorizonExcess = 0.035 ; prevent mountain tops beyond sphere horizon from disappearing
MinElevation = -8300 ; min surface elevation relative to mean radius
Expand Down
2 changes: 1 addition & 1 deletion Src/Orbiter/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#define PROP_SY8 9

#define SURF_MAX_PATCHLEVEL 14
#define SURF_MAX_PATCHLEVEL2 19
#define SURF_MAX_PATCHLEVEL2 21

class Mesh;
class PlanetarySystem;
Expand Down
10 changes: 5 additions & 5 deletions Src/Orbiter/MfdUser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "Psys.h"
#include "Nav.h"
#include <stdio.h>
#include <strstream>
#include <sstream>
#include <iomanip>
#include "Log.h"
#include "Util.h"
Expand Down Expand Up @@ -397,11 +397,11 @@ void GraphMFD::Plot (HDC hDC, int g, int h0, int h1, const char *title)
}
}
if (gf.absc_title[0]) {
ostrstream oss(cbuf, 64);
ostringstream oss(cbuf, 64);
oss << gf.absc_title;
if (gf.absc_tickscale != 1.0f) oss << " x " << 1.0/gf.absc_tickscale;
oss << '\0';
TextOut (hDC, (x0+x1)/2, y0+(3*ch)/4, oss.str(), strlen(oss.str()));
TextOut (hDC, (x0+x1)/2, y0+(3*ch)/4, oss.str().c_str(), strlen(oss.str().c_str()));
}

// ordinate ticks/labels
Expand Down Expand Up @@ -430,11 +430,11 @@ void GraphMFD::Plot (HDC hDC, int g, int h0, int h1, const char *title)
SetTextAlign (hDC, TA_CENTER);
if (gf.data_title[0]) {
SelectDefaultFont (hDC, 2);
ostrstream oss(cbuf, 64);
ostringstream oss(cbuf, 64);
oss << gf.data_title;
if (gf.data_tickscale != 1.0f) oss << " x " << 1.0/gf.data_tickscale;
oss << '\0';
TextOut (hDC, 0, (y0+y1)/2, oss.str(), strlen(oss.str()));
TextOut (hDC, 0, (y0+y1)/2, oss.str().c_str(), strlen(oss.str().c_str()));
}

// plot frame
Expand Down
Loading

0 comments on commit ccfccb0

Please sign in to comment.