Compare commits
72
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bad115cac0 | ||
|
|
696829a260 | ||
|
|
09cc52296d | ||
|
|
abc616b548 | ||
|
|
c3b9b9a524 | ||
|
|
2277ba38c7 | ||
|
|
97a72b4934 | ||
|
|
ecd4b9aab3 | ||
|
|
882ab6ae59 | ||
|
|
f3423dba60 | ||
|
|
39c1754a7f | ||
|
|
f190773790 | ||
|
|
5b34458439 | ||
|
|
59c9a55baa | ||
|
|
92f566f1d3 | ||
|
|
5b6ba959d9 | ||
|
|
675e7e6bdc | ||
|
|
07d1b0e882 | ||
|
|
f826f8c4b2 | ||
|
|
82f3c85343 | ||
|
|
3344c21c71 | ||
|
|
b2274fbbed | ||
|
|
cd80fffbe2 | ||
|
|
5e25bc9277 | ||
|
|
06d84d1d5b | ||
|
|
6661d1e10c | ||
|
|
6caf43f9e7 | ||
|
|
7b51c99439 | ||
|
|
1cf284bd6f | ||
|
|
1f27f8e39a | ||
|
|
caaad41e26 | ||
|
|
120055fa43 | ||
|
|
72bd67c6ef | ||
|
|
ac35f4d20f | ||
|
|
56e1055dec | ||
|
|
ed88c630ea | ||
|
|
da0f443f62 | ||
|
|
2eac2b8546 | ||
|
|
1d97e9f573 | ||
|
|
bd7ccccda6 | ||
|
|
f0f047e6c5 | ||
|
|
271f103ae3 | ||
|
|
99b893368b | ||
|
|
e4007bae99 | ||
|
|
6e8b4c3ee7 | ||
|
|
ccb35c7707 | ||
|
|
391ceaea11 | ||
|
|
feae4a2d56 | ||
|
|
70dfd6b8d4 | ||
|
|
a1f8e52ae8 | ||
|
|
a5525ba2b3 | ||
|
|
1c5449fcd6 | ||
|
|
359152c8d1 | ||
|
|
2c41742b99 | ||
|
|
a20342ed48 | ||
|
|
d424cdaad3 | ||
|
|
141bb7dec4 | ||
|
|
2874e0eade | ||
|
|
6520925c5b | ||
|
|
77384be44a | ||
|
|
7c5ad2405e | ||
|
|
250c0c54a8 | ||
|
|
2930727a87 | ||
|
|
a281b46214 | ||
|
|
8a7fd33b2b | ||
|
|
305a501ef3 | ||
|
|
d073c54c0d | ||
|
|
705bd47bcd | ||
|
|
4128259e8e | ||
|
|
44bdb42fd0 | ||
|
|
7de0f9f524 | ||
|
|
1e3ac37c96 |
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
dist
|
dist
|
||||||
.DS_Store
|
.DS_Store
|
||||||
install
|
install*/
|
||||||
3rdParty
|
3rdParty
|
||||||
3rdParty.x64
|
3rdParty.x64
|
||||||
boost_1_44_0
|
boost_1_44_0
|
||||||
|
|||||||
+4
-4
@@ -1,11 +1,11 @@
|
|||||||
[submodule "simgear"]
|
[submodule "simgear"]
|
||||||
path = simgear
|
path = simgear
|
||||||
url = ../simgear
|
url = ../simgear
|
||||||
branch = release/2018.3
|
branch = next
|
||||||
[submodule "flightgear"]
|
[submodule "flightgear"]
|
||||||
path = flightgear
|
path = flightgear
|
||||||
url = ../flightgear
|
url = ../flightgear
|
||||||
branch = release/2018.3
|
branch = next
|
||||||
[submodule "fgrun"]
|
[submodule "fgrun"]
|
||||||
path = fgrun
|
path = fgrun
|
||||||
url = ../fgrun
|
url = ../fgrun
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
[submodule "fgdata"]
|
[submodule "fgdata"]
|
||||||
path = fgdata
|
path = fgdata
|
||||||
url = ../fgdata
|
url = ../fgdata
|
||||||
branch = release/2018.3
|
branch = next
|
||||||
[submodule "windows-3rd-party"]
|
[submodule "windows-3rd-party"]
|
||||||
path = windows-3rd-party
|
path = windows-3rd-party
|
||||||
url = ../windows-3rd-party
|
url = ../windows-3rd-party
|
||||||
@@ -21,4 +21,4 @@
|
|||||||
[submodule "getstart"]
|
[submodule "getstart"]
|
||||||
path = getstart
|
path = getstart
|
||||||
url = ../getstart
|
url = ../getstart
|
||||||
branch = release/2018.3
|
branch = next
|
||||||
|
|||||||
@@ -85,6 +85,8 @@ Source: "{#ThirdPartyDir}\3rdParty\bin\libintl-8.dll"; DestDir: "{app}\bin"; Che
|
|||||||
Source: "{#ThirdPartyDir}\3rdParty\bin\CrashRpt1403.dll"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode
|
Source: "{#ThirdPartyDir}\3rdParty\bin\CrashRpt1403.dll"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode
|
||||||
Source: "{#ThirdPartyDir}\3rdParty\bin\crashrpt_lang.ini"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode
|
Source: "{#ThirdPartyDir}\3rdParty\bin\crashrpt_lang.ini"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode
|
||||||
Source: "{#ThirdPartyDir}\3rdParty\bin\CrashSender1403.exe"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode
|
Source: "{#ThirdPartyDir}\3rdParty\bin\CrashSender1403.exe"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode
|
||||||
|
Source: "{#ThirdPartyDir}\3rdParty\bin\dbus-1-3.dll"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode
|
||||||
|
Source: "{#ThirdPartyDir}\3rdParty\bin\event_core.dll"; DestDir: "{app}\bin"; Check: not Is64BitInstallMode
|
||||||
|
|
||||||
; 64 bits install
|
; 64 bits install
|
||||||
Source: "{#InstallDir64}\bin\*.*"; DestDir: "{app}\bin"; Excludes: "{#ExcludedBinaries}"; Flags: ignoreversion recursesubdirs; Check: Is64BitInstallMode
|
Source: "{#InstallDir64}\bin\*.*"; DestDir: "{app}\bin"; Excludes: "{#ExcludedBinaries}"; Flags: ignoreversion recursesubdirs; Check: Is64BitInstallMode
|
||||||
@@ -99,6 +101,8 @@ Source: "{#ThirdPartyDir}\3rdParty.x64\bin\libintl-8.dll"; DestDir: "{app}\bin";
|
|||||||
Source: "{#ThirdPartyDir}\3rdParty.x64\bin\CrashRpt1403.dll"; DestDir: "{app}\bin"; Check: Is64BitInstallMode
|
Source: "{#ThirdPartyDir}\3rdParty.x64\bin\CrashRpt1403.dll"; DestDir: "{app}\bin"; Check: Is64BitInstallMode
|
||||||
Source: "{#ThirdPartyDir}\3rdParty.x64\bin\crashrpt_lang.ini"; DestDir: "{app}\bin"; Check: Is64BitInstallMode
|
Source: "{#ThirdPartyDir}\3rdParty.x64\bin\crashrpt_lang.ini"; DestDir: "{app}\bin"; Check: Is64BitInstallMode
|
||||||
Source: "{#ThirdPartyDir}\3rdParty.x64\bin\CrashSender1403.exe"; DestDir: "{app}\bin"; Check: Is64BitInstallMode
|
Source: "{#ThirdPartyDir}\3rdParty.x64\bin\CrashSender1403.exe"; DestDir: "{app}\bin"; Check: Is64BitInstallMode
|
||||||
|
Source: "{#ThirdPartyDir}\3rdParty.x64\bin\dbus-1-3.dll"; DestDir: "{app}\bin"; Check: Is64BitInstallMode
|
||||||
|
Source: "{#ThirdPartyDir}\3rdParty.x64\bin\event_core.dll"; DestDir: "{app}\bin"; Check: Is64BitInstallMode
|
||||||
|
|
||||||
; Include the base package
|
; Include the base package
|
||||||
#if IncludeData == "TRUE"
|
#if IncludeData == "TRUE"
|
||||||
|
|||||||
+107
-58
@@ -1,96 +1,123 @@
|
|||||||
# Nasa2FGearthview
|
# Nasa2FGearthview
|
||||||
A bash-script to convert NASA satellite images to ready-to-use
|
A bash-script to convert NASA satellite images to ready-to-use
|
||||||
textures for FG's EarthView using ImageMagick.
|
textures for FG's EarthView using ImageMagick and normalmap
|
||||||
|
|
||||||
For info about FGearthview, see the forum thread:
|
You can get "normalmap" there:
|
||||||
|
https://github.com/planrich/normalmap
|
||||||
|
|
||||||
|
For info about FGearthview, see the forum thread:\
|
||||||
https://forum.flightgear.org/viewtopic.php?f=6&t=15754
|
https://forum.flightgear.org/viewtopic.php?f=6&t=15754
|
||||||
or this FG-wiki-page:
|
|
||||||
|
or this FG-wiki-page:\
|
||||||
http://wiki.flightgear.org/Earthview
|
http://wiki.flightgear.org/Earthview
|
||||||
|
|
||||||
|
### Caution!
|
||||||
|
Don't use this script on a server! It will most likely cause
|
||||||
|
Denial-of-service (DoS). When working on these huge images, the
|
||||||
|
harddisk throughput will cease occasionally and CPU / RAM usage will
|
||||||
|
spike tremendously! So, only use this script on your home desktop
|
||||||
|
computer, or if you don't mind several long server-outages...
|
||||||
|
|
||||||
|
|
||||||
------------------------------------
|
------------------------------------
|
||||||
About:
|
## About:
|
||||||
|
|
||||||
This script runs on Linux (maybe Mac also?) in a Bash
|
This script runs on Linux (maybe Mac also?) in a Bash
|
||||||
(Bourne Again Shell) - Windows is not supported (by the nature of the
|
(Bourne Again Shell) - Windows is not supported (by the nature of the
|
||||||
script). Maybe it works on windows as well, I don't know, feel free
|
script). Maybe it works on windows as well, I don't know, feel free
|
||||||
to try, and please let me know! :)
|
to try, and please let me know! :)
|
||||||
|
|
||||||
This will download the raw images from http://visibleearth.nasa.gov -
|
|
||||||
their server is not very fast, so I provide an alternative download
|
|
||||||
location: https://musicchris.de/download/FG/EarthView/raw-data-NASA.7z
|
|
||||||
This one is much quicker! If you really want the images directly from
|
|
||||||
NASA, then provide "nasa" to the script (see below)
|
|
||||||
|
|
||||||
In the end you will have 8 world-textures in .png and .dds format.
|
In the end you will have 8 world-textures in .png and .dds format.
|
||||||
Generally .dds is better in performance, but it won't work on some
|
Generally .dds is better in performance, but it won't work on some
|
||||||
graphics cards. If this is the case for you, then try the .png files.
|
graphics cards. If this is the case for you, then try the .png files.
|
||||||
For further information see:
|
For further information see:\
|
||||||
http://wiki.flightgear.org/index.php?title=DDS_Textures_in_FlightGear&redirect=no
|
http://wiki.flightgear.org/index.php?title=DDS_Textures_in_FlightGear&redirect=no
|
||||||
|
|
||||||
If you also converted the clouds, then you'll also find 8 cloud-
|
If you also converted the clouds and the height maps, then you'll also
|
||||||
textures in the format .png. Because the .dds-format has trouble with
|
find 8 cloud- and 8 height textures (as well as their conversion to
|
||||||
rendering heavy alpha images, which is because of it's compression
|
normal maps) in the format .png. Because the .dds-format has trouble
|
||||||
algorythm [1], I think it's useless to also build faulty files.
|
with rendering heavy alpha images, which is because of it's
|
||||||
However, this is not entirely true! It is possible to switch off the
|
compression algorythm [1], I think it's useless to also build faulty
|
||||||
.dds/DXT compression. But this results in huge files and is rather
|
files. However, this is not entirely true! It is possible to switch
|
||||||
heavy on the GPU's RAM.
|
off the .dds/DXT compression. But this results in huge files and is
|
||||||
|
rather heavy on the GPU's RAM.
|
||||||
|
|
||||||
Buckaroo has created a nice overview on dds-compression:
|
Buckaroo has created a nice overview on dds-compression:
|
||||||
[1] http://www.buckarooshangar.com/flightgear/tut_dds.html
|
[1] http://www.buckarooshangar.com/flightgear/tut_dds.html
|
||||||
|
|
||||||
------------------------------------
|
------------------------------------
|
||||||
Installation and usage:
|
## Installation and usage:
|
||||||
|
|
||||||
Simply copy "convert.sh" into a folder of your liking and run it:
|
Simply copy "convert.sh" into a folder of your liking and run it:
|
||||||
|
|
||||||
$ ./convert.sh
|
```shell
|
||||||
|
./convert.sh
|
||||||
|
```
|
||||||
|
|
||||||
This will show a help text, since you didn't specify any target(s).
|
This will show a help text, since you didn't specify any target(s).
|
||||||
Possible targets are:
|
Possible targets are:
|
||||||
* world
|
* world
|
||||||
* clouds
|
* clouds
|
||||||
|
* heights
|
||||||
* all
|
* all
|
||||||
|
|
||||||
Additionally, there are some options you could specify (further
|
Additionally, there are some options you could specify (further
|
||||||
explained below):
|
explained below):
|
||||||
* 1k | 2k | 4k | 8k | 16k
|
* 1k | 2k | 4k | 8k | 16k
|
||||||
* nasa
|
* download | no-download
|
||||||
* no-download
|
* world
|
||||||
|
* clouds
|
||||||
|
* heights
|
||||||
* cleanup
|
* cleanup
|
||||||
* rebuild
|
* rebuild
|
||||||
* check
|
* check
|
||||||
|
|
||||||
So your call could look sth like this:
|
So your call could look sth like this:
|
||||||
|
|
||||||
$ ./convert.sh world no-download cleanup 8k
|
```shell
|
||||||
|
./convert.sh world download alt cleanup 8k
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
------------------------------------
|
------------------------------------
|
||||||
Requirements:
|
## Requirements:
|
||||||
|
|
||||||
WARNING!
|
WARNING!
|
||||||
|
|
||||||
This script uses a *lot* disk space! Make sure you have at least 90GB
|
This script uses a *lot* disk space! In my last test run, which
|
||||||
available!
|
generated all maps in all resolutions, the disk usage was about 330GB!
|
||||||
|
Beware!\
|
||||||
|
Also, I wouldn't recommend doing this on a SSD! While SSDs are
|
||||||
|
generally faster, they also get more wear-and-tear when write such
|
||||||
|
huge files. So this script might cause your SSD to die earlier as it
|
||||||
|
should. Generally speaking, this won't kill your SSD, but it might
|
||||||
|
cause it to die earlier. HDDs are much more robust in that respect.
|
||||||
|
|
||||||
Also, this script will run for a *very long* time! It might be best to
|
Also, this script will run for a *very long* time! It might be best to
|
||||||
let it run over night - your computer might become unresponsive from
|
let it run over night - your computer might become unresponsive from
|
||||||
time to time, due to the heavy CPU and memory load, which tends to
|
time to time, due to the heavy CPU and memory load, which tends to
|
||||||
occur, when converting 54000x27000 images. ;-)
|
occur, when converting 54000x27000 images. ;-)
|
||||||
I also recommend to deactivate swapping!
|
|
||||||
$ sudo swapoff -a
|
|
||||||
To reactivate swapping do:
|
|
||||||
$ sudo swapon -a
|
|
||||||
|
|
||||||
This script relies on wget and imagemagick. Both are easily installed
|
I also recommend to deactivate swapping!
|
||||||
by your systems package-management-system.
|
```shell
|
||||||
(On Debian/Ubuntu this is "apt-get")
|
sudo swapoff -a
|
||||||
|
```
|
||||||
|
To reactivate swapping do:
|
||||||
|
```shell
|
||||||
|
$ sudo swapon -a
|
||||||
|
```
|
||||||
|
|
||||||
|
This script relies on wget, ImageMagick and, for converting the height
|
||||||
|
maps to normal maps, on "normalmap". Some of these programs are easily
|
||||||
|
installed by your systems package-management-system.\ (On
|
||||||
|
Debian/Ubuntu this is "apt-get").
|
||||||
|
|
||||||
So, on Debian for instance, you only need to put the following into
|
So, on Debian for instance, you only need to put the following into
|
||||||
the console:
|
the console:
|
||||||
|
|
||||||
$ sudo apt-get install wget imagemagick
|
```shell
|
||||||
|
sudo apt-get install wget imagemagick
|
||||||
|
```
|
||||||
|
|
||||||
Depending on your distro, the package names might differ slightly! Use
|
Depending on your distro, the package names might differ slightly! Use
|
||||||
a search engine of your choice to find out, how the packages are named
|
a search engine of your choice to find out, how the packages are named
|
||||||
@@ -98,55 +125,77 @@ in your distro!
|
|||||||
|
|
||||||
You may want to check:
|
You may want to check:
|
||||||
|
|
||||||
$ apt search imagemagick
|
```shell
|
||||||
|
apt search imagemagick
|
||||||
|
```
|
||||||
|
|
||||||
|
### IMPORTANT!
|
||||||
|
Check out your ```/etc/ImageMagick-6/policy.xml```
|
||||||
|
On some distros, there are limits set, which will cause IM to abort
|
||||||
|
the conversion of images larger than
|
||||||
|
[rediculously small images](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=860763).
|
||||||
|
Edit and set to our needs:
|
||||||
|
* width: at least 55000
|
||||||
|
* height: at least 55000
|
||||||
|
* area: less than your free RAM
|
||||||
|
|
||||||
|
### Normalmap
|
||||||
|
For normalmap, you can download and compile it from
|
||||||
|
https://github.com/planrich/normalmap
|
||||||
|
|
||||||
|
You can install the binary into your system, or just copy it next to
|
||||||
|
convert.sh - both should work.
|
||||||
|
|
||||||
------------------------------------
|
------------------------------------
|
||||||
Targets:
|
## Targets:
|
||||||
|
|
||||||
world
|
**world**\
|
||||||
Generates the world tiles, needed to run FG with EarthView.
|
Generates the world tiles, needed to run FG with EarthView.
|
||||||
You will find the results in output/[$resolution]/*. Copy
|
You will find the results in output/[$resolution]/\*. Copy
|
||||||
these into $FGDATA/Models/Astro/*. More about the installation
|
these into $FGDATA/Models/Astro/\*. More about the installation
|
||||||
of these textures can be found here:
|
of these textures can be found here:
|
||||||
http://wiki.flightgear.org/Earthview#Customization
|
http://wiki.flightgear.org/Earthview#Customization
|
||||||
|
|
||||||
clouds
|
**clouds**\
|
||||||
Generates the cloud tiles, needed to run FG with EarthView.
|
Generates the cloud tiles, needed to run FG with EarthView.
|
||||||
The locations are the same as the other textures mentioned
|
The locations are the same as the other textures mentioned
|
||||||
above. Note that clouds are only available with up to 8k
|
above. Note that clouds are only available with up to 8k
|
||||||
resolution, due to the available data at NASA.
|
resolution, due to the available data at NASA.
|
||||||
|
|
||||||
all
|
**heights**\
|
||||||
|
Generates the height tiles, which are then converted to the
|
||||||
|
normal maps needed to run FG with EarthView. The locations are
|
||||||
|
the same as the other textures mentioned above. Note that
|
||||||
|
heights are only available with up to 8k resolution, due to the
|
||||||
|
available data at NASA.
|
||||||
|
|
||||||
|
**all**\
|
||||||
Converts everything needed for a full-blown earthview texture
|
Converts everything needed for a full-blown earthview texture
|
||||||
set. Does the same as:
|
set. Does the same as:
|
||||||
$ ./convert.sh world clouds
|
```./convert.sh world clouds heights```
|
||||||
|
|
||||||
|
|
||||||
Options:
|
## Options:
|
||||||
|
|
||||||
1k | 2k | 4k | 8k | 16k
|
**1k | 2k | 4k | 8k | 16k**\
|
||||||
Lets you specify a desired resolution of the textures.
|
Lets you specify a desired resolution of the textures.
|
||||||
Possible values are 1k, 2k, 4k, 8k and 16k. If nothing is
|
Possible values are 1k, 2k, 4k, 8k and 16k. If nothing is
|
||||||
specified, the script will generate all of the resolutions.
|
specified, the script will generate all of the resolutions.
|
||||||
16k is only available for earth textures.
|
16k is recommended only for earth textures, it will induce
|
||||||
|
oversampling from clouds and height maps.
|
||||||
|
|
||||||
nasa
|
**download**\
|
||||||
Causes the script to download directly from
|
Causes the script to download the needed data, this is the
|
||||||
http://visibleearth.nasa.gov . If omitted the script will
|
default behavior (and can be omitted).
|
||||||
download from
|
|
||||||
https://musicchris.de/download/FG/EarthView/raw-data-NASA.7z
|
|
||||||
which is much faster!
|
|
||||||
Uses wget either way.
|
|
||||||
|
|
||||||
no-download
|
**no-download**\
|
||||||
Causes the script to skip the download function. If you
|
Causes the script to skip the download function. If you
|
||||||
already have the source images, then you don't need to
|
already have the source images, then you don't need to
|
||||||
re-download them. (About 2.4GB!)
|
re-download them. (About 2.4GB!)
|
||||||
If omitted, the script will download the source images from
|
If omitted, the script will download the source images from
|
||||||
https://musicchris.de/download/FG/EarthView/raw-data-NASA.7z
|
the default location.
|
||||||
|
|
||||||
cleanup
|
**cleanup**\
|
||||||
Deletes the temporary files created during texture generation.
|
Deletes the temporary files created during texture generation.
|
||||||
These can be found in tmp/
|
These can be found in tmp/
|
||||||
Note: if for some reason you later want some other resolution,
|
Note: if for some reason you later want some other resolution,
|
||||||
@@ -155,13 +204,13 @@ cleanup
|
|||||||
Frees up a lot of disk-space! Which would have to be
|
Frees up a lot of disk-space! Which would have to be
|
||||||
regenerated if needed again.
|
regenerated if needed again.
|
||||||
|
|
||||||
rebuild
|
**rebuild**\
|
||||||
Deletes only the temporary files of the given target. So if
|
Deletes only the temporary files of the given target. So if
|
||||||
you call './convert.sh rebuild world' the script will delete
|
you call ```./convert.sh rebuild world``` the script will delete
|
||||||
all corresponding temp-files of the target world, which will
|
all corresponding temp-files of the target world, which will
|
||||||
trigger a complete regeneration of the relevant (instead of
|
trigger a complete regeneration of the relevant (instead of
|
||||||
skipping existing files)
|
skipping existing files)
|
||||||
|
|
||||||
check
|
**check**\
|
||||||
Creates mosaics of the tiles, so you can look at them and see
|
Creates mosaics of the tiles, so you can look at them and see
|
||||||
if all went well.
|
if all went well.
|
||||||
|
|||||||
+518
-74
@@ -1,7 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# convert.sh - a script to convert NASA sattelite images into textures for use with FGearthview (orbital rendering)
|
# convert.sh - a script to convert NASA sattelite images into textures
|
||||||
# Copyright (C) 2016 Chris Schwarz <chris@musicchris.de>
|
# for use with FGearthview (orbital rendering)
|
||||||
|
# Copyright (C) 2016 chris_blues <chris@musicchris.de>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -16,9 +17,12 @@
|
|||||||
# You should have received a copy of the GNU General Public License along
|
# You should have received a copy of the GNU General Public License along
|
||||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
#
|
||||||
|
# v0.12: Chris Ringeval (eatdirt):
|
||||||
|
# -add normalmapping output + small improvements
|
||||||
|
|
||||||
|
|
||||||
VERSION="v0.11"
|
VERSION="v0.13"
|
||||||
|
|
||||||
# make sure the script halts on error
|
# make sure the script halts on error
|
||||||
set -e
|
set -e
|
||||||
@@ -29,21 +33,21 @@ function showHelp
|
|||||||
echo "https://github.com/chris-blues/Nasa2FGearthview"
|
echo "https://github.com/chris-blues/Nasa2FGearthview"
|
||||||
echo
|
echo
|
||||||
echo "Usage:"
|
echo "Usage:"
|
||||||
echo "./convert.sh [ download world clouds 8k cleanup rebuild ]"
|
echo "./convert.sh [ download no-download world clouds heights"
|
||||||
|
echo " 1k 2k 4k 8k 16k cleanup rebuild ]"
|
||||||
echo
|
echo
|
||||||
echo "* Append \"nasa\" to download the needed images from NASA"
|
|
||||||
echo " -> This will download ca 2.4GB of data!"
|
|
||||||
echo " -> wget can continue interrupted downloads!"
|
|
||||||
echo " If omitted, it will download from my server, which is a lot"
|
|
||||||
echo " faster. See README for details."
|
|
||||||
echo "* Append \"no-download\" to the command to skip the download"
|
echo "* Append \"no-download\" to the command to skip the download"
|
||||||
echo " process alltogether. Only makes sense if you already got"
|
echo " process alltogether. Only makes sense if you already got"
|
||||||
echo " the necessary data."
|
echo " the necessary data."
|
||||||
echo "* Append \"world\" to the command to generate the world tiles"
|
echo "* Append \"world\" to the command to generate the world tiles"
|
||||||
echo "* Append \"clouds\" to the command to generate cloud tiles"
|
echo "* Append \"clouds\" to the command to generate cloud tiles"
|
||||||
echo "* Append \"all\" to the command to generate both - world and"
|
echo "* Append \"heights\" to the command to generate height tiles"
|
||||||
echo " clouds"
|
echo " and the normalmaps needed by EarthView. Notice that you need"
|
||||||
echo "* Append the size of the tiles (1k, 2k, 4, 8k, 16k). If you"
|
echo " the normalmap binary to be installed. You can get it from:"
|
||||||
|
echo " https://github.com/planrich/normalmap"
|
||||||
|
echo "* Append \"all\" to the command to generate all - world, clouds"
|
||||||
|
echo " and heights"
|
||||||
|
echo "* Append the size of the tiles (1k, 2k, 4k, 8k, 16k). If you"
|
||||||
echo " don't pass a resolution, then all resolutions will be"
|
echo " don't pass a resolution, then all resolutions will be"
|
||||||
echo " generated."
|
echo " generated."
|
||||||
echo "* Append \"cleanup\" to delete all temporary files in tmp/"
|
echo "* Append \"cleanup\" to delete all temporary files in tmp/"
|
||||||
@@ -59,7 +63,7 @@ function showHelp
|
|||||||
echo " Useful if the source files have changed."
|
echo " Useful if the source files have changed."
|
||||||
echo "* Append \"check\" to let check the results. This will create"
|
echo "* Append \"check\" to let check the results. This will create"
|
||||||
echo " mosaics of the existing tiles. If no target is specified,"
|
echo " mosaics of the existing tiles. If no target is specified,"
|
||||||
echo " all 3 layers will be built: clouds world and nightlights."
|
echo " all layers will be built: clouds, heights, world and nightlights."
|
||||||
echo
|
echo
|
||||||
echo "If, for some reason, the script aborts, then it will try to"
|
echo "If, for some reason, the script aborts, then it will try to"
|
||||||
echo "skip the already completed steps, so you don't have to wait"
|
echo "skip the already completed steps, so you don't have to wait"
|
||||||
@@ -102,11 +106,11 @@ if [ $1 == "-h" ] ; then showHelp ; fi
|
|||||||
################################
|
################################
|
||||||
for ARG in "$@"
|
for ARG in "$@"
|
||||||
do
|
do
|
||||||
if [ $ARG == "nasa" ] ; then DOWNLOAD="true" ; DL_LOCATION="NASA" ; echo "Downloading from visibleearth.nasa.gov" ; fi
|
|
||||||
if [ $ARG == "no-download" ] ; then DOWNLOAD="false" ; echo "Skipping the download process" ; fi
|
if [ $ARG == "no-download" ] ; then DOWNLOAD="false" ; echo "Skipping the download process" ; fi
|
||||||
if [ $ARG == "world" ] ; then WORLD="true" ; fi
|
if [ $ARG == "world" ] ; then WORLD="true" ; fi
|
||||||
if [ $ARG == "clouds" ] ; then CLOUDS="true" ; fi
|
if [ $ARG == "clouds" ] ; then CLOUDS="true" ; fi
|
||||||
if [ $ARG == "all" ] ; then WORLD="true" ; CLOUDS="true" ; fi
|
if [ $ARG == "heights" ] ; then HEIGHTS="true" ; fi
|
||||||
|
if [ $ARG == "all" ] ; then WORLD="true" ; CLOUDS="true" ; HEIGHTS="true" ; fi
|
||||||
if [ $ARG == "1k" ] ; then RESOLUTION="1024" ; fi
|
if [ $ARG == "1k" ] ; then RESOLUTION="1024" ; fi
|
||||||
if [ $ARG == "2k" ] ; then RESOLUTION="2048" ; fi
|
if [ $ARG == "2k" ] ; then RESOLUTION="2048" ; fi
|
||||||
if [ $ARG == "4k" ] ; then RESOLUTION="4096" ; fi
|
if [ $ARG == "4k" ] ; then RESOLUTION="4096" ; fi
|
||||||
@@ -119,17 +123,22 @@ done
|
|||||||
if [ -z $DOWNLOAD ] ; then DOWNLOAD="true" ; fi
|
if [ -z $DOWNLOAD ] ; then DOWNLOAD="true" ; fi
|
||||||
if [ -z $WORLD ] ; then WORLD="false" ; fi
|
if [ -z $WORLD ] ; then WORLD="false" ; fi
|
||||||
if [ -z $CLOUDS ] ; then CLOUDS="false" ; fi
|
if [ -z $CLOUDS ] ; then CLOUDS="false" ; fi
|
||||||
|
if [ -z $HEIGHTS ] ; then HEIGHTS="false" ; fi
|
||||||
if [ -z $CLEANUP ] ; then CLEANUP="false" ; fi
|
if [ -z $CLEANUP ] ; then CLEANUP="false" ; fi
|
||||||
if [ -z $REBUILD ] ; then REBUILD="false" ; fi
|
if [ -z $REBUILD ] ; then REBUILD="false" ; fi
|
||||||
if [ -z $BUILDCHECKS ] ; then BUILDCHECKS="false" ; fi
|
if [ -z $BUILDCHECKS ] ; then BUILDCHECKS="false" ; fi
|
||||||
|
|
||||||
CHECKWORLD=$WORLD
|
CHECKWORLD=$WORLD
|
||||||
CHECKCLOUDS=$CLOUDS
|
CHECKCLOUDS=$CLOUDS
|
||||||
|
CHECKHEIGHTS=$HEIGHTS
|
||||||
|
|
||||||
|
|
||||||
########################
|
########################
|
||||||
## Set some variables ##
|
## Set some variables ##
|
||||||
########################
|
########################
|
||||||
|
|
||||||
|
DL_LOCATION="NASA"
|
||||||
|
|
||||||
mkdir -p tmp
|
mkdir -p tmp
|
||||||
export MAGICK_TMPDIR=${PWD}/tmp
|
export MAGICK_TMPDIR=${PWD}/tmp
|
||||||
echo "tmp-dir: $MAGICK_TMPDIR"
|
echo "tmp-dir: $MAGICK_TMPDIR"
|
||||||
@@ -139,21 +148,50 @@ TIME=$(date +"%Y-%m-%d_%H:%M:%S")
|
|||||||
LOGFILE_GENERAL="logs/${TIME}.log"
|
LOGFILE_GENERAL="logs/${TIME}.log"
|
||||||
LOGFILE_TIME="logs/${TIME}.time.log"
|
LOGFILE_TIME="logs/${TIME}.time.log"
|
||||||
|
|
||||||
URLS_WORLD="http://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.A1.png
|
#command line gimp plugin from https://github.com/planrich/normalmap
|
||||||
http://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.A2.png
|
#higher filters (5x5) create too sharp features (no rescaling, I
|
||||||
http://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.B1.png
|
#assume earthview do its own normalization)
|
||||||
http://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.B2.png
|
NORMALBIN="normalmap"
|
||||||
http://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.C1.png
|
NORMALOPTS="-s 1 -f FILTER_PREWITT_3x3"
|
||||||
http://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.C2.png
|
|
||||||
http://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.D1.png
|
|
||||||
http://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.D2.png
|
|
||||||
http://eoimages.gsfc.nasa.gov/images/imagerecords/79000/79765/dnb_land_ocean_ice.2012.54000x27000_geo.tif"
|
|
||||||
|
|
||||||
URLS_CLOUDS="http://eoimages.gsfc.nasa.gov/images/imagerecords/57000/57747/cloud.E.2001210.21600x21600.png
|
URLS_WORLD="https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.A1.png
|
||||||
http://eoimages.gsfc.nasa.gov/images/imagerecords/57000/57747/cloud.W.2001210.21600x21600.png"
|
https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.A2.png
|
||||||
|
https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.B1.png
|
||||||
|
https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.B2.png
|
||||||
|
https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.C1.png
|
||||||
|
https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.C2.png
|
||||||
|
https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.D1.png
|
||||||
|
https://eoimages.gsfc.nasa.gov/images/imagerecords/74000/74117/world.200408.3x21600x21600.D2.png
|
||||||
|
https://eoimages.gsfc.nasa.gov/images/imagerecords/79000/79765/dnb_land_ocean_ice.2012.54000x27000_geo.tif"
|
||||||
|
|
||||||
|
URLS_CLOUDS="https://eoimages.gsfc.nasa.gov/images/imagerecords/57000/57747/cloud.E.2001210.21600x21600.png
|
||||||
|
https://eoimages.gsfc.nasa.gov/images/imagerecords/57000/57747/cloud.W.2001210.21600x21600.png"
|
||||||
|
|
||||||
|
URLS_HEIGHTS="https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73934/gebco_08_rev_elev_A1_grey_geo.tif
|
||||||
|
https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73934/gebco_08_rev_elev_A2_grey_geo.tif
|
||||||
|
https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73934/gebco_08_rev_elev_B1_grey_geo.tif
|
||||||
|
https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73934/gebco_08_rev_elev_B2_grey_geo.tif
|
||||||
|
https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73934/gebco_08_rev_elev_C1_grey_geo.tif
|
||||||
|
https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73934/gebco_08_rev_elev_C2_grey_geo.tif
|
||||||
|
https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73934/gebco_08_rev_elev_D1_grey_geo.tif
|
||||||
|
https://eoimages.gsfc.nasa.gov/images/imagerecords/73000/73934/gebco_08_rev_elev_D2_grey_geo.tif"
|
||||||
|
|
||||||
|
if ! [ -x "$(command -v $NORMALBIN)" ]
|
||||||
|
then
|
||||||
|
if ! [ -x "./${NORMALBIN}" ]
|
||||||
|
then
|
||||||
|
echo ">>>>>>>>>>>> Error: $NORMALBIN binary not found! <<<<<<<<<<<<<"
|
||||||
|
echo "You can get it from: https://github.com/planrich/normalmap"
|
||||||
|
HEIGHTS="false"
|
||||||
|
else
|
||||||
|
NORMALBIN="./${NORMALBIN}"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo ">>>>>>>>>>>> Error: $NORMALBIN binary not found! <<<<<<<<<<<<<"
|
||||||
|
echo "You can get it from: https://github.com/planrich/normalmap"
|
||||||
|
HEIGHTS="false"
|
||||||
|
fi
|
||||||
|
|
||||||
ALTERNATE_URL="https://musicchris.de/download/FG/EarthView/raw-data-NASA.7z"
|
|
||||||
ALTERNATE_FILENAME="raw-data-NASA.7z"
|
|
||||||
|
|
||||||
if [ -z $RESOLUTION ]
|
if [ -z $RESOLUTION ]
|
||||||
then
|
then
|
||||||
@@ -162,7 +200,7 @@ if [ -z $RESOLUTION ]
|
|||||||
4096
|
4096
|
||||||
8192
|
8192
|
||||||
16384"
|
16384"
|
||||||
NO_RESOLUTION_GIVEN="true"
|
NO_RESOLUTION_GIVEN="false"
|
||||||
RESOLUTION_MAX="16384"
|
RESOLUTION_MAX="16384"
|
||||||
fi
|
fi
|
||||||
if [ -z $RESOLUTION_MAX ] ; then RESOLUTION_MAX=$RESOLUTION ; fi
|
if [ -z $RESOLUTION_MAX ] ; then RESOLUTION_MAX=$RESOLUTION ; fi
|
||||||
@@ -236,6 +274,18 @@ function rebuild
|
|||||||
rm tmp/cloud*
|
rm tmp/cloud*
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ $HEIGHTS == "true" ]
|
||||||
|
then
|
||||||
|
{
|
||||||
|
echo
|
||||||
|
echo "#########################################"
|
||||||
|
echo "## Removing tmp-files of target heights##"
|
||||||
|
echo "#########################################"
|
||||||
|
rm tmp/height*
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function cleanUp
|
function cleanUp
|
||||||
@@ -244,9 +294,10 @@ function cleanUp
|
|||||||
echo "############################"
|
echo "############################"
|
||||||
echo "## Removing all tmp-files ##"
|
echo "## Removing all tmp-files ##"
|
||||||
echo "############################"
|
echo "############################"
|
||||||
rm -rv tmp/night*
|
rm -rvf tmp/night*
|
||||||
rm -rv tmp/world*
|
rm -rvf tmp/world*
|
||||||
rm -rv tmp/clouds*
|
rm -rvf tmp/cloud*
|
||||||
|
rm -rvf tmp/height*
|
||||||
}
|
}
|
||||||
|
|
||||||
function prettyTime
|
function prettyTime
|
||||||
@@ -312,13 +363,18 @@ function downloadImages
|
|||||||
{
|
{
|
||||||
echo | tee -a $LOGFILE_GENERAL
|
echo | tee -a $LOGFILE_GENERAL
|
||||||
echo "###################################################" | tee -a $LOGFILE_GENERAL
|
echo "###################################################" | tee -a $LOGFILE_GENERAL
|
||||||
if [ ! -z $DL_LOCATION ]
|
if [ -z $DL_LOCATION ]
|
||||||
then echo "## Downloading images from visibleearth.nasa.gov ##" | tee -a $LOGFILE_GENERAL
|
then
|
||||||
else echo "## Downloading images from musicchris.de ##" | tee -a $LOGFILE_GENERAL
|
DL_LOCATION="NASA"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ $DL_LOCATION == "NASA" ]
|
||||||
|
then
|
||||||
|
echo "## Downloading images from visibleearth.nasa.gov ##" | tee -a $LOGFILE_GENERAL
|
||||||
|
fi
|
||||||
|
|
||||||
echo "###################################################" | tee -a $LOGFILE_GENERAL
|
echo "###################################################" | tee -a $LOGFILE_GENERAL
|
||||||
if [ -z $DL_LOCATION ] ; then f=$ALTERNATE_URL ; DL_LOCATION="musicchris.de" ; fi
|
|
||||||
FILENAME=$(echo $f | sed 's@.*/@@')
|
|
||||||
if [ $WORLD == "true" ]
|
if [ $WORLD == "true" ]
|
||||||
then
|
then
|
||||||
if [ $DL_LOCATION == "NASA" ]
|
if [ $DL_LOCATION == "NASA" ]
|
||||||
@@ -335,7 +391,13 @@ function downloadImages
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $DL_LOCATION == "musicchris.de" ] ; then downloadMusicchris ; fi
|
if [ $HEIGHTS == "true" ]
|
||||||
|
then
|
||||||
|
if [ $DL_LOCATION == "NASA" ]
|
||||||
|
then
|
||||||
|
downloadHeights
|
||||||
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function downloadWorld
|
function downloadWorld
|
||||||
@@ -345,10 +407,23 @@ function downloadWorld
|
|||||||
for f in $URLS_WORLD
|
for f in $URLS_WORLD
|
||||||
do
|
do
|
||||||
FILENAME=$(echo $f | sed 's@.*/@@')
|
FILENAME=$(echo $f | sed 's@.*/@@')
|
||||||
wget --output-document=input/$FILENAME --continue --show-progress $f 2>> $LOGFILE_GENERAL
|
wget --output-document=input/$FILENAME --continue --show-progress $f | tee -a $LOGFILE_GENERAL 2>> $LOGFILE_GENERAL
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function downloadHeights
|
||||||
|
{
|
||||||
|
mkdir -p input
|
||||||
|
echo "Downloading height tiles..." | tee -a $LOGFILE_GENERAL
|
||||||
|
for f in $URLS_HEIGHTS
|
||||||
|
do
|
||||||
|
FILENAME=$(echo $f | sed 's@.*/@@')
|
||||||
|
wget --output-document=input/$FILENAME --continue --show-progress $f | tee -a $LOGFILE_GENERAL 2>> $LOGFILE_GENERAL
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function downloadClouds
|
function downloadClouds
|
||||||
{
|
{
|
||||||
mkdir -p input
|
mkdir -p input
|
||||||
@@ -356,24 +431,10 @@ function downloadClouds
|
|||||||
for f in $URLS_CLOUDS
|
for f in $URLS_CLOUDS
|
||||||
do
|
do
|
||||||
FILENAME=$(echo $f | sed 's@.*/@@')
|
FILENAME=$(echo $f | sed 's@.*/@@')
|
||||||
wget --output-document=input/$FILENAME --continue --show-progress $f 2>> $LOGFILE_GENERAL
|
wget --output-document=input/$FILENAME --continue --show-progress $f | tee -a $LOGFILE_GENERAL 2>> $LOGFILE_GENERAL
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
function downloadMusicchris
|
|
||||||
{
|
|
||||||
mkdir -p input
|
|
||||||
echo "Downloading raw images... (ca 2.2 GB)" | tee -a $LOGFILE_GENERAL
|
|
||||||
for p in 1 2 3 4 5
|
|
||||||
do
|
|
||||||
wget --output-document=input/${FILENAME}.00${p} --continue --show-progress $ALTERNATE_URL | tee -a $LOGFILE_GENERAL 2>> $LOGFILE_GENERAL
|
|
||||||
done
|
|
||||||
echo "Unpacking raw images..." | tee -a $LOGFILE_GENERAL
|
|
||||||
cd input
|
|
||||||
7z e -bt -y raw-data-NASA.7z 2>> $LOGFILE_GENERAL
|
|
||||||
cd ..
|
|
||||||
}
|
|
||||||
|
|
||||||
function generateWorld
|
function generateWorld
|
||||||
{
|
{
|
||||||
STARTTIME=$(date +%s)
|
STARTTIME=$(date +%s)
|
||||||
@@ -419,7 +480,7 @@ function generateWorld
|
|||||||
let "RESIZE_H = ( $RESOLUTION_MAX - ( 2 * $BORDER_WIDTH ) ) * 2"
|
let "RESIZE_H = ( $RESOLUTION_MAX - ( 2 * $BORDER_WIDTH ) ) * 2"
|
||||||
if [ ! -s "tmp/nightlights_${RESIZE_W}x${RESIZE_H}.mpc" ]
|
if [ ! -s "tmp/nightlights_${RESIZE_W}x${RESIZE_H}.mpc" ]
|
||||||
then
|
then
|
||||||
for r in 16384 8192 4096 2048
|
for r in $RESOLUTION
|
||||||
do
|
do
|
||||||
if [ $r -le $RESOLUTION_MAX ]
|
if [ $r -le $RESOLUTION_MAX ]
|
||||||
then continue
|
then continue
|
||||||
@@ -553,7 +614,7 @@ function generateWorld
|
|||||||
do
|
do
|
||||||
NASA2FG $t
|
NASA2FG $t
|
||||||
FOUND_BIGGER_WORLD_PICTURE="false"
|
FOUND_BIGGER_WORLD_PICTURE="false"
|
||||||
unset $TIMESAVER_SIZE
|
unset TIMESAVER_SIZE
|
||||||
if [ ! -s "tmp/world_seamless_${IMAGE_BORDERLESS}_${DEST}.mpc" ]
|
if [ ! -s "tmp/world_seamless_${IMAGE_BORDERLESS}_${DEST}.mpc" ]
|
||||||
then
|
then
|
||||||
{
|
{
|
||||||
@@ -825,6 +886,10 @@ function generateWorld
|
|||||||
echo
|
echo
|
||||||
echo "--> Writing output/${r}/world_${t}.dds @ ${r}x${r}"
|
echo "--> Writing output/${r}/world_${t}.dds @ ${r}x${r}"
|
||||||
# set -x
|
# set -x
|
||||||
|
|
||||||
|
if [ ! -s "output/${r}/world_${t}.dds" ]
|
||||||
|
then
|
||||||
|
|
||||||
convert \
|
convert \
|
||||||
-monitor \
|
-monitor \
|
||||||
tmp/world_${RESOLUTION_MAX}_done_${t}.mpc \
|
tmp/world_${RESOLUTION_MAX}_done_${t}.mpc \
|
||||||
@@ -834,7 +899,15 @@ function generateWorld
|
|||||||
output/${r}/world_${t}.dds
|
output/${r}/world_${t}.dds
|
||||||
set +x
|
set +x
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
else echo "=> Skipping existing file: output/${r}/world_${t}.dds" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
|
||||||
|
fi
|
||||||
|
|
||||||
echo "--> Writing output/${r}/world_${t}.png @ ${r}x${r}"
|
echo "--> Writing output/${r}/world_${t}.png @ ${r}x${r}"
|
||||||
|
|
||||||
|
if [ ! -s "output/${r}/world_${t}.png" ]
|
||||||
|
then
|
||||||
|
|
||||||
# set -x
|
# set -x
|
||||||
convert \
|
convert \
|
||||||
-monitor \
|
-monitor \
|
||||||
@@ -843,6 +916,10 @@ function generateWorld
|
|||||||
output/${r}/world_${t}.png
|
output/${r}/world_${t}.png
|
||||||
set +x
|
set +x
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
else echo "=> Skipping existing file: output/${r}/world_${t}.png" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
|
||||||
|
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -874,7 +951,11 @@ function generateClouds
|
|||||||
{
|
{
|
||||||
if [ -z $STARTTIME ] ; then STARTTIME=$(date +%s) ; fi
|
if [ -z $STARTTIME ] ; then STARTTIME=$(date +%s) ; fi
|
||||||
# maximum cloud-tile resolution is 8192, since we have no big enough source files...
|
# maximum cloud-tile resolution is 8192, since we have no big enough source files...
|
||||||
|
|
||||||
|
if [[ $NO_RESOLUTION_GIVEN == "true" ]]; then
|
||||||
if [ $RESOLUTION_MAX -eq 16384 ] ; then RESOLUTION_MAX=8192 ; fi
|
if [ $RESOLUTION_MAX -eq 16384 ] ; then RESOLUTION_MAX=8192 ; fi
|
||||||
|
fi
|
||||||
|
|
||||||
let "BORDER_WIDTH = $RESOLUTION_MAX / 128"
|
let "BORDER_WIDTH = $RESOLUTION_MAX / 128"
|
||||||
let "IMAGE_BORDERLESS = $RESOLUTION_MAX - ( 2 * $BORDER_WIDTH )"
|
let "IMAGE_BORDERLESS = $RESOLUTION_MAX - ( 2 * $BORDER_WIDTH )"
|
||||||
let "IMAGE_WITH_BORDER = $RESOLUTION_MAX - $BORDER_WIDTH - 1"
|
let "IMAGE_WITH_BORDER = $RESOLUTION_MAX - $BORDER_WIDTH - 1"
|
||||||
@@ -1071,7 +1152,9 @@ W"
|
|||||||
echo "## propagate last pixels to the edge ##" | tee -a $LOGFILE_GENERAL
|
echo "## propagate last pixels to the edge ##" | tee -a $LOGFILE_GENERAL
|
||||||
echo "#######################################" | tee -a $LOGFILE_GENERAL
|
echo "#######################################" | tee -a $LOGFILE_GENERAL
|
||||||
|
|
||||||
|
if [[ $NO_RESOLUTION_GIVEN == "true" ]]; then
|
||||||
if [ $RESOLUTION_MAX -eq 16384 ] ; then RESOLUTION_MAX=8192 ; fi
|
if [ $RESOLUTION_MAX -eq 16384 ] ; then RESOLUTION_MAX=8192 ; fi
|
||||||
|
fi
|
||||||
let "BORDER_WIDTH = $RESOLUTION_MAX / 128"
|
let "BORDER_WIDTH = $RESOLUTION_MAX / 128"
|
||||||
let "IMAGE_BORDERLESS = $RESOLUTION_MAX - ( 2 * $BORDER_WIDTH )"
|
let "IMAGE_BORDERLESS = $RESOLUTION_MAX - ( 2 * $BORDER_WIDTH )"
|
||||||
let "IMAGE_WITH_BORDER = $RESOLUTION_MAX - $BORDER_WIDTH - 1"
|
let "IMAGE_WITH_BORDER = $RESOLUTION_MAX - $BORDER_WIDTH - 1"
|
||||||
@@ -1190,23 +1273,22 @@ W"
|
|||||||
for r in $RESOLUTION
|
for r in $RESOLUTION
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if [ $r -eq 16384 ]
|
|
||||||
then
|
|
||||||
if [ $NO_RESOLUTION_GIVEN == "true" ]
|
|
||||||
then
|
|
||||||
continue
|
|
||||||
else
|
|
||||||
r=8192
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
mkdir -p output/$r
|
mkdir -p output/$r
|
||||||
echo
|
|
||||||
|
if [ ! -s "output/${r}/clouds_${t}.png" ]
|
||||||
|
then
|
||||||
|
|
||||||
echo "--> Writing output/${r}/clouds_${t}.png @ ${r}x${r}" | tee -a $LOGFILE_GENERAL
|
echo "--> Writing output/${r}/clouds_${t}.png @ ${r}x${r}" | tee -a $LOGFILE_GENERAL
|
||||||
convert \
|
convert \
|
||||||
-monitor \
|
-monitor \
|
||||||
tmp/clouds_${RESOLUTION_MAX}_${t}_done.mpc \
|
tmp/clouds_${RESOLUTION_MAX}_${t}_done.mpc \
|
||||||
-resize ${r}x${r} \
|
-resize ${r}x${r} \
|
||||||
output/${r}/clouds_${t}.png
|
output/${r}/clouds_${t}.png
|
||||||
|
echo
|
||||||
|
|
||||||
|
else echo "=> Skipping existing file: output/${r}/clouds_${t}.png" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
|
||||||
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -1231,6 +1313,322 @@ W"
|
|||||||
echo "Overall processing time: $DAYS d, $HOURS h, $MINUTES m, $SECS s" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
|
echo "Overall processing time: $DAYS d, $HOURS h, $MINUTES m, $SECS s" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function generateHeights
|
||||||
|
{
|
||||||
|
if [ -z $STARTTIME ] ; then STARTTIME=$(date +%s) ; fi
|
||||||
|
echo | tee -a $LOGFILE_GENERAL
|
||||||
|
echo "################################" | tee -a $LOGFILE_GENERAL
|
||||||
|
echo "#### Processing Heights ####" | tee -a $LOGFILE_GENERAL
|
||||||
|
echo "################################" | tee -a $LOGFILE_GENERAL
|
||||||
|
echo | tee -a $LOGFILE_GENERAL
|
||||||
|
|
||||||
|
if [[ $NO_RESOLUTION_GIVEN == "true" ]]; then
|
||||||
|
if [ $RESOLUTION_MAX -eq 16384 ] ; then RESOLUTION_MAX=8192 ; fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
let "BORDER_WIDTH = $RESOLUTION_MAX / 128"
|
||||||
|
let "IMAGE_BORDERLESS = $RESOLUTION_MAX - ( 2 * $BORDER_WIDTH )"
|
||||||
|
let "IMAGE_WITH_BORDER = $RESOLUTION_MAX - $BORDER_WIDTH - 1"
|
||||||
|
let "IMAGE_WITH_BORDER_POS = $RESOLUTION_MAX - $BORDER_WIDTH"
|
||||||
|
let "SIZE = 2 * $IMAGE_BORDERLESS"
|
||||||
|
|
||||||
|
mkdir -p tmp
|
||||||
|
mkdir -p output
|
||||||
|
|
||||||
|
|
||||||
|
echo "################################################" | tee -a $LOGFILE_GENERAL
|
||||||
|
echo "## Resize the NASA-Originals to ${RESOLUTION_MAX}-(2*${BORDER_WIDTH}) ##" | tee -a $LOGFILE_GENERAL
|
||||||
|
echo "################################################" | tee -a $LOGFILE_GENERAL
|
||||||
|
for t in $NASA
|
||||||
|
do
|
||||||
|
NASA2FG $t
|
||||||
|
FOUND_BIGGER_WORLD_PICTURE="false"
|
||||||
|
unset TIMESAVER_SIZE
|
||||||
|
if [ ! -s "tmp/heights_seamless_${IMAGE_BORDERLESS}_${DEST}.mpc" ]
|
||||||
|
then
|
||||||
|
{
|
||||||
|
for r in $RESOLUTION
|
||||||
|
do
|
||||||
|
if [ $r -le $RESOLUTION_MAX ]
|
||||||
|
then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
let "IMAGE_SIZE = $r - ( 2 * ( $r / 128 ) )"
|
||||||
|
let "I_W = $IMAGE_SIZE * 4"
|
||||||
|
let "I_H = $IMAGE_SIZE * 2"
|
||||||
|
if [ -s tmp/heights_seamless_${IMAGE_SIZE}_${DEST}.mpc ]
|
||||||
|
then
|
||||||
|
if [ $IMAGE_SIZE -ge $IMAGE_BORDERLESS ]
|
||||||
|
then
|
||||||
|
FOUND_BIGGER_WORLD_PICTURE="true"
|
||||||
|
TIMESAVER_SIZE="$IMAGE_SIZE"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ $FOUND_BIGGER_WORLD_PICTURE != "true" ]
|
||||||
|
then
|
||||||
|
# set -x
|
||||||
|
convert \
|
||||||
|
-monitor \
|
||||||
|
-limit memory 32 \
|
||||||
|
-limit map 32 \
|
||||||
|
input/gebco_08_rev_elev_${t}_grey_geo.tif \
|
||||||
|
-resize ${IMAGE_BORDERLESS}x${IMAGE_BORDERLESS} \
|
||||||
|
tmp/heights_seamless_${IMAGE_BORDERLESS}_${DEST}.mpc
|
||||||
|
set +x
|
||||||
|
else
|
||||||
|
echo "==> Timesaver:) Using existing file: tmp/heights_seamless_${TIMESAVER_SIZE}_${DEST}.mpc -> tmp/heights_seamless_${IMAGE_BORDERLESS}_${DEST}.mpc" | tee -a $LOGFILE_GENERAL
|
||||||
|
set -x
|
||||||
|
convert \
|
||||||
|
-monitor \
|
||||||
|
-limit memory 32 \
|
||||||
|
-limit map 32 \
|
||||||
|
tmp/heights_seamless_${TIMESAVER_SIZE}_${DEST}.mpc \
|
||||||
|
-resize ${IMAGE_BORDERLESS}x${IMAGE_BORDERLESS} \
|
||||||
|
tmp/heights_seamless_${IMAGE_BORDERLESS}_${DEST}.mpc
|
||||||
|
set +x
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
else echo "=> Skipping existing file: tmp/heights_seamless_${IMAGE_BORDERLESS}_${DEST}.mpc" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
# 3h, 12m, 9s
|
||||||
|
if [ -z $LASTTIME ] ; then LASTTIME=$STARTTIME ; fi
|
||||||
|
echo "input/gebco_08_rev_elev_[A-D][12]_grey_geo.tif -> tmp/heights_seamless_${IMAGE_BORDERLESS}_[NS][1-4].mpc" >> $LOGFILE_TIME
|
||||||
|
getProcessingTime
|
||||||
|
|
||||||
|
echo | tee -a $LOGFILE_GENERAL
|
||||||
|
echo "#####################################" | tee -a $LOGFILE_GENERAL
|
||||||
|
echo "## Put a ${BORDER_WIDTH}px border to each side ##" | tee -a $LOGFILE_GENERAL
|
||||||
|
echo "#####################################" | tee -a $LOGFILE_GENERAL
|
||||||
|
for t in $TILES
|
||||||
|
do
|
||||||
|
if [ ! -s "tmp/heights_seams_${RESOLUTION_MAX}_${t}_emptyBorder.mpc" ]
|
||||||
|
then
|
||||||
|
# set -x
|
||||||
|
convert \
|
||||||
|
-monitor \
|
||||||
|
tmp/heights_seamless_${IMAGE_BORDERLESS}_${t}.mpc \
|
||||||
|
-bordercolor none \
|
||||||
|
-border ${BORDER_WIDTH} \
|
||||||
|
tmp/heights_seams_${RESOLUTION_MAX}_${t}_emptyBorder.mpc
|
||||||
|
set +x
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
if [ ! -s "tmp/heights_seams_${RESOLUTION_MAX}_${t}.mpc" ]
|
||||||
|
then
|
||||||
|
# set -x
|
||||||
|
cp tmp/heights_seams_${RESOLUTION_MAX}_${t}_emptyBorder.mpc tmp/heights_seams_${RESOLUTION_MAX}_${t}.mpc
|
||||||
|
cp tmp/heights_seams_${RESOLUTION_MAX}_${t}_emptyBorder.cache tmp/heights_seams_${RESOLUTION_MAX}_${t}.cache
|
||||||
|
set +x
|
||||||
|
else echo "=> Skipping existing file: tmp/heights_seams_${RESOLUTION_MAX}_${t}.mpc" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
# 11m, 24s
|
||||||
|
echo "-> tmp/heights_seams_${RESOLUTION_MAX}_[NS][1-4]_emptyBorder.mpc -> tmp/heights_seams_${RESOLUTION_MAX}_[NS][1-4].mpc" >> $LOGFILE_TIME
|
||||||
|
getProcessingTime
|
||||||
|
|
||||||
|
echo | tee -a $LOGFILE_GENERAL
|
||||||
|
echo "######################################################" | tee -a $LOGFILE_GENERAL
|
||||||
|
echo "## crop borderline pixels and propagate to the edge ##" | tee -a $LOGFILE_GENERAL
|
||||||
|
echo "######################################################" | tee -a $LOGFILE_GENERAL
|
||||||
|
|
||||||
|
if [[ $NO_RESOLUTION_GIVEN == "true" ]]; then
|
||||||
|
if [ $RESOLUTION_MAX -eq 16384 ] ; then RESOLUTION_MAX=8192 ; fi
|
||||||
|
fi
|
||||||
|
let "BORDER_WIDTH = $RESOLUTION_MAX / 128"
|
||||||
|
let "IMAGE_BORDERLESS = $RESOLUTION_MAX - ( 2 * $BORDER_WIDTH )"
|
||||||
|
let "IMAGE_WITH_BORDER = $RESOLUTION_MAX - $BORDER_WIDTH - 1"
|
||||||
|
let "IMAGE_WITH_BORDER_POS = $RESOLUTION_MAX - $BORDER_WIDTH"
|
||||||
|
let "SIZE = 2 * $IMAGE_BORDERLESS"
|
||||||
|
|
||||||
|
CROP_TOP="${IMAGE_BORDERLESS}x1+${BORDER_WIDTH}+${BORDER_WIDTH}"
|
||||||
|
CROP_RIGHT="1x${IMAGE_BORDERLESS}+${IMAGE_WITH_BORDER}+${BORDER_WIDTH}"
|
||||||
|
CROP_BOTTOM="${IMAGE_BORDERLESS}x1+${BORDER_WIDTH}+${IMAGE_WITH_BORDER}"
|
||||||
|
CROP_LEFT="1x${IMAGE_BORDERLESS}+${BORDER_WIDTH}+${BORDER_WIDTH}"
|
||||||
|
CROP_TOPLEFT="1x1+${BORDER_WIDTH}+${BORDER_WIDTH}"
|
||||||
|
CROP_TOPRIGHT="1x1+${IMAGE_WITH_BORDER}+${BORDER_WIDTH}"
|
||||||
|
CROP_BOTTOMRIGHT="1x1+${IMAGE_WITH_BORDER}+${IMAGE_WITH_BORDER}"
|
||||||
|
CROP_BOTTOMLEFT="1x1+${BORDER_WIDTH}+${IMAGE_WITH_BORDER}"
|
||||||
|
|
||||||
|
## HORIZ meaning a horizontal bar, like the one on top
|
||||||
|
HORIZ_RESIZE="${IMAGE_BORDERLESS}x${BORDER_WIDTH}"
|
||||||
|
VERT_RESIZE="${BORDER_WIDTH}x${IMAGE_BORDERLESS}"
|
||||||
|
|
||||||
|
POS_TOP="+${BORDER_WIDTH}+0"
|
||||||
|
POS_RIGHT="+${IMAGE_WITH_BORDER_POS}+${BORDER_WIDTH}"
|
||||||
|
POS_BOTTOM="+${BORDER_WIDTH}+${IMAGE_WITH_BORDER_POS}"
|
||||||
|
POS_LEFT="+0+${BORDER_WIDTH}"
|
||||||
|
|
||||||
|
for t in $TILES
|
||||||
|
do
|
||||||
|
if [ ! -s "tmp/heights_${RESOLUTION_MAX}_done_${t}.mpc" ]
|
||||||
|
then
|
||||||
|
for b in $BORDERS
|
||||||
|
do
|
||||||
|
{
|
||||||
|
if [ $b == "top" ]
|
||||||
|
then
|
||||||
|
CROP=$CROP_TOP
|
||||||
|
RESIZE=$HORIZ_RESIZE
|
||||||
|
POSITION=$POS_TOP
|
||||||
|
CROPCORNER=$CROP_TOPRIGHT
|
||||||
|
CORNER_POS="+${IMAGE_WITH_BORDER_POS}+0"
|
||||||
|
CORNER_NAME="topRight"
|
||||||
|
fi
|
||||||
|
if [ $b == "right" ]
|
||||||
|
then
|
||||||
|
CROP=$CROP_RIGHT
|
||||||
|
RESIZE=$VERT_RESIZE
|
||||||
|
POSITION=$POS_RIGHT
|
||||||
|
CROPCORNER=$CROP_BOTTOMRIGHT
|
||||||
|
CORNER_POS="+${IMAGE_WITH_BORDER_POS}+${IMAGE_WITH_BORDER_POS}"
|
||||||
|
CORNER_NAME="bottomRight"
|
||||||
|
fi
|
||||||
|
if [ $b == "bottom" ]
|
||||||
|
then
|
||||||
|
CROP=$CROP_BOTTOM
|
||||||
|
RESIZE=$HORIZ_RESIZE
|
||||||
|
POSITION=$POS_BOTTOM
|
||||||
|
CROPCORNER=$CROP_BOTTOMLEFT
|
||||||
|
CORNER_POS="+0+${IMAGE_WITH_BORDER_POS}"
|
||||||
|
CORNER_NAME="bottomLeft"
|
||||||
|
fi
|
||||||
|
if [ $b == "left" ]
|
||||||
|
then
|
||||||
|
CROP=$CROP_LEFT
|
||||||
|
RESIZE=$VERT_RESIZE
|
||||||
|
POSITION=$POS_LEFT
|
||||||
|
CROPCORNER=$CROP_TOPLEFT
|
||||||
|
CORNER_POS="+0+0"
|
||||||
|
CORNER_NAME="topLeft"
|
||||||
|
fi
|
||||||
|
echo
|
||||||
|
# set -x
|
||||||
|
convert \
|
||||||
|
-monitor \
|
||||||
|
tmp/heights_seams_${RESOLUTION_MAX}_${t}_emptyBorder.mpc \
|
||||||
|
-crop $CROP \
|
||||||
|
-resize $RESIZE\! \
|
||||||
|
tmp/heights_${RESOLUTION_MAX}_${t}_seam_${b}.mpc
|
||||||
|
convert \
|
||||||
|
-monitor \
|
||||||
|
tmp/heights_seams_${RESOLUTION_MAX}_${t}_emptyBorder.mpc \
|
||||||
|
-crop $CROPCORNER \
|
||||||
|
-resize ${BORDER_WIDTH}x${BORDER_WIDTH}\! \
|
||||||
|
tmp/heights_${RESOLUTION_MAX}_${t}_seam_${CORNER_NAME}.mpc
|
||||||
|
convert \
|
||||||
|
-monitor \
|
||||||
|
tmp/heights_seams_${RESOLUTION_MAX}_${t}.mpc \
|
||||||
|
tmp/heights_${RESOLUTION_MAX}_${t}_seam_${b}.mpc \
|
||||||
|
-geometry $POSITION \
|
||||||
|
-composite \
|
||||||
|
tmp/heights_seams_${RESOLUTION_MAX}_${t}.mpc
|
||||||
|
echo
|
||||||
|
convert \
|
||||||
|
-monitor \
|
||||||
|
tmp/heights_seams_${RESOLUTION_MAX}_${t}.mpc \
|
||||||
|
tmp/heights_${RESOLUTION_MAX}_${t}_seam_${CORNER_NAME}.mpc \
|
||||||
|
-geometry $CORNER_POS \
|
||||||
|
-composite \
|
||||||
|
tmp/heights_seams_${RESOLUTION_MAX}_${t}.mpc
|
||||||
|
set +x
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
done
|
||||||
|
echo
|
||||||
|
# set -x
|
||||||
|
cp -v tmp/heights_seams_${RESOLUTION_MAX}_${t}.mpc tmp/heights_${RESOLUTION_MAX}_done_${t}.mpc | tee -a $LOGFILE_GENERAL
|
||||||
|
cp -v tmp/heights_seams_${RESOLUTION_MAX}_${t}.cache tmp/heights_${RESOLUTION_MAX}_done_${t}.cache | tee -a $LOGFILE_GENERAL
|
||||||
|
set +x
|
||||||
|
|
||||||
|
else echo "=> Skipping existing file: tmp/heights_${RESOLUTION_MAX}_done_${t}.mpc" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
|
||||||
|
fi
|
||||||
|
|
||||||
|
done
|
||||||
|
# 37m, 6s
|
||||||
|
echo "-> tmp/heights_seams_${RESOLUTION_MAX}_[NS][1-4].mpc -> tmp/heights_${RESOLUTION_MAX}_done_[NS][1-4].mpc" >> $LOGFILE_TIME
|
||||||
|
getProcessingTime
|
||||||
|
|
||||||
|
for t in $TILES
|
||||||
|
do
|
||||||
|
echo | tee -a $LOGFILE_GENERAL
|
||||||
|
echo "#############################" | tee -a $LOGFILE_GENERAL
|
||||||
|
echo "## Final output of tile $t ##" | tee -a $LOGFILE_GENERAL
|
||||||
|
echo "## and normalmapping ##" | tee -a $LOGFILE_GENERAL
|
||||||
|
echo "#############################" | tee -a $LOGFILE_GENERAL
|
||||||
|
|
||||||
|
for r in $RESOLUTION
|
||||||
|
do
|
||||||
|
{
|
||||||
|
mkdir -p output/$r
|
||||||
|
set +x
|
||||||
|
echo
|
||||||
|
echo "--> Writing output/${r}/heights_${t}.png @ ${r}x${r}"
|
||||||
|
# set -x
|
||||||
|
|
||||||
|
if [ ! -s "output/${r}/heights_${t}.png" ]
|
||||||
|
then
|
||||||
|
|
||||||
|
convert \
|
||||||
|
-monitor \
|
||||||
|
tmp/heights_${RESOLUTION_MAX}_done_${t}.mpc \
|
||||||
|
-resize ${r}x${r} \
|
||||||
|
output/${r}/heights_${t}.png
|
||||||
|
echo
|
||||||
|
|
||||||
|
else echo "=> Skipping existing file: tmp/heights_${RESOLUTION_MAX}_done_${t}.mpc" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "--> Writing output/${r}/normalmap_earth_${t}.png @ ${r}x${r}"
|
||||||
|
if [ ! -s "output/${r}/normalmap_earth_${t}.png" ]
|
||||||
|
then
|
||||||
|
|
||||||
|
$NORMALBIN $NORMALOPTS output/${r}/heights_${t}.png output/${r}/normalmap_earth_${t}.png
|
||||||
|
|
||||||
|
else echo "=> Skipping existing file: output/${r}/normalmap_earth_${t}.png" | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
|
||||||
|
fi
|
||||||
|
|
||||||
|
set +x
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
done
|
||||||
|
|
||||||
|
echo | tee -a $LOGFILE_GENERAL
|
||||||
|
echo "Heights and Normal $t [ done ]" | tee -a $LOGFILE_GENERAL
|
||||||
|
echo | tee -a $LOGFILE_GENERAL
|
||||||
|
|
||||||
|
done
|
||||||
|
echo "###############################" | tee -a $LOGFILE_GENERAL
|
||||||
|
echo "#### Heights: [ done ] ####" | tee -a $LOGFILE_GENERAL
|
||||||
|
echo "###############################" | tee -a $LOGFILE_GENERAL
|
||||||
|
# 2h, 19m, 7s
|
||||||
|
# Overall processing time: 44089 s
|
||||||
|
# Overall processing time: 0 d, 2 h, 19 m, 7 s
|
||||||
|
|
||||||
|
echo "-> output/<\$RESOLUTIONS>/heights_[NS][1-4].png" >> $LOGFILE_TIME
|
||||||
|
getProcessingTime
|
||||||
|
echo
|
||||||
|
if [ $STARTTIME -eq $ENDTIME ]
|
||||||
|
then SECS=0
|
||||||
|
else let "SECS = $ENDTIME - $STARTTIME"
|
||||||
|
fi
|
||||||
|
echo "Overall processing time: $SECS s" | tee -a $LOGFILE_GENERAL
|
||||||
|
prettyTime
|
||||||
|
echo "Overall processing time: $DAYS d, $HOURS h, $MINUTES m, $SECS s" | tee -a $LOGFILE_GENERAL
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function checkResults
|
function checkResults
|
||||||
{
|
{
|
||||||
echo | tee -a $LOGFILE_GENERAL
|
echo | tee -a $LOGFILE_GENERAL
|
||||||
@@ -1251,7 +1649,7 @@ function checkResults
|
|||||||
let "HEIGHT = 2 * $RES"
|
let "HEIGHT = 2 * $RES"
|
||||||
echo "Lowest available resolution is: $RES" | tee -a $LOGFILE_GENERAL
|
echo "Lowest available resolution is: $RES" | tee -a $LOGFILE_GENERAL
|
||||||
|
|
||||||
if [ $CHECKCLOUDS == "true" ]
|
if [[ $CHECKCLOUDS == "true" ]]
|
||||||
then
|
then
|
||||||
{
|
{
|
||||||
echo "checking clouds..." | tee -a $LOGFILE_GENERAL
|
echo "checking clouds..." | tee -a $LOGFILE_GENERAL
|
||||||
@@ -1292,7 +1690,51 @@ function checkResults
|
|||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $CHECKWORLD == "true" ]
|
|
||||||
|
if [[ $CHECKHEIGHTS == "true" ]]
|
||||||
|
then
|
||||||
|
{
|
||||||
|
echo "checking heights..." | tee -a $LOGFILE_GENERAL
|
||||||
|
echo | tee -a $LOGFILE_GENERAL
|
||||||
|
|
||||||
|
echo "Creating canvas ${WIDTH}x${HEIGHT}" | tee -a $LOGFILE_GENERAL
|
||||||
|
convert \
|
||||||
|
-size ${WIDTH}x${HEIGHT} \
|
||||||
|
xc:Black \
|
||||||
|
-alpha on \
|
||||||
|
check_heights.png
|
||||||
|
|
||||||
|
POS=0
|
||||||
|
for t in 1 2 3 4
|
||||||
|
do
|
||||||
|
convert \
|
||||||
|
-monitor \
|
||||||
|
check_heights.png \
|
||||||
|
output/${RES}/heights_N${t}.png \
|
||||||
|
-geometry +${POS}+0 \
|
||||||
|
-composite \
|
||||||
|
check_heights.png
|
||||||
|
echo
|
||||||
|
convert \
|
||||||
|
-monitor \
|
||||||
|
check_heights.png \
|
||||||
|
output/${RES}/heights_S${t}.png \
|
||||||
|
-geometry +${POS}+${RES} \
|
||||||
|
-composite \
|
||||||
|
check_heights.png
|
||||||
|
echo
|
||||||
|
let "POS += $RES"
|
||||||
|
done
|
||||||
|
mogrify \
|
||||||
|
-monitor \
|
||||||
|
-resize 4096x2048 \
|
||||||
|
check_heights.png
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if [[ $CHECKWORLD == "true" ]]
|
||||||
then
|
then
|
||||||
{
|
{
|
||||||
echo "checking world..." | tee -a $LOGFILE_GENERAL
|
echo "checking world..." | tee -a $LOGFILE_GENERAL
|
||||||
@@ -1366,6 +1808,7 @@ echo $TIME | tee -a $LOGFILE_TIME
|
|||||||
echo | tee -a $LOGFILE_GENERAL
|
echo | tee -a $LOGFILE_GENERAL
|
||||||
printf "Target: " | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
|
printf "Target: " | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
|
||||||
if [ $CLOUDS == "true" ] ; then printf "clouds " | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME ; fi
|
if [ $CLOUDS == "true" ] ; then printf "clouds " | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME ; fi
|
||||||
|
if [ $HEIGHTS == "true" ] ; then printf "heights " | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME ; fi
|
||||||
if [ $WORLD == "true" ] ; then printf "world " | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME ; fi
|
if [ $WORLD == "true" ] ; then printf "world " | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME ; fi
|
||||||
echo | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
|
echo | tee -a $LOGFILE_GENERAL | tee -a $LOGFILE_TIME
|
||||||
echo "Will work in ${RESOLUTION_MAX}x${RESOLUTION_MAX} resolution and will output" | tee -a $LOGFILE_GENERAL
|
echo "Will work in ${RESOLUTION_MAX}x${RESOLUTION_MAX} resolution and will output" | tee -a $LOGFILE_GENERAL
|
||||||
@@ -1377,12 +1820,13 @@ echo "--------------------------------------------------------------" | tee -a $
|
|||||||
echo | tee -a $LOGFILE_GENERAL
|
echo | tee -a $LOGFILE_GENERAL
|
||||||
|
|
||||||
|
|
||||||
if [ $REBUILD == "true" ] ; then rebuild ; fi
|
if [[ $REBUILD == "true" ]] ; then rebuild ; fi
|
||||||
if [ $DOWNLOAD == "true" ] ; then downloadImages ; fi
|
if [[ $DOWNLOAD == "true" ]] ; then downloadImages ; fi
|
||||||
if [ $WORLD == "true" ] ; then generateWorld ; fi
|
if [[ $WORLD == "true" ]] ; then generateWorld ; fi
|
||||||
if [ $CLOUDS == "true" ] ; then generateClouds ; fi
|
if [[ $CLOUDS == "true" ]] ; then generateClouds ; fi
|
||||||
if [ $BUILDCHECKS == "true" ] ; then checkResults ; fi
|
if [[ $HEIGHTS == "true" ]]; then generateHeights; fi
|
||||||
if [ $CLEANUP == "true" ] ; then cleanUp ; fi
|
if [[ $BUILDCHECKS == "true" ]] ; then checkResults ; fi
|
||||||
|
if [[ $CLEANUP == "true" ]] ; then cleanUp ; fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ cp simgear-*.tar.bz2 ../output/.
|
|||||||
#####################################################################################
|
#####################################################################################
|
||||||
echo "Starting on FlightGear"
|
echo "Starting on FlightGear"
|
||||||
cd ../fgBuild
|
cd ../fgBuild
|
||||||
cmake -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DSIMGEAR_SHARED:BOOL="ON" -DFG_BUILD_TYPE=Release ../flightgear
|
cmake -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DSIMGEAR_SHARED:BOOL="ON" -DENABLE_SWIFT:BOOL=ON -DFG_BUILD_TYPE=Release ../flightgear
|
||||||
|
|
||||||
# compile
|
# compile
|
||||||
make
|
make
|
||||||
|
|||||||
@@ -37,7 +37,8 @@ cmake ..\flightgear -G "Visual Studio 14" ^
|
|||||||
-DBOOST_ROOT=%WORKSPACE%/windows-3rd-party ^
|
-DBOOST_ROOT=%WORKSPACE%/windows-3rd-party ^
|
||||||
-DOSG_FSTREAM_EXPORT_FIXED=1 ^
|
-DOSG_FSTREAM_EXPORT_FIXED=1 ^
|
||||||
-DCMAKE_PREFIX_PATH=%QT5SDK32%;%OSG32% ^
|
-DCMAKE_PREFIX_PATH=%QT5SDK32%;%OSG32% ^
|
||||||
-DFG_BUILD_TYPE=%FGBUILDTYPE%
|
-DFG_BUILD_TYPE=%FGBUILDTYPE% ^
|
||||||
|
-DENABLE_SWIFT:BOOL=ON
|
||||||
cmake --build . --config RelWithDebInfo --target INSTALL
|
cmake --build . --config RelWithDebInfo --target INSTALL
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
@@ -62,7 +63,8 @@ cmake ..\flightgear -G "Visual Studio 14 Win64" ^
|
|||||||
-DCMAKE_INSTALL_PREFIX:PATH=%WORKSPACE%/install/msvc140-64 ^
|
-DCMAKE_INSTALL_PREFIX:PATH=%WORKSPACE%/install/msvc140-64 ^
|
||||||
-DCMAKE_PREFIX_PATH=%QT5SDK64%;%OSG64% ^
|
-DCMAKE_PREFIX_PATH=%QT5SDK64%;%OSG64% ^
|
||||||
-DOSG_FSTREAM_EXPORT_FIXED=1 ^
|
-DOSG_FSTREAM_EXPORT_FIXED=1 ^
|
||||||
-DFG_BUILD_TYPE=%FGBUILDTYPE%
|
-DFG_BUILD_TYPE=%FGBUILDTYPE% ^
|
||||||
|
-DENABLE_SWIFT:BOOL=ON
|
||||||
cmake --build . --config RelWithDebInfo --target INSTALL
|
cmake --build . --config RelWithDebInfo --target INSTALL
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|||||||
+9
-2
@@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import datetime
|
import datetime
|
||||||
import xml.etree.cElementTree as ET
|
#import xml.etree.cElementTree as ET
|
||||||
|
import lxml.etree as ET
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sgprops
|
import sgprops
|
||||||
@@ -212,7 +213,7 @@ def append_author_nodes(node, info):
|
|||||||
# traditional single author string
|
# traditional single author string
|
||||||
node.append( make_xml_leaf('author', info['author']) )
|
node.append( make_xml_leaf('author', info['author']) )
|
||||||
|
|
||||||
def make_aircraft_node(aircraftDirName, package, variants, downloadBase):
|
def make_aircraft_node(aircraftDirName, package, variants, downloadBase, mirrors):
|
||||||
#print "package:", package
|
#print "package:", package
|
||||||
#print "variants:", variants
|
#print "variants:", variants
|
||||||
package_node = ET.Element('package')
|
package_node = ET.Element('package')
|
||||||
@@ -261,9 +262,15 @@ def make_aircraft_node(aircraftDirName, package, variants, downloadBase):
|
|||||||
|
|
||||||
package_node.append( make_xml_leaf('dir', aircraftDirName) )
|
package_node.append( make_xml_leaf('dir', aircraftDirName) )
|
||||||
|
|
||||||
|
# primary URL is first
|
||||||
download_url = downloadBase + aircraftDirName + '.zip'
|
download_url = downloadBase + aircraftDirName + '.zip'
|
||||||
package_node.append( make_xml_leaf('url', download_url) )
|
package_node.append( make_xml_leaf('url', download_url) )
|
||||||
|
|
||||||
|
for m in mirrors:
|
||||||
|
mu = m + aircraftDirName + '.zip'
|
||||||
|
package_node.append( make_xml_leaf('url', mu) )
|
||||||
|
|
||||||
|
|
||||||
if 'thumbnail' in package:
|
if 'thumbnail' in package:
|
||||||
thumbnail_url = downloadBase + 'thumbnails/' + aircraftDirName + '_' + package['thumbnail']
|
thumbnail_url = downloadBase + 'thumbnails/' + aircraftDirName + '_' + package['thumbnail']
|
||||||
package_node.append( make_xml_leaf('thumbnail', thumbnail_url) )
|
package_node.append( make_xml_leaf('thumbnail', thumbnail_url) )
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<PropertyList>
|
||||||
|
<local-output>/home/fgaddon/output/Aircraft-trunk</local-output>
|
||||||
|
<download-url n="0">http://mirrors.ibiblio.org/flightgear/ftp/Aircraft-trunk/</download-url>
|
||||||
|
<download-url n="1">http://ukmirror.flightgear.org/fgaddon/Aircraft-trunk/</download-url>
|
||||||
|
|
||||||
|
<thumbnail-url n="0">http://mirrors.ibiblio.org/flightgear/ftp/Aircraft-trunk/thumbnails</thumbnail-url>
|
||||||
|
<thumbnail-url n="1">http://ukmirror.flightgear.org/fgaddon/Aircraft-trunk/thumbnails</thumbnail-url>
|
||||||
|
|
||||||
|
<scm>
|
||||||
|
<type>svn</type>
|
||||||
|
<path>/home/fgaddon/fgaddon-trunk/Aircraft</path>
|
||||||
|
<skip>NTPS</skip>
|
||||||
|
<skip>c172</skip>
|
||||||
|
<skip>tu134</skip>
|
||||||
|
</scm>
|
||||||
|
<include-dir>/home/fgaddon/fgdata</include-dir>
|
||||||
|
<include-dir>/home/fgaddon/fgaddon-trunk</include-dir>
|
||||||
|
|
||||||
|
<!-- <scm>
|
||||||
|
<type>git</type>
|
||||||
|
<update type="bool">false</update>
|
||||||
|
<path>/Users/jmt/FGFS/fgdata</path>
|
||||||
|
<url>git://git.code.sf.net/p/flightgear/fgdata</url>
|
||||||
|
</scm> -->
|
||||||
|
<upload n="0">
|
||||||
|
<enabled type="bool">true</enabled>
|
||||||
|
<type>rsync-ssh</type>
|
||||||
|
<remote>ibiblio:/public/mirrors/flightgear/ftp/Aircraft</remote>
|
||||||
|
</upload>
|
||||||
|
</PropertyList>
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<PropertyList>
|
||||||
|
<template>
|
||||||
|
<version n="0">2019.*</version>
|
||||||
|
<version n="1">2018.*</version>
|
||||||
|
|
||||||
|
<id>org.flightgear.fgaddon.trunk</id>
|
||||||
|
<license>GPL</license>
|
||||||
|
<url>http://mirrors.ibiblio.org/flightgear/ftp/Aircraft-trunk/catalog.xml</url>
|
||||||
|
<name>FlightGear aircraft distribution from fgaddon</name>
|
||||||
|
<description>This hangar provides aircraft officially supported and maintained by the FlightGear project,
|
||||||
|
under a free-software license. It tracks latest aircraft developments in the FGaddon repository.</description>
|
||||||
|
<!-- <de>
|
||||||
|
<description>Auf Deutsch</description>
|
||||||
|
</de>
|
||||||
|
<fr>
|
||||||
|
<description>En Francais</description>
|
||||||
|
</fr> -->
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</PropertyList>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
*/.svn/*
|
||||||
|
*.xcf
|
||||||
|
*.blend
|
||||||
|
*.psd
|
||||||
|
*~
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<PropertyList>
|
||||||
|
<local-output>/home/fgaddon/output/Aircraft</local-output>
|
||||||
|
<download-url n="0">http://mirrors.ibiblio.org/flightgear/ftp/Aircraft/</download-url>
|
||||||
|
<download-url n="1">http://ukmirror.flightgear.org/fgaddon/Aircraft/</download-url>
|
||||||
|
|
||||||
|
<thumbnail-url n="0">http://mirrors.ibiblio.org/flightgear/ftp/Aircraft/thumbnails</thumbnail-url>
|
||||||
|
<thumbnail-url n="1">http://ukmirror.flightgear.org/fgaddon/Aircraft/thumbnails</thumbnail-url>
|
||||||
|
|
||||||
|
<scm>
|
||||||
|
<type>svn</type>
|
||||||
|
<path>/home/fgaddon/fgaddon-legacy/Aircraft</path>
|
||||||
|
<skip>NTPS</skip>
|
||||||
|
<skip>c172</skip>
|
||||||
|
<skip>tu134</skip>
|
||||||
|
</scm>
|
||||||
|
<include-dir>/home/fgaddon/fgdata-legacy</include-dir>
|
||||||
|
<include-dir>/home/fgaddon/fgaddon-legacy</include-dir>
|
||||||
|
|
||||||
|
<upload n="0">
|
||||||
|
<enabled type="bool">true</enabled>
|
||||||
|
<type>rsync-ssh</type>
|
||||||
|
<remote>ibiblio:/public/mirrors/flightgear/ftp/Aircraft-legacy</remote>
|
||||||
|
</upload>
|
||||||
|
</PropertyList>
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<PropertyList>
|
||||||
|
<template>
|
||||||
|
<version n="0">3.4.*</version>
|
||||||
|
<version n="1">3.5.*</version>
|
||||||
|
<version n="2">3.6.*</version>
|
||||||
|
<version n="3">3.7.*</version>
|
||||||
|
<version n="5">2016.*.*</version>
|
||||||
|
<version n="6">2017.*.*</version>
|
||||||
|
<version n="7">2018.*.*</version>
|
||||||
|
|
||||||
|
<!-- the legacy catalog has to have this ID, becuase this is what older FG
|
||||||
|
clients expect -->
|
||||||
|
<id>org.flightgear.fgaddon</id>
|
||||||
|
<license>GPL</license>
|
||||||
|
<url>http://mirrors.ibiblio.org/flightgear/ftp/Aircraft/catalog.xml</url>
|
||||||
|
<name>FlightGear aircraft(legacy support)</name>
|
||||||
|
<description>This hangar provides aircraft officially supported and maintained by the
|
||||||
|
FlightGear project, under a free-software license. Aircraft are intended for
|
||||||
|
use with FlightGear versions 2018.2 and older.</description>
|
||||||
|
|
||||||
|
<!-- <alternate-version>
|
||||||
|
<version>2019.*</version>
|
||||||
|
<version>2018.4.*</version>
|
||||||
|
<url>http://mirrors.ibiblio.org/flightgear/ftp/Aircraft-trunk/catalog.xml</url>
|
||||||
|
<id>org.flightgear.fgaddon.trunk</id>
|
||||||
|
</alternate-version>
|
||||||
|
|
||||||
|
<alternate-version>
|
||||||
|
<version>2018.3.*</version>
|
||||||
|
<url>http://mirrors.ibiblio.org/flightgear/ftp/Aircraft-2018/catalog.xml</url>
|
||||||
|
<id>org.flightgear.fgaddon.stable_2018</id>
|
||||||
|
</alternate-version>
|
||||||
|
-->
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</PropertyList>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
*/.svn/*
|
||||||
|
*.xcf
|
||||||
|
*.blend
|
||||||
|
*.psd
|
||||||
|
*~
|
||||||
+2
-1
@@ -2,7 +2,8 @@
|
|||||||
from xml.sax import make_parser, handler, expatreader
|
from xml.sax import make_parser, handler, expatreader
|
||||||
|
|
||||||
# ElementTree for writing
|
# ElementTree for writing
|
||||||
import xml.etree.cElementTree as ET
|
#import xml.etree.cElementTree as ET
|
||||||
|
import lxml.etree as ET
|
||||||
|
|
||||||
import re, os
|
import re, os
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--Template catalog - copy and modify for your site as required-->
|
||||||
|
<PropertyList>
|
||||||
|
<local-output>/home/fgaddon/output/Aircraft-2018</local-output>
|
||||||
|
<download-url n="0">http://mirrors.ibiblio.org/flightgear/ftp/Aircraft-2018/</download-url>
|
||||||
|
<download-url n="1">http://ukmirror.flightgear.org/fgaddon/Aircraft-2018/</download-url>
|
||||||
|
|
||||||
|
<thumbnail-url n="0">http://mirrors.ibiblio.org/flightgear/ftp/Aircraft-2018/thumbnails</thumbnail-url>
|
||||||
|
<thumbnail-url n="1">http://ukmirror.flightgear.org/official/Aircraft-2018/thumbnails</thumbnail-url>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- share zips with the trunk catalog where possible -->
|
||||||
|
<share-output>/home/fgaddon/output/Aircraft</share-output>
|
||||||
|
<share-md5-sums>/home/fgaddon/fgmeta/catalog/fgaddon-catalog-ukmirror/md5sum.xml</share-md5-sums>
|
||||||
|
|
||||||
|
<scm>
|
||||||
|
<type>svn</type>
|
||||||
|
<path>/home/fgaddon/fgaddon-release-2018.3/Aircraft</path>
|
||||||
|
<skip>NTPS</skip>
|
||||||
|
<skip>c172</skip>
|
||||||
|
<skip>tu134</skip>
|
||||||
|
</scm>
|
||||||
|
|
||||||
|
<include-dir>/home/fgaddon/fgdata-release_2018.3</include-dir>
|
||||||
|
<include-dir>/home/fgaddon/fgaddon-release-2018.3</include-dir>
|
||||||
|
|
||||||
|
<upload n="0">
|
||||||
|
<enabled type="bool">true</enabled>
|
||||||
|
<type>rsync-ssh</type>
|
||||||
|
<remote>ibiblio:/public/mirrors/flightgear/ftp/Aircraft-2018</remote>
|
||||||
|
</upload>
|
||||||
|
</PropertyList>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<PropertyList>
|
||||||
|
<template>
|
||||||
|
<version n="0">2018.*</version>
|
||||||
|
<id>org.flightgear.fgaddon.stable_2018</id>
|
||||||
|
<license>GPL</license>
|
||||||
|
<url>http://mirrors.ibiblio.org/flightgear/ftp/Aircraft-2018/catalog.xml</url>
|
||||||
|
<name>FlightGear aircraft distribution for 2018.x versions</name>
|
||||||
|
<description>This hangar provides aircraft officially supported and maintained
|
||||||
|
by the FlightGear project, under a free-software license. These aircraft
|
||||||
|
are compatible with FlightGear versions from 2018.</description>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</PropertyList>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
*/.svn/*
|
||||||
|
*.xcf
|
||||||
|
*.blend
|
||||||
|
*.psd
|
||||||
|
*~
|
||||||
@@ -24,10 +24,13 @@ parser.add_argument("--no-update",
|
|||||||
action="store_true")
|
action="store_true")
|
||||||
parser.add_argument("--clean", help="Force regeneration of all zip files",
|
parser.add_argument("--clean", help="Force regeneration of all zip files",
|
||||||
action="store_true")
|
action="store_true")
|
||||||
|
parser.add_argument("--quiet", help="Only print warnings and errors",
|
||||||
|
action="store_true")
|
||||||
parser.add_argument("dir", help="Catalog directory")
|
parser.add_argument("dir", help="Catalog directory")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
includes = []
|
includes = []
|
||||||
|
mirrors = [] # mirror base URLs
|
||||||
|
|
||||||
# xml node (robust) get text helper
|
# xml node (robust) get text helper
|
||||||
def get_xml_text(e):
|
def get_xml_text(e):
|
||||||
@@ -64,6 +67,7 @@ def scan_dir_for_change_date_mtime(path):
|
|||||||
return maxsec
|
return maxsec
|
||||||
|
|
||||||
def make_aircraft_zip(repo_path, name, zip_file):
|
def make_aircraft_zip(repo_path, name, zip_file):
|
||||||
|
if (not args.quiet):
|
||||||
print "Updating:", name + '.zip'
|
print "Updating:", name + '.zip'
|
||||||
savedir = os.getcwd()
|
savedir = os.getcwd()
|
||||||
os.chdir(repo_path)
|
os.chdir(repo_path)
|
||||||
@@ -129,6 +133,7 @@ def process_aircraft_dir(name, repo_path):
|
|||||||
global output_dir
|
global output_dir
|
||||||
global valid_zips
|
global valid_zips
|
||||||
global previews_dir
|
global previews_dir
|
||||||
|
global mirrors
|
||||||
|
|
||||||
aircraft_dir = os.path.join(repo_path, name)
|
aircraft_dir = os.path.join(repo_path, name)
|
||||||
if not os.path.isdir(aircraft_dir):
|
if not os.path.isdir(aircraft_dir):
|
||||||
@@ -136,12 +141,14 @@ def process_aircraft_dir(name, repo_path):
|
|||||||
|
|
||||||
(package, variants) = catalog.scan_aircraft_dir(aircraft_dir, includes)
|
(package, variants) = catalog.scan_aircraft_dir(aircraft_dir, includes)
|
||||||
if package == None:
|
if package == None:
|
||||||
|
if not args.quiet:
|
||||||
print "skipping:", name, "(no -set.xml files)"
|
print "skipping:", name, "(no -set.xml files)"
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if not args.quiet:
|
||||||
print "%s:" % name,
|
print "%s:" % name,
|
||||||
|
|
||||||
package_node = catalog.make_aircraft_node(name, package, variants, download_base)
|
package_node = catalog.make_aircraft_node(name, package, variants, download_base, mirrors)
|
||||||
|
|
||||||
download_url = download_base + name + '.zip'
|
download_url = download_base + name + '.zip'
|
||||||
if 'thumbnail' in package:
|
if 'thumbnail' in package:
|
||||||
@@ -168,10 +175,12 @@ def process_aircraft_dir(name, repo_path):
|
|||||||
or dir_mtime > os.path.getmtime(zipfile) \
|
or dir_mtime > os.path.getmtime(zipfile) \
|
||||||
or args.clean:
|
or args.clean:
|
||||||
# rebuild zip file
|
# rebuild zip file
|
||||||
|
if not args.quiet:
|
||||||
print "updating:", zipfile
|
print "updating:", zipfile
|
||||||
make_aircraft_zip(repo_path, name, zipfile)
|
make_aircraft_zip(repo_path, name, zipfile)
|
||||||
md5sum = get_md5sum(zipfile)
|
md5sum = get_md5sum(zipfile)
|
||||||
else:
|
else:
|
||||||
|
if not args.quiet:
|
||||||
print "(no change)"
|
print "(no change)"
|
||||||
if md5sum == "":
|
if md5sum == "":
|
||||||
md5sum = get_md5sum(zipfile)
|
md5sum = get_md5sum(zipfile)
|
||||||
@@ -186,6 +195,18 @@ def process_aircraft_dir(name, repo_path):
|
|||||||
else:
|
else:
|
||||||
md5sum_root.append( catalog.make_xml_leaf('aircraft_' + name, md5sum) )
|
md5sum_root.append( catalog.make_xml_leaf('aircraft_' + name, md5sum) )
|
||||||
|
|
||||||
|
# handle sharing
|
||||||
|
if share_md5sum_root != None:
|
||||||
|
sharedNode = share_md5sum_root.find(str('aircraft_' + name))
|
||||||
|
if node != None:
|
||||||
|
shared_md5 = get_xml_text(sharedNode)
|
||||||
|
if shared_md5 == md5sum:
|
||||||
|
if not args.quiet:
|
||||||
|
print "Sharing zip with share catalog for:",name
|
||||||
|
os.remove(zipfile)
|
||||||
|
os.symlink(os.path.join( share_output_dir, name + '.zip' ), zipfile)
|
||||||
|
|
||||||
|
|
||||||
# handle thumbnails
|
# handle thumbnails
|
||||||
copy_thumbnails_for_package(package, variants, name, aircraft_dir, thumbnail_dir)
|
copy_thumbnails_for_package(package, variants, name, aircraft_dir, thumbnail_dir)
|
||||||
|
|
||||||
@@ -224,11 +245,31 @@ else:
|
|||||||
md5sum_root = ET.Element('PropertyList')
|
md5sum_root = ET.Element('PropertyList')
|
||||||
md5sum_tree = ET.ElementTree(md5sum_root)
|
md5sum_tree = ET.ElementTree(md5sum_root)
|
||||||
|
|
||||||
|
# share .zip files with other output dirs
|
||||||
|
share_output_dir = get_xml_text(config_node.find('share-output'))
|
||||||
|
share_md5_file = get_xml_text(config_node.find('share-md5-sums'))
|
||||||
|
if share_output_dir != '' and share_md5_file != '':
|
||||||
|
print 'Output shared with:', share_output_dir
|
||||||
|
share_md5sum_tree = ET.parse(share_md5_file, parser)
|
||||||
|
share_md5sum_root = share_md5sum_tree.getroot()
|
||||||
|
else:
|
||||||
|
share_md5sum_root = None
|
||||||
|
|
||||||
|
# SCM providers
|
||||||
scm_list = config_node.findall('scm')
|
scm_list = config_node.findall('scm')
|
||||||
upload_node = config_node.find('upload')
|
upload_node = config_node.find('upload')
|
||||||
download_base = get_xml_text(config_node.find('download-url'))
|
|
||||||
if not download_base.endswith('/'):
|
download_base = None
|
||||||
download_base += '/'
|
for i in config_node.findall("download-url"):
|
||||||
|
url = get_xml_text(i)
|
||||||
|
if not url.endswith('/'):
|
||||||
|
url += '/'
|
||||||
|
|
||||||
|
if download_base == None:
|
||||||
|
# download_base is the first entry
|
||||||
|
download_base = url
|
||||||
|
else:
|
||||||
|
mirrors.append(url)
|
||||||
|
|
||||||
output_dir = get_xml_text(config_node.find('local-output'))
|
output_dir = get_xml_text(config_node.find('local-output'))
|
||||||
if output_dir == '':
|
if output_dir == '':
|
||||||
@@ -300,6 +341,7 @@ for scm in scm_list:
|
|||||||
names = os.listdir(repo_path)
|
names = os.listdir(repo_path)
|
||||||
for name in sorted(names, key=lambda s: s.lower()):
|
for name in sorted(names, key=lambda s: s.lower()):
|
||||||
if name in skip_list:
|
if name in skip_list:
|
||||||
|
if not args.quiet:
|
||||||
print "skipping:", name
|
print "skipping:", name
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
+785
-350
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,2 @@
|
|||||||
|
scratch-*/
|
||||||
|
vcpkg-git/
|
||||||
@@ -46,8 +46,10 @@ IF NOT EXIST vcpkg-git/NUL (
|
|||||||
)
|
)
|
||||||
cd %ROOT_DIR%
|
cd %ROOT_DIR%
|
||||||
|
|
||||||
IF NOT EXIST openscenegraph-3.4-git/NUL (
|
IF NOT EXIST openscenegraph-3.4-build/NUL (
|
||||||
mkdir openscenegraph-3.4-build
|
mkdir openscenegraph-3.4-build
|
||||||
|
)
|
||||||
|
IF NOT EXIST openscenegraph-3.4-git/NUL (
|
||||||
echo Downloading OpenSceneGraph . . .
|
echo Downloading OpenSceneGraph . . .
|
||||||
git clone -b OpenSceneGraph-3.4 https://github.com/openscenegraph/OpenSceneGraph.git openscenegraph-3.4-git
|
git clone -b OpenSceneGraph-3.4 https://github.com/openscenegraph/OpenSceneGraph.git openscenegraph-3.4-git
|
||||||
) ELSE (
|
) ELSE (
|
||||||
@@ -57,8 +59,10 @@ IF NOT EXIST openscenegraph-3.4-git/NUL (
|
|||||||
)
|
)
|
||||||
cd %ROOT_DIR%
|
cd %ROOT_DIR%
|
||||||
|
|
||||||
IF NOT EXIST simgear-git/NUL (
|
IF NOT EXIST simgear-build/NUL (
|
||||||
mkdir simgear-build
|
mkdir simgear-build
|
||||||
|
)
|
||||||
|
IF NOT EXIST simgear-git/NUL (
|
||||||
echo Downloading SimGear . . .
|
echo Downloading SimGear . . .
|
||||||
git clone -b next https://git.code.sf.net/p/flightgear/simgear simgear-git
|
git clone -b next https://git.code.sf.net/p/flightgear/simgear simgear-git
|
||||||
) ELSE (
|
) ELSE (
|
||||||
@@ -68,8 +72,10 @@ IF NOT EXIST simgear-git/NUL (
|
|||||||
)
|
)
|
||||||
cd %ROOT_DIR%
|
cd %ROOT_DIR%
|
||||||
|
|
||||||
IF NOT EXIST flightgear-git/NUL (
|
IF NOT EXIST flightgear-build/NUL (
|
||||||
mkdir flightgear-build
|
mkdir flightgear-build
|
||||||
|
)
|
||||||
|
IF NOT EXIST flightgear-git/NUL (
|
||||||
echo Downloading FlightGear . . .
|
echo Downloading FlightGear . . .
|
||||||
git clone -b next https://git.code.sf.net/p/flightgear/flightgear flightgear-git
|
git clone -b next https://git.code.sf.net/p/flightgear/flightgear flightgear-git
|
||||||
) ELSE (
|
) ELSE (
|
||||||
@@ -79,8 +85,10 @@ IF NOT EXIST flightgear-git/NUL (
|
|||||||
)
|
)
|
||||||
cd %ROOT_DIR%
|
cd %ROOT_DIR%
|
||||||
|
|
||||||
IF NOT EXIST terragear-git/NUL (
|
IF NOT EXIST terragear-build/NUL (
|
||||||
mkdir terragear-build
|
mkdir terragear-build
|
||||||
|
)
|
||||||
|
IF NOT EXIST terragear-git/NUL (
|
||||||
echo Downloading TerraGear . . .
|
echo Downloading TerraGear . . .
|
||||||
git clone -b next https://git.code.sf.net/p/flightgear/terragear terragear-git
|
git clone -b next https://git.code.sf.net/p/flightgear/terragear terragear-git
|
||||||
) ELSE (
|
) ELSE (
|
||||||
|
|||||||
Executable
+202
@@ -0,0 +1,202 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# fg-from-scratch - Linux utility to download, compile, and stage TerraGear and its dependencies
|
||||||
|
# Copyright (C) 2018 Scott Giese (xDraconian) scttgs0@gmail.com
|
||||||
|
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
QT_SELECT=qt5
|
||||||
|
ROOT_DIR=${PWD}
|
||||||
|
PATH=${ROOT_DIR}/vcpkg-git/installed/x64-linux/bin:${PATH}
|
||||||
|
CMAKE_TOOLCHAIN="Ninja"
|
||||||
|
CHIPSET=$(gcc -march=native -Q --help=target | grep -- '-march=' | cut -f3)
|
||||||
|
|
||||||
|
QT5x64=$(qtpaths --install-prefix)
|
||||||
|
QT5x64_LIB=${QT5x64}/lib
|
||||||
|
QT5x64_CMAKE=${QT5x64_LIB}/cmake
|
||||||
|
QT5x64_PKGCONFIG=${QT5x64_LIB}/pkgconfig
|
||||||
|
export PKG_CONFIG_PATH=${ROOT_DIR}/scratch-install/lib64/pkgconfig:${ROOT_DIR}/vcpkg-git/installed/x64-linux/lib/pkgconfig:${QT5x64_PKGCONFIG}
|
||||||
|
|
||||||
|
echo ${QT5x64}
|
||||||
|
|
||||||
|
if [ ! -d "vcpkg-git" ]
|
||||||
|
then
|
||||||
|
echo Preparing to install external libraries via vcpkg . . .
|
||||||
|
git clone https://github.com/Microsoft/vcpkg.git vcpkg-git
|
||||||
|
|
||||||
|
echo Compiling vcpkg
|
||||||
|
cd vcpkg-git
|
||||||
|
./bootstrap-vcpkg.sh
|
||||||
|
|
||||||
|
echo Compiling external libraries . . .
|
||||||
|
./vcpkg install --triplet x64-linux boost cgal curl freeglut freetype glew jasper libxml2 openal-soft openssl plib sdl2 tiff zlib
|
||||||
|
else
|
||||||
|
echo Updating vcpkg . . .
|
||||||
|
cd vcpkg-git
|
||||||
|
PULL_RESULT=$(git pull)
|
||||||
|
|
||||||
|
if [ "${PULL_RESULT}" != "Already up to date." ]
|
||||||
|
then
|
||||||
|
echo Compiling vcpkg
|
||||||
|
./bootstrap-vcpkg.sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo Updating external libraries . . .
|
||||||
|
./vcpkg update
|
||||||
|
./vcpkg upgrade --triplet x64-linux --no-dry-run
|
||||||
|
|
||||||
|
echo Compiling external libraries . . .
|
||||||
|
./vcpkg install --triplet x64-linux boost cgal curl freeglut freetype glew jasper libxml2 openal-soft openssl plib sdl2 tiff zlib
|
||||||
|
fi
|
||||||
|
cd ${ROOT_DIR}
|
||||||
|
|
||||||
|
if [ ! -d "scratch-source" ]
|
||||||
|
then
|
||||||
|
mkdir scratch-source
|
||||||
|
fi
|
||||||
|
if [ ! -d "scratch-build" ]
|
||||||
|
then
|
||||||
|
mkdir scratch-build
|
||||||
|
fi
|
||||||
|
if [ ! -d "scratch-install" ]
|
||||||
|
then
|
||||||
|
mkdir scratch-install
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "scratch-build/openscenegraph-3.4" ]
|
||||||
|
then
|
||||||
|
mkdir scratch-build/openscenegraph-3.4
|
||||||
|
fi
|
||||||
|
if [ ! -d "scratch-source/openscenegraph-3.4-git" ]
|
||||||
|
then
|
||||||
|
echo Downloading OpenSceneGraph . . .
|
||||||
|
git clone -b OpenSceneGraph-3.4 https://github.com/openscenegraph/OpenSceneGraph.git scratch-source/openscenegraph-3.4-git
|
||||||
|
else
|
||||||
|
echo Updating OpenSceneGraph . . .
|
||||||
|
cd scratch-source/openscenegraph-3.4-git
|
||||||
|
git pull
|
||||||
|
fi
|
||||||
|
cd ${ROOT_DIR}
|
||||||
|
|
||||||
|
if [ ! -d "scratch-build/simgear" ]
|
||||||
|
then
|
||||||
|
mkdir scratch-build/simgear
|
||||||
|
fi
|
||||||
|
if [ ! -d "scratch-source/simgear-git" ]
|
||||||
|
then
|
||||||
|
echo Downloading SimGear . . .
|
||||||
|
git clone -b next https://git.code.sf.net/p/flightgear/simgear scratch-source/simgear-git
|
||||||
|
else
|
||||||
|
echo Updating SimGear . . .
|
||||||
|
cd scratch-source/simgear-git
|
||||||
|
git pull
|
||||||
|
fi
|
||||||
|
cd ${ROOT_DIR}
|
||||||
|
|
||||||
|
if [ ! -d "scratch-build/flightgear" ]
|
||||||
|
then
|
||||||
|
mkdir scratch-build/flightgear
|
||||||
|
fi
|
||||||
|
if [ ! -d "scratch-source/flightgear-git" ]
|
||||||
|
then
|
||||||
|
echo Downloading FlightGear . . .
|
||||||
|
git clone -b next https://git.code.sf.net/p/flightgear/flightgear scratch-source/flightgear-git
|
||||||
|
else
|
||||||
|
echo Updating FlightGear . . .
|
||||||
|
cd scratch-source/flightgear-git
|
||||||
|
git pull
|
||||||
|
fi
|
||||||
|
cd ${ROOT_DIR}
|
||||||
|
|
||||||
|
if [ ! -d "scratch-build/terragear" ]
|
||||||
|
then
|
||||||
|
mkdir scratch-build/terragear
|
||||||
|
fi
|
||||||
|
if [ ! -d "scratch-source/terragear-git" ]
|
||||||
|
then
|
||||||
|
echo Downloading TerraGear . . .
|
||||||
|
git clone -b next https://git.code.sf.net/p/flightgear/terragear scratch-source/terragear-git
|
||||||
|
else
|
||||||
|
echo Updating TerraGear . . .
|
||||||
|
cd scratch-source/terragear-git
|
||||||
|
git pull
|
||||||
|
fi
|
||||||
|
cd ${ROOT_DIR}
|
||||||
|
|
||||||
|
echo Compiling OpenSceneGraph . . .
|
||||||
|
cd scratch-build/openscenegraph-3.4
|
||||||
|
cmake ../../scratch-source/openscenegraph-3.4-git -G ${CMAKE_TOOLCHAIN} \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=${ROOT_DIR}/scratch-install \
|
||||||
|
-DCMAKE_PREFIX_PATH=${ROOT_DIR}/scratch-install/lib:${ROOT_DIR}/vcpkg-git/installed/x64-linux/lib:${QT5x64_LIB} \
|
||||||
|
-DCMAKE_CXX_FLAGS="-march=${CHIPSET} -mtune=${CHIPSET}" \
|
||||||
|
-DCMAKE_C_FLAGS="-march=${CHIPSET} -mtune=${CHIPSET}" \
|
||||||
|
-DBUILD_DOCUMENTATION:BOOL=1 \
|
||||||
|
-DBUILD_OSG_APPLICATIONS:BOOL=1 \
|
||||||
|
-DQt5Core_DIR=${QT5x64_CMAKE}/Qt5Core \
|
||||||
|
-DQt5Gui_DIR=${QT5x64_CMAKE}/Qt5Gui \
|
||||||
|
-DQt5OpenGL_DIR=${QT5x64_CMAKE}/Qt5OpenGL \
|
||||||
|
-DQt5Widgets_DIR=${QT5x64_CMAKE}/Qt5Widgets
|
||||||
|
cmake --build . --config Release --target install
|
||||||
|
cd ${ROOT_DIR}
|
||||||
|
|
||||||
|
echo Compiling SimGear . . .
|
||||||
|
cd scratch-build/simgear
|
||||||
|
cmake ../../scratch-source/simgear-git -G ${CMAKE_TOOLCHAIN} \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=${ROOT_DIR}/scratch-install \
|
||||||
|
-DCMAKE_PREFIX_PATH=${ROOT_DIR}/scratch-install/lib:${ROOT_DIR}/vcpkg-git/installed/x64-linux/lib:${QT5x64} \
|
||||||
|
-DCMAKE_CXX_FLAGS="-march=${CHIPSET} -mtune=${CHIPSET}" \
|
||||||
|
-DCMAKE_C_FLAGS="-march=${CHIPSET} -mtune=${CHIPSET}"
|
||||||
|
cmake --build . --config Release --target install
|
||||||
|
cd ${ROOT_DIR}
|
||||||
|
|
||||||
|
echo Compiling FlightGear . . .
|
||||||
|
cd scratch-build/flightgear
|
||||||
|
cmake ../../scratch-source/flightgear-git -G ${CMAKE_TOOLCHAIN} \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=${ROOT_DIR}/scratch-install \
|
||||||
|
-DCMAKE_PREFIX_PATH=${ROOT_DIR}/scratch-install/lib:${ROOT_DIR}/vcpkg-git/installed/x64-linux/lib:${QT5x64_LIB} \
|
||||||
|
-DCMAKE_CXX_FLAGS="-march=${CHIPSET} -mtune=${CHIPSET}" \
|
||||||
|
-DCMAKE_C_FLAGS="-march=${CHIPSET} -mtune=${CHIPSET}" \
|
||||||
|
-DOSG_FSTREAM_EXPORT_FIXED:BOOL=1 \
|
||||||
|
-DENABLE_JSBSIM:BOOL=1 \
|
||||||
|
-DENABLE_GPSSMOOTH:BOOL=1 \
|
||||||
|
-DENABLE_FGVIEWER:BOOL=1 \
|
||||||
|
-DENABLE_STGMERGE:BOOL=0 \
|
||||||
|
-DQt5Core_DIR=${QT5x64_CMAKE}/Qt5Core \
|
||||||
|
-DQt5Gui_DIR=${QT5x64_CMAKE}/Qt5Gui \
|
||||||
|
-DQt5LinguistTools_DIR=${QT5x64_CMAKE}/Qt5LinguistTools \
|
||||||
|
-DQt5Network_DIR=${QT5x64_CMAKE}/Qt5Network \
|
||||||
|
-DQt5Qml_DIR=${QT5x64_CMAKE}/Qt5Qml \
|
||||||
|
-DQt5Quick_DIR=${QT5x64_CMAKE}/Qt5Quick \
|
||||||
|
-DQt5Svg_DIR=${QT5x64_CMAKE}/Qt5Svg \
|
||||||
|
-DQt5Widgets_DIR=${QT5x64_CMAKE}/Qt5Widgets \
|
||||||
|
-DQt5_DIR=${QT5x64_CMAKE}/Qt5
|
||||||
|
cmake --build . --config Release --target install
|
||||||
|
cd ${ROOT_DIR}
|
||||||
|
|
||||||
|
echo Compiling TerraGear . . .
|
||||||
|
cd scratch-build/terragear
|
||||||
|
cmake ../../scratch-source/terragear-git -G ${CMAKE_TOOLCHAIN} \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=${ROOT_DIR}/scratch-install \
|
||||||
|
-DCMAKE_PREFIX_PATH=${ROOT_DIR}/scratch-install/lib:${ROOT_DIR}/vcpkg-git/installed/x64-linux/lib:${QT5x64_LIB} \
|
||||||
|
-DCMAKE_CXX_FLAGS="-march=${CHIPSET} -mtune=${CHIPSET}" \
|
||||||
|
-DCMAKE_C_FLAGS="-march=${CHIPSET} -mtune=${CHIPSET}"
|
||||||
|
cmake --build . --config Release --target install
|
||||||
|
cd ${ROOT_DIR}
|
||||||
|
|
||||||
|
echo All done!
|
||||||
+1
-1
Submodule fgdata updated: 87133520e7...dce80cbf83
+1
-1
Submodule flightgear updated: 9ae95c47a5...f007dd3ea1
+1
-1
Submodule getstart updated: 284d220dbc...b7ab2fa1e9
@@ -23,15 +23,16 @@ echo "Starting on SimGear"
|
|||||||
pushd sgBuild
|
pushd sgBuild
|
||||||
cmake -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DCMAKE_BUILD_TYPE=RelWithDebInfo ../simgear
|
cmake -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DCMAKE_BUILD_TYPE=RelWithDebInfo ../simgear
|
||||||
|
|
||||||
# compile (with out-j for now, it's hitting process limits)
|
# compile
|
||||||
cmake --build .
|
make
|
||||||
|
|
||||||
if [ $? -ne '0' ]; then
|
if [ $? -ne '0' ]; then
|
||||||
echo "make simgear failed"
|
echo "make simgear failed"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cmake --build . --target install
|
make install
|
||||||
|
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
@@ -45,17 +46,16 @@ else
|
|||||||
FGBUILDTYPE=Nightly
|
FGBUILDTYPE=Nightly
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cmake -DFG_BUILD_TYPE=$FGBUILDTYPE -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DCMAKE_BUILD_TYPE=RelWithDebInfo ../flightgear
|
cmake -DFG_BUILD_TYPE=$FGBUILDTYPE -DCMAKE_INSTALL_PREFIX:PATH=$WORKSPACE/dist -DENABLE_SWIFT:BOOL=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo ../flightgear
|
||||||
|
|
||||||
# compile (with out-j for now, it's hitting process limits)
|
make
|
||||||
cmake --build .
|
|
||||||
|
|
||||||
if [ $? -ne '0' ]; then
|
if [ $? -ne '0' ]; then
|
||||||
echo "make flightgear failed"
|
echo "make flightgear failed"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cmake --build . --target install
|
make install
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
|||||||
@@ -31,8 +31,6 @@ $osgSoVersion=runOsgVersion('so-number')
|
|||||||
$openThreadsSoVersion=runOsgVersion('openthreads-soversion-number')
|
$openThreadsSoVersion=runOsgVersion('openthreads-soversion-number')
|
||||||
|
|
||||||
$codeSignIdentity = ENV['FG_CODESIGN_IDENTITY']
|
$codeSignIdentity = ENV['FG_CODESIGN_IDENTITY']
|
||||||
$keychain = ENV['FG_KEYCHAIN']
|
|
||||||
|
|
||||||
puts "Code signing identity is #{$codeSignIdentity}"
|
puts "Code signing identity is #{$codeSignIdentity}"
|
||||||
puts "osgVersion=#{osgVersion}, so-number=#{$osgSoVersion}"
|
puts "osgVersion=#{osgVersion}, so-number=#{$osgSoVersion}"
|
||||||
|
|
||||||
@@ -56,10 +54,11 @@ bundle=dmgDir + "/FlightGear.app"
|
|||||||
puts "Running macdeployqt on the bundle to copy Qt libraries"
|
puts "Running macdeployqt on the bundle to copy Qt libraries"
|
||||||
`macdeployqt #{$prefixDir}/fgfs.app -qmldir=#{qmlDir}`
|
`macdeployqt #{$prefixDir}/fgfs.app -qmldir=#{qmlDir}`
|
||||||
|
|
||||||
puts "Copying & renaming app bundle"
|
puts "Moving & renaming app bundle"
|
||||||
`mkdir -p #{dmgDir}`
|
`mkdir -p #{dmgDir}`
|
||||||
`rsync --archive --quiet #{$prefixDir}/fgfs.app/ #{bundle}`
|
`mv #{$prefixDir}/fgfs.app #{bundle}`
|
||||||
|
|
||||||
|
bundle=dmgDir + "/FlightGear.app"
|
||||||
contents=bundle + "/Contents"
|
contents=bundle + "/Contents"
|
||||||
macosDir=contents + "/MacOS"
|
macosDir=contents + "/MacOS"
|
||||||
$frameworksDir=contents +"/Frameworks"
|
$frameworksDir=contents +"/Frameworks"
|
||||||
@@ -136,47 +135,27 @@ File.open("#{contents}/Info.plist", 'w') { |f|
|
|||||||
|
|
||||||
createArgs = "-format UDBZ -imagekey bzip2-level=9 -quiet -volname #{volName}"
|
createArgs = "-format UDBZ -imagekey bzip2-level=9 -quiet -volname #{volName}"
|
||||||
|
|
||||||
# enable the hardened runtime and timestamp options, so notarization works
|
|
||||||
codeSignArgs = "--deep --options=runtime --timestamp"
|
|
||||||
|
|
||||||
if !$isRelease
|
if !$isRelease
|
||||||
# create the 'lite' DMG without the base files
|
# create the 'lite' DMG without the base files
|
||||||
|
|
||||||
|
|
||||||
# code sign the entire bundle once complete - v2 code-signing
|
# code sign the entire bundle once complete - v2 code-signing
|
||||||
puts "Signing #{bundle}"
|
puts "Signing #{bundle}"
|
||||||
`codesign #{codeSignArgs} --keychain #{$keychain} -s "#{$codeSignIdentity}" #{bundle}`
|
`codesign --deep -s "#{$codeSignIdentity}" #{bundle}`
|
||||||
puts "Creating DMG without base-files"
|
puts "Creating DMG"
|
||||||
|
|
||||||
`rm -f #{dmgPath}`
|
`rm -f #{dmgPath}`
|
||||||
`hdiutil create -srcfolder #{dmgDir} #{createArgs} #{dmgPath}`
|
`hdiutil create -srcfolder #{dmgDir} #{createArgs} #{dmgPath}`
|
||||||
|
|
||||||
puts "Notarizing DMG #{dmgPath}"
|
|
||||||
`xcrun altool --notarize-app \
|
|
||||||
--primary-bundle-id "org.flightgear.mac" \
|
|
||||||
--username "zakalawe@mac.com" \
|
|
||||||
--password "@keychain:FlightGearAppStoreConnectUserName" \
|
|
||||||
--file #{dmgPath}`
|
|
||||||
end
|
end
|
||||||
|
|
||||||
puts "Creating full image with data"
|
puts "Creating full image with data"
|
||||||
|
|
||||||
|
puts "Copying base package files into the image"
|
||||||
`rsync -a fgdata/ #{resourcesDir}/data`
|
`rsync -a fgdata/ #{resourcesDir}/data`
|
||||||
|
|
||||||
# re-sign the entire bundle
|
# re-sign the entire bundle
|
||||||
puts "Re-signing full app: #{bundle}"
|
puts "Re-signing full #{bundle}"
|
||||||
`codesign --force #{codeSignArgs} --keychain #{$keychain} -s "#{$codeSignIdentity}" #{bundle}`
|
`codesign --force --deep -s "#{$codeSignIdentity}" #{bundle}`
|
||||||
|
|
||||||
`rm -f #{dmgFullPath}`
|
`rm -f #{dmgFullPath}`
|
||||||
`hdiutil create -srcfolder #{dmgDir} #{createArgs} #{dmgFullPath}`
|
`hdiutil create -srcfolder #{dmgDir} #{createArgs} #{dmgFullPath}`
|
||||||
|
|
||||||
puts "Notarizing DMG #{dmgFullPath}"
|
|
||||||
|
|
||||||
`xcrun altool --notarize-app \
|
|
||||||
--primary-bundle-id "org.flightgear.mac" \
|
|
||||||
--username "zakalawe@mac.com" \
|
|
||||||
--password "@keychain:FlightGearAppStoreConnectUserName" \
|
|
||||||
--file #{dmgFullPath}`
|
|
||||||
|
|
||||||
puts "Packaging complete"
|
|
||||||
|
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ PLURAL_FORMS = {
|
|||||||
"nl": ["singular", "plural"],
|
"nl": ["singular", "plural"],
|
||||||
"pl": ["singular", "paucal", "plural"],
|
"pl": ["singular", "paucal", "plural"],
|
||||||
"pt": ["singular", "plural"],
|
"pt": ["singular", "plural"],
|
||||||
|
"ru": ["singular", "plural"],
|
||||||
"zh": ["universal"] # universal form
|
"zh": ["universal"] # universal form
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -576,10 +577,25 @@ class Translation:
|
|||||||
return ''.join(l)
|
return ''.join(l)
|
||||||
|
|
||||||
def __getitem__(self, cat):
|
def __getitem__(self, cat):
|
||||||
|
"""Get all translations for a given category.
|
||||||
|
|
||||||
|
Return a mapping where each key is a tid (instance of a subclass
|
||||||
|
of AbstractTranslationUnitId) and each value a TranslationUnit
|
||||||
|
instance.
|
||||||
|
|
||||||
|
"""
|
||||||
return self.translations[cat]
|
return self.translations[cat]
|
||||||
|
|
||||||
def __setitem__(self, cat, translUnit):
|
def __setitem__(self, cat, mapping):
|
||||||
self.translations[cat] = translUnit
|
"""Replace all translations for a given category.
|
||||||
|
|
||||||
|
cat: a category name (string such as 'sys', 'options', etc.)
|
||||||
|
mapping: a mapping where each key is a tid (instance of a
|
||||||
|
subclass of AbstractTranslationUnitId) and each value a
|
||||||
|
TranslationUnit instance.
|
||||||
|
|
||||||
|
"""
|
||||||
|
self.translations[cat] = dict(mapping)
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
return iter(self.translations)
|
return iter(self.translations)
|
||||||
@@ -1654,10 +1670,8 @@ registerFormatHandler("xliff", XliffFormatHandler)
|
|||||||
# Could also be a dict
|
# Could also be a dict
|
||||||
def L10nResMgrForCat(category):
|
def L10nResMgrForCat(category):
|
||||||
"""Map from category/resource name to L10NResourceManager class."""
|
"""Map from category/resource name to L10NResourceManager class."""
|
||||||
if category in ("menu", "options", "tips"):
|
if category in ("menu", "options", "sys", "tips"):
|
||||||
return BasicL10NResourceManager
|
return BasicL10NResourceManager
|
||||||
elif category == "sys":
|
|
||||||
return SysL10NResourceManager
|
|
||||||
else:
|
else:
|
||||||
assert False, "unexpected category: {!r}".format(category)
|
assert False, "unexpected category: {!r}".format(category)
|
||||||
|
|
||||||
@@ -1843,7 +1857,7 @@ class L10NResourceManagerBase:
|
|||||||
class BasicL10NResourceManager(L10NResourceManagerBase):
|
class BasicL10NResourceManager(L10NResourceManagerBase):
|
||||||
"""Resource manager for FG XML i18n files with the simplest structure.
|
"""Resource manager for FG XML i18n files with the simplest structure.
|
||||||
|
|
||||||
This is suitable for resources (menu, options, tips) where
|
This is suitable for resources (menu, options, tips, etc.) where
|
||||||
translations are in direct children of the <PropertyList> element,
|
translations are in direct children of the <PropertyList> element,
|
||||||
with no more structure.
|
with no more structure.
|
||||||
|
|
||||||
@@ -1851,7 +1865,16 @@ class BasicL10NResourceManager(L10NResourceManagerBase):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def _findMainNode(cls, rootNode):
|
def _findMainNode(cls, rootNode):
|
||||||
"""
|
"""
|
||||||
Return the node directly containing the translations in an FG XML file."""
|
Return the node directly containing the translations in an FG XML file.
|
||||||
|
|
||||||
|
This method was added when sys.xml had all its useful contents
|
||||||
|
inside a 'splash' top-level node, instead of having a flat
|
||||||
|
structure like the other FG XML i18n files (options.xml,
|
||||||
|
menu.xml, etc.). At that time, we thus had a
|
||||||
|
SysL10NResourceManager class derived from this class only to
|
||||||
|
override this method.
|
||||||
|
|
||||||
|
"""
|
||||||
assert rootNode.tag == "PropertyList", rootNode.tag
|
assert rootNode.tag == "PropertyList", rootNode.tag
|
||||||
return rootNode
|
return rootNode
|
||||||
|
|
||||||
@@ -1909,17 +1932,3 @@ class BasicL10NResourceManager(L10NResourceManagerBase):
|
|||||||
[text], isPlural=isPlural, logger=logger)
|
[text], isPlural=isPlural, logger=logger)
|
||||||
|
|
||||||
return nbWhitespaceProblems
|
return nbWhitespaceProblems
|
||||||
|
|
||||||
|
|
||||||
class SysL10NResourceManager(BasicL10NResourceManager):
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def _findMainNode(cls, rootNode):
|
|
||||||
"""
|
|
||||||
Return the node directly containing the translations in sys.xml."""
|
|
||||||
assert rootNode.tag == "PropertyList", rootNode.tag
|
|
||||||
# In sys.xml, all translations are inside a <splash> element
|
|
||||||
mainNode = rootNode.find("splash")
|
|
||||||
assert mainNode is not None
|
|
||||||
|
|
||||||
return mainNode
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
THIS_RELEASE="2018.3"
|
THIS_RELEASE="2019.1"
|
||||||
NEXT_RELEASE="2018.4"
|
NEXT_RELEASE="2019.2"
|
||||||
SUBMODULES="simgear flightgear fgdata getstart"
|
SUBMODULES="simgear flightgear fgdata getstart"
|
||||||
|
|
||||||
#:<< 'COMMENT_END'
|
#:<< 'COMMENT_END'
|
||||||
|
|||||||
+1
-1
Submodule simgear updated: 8dec1cb38c...f964374027
Executable
+22
@@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
mirror_dirs='fgdata fgmeta flightgear simgear getstart windows-3rd-party fgrun'
|
||||||
|
|
||||||
|
pushd /var/lib/git
|
||||||
|
|
||||||
|
for dir in $mirror_dirs
|
||||||
|
do
|
||||||
|
repo_name=$dir.git
|
||||||
|
if [ ! -d "$repo_name" ]; then
|
||||||
|
echo "Doing initial clone"
|
||||||
|
git clone --mirror git://git.code.sf.net/p/flightgear/$dir
|
||||||
|
fi
|
||||||
|
|
||||||
|
pushd $repo_name
|
||||||
|
echo "Updating in $PWD"
|
||||||
|
git remote update
|
||||||
|
popd
|
||||||
|
done
|
||||||
|
|
||||||
|
popd
|
||||||
|
|
||||||
Reference in New Issue
Block a user