├── Shaders ├── .gitkeep ├── sphere.ush └── interpolate.ush ├── Content ├── Data │ └── Demo │ │ └── .gitkeep ├── Radar.umap ├── RadarLevel.umap ├── Meshes │ ├── radar.uasset │ └── inverted_cube.uasset ├── Textures │ ├── icon.ico │ ├── icon.png │ ├── BlueNoise.png │ ├── crosshair.png │ ├── mapzoom0.uasset │ ├── BlueNoise.uasset │ ├── crosshair.uasset │ └── crosshair.svg ├── Materials │ ├── Map.uasset │ ├── GISLine.uasset │ ├── Metal.uasset │ ├── Radome.uasset │ ├── Sphere.uasset │ ├── TestImage.png │ ├── TestImage2.uasset │ ├── UnlitColor.uasset │ ├── UnlitColorText.uasset │ ├── TestImageMaterial.uasset │ ├── RadarVolumeMaterial.uasset │ ├── TextureTestMaterial.uasset │ ├── InterpolationMaterial.uasset │ ├── ToneMapperReplacement.uasset │ ├── TextureTestMaterialCustom.uasset │ └── InterpolationAdvancedMaterial.uasset ├── RadarLevel_BuiltData.uasset └── __ExternalActors__ │ └── RadarLevel │ ├── 0 │ └── ZP │ │ └── YICH7XY2RVIW3JQC8YRFVY.uasset │ ├── 1 │ ├── V1 │ │ └── 425BTAR7AKT5XPC3IGCGJR.uasset │ └── Y4 │ │ └── HB716NF1O3S7FJ5WXS0ALG.uasset │ ├── 2 │ └── XS │ │ └── B94RMK0A3XVGCSYEDOIX6Z.uasset │ ├── 4 │ └── GY │ │ └── 0XY2VGE1TCHE6W95RB2TIL.uasset │ ├── 5 │ └── 9K │ │ └── HGLGADNZPRMNZ0NLEIG15C.uasset │ ├── 7 │ └── ZU │ │ └── GP0SWO0I1H5KC9MQSGT7WG.uasset │ ├── 8 │ ├── FA │ │ └── 26L9QOOXBOU8MHCFLXVME8.uasset │ └── H0 │ │ └── 009RLSF48CQDWRY6L55J2H.uasset │ ├── 9 │ ├── PF │ │ └── 2RZEI7GIVYYQGYEZ04UMYM.uasset │ └── UQ │ │ └── ZI88KO4P7DTMLW6YT4S6U3.uasset │ ├── A │ └── A3 │ │ └── TH8V06FCK5UTIEU4KN9AOO.uasset │ ├── B │ └── IA │ │ └── AGGEAD5NZKY126KVSJP8AD.uasset │ ├── C │ ├── N0 │ │ └── 2Y1UHU7KM51E6V389IHCEP.uasset │ └── QX │ │ └── 1614ZN9IS0Q25Y9TRO70U5.uasset │ └── E │ └── ES │ └── 777FD6NE77RFEGN0WV9BWV.uasset ├── Source ├── OpenStorm │ ├── UI │ │ ├── Theme.h │ │ ├── Font.h │ │ ├── Native.h │ │ ├── ClickableInterface.cpp │ │ ├── Slate │ │ │ ├── SlateUIResources.h │ │ │ ├── SlateUIResources.cpp │ │ │ ├── SCompass.h │ │ │ ├── SlateUI.h │ │ │ ├── SCacheState.h │ │ │ ├── SlateUI.cpp │ │ │ └── SCompass.cpp │ │ ├── ImGuiUI.h │ │ ├── UiWindow.h │ │ ├── ClickableInterface.h │ │ ├── Font.cpp │ │ ├── ImGuiController.h │ │ ├── Theme.cpp │ │ └── portable-file-dialogs.h │ ├── Mapping │ │ ├── Data │ │ │ ├── HTTPRequest.cpp │ │ │ ├── SimpleConfig.h │ │ │ ├── ElevationData.h │ │ │ ├── Tar.h │ │ │ ├── HTTPRequest.h │ │ │ ├── ShapeFile.h │ │ │ ├── TileProvider.h │ │ │ ├── Tar.cpp │ │ │ └── SimpleConfig.cpp │ │ ├── LocationMarkerManager.h │ │ ├── GISPolyline.h │ │ ├── MapMeshManager.h │ │ ├── GISManager.h │ │ ├── LocationMarker.h │ │ └── MapMesh.h │ ├── Radar │ │ ├── SimpleVector3.cpp │ │ ├── Deps │ │ │ ├── bzip2 │ │ │ │ ├── libbz2.dsp │ │ │ │ ├── libbz2.def │ │ │ │ ├── makefile.msc │ │ │ │ ├── Makefile-libbz2_so │ │ │ │ ├── LICENSE │ │ │ │ ├── meson.build │ │ │ │ ├── xmlproc.sh │ │ │ │ └── randtable.cpp │ │ │ ├── rsl │ │ │ │ ├── wsr88d_decode_ar2v.h │ │ │ │ ├── unimplemented.cpp │ │ │ │ ├── polyfill.cpp │ │ │ │ ├── endian.cpp │ │ │ │ ├── prune.cpp │ │ │ │ └── wsr88d_get_site.cpp │ │ │ ├── zlib │ │ │ │ ├── inffast.h │ │ │ │ ├── gzclose.c │ │ │ │ ├── LICENSE │ │ │ │ ├── inftrees.h │ │ │ │ ├── gz_compress.c │ │ │ │ └── uncompr.c │ │ │ └── json11 │ │ │ │ └── LICENSE.txt │ │ ├── Products │ │ │ ├── RotationProduct.h │ │ │ ├── NormalizedRotationProduct.h │ │ │ ├── VelocityRelativeProduct.h │ │ │ ├── VelocityDealiasProduct.h │ │ │ ├── RadarProduct.cpp │ │ │ ├── ProductList.cpp │ │ │ ├── RadarProduct.h │ │ │ └── RotationProduct.cpp │ │ ├── PolyFillUtils.h │ │ ├── OdimH5.h │ │ ├── MiniRad.h │ │ ├── NexradSites │ │ │ ├── NexradSites.h │ │ │ └── generate.js │ │ ├── Nexrad.h │ │ ├── RadarReader.h │ │ ├── SystemAPI.h │ │ ├── RadarReader.cpp │ │ ├── AsyncTask.h │ │ ├── Globe.h │ │ ├── RadarColorIndex.h │ │ └── Globe.cpp │ ├── OpenStorm.h │ ├── Objects │ │ ├── RadarGameStateBase.cpp │ │ ├── RadarGameStateBase.h │ │ ├── Joke.h │ │ ├── RadarViewport.h │ │ ├── Satellite.h │ │ ├── RadarViewport.cpp │ │ ├── Satellite.cpp │ │ ├── RadarSlice.h │ │ ├── RadarViewPawn.h │ │ └── RadarVolumeRender.h │ ├── OpenStorm.cpp │ ├── Deps │ │ └── discord-rpc │ │ │ ├── src │ │ │ ├── connection.h │ │ │ ├── backoff.h │ │ │ ├── msg_queue.h │ │ │ ├── rpc_connection.h │ │ │ ├── connection_unix.cpp │ │ │ └── connection_win.cpp │ │ │ ├── LICENSE │ │ │ └── include │ │ │ └── discord_rpc.h │ ├── OpenStormGameModeBase.cpp │ ├── OpenStormGameModeBase.h │ ├── Application │ │ ├── DiscordPresence.h │ │ ├── RadarDataDownloader.h │ │ ├── SettingsSaver.h │ │ ├── GlobalState.cpp │ │ └── DiscordPresence.cpp │ ├── EngineHelpers │ │ ├── StringUtils.cpp │ │ ├── StringUtils.h │ │ ├── MaterialRenderTarget.h │ │ └── MaterialRenderTarget.cpp │ ├── .vscode │ │ └── settings.json │ └── OpenStorm.Build.cs ├── OpenStorm.Target.cs └── OpenStormEditor.Target.cs ├── Config ├── DefaultEditor.ini ├── DefaultGameUserSettings.ini ├── UnrealBuildTool │ └── BuildConfiguration.xml ├── DefaultImGui.ini ├── DefaultGame.ini └── HoloLens │ └── HoloLensEngine.ini ├── Plugins └── CustomShaders │ ├── Shaders │ └── .gitkeep │ ├── Resources │ └── Icon128.png │ ├── Source │ └── CustomShaders │ │ ├── Public │ │ └── CustomShaders.h │ │ ├── Private │ │ └── CustomShaders.cpp │ │ └── CustomShaders.Build.cs │ └── CustomShaders.uplugin ├── stuff.txt ├── OpenStorm.png ├── .github └── FUNDING.yml ├── docs ├── img │ ├── OpenStorm2.jpg │ ├── OpenStorm2Small.jpg │ ├── OpenStormLogo192.png │ └── OpenStormLogo256.png ├── GlobalState.md └── Products.md ├── .gitmodules ├── Script ├── code-stats │ ├── copy.sh │ ├── info.sh │ └── include.txt └── android-upload-demo.bat ├── .vscode ├── build.bat ├── tasks.json ├── c_cpp_properties.json └── settings.json ├── .gitignore ├── OpenStorm.uproject └── TODO.md /Shaders/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Content/Data/Demo/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Source/OpenStorm/UI/Theme.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Config/DefaultEditor.ini: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Plugins/CustomShaders/Shaders/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Source/OpenStorm/Mapping/Data/HTTPRequest.cpp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /stuff.txt: -------------------------------------------------------------------------------- 1 | set max fps in editor 2 | t.MaxFPS 60 -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/SimpleVector3.cpp: -------------------------------------------------------------------------------- 1 | #include "SimpleVector3.h" 2 | 3 | -------------------------------------------------------------------------------- /OpenStorm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/OpenStorm.png -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [JordanSchlick] 2 | custom: ["https://paypal.me/j2schlick"] 3 | -------------------------------------------------------------------------------- /Content/Radar.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Radar.umap -------------------------------------------------------------------------------- /Source/OpenStorm/UI/Font.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IconsFontAwesome6.h" 3 | 4 | void LoadFonts(); -------------------------------------------------------------------------------- /Config/DefaultGameUserSettings.ini: -------------------------------------------------------------------------------- 1 | [/Script/Engine.GameUserSettings] 2 | FullscreenMode=2 3 | Version=5 -------------------------------------------------------------------------------- /Content/RadarLevel.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/RadarLevel.umap -------------------------------------------------------------------------------- /docs/img/OpenStorm2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/docs/img/OpenStorm2.jpg -------------------------------------------------------------------------------- /Content/Meshes/radar.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Meshes/radar.uasset -------------------------------------------------------------------------------- /Content/Textures/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Textures/icon.ico -------------------------------------------------------------------------------- /Content/Textures/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Textures/icon.png -------------------------------------------------------------------------------- /Content/Materials/Map.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Materials/Map.uasset -------------------------------------------------------------------------------- /docs/img/OpenStorm2Small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/docs/img/OpenStorm2Small.jpg -------------------------------------------------------------------------------- /docs/img/OpenStormLogo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/docs/img/OpenStormLogo192.png -------------------------------------------------------------------------------- /docs/img/OpenStormLogo256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/docs/img/OpenStormLogo256.png -------------------------------------------------------------------------------- /Content/Materials/GISLine.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Materials/GISLine.uasset -------------------------------------------------------------------------------- /Content/Materials/Metal.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Materials/Metal.uasset -------------------------------------------------------------------------------- /Content/Materials/Radome.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Materials/Radome.uasset -------------------------------------------------------------------------------- /Content/Materials/Sphere.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Materials/Sphere.uasset -------------------------------------------------------------------------------- /Content/Materials/TestImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Materials/TestImage.png -------------------------------------------------------------------------------- /Content/Textures/BlueNoise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Textures/BlueNoise.png -------------------------------------------------------------------------------- /Content/Textures/crosshair.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Textures/crosshair.png -------------------------------------------------------------------------------- /Content/Textures/mapzoom0.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Textures/mapzoom0.uasset -------------------------------------------------------------------------------- /Content/Textures/BlueNoise.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Textures/BlueNoise.uasset -------------------------------------------------------------------------------- /Content/Textures/crosshair.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Textures/crosshair.uasset -------------------------------------------------------------------------------- /Content/Materials/TestImage2.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Materials/TestImage2.uasset -------------------------------------------------------------------------------- /Content/Materials/UnlitColor.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Materials/UnlitColor.uasset -------------------------------------------------------------------------------- /Content/Meshes/inverted_cube.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Meshes/inverted_cube.uasset -------------------------------------------------------------------------------- /Content/RadarLevel_BuiltData.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/RadarLevel_BuiltData.uasset -------------------------------------------------------------------------------- /Content/Materials/UnlitColorText.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Materials/UnlitColorText.uasset -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | 2 | [submodule "Plugins/UnrealImGui"] 3 | path = Plugins/UnrealImGui 4 | url = https://github.com/JordanSchlick/UnrealImGui 5 | -------------------------------------------------------------------------------- /Content/Materials/TestImageMaterial.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Materials/TestImageMaterial.uasset -------------------------------------------------------------------------------- /Content/Materials/RadarVolumeMaterial.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Materials/RadarVolumeMaterial.uasset -------------------------------------------------------------------------------- /Content/Materials/TextureTestMaterial.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Materials/TextureTestMaterial.uasset -------------------------------------------------------------------------------- /Plugins/CustomShaders/Resources/Icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Plugins/CustomShaders/Resources/Icon128.png -------------------------------------------------------------------------------- /Script/code-stats/copy.sh: -------------------------------------------------------------------------------- 1 | mkdir -p tmp 2 | rsync -a -m --info=progress2 --delete --delete-excluded --include-from=include.txt ../../ ./tmp/source/ -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Deps/bzip2/libbz2.dsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Source/OpenStorm/Radar/Deps/bzip2/libbz2.dsp -------------------------------------------------------------------------------- /Content/Materials/InterpolationMaterial.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Materials/InterpolationMaterial.uasset -------------------------------------------------------------------------------- /Content/Materials/ToneMapperReplacement.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Materials/ToneMapperReplacement.uasset -------------------------------------------------------------------------------- /Source/OpenStorm/OpenStorm.h: -------------------------------------------------------------------------------- 1 | // Copyright Epic Games, Inc. All Rights Reserved. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | 7 | -------------------------------------------------------------------------------- /Content/Materials/TextureTestMaterialCustom.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Materials/TextureTestMaterialCustom.uasset -------------------------------------------------------------------------------- /Content/Materials/InterpolationAdvancedMaterial.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/Materials/InterpolationAdvancedMaterial.uasset -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Deps/rsl/wsr88d_decode_ar2v.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | FILE* uncompress_pipe_ar2v(FILE* inFile); 5 | 6 | FILE* uncompress_pipe_gzip(FILE* inFile); -------------------------------------------------------------------------------- /Content/__ExternalActors__/RadarLevel/0/ZP/YICH7XY2RVIW3JQC8YRFVY.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/__ExternalActors__/RadarLevel/0/ZP/YICH7XY2RVIW3JQC8YRFVY.uasset -------------------------------------------------------------------------------- /Content/__ExternalActors__/RadarLevel/1/V1/425BTAR7AKT5XPC3IGCGJR.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/__ExternalActors__/RadarLevel/1/V1/425BTAR7AKT5XPC3IGCGJR.uasset -------------------------------------------------------------------------------- /Content/__ExternalActors__/RadarLevel/1/Y4/HB716NF1O3S7FJ5WXS0ALG.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/__ExternalActors__/RadarLevel/1/Y4/HB716NF1O3S7FJ5WXS0ALG.uasset -------------------------------------------------------------------------------- /Content/__ExternalActors__/RadarLevel/2/XS/B94RMK0A3XVGCSYEDOIX6Z.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/__ExternalActors__/RadarLevel/2/XS/B94RMK0A3XVGCSYEDOIX6Z.uasset -------------------------------------------------------------------------------- /Content/__ExternalActors__/RadarLevel/4/GY/0XY2VGE1TCHE6W95RB2TIL.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/__ExternalActors__/RadarLevel/4/GY/0XY2VGE1TCHE6W95RB2TIL.uasset -------------------------------------------------------------------------------- /Content/__ExternalActors__/RadarLevel/5/9K/HGLGADNZPRMNZ0NLEIG15C.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/__ExternalActors__/RadarLevel/5/9K/HGLGADNZPRMNZ0NLEIG15C.uasset -------------------------------------------------------------------------------- /Content/__ExternalActors__/RadarLevel/7/ZU/GP0SWO0I1H5KC9MQSGT7WG.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/__ExternalActors__/RadarLevel/7/ZU/GP0SWO0I1H5KC9MQSGT7WG.uasset -------------------------------------------------------------------------------- /Content/__ExternalActors__/RadarLevel/8/FA/26L9QOOXBOU8MHCFLXVME8.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/__ExternalActors__/RadarLevel/8/FA/26L9QOOXBOU8MHCFLXVME8.uasset -------------------------------------------------------------------------------- /Content/__ExternalActors__/RadarLevel/8/H0/009RLSF48CQDWRY6L55J2H.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/__ExternalActors__/RadarLevel/8/H0/009RLSF48CQDWRY6L55J2H.uasset -------------------------------------------------------------------------------- /Content/__ExternalActors__/RadarLevel/9/PF/2RZEI7GIVYYQGYEZ04UMYM.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/__ExternalActors__/RadarLevel/9/PF/2RZEI7GIVYYQGYEZ04UMYM.uasset -------------------------------------------------------------------------------- /Content/__ExternalActors__/RadarLevel/9/UQ/ZI88KO4P7DTMLW6YT4S6U3.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/__ExternalActors__/RadarLevel/9/UQ/ZI88KO4P7DTMLW6YT4S6U3.uasset -------------------------------------------------------------------------------- /Content/__ExternalActors__/RadarLevel/A/A3/TH8V06FCK5UTIEU4KN9AOO.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/__ExternalActors__/RadarLevel/A/A3/TH8V06FCK5UTIEU4KN9AOO.uasset -------------------------------------------------------------------------------- /Content/__ExternalActors__/RadarLevel/B/IA/AGGEAD5NZKY126KVSJP8AD.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/__ExternalActors__/RadarLevel/B/IA/AGGEAD5NZKY126KVSJP8AD.uasset -------------------------------------------------------------------------------- /Content/__ExternalActors__/RadarLevel/C/N0/2Y1UHU7KM51E6V389IHCEP.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/__ExternalActors__/RadarLevel/C/N0/2Y1UHU7KM51E6V389IHCEP.uasset -------------------------------------------------------------------------------- /Content/__ExternalActors__/RadarLevel/C/QX/1614ZN9IS0Q25Y9TRO70U5.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/__ExternalActors__/RadarLevel/C/QX/1614ZN9IS0Q25Y9TRO70U5.uasset -------------------------------------------------------------------------------- /Content/__ExternalActors__/RadarLevel/E/ES/777FD6NE77RFEGN0WV9BWV.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JordanSchlick/OpenStorm/HEAD/Content/__ExternalActors__/RadarLevel/E/ES/777FD6NE77RFEGN0WV9BWV.uasset -------------------------------------------------------------------------------- /Source/OpenStorm/Objects/RadarGameStateBase.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "RadarGameStateBase.h" 5 | 6 | ARadarGameStateBase::ARadarGameStateBase() 7 | { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /Source/OpenStorm/OpenStorm.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Epic Games, Inc. All Rights Reserved. 2 | 3 | #include "OpenStorm.h" 4 | #include "Modules/ModuleManager.h" 5 | 6 | IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, OpenStorm, "OpenStorm" ); 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Products/RotationProduct.h: -------------------------------------------------------------------------------- 1 | #include "RadarProduct.h" 2 | 3 | class RadarProductRotation : public RadarProduct { 4 | public: 5 | RadarProductRotation(); 6 | virtual RadarData* deriveVolume(std::map inputProducts) override; 7 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Products/NormalizedRotationProduct.h: -------------------------------------------------------------------------------- 1 | #include "RadarProduct.h" 2 | 3 | class RadarProductNormalizedRotation : public RadarProduct { 4 | public: 5 | RadarProductNormalizedRotation(); 6 | virtual RadarData* deriveVolume(std::map inputProducts) override; 7 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Products/VelocityRelativeProduct.h: -------------------------------------------------------------------------------- 1 | #include "RadarProduct.h" 2 | 3 | class RadarProductStormRelativeVelocity : public RadarProduct { 4 | public: 5 | RadarProductStormRelativeVelocity(); 6 | virtual RadarData* deriveVolume(std::map inputProducts) override; 7 | }; -------------------------------------------------------------------------------- /Script/code-stats/info.sh: -------------------------------------------------------------------------------- 1 | ( find ./tmp/source -type f -name '*' -print0 | xargs -0 cat ) > tmp/all-code.txt 2 | echo total lines `cat tmp/all-code.txt | wc -l ` | tee tmp/output.txt 3 | echo total size `du -h "tmp/all-code.txt" | cut -f1` | tee -a tmp/output.txt 4 | echo | tee -a tmp/output.txt 5 | cloc tmp/source/ | tee -a tmp/output.txt -------------------------------------------------------------------------------- /Config/UnrealBuildTool/BuildConfiguration.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | None 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Deps/rsl/unimplemented.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | int rsl_pclose(FILE* fp) 5 | { 6 | int rc; 7 | rc = fclose(fp); 8 | return rc; 9 | } 10 | 11 | FILE* uncompress_pipe(FILE* fp) 12 | { 13 | fprintf(stderr, "GZIP compressed radar files are not supported\n"); 14 | return nullptr; 15 | } -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Deps/rsl/polyfill.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | #ifdef _WIN32 5 | int strcasecmp(char const *a, char const *b) 6 | { 7 | for (;; a++, b++) { 8 | int d = tolower((unsigned char)*a) - tolower((unsigned char)*b); 9 | if (d != 0 || !*a) 10 | return d; 11 | } 12 | } 13 | #endif -------------------------------------------------------------------------------- /Script/code-stats/include.txt: -------------------------------------------------------------------------------- 1 | 2 | - /Source/OpenStorm/Radar/NexradSites/NexradSites.cpp 3 | 4 | - /Source/OpenStorm/UI/IconsFontAwesome6.h 5 | - /Source/OpenStorm/UI/portable-file-dialogs.cpp 6 | - /Source/OpenStorm/UI/FontData.h 7 | 8 | + Source 9 | - /* 10 | 11 | - Deps 12 | + */ 13 | + *.c 14 | + *.h 15 | + *.cpp 16 | 17 | 18 | 19 | - * -------------------------------------------------------------------------------- /Source/OpenStorm/UI/Native.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | namespace NativeAPI{ 5 | // allocate stderr and stdout and hide the console window 6 | void AllocateConsole(); 7 | // show the console window 8 | void ShowConsole(); 9 | 10 | // Use GetWorld()->GetGameViewport()->GetWindow()->GetDPIScaleFactor() instead 11 | float GetDisplayScale(void * hwnd); 12 | } -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/PolyFillUtils.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L) 5 | //C++17 specific stuff here 6 | #else 7 | namespace std{ 8 | inline float clamp(float value, float minValue, float maxValue){ 9 | return std::min(std::max(value, minValue), maxValue); 10 | } 11 | } 12 | #endif -------------------------------------------------------------------------------- /.vscode/build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | cd /D "%~dp0../" 3 | 4 | rem use relative link to enjine 5 | set UNREAL_PATH=../UnrealEngine 6 | rem find absolute path of symlink to unreal engine because it does not like symlinks 7 | for /f "tokens=2 delims=[]" %%H in ('dir /al ..\ ^| findstr /i /c:"UnrealEngine"') do ( 8 | set UNREAL_PATH=%%H 9 | ) 10 | echo Using engine at %UNREAL_PATH% 11 | %UNREAL_PATH%/Engine/Build/BatchFiles/Build.bat %* 12 | 13 | -------------------------------------------------------------------------------- /Plugins/CustomShaders/Source/CustomShaders/Public/CustomShaders.h: -------------------------------------------------------------------------------- 1 | // Copyright Epic Games, Inc. All Rights Reserved. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Modules/ModuleManager.h" 7 | 8 | class FCustomShadersModule : public IModuleInterface 9 | { 10 | public: 11 | 12 | /** IModuleInterface implementation */ 13 | virtual void StartupModule() override; 14 | virtual void ShutdownModule() override; 15 | }; 16 | -------------------------------------------------------------------------------- /Config/DefaultImGui.ini: -------------------------------------------------------------------------------- 1 | 2 | 3 | [/Script/ImGui.ImGuiSettings] 4 | DPIScale=(ScalingMethod=ImGui,Scale=1.000000,DPICurve=(EditorCurveData=(Keys=((Value=1.000000),(Time=2159.500000,Value=1.000000),(Time=2160.000000,Value=2.000000),(Time=4319.500000,Value=2.000000),(Time=4320.000000,Value=4.000000)),DefaultValue=340282346638528859811704183484516925440.000000,PreInfinityExtrap=RCCE_Constant,PostInfinityExtrap=RCCE_Constant),ExternalCurve=None),bScaleWithCurve=False) 5 | 6 | -------------------------------------------------------------------------------- /Source/OpenStorm/UI/ClickableInterface.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "ClickableInterface.h" 5 | 6 | // Add default functionality here for any IClickableInterface functions that are not pure virtual. 7 | 8 | IClickableInterface::ClickableType IClickableInterface::GetClickableType(){ 9 | return ClickableTypeClick; 10 | } 11 | 12 | void IClickableInterface::OnClick(){ 13 | 14 | } 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Binaries 2 | Build 3 | DerivedDataCache 4 | Intermediate 5 | /Packaged 6 | /Saved 7 | .vs 8 | .vs2 9 | .vs3 10 | /OpenStorm.sln 11 | /Content/Data/Demo/* 12 | /Content/Data/Map/* 13 | !/Content/Data/Map/download.js 14 | /Content/Data/elevation.bin 15 | /Content/Data/elevation.bin.gz 16 | /Content/testing 17 | /Content/Testing 18 | !.gitkeep 19 | tmp 20 | /.vsconfig 21 | /enc_temp_folder 22 | /Source/OpenStorm/Radar/Deps/hdf5 23 | /Plugins/UnrealHDF5 -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/OdimH5.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "RadarReader.h" 4 | 5 | class OdimH5RadarReader : public RadarReader{ 6 | public: 7 | class OdimH5Internal; 8 | class SweepData; 9 | OdimH5Internal* internal = NULL; 10 | 11 | virtual bool LoadFile(std::string filename); 12 | 13 | virtual bool LoadVolume(RadarData* radarData, RadarData::VolumeType volumeType); 14 | 15 | virtual void UnloadFile(); 16 | 17 | virtual ~OdimH5RadarReader(); 18 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Deps/zlib/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/MiniRad.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "RadarReader.h" 4 | 5 | class MiniRadRadarReader : public RadarReader{ 6 | public: 7 | class MiniRadInternal; 8 | class SweepData; 9 | class RayData; 10 | MiniRadInternal* internal = NULL; 11 | 12 | virtual bool LoadFile(std::string filename); 13 | 14 | virtual bool LoadVolume(RadarData* radarData, RadarData::VolumeType volumeType); 15 | 16 | virtual void UnloadFile(); 17 | 18 | virtual ~MiniRadRadarReader(); 19 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/Mapping/Data/SimpleConfig.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | 5 | class SimpleConfig{ 6 | public: 7 | std::map values; 8 | 9 | SimpleConfig(std::string fileName); 10 | bool HasOption(std::string name); 11 | bool GetBool(std::string name, bool defaultValue = false); 12 | double GetDouble(std::string name, double defaultValue = 0); 13 | float GetFloat(std::string name, float defaultValue = 0); 14 | std::string GetString(std::string name, std::string defaultValue = ""); 15 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/Deps/discord-rpc/src/connection.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // This is to wrap the platform specific kinds of connect/read/write. 4 | 5 | #include 6 | #include 7 | 8 | // not really connectiony, but need per-platform 9 | int GetProcessId(); 10 | 11 | struct BaseConnection { 12 | static BaseConnection* Create(); 13 | static void Destroy(BaseConnection*&); 14 | bool isOpen{false}; 15 | bool Open(); 16 | bool Close(); 17 | bool Write(const void* data, size_t length); 18 | bool Read(void* data, size_t length); 19 | }; 20 | -------------------------------------------------------------------------------- /Source/OpenStorm/OpenStormGameModeBase.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Epic Games, Inc. All Rights Reserved. 2 | 3 | 4 | #include "OpenStormGameModeBase.h" 5 | 6 | 7 | void AOpenStormGameModeBase::InitGameState() 8 | { 9 | Super::InitGameState(); 10 | #ifdef _WIN32 11 | // set file apis to binary on windows 12 | _set_fmode(0x8000); 13 | #endif // _WIN32 14 | } 15 | 16 | AOpenStormGameModeBase::AOpenStormGameModeBase() 17 | { 18 | DefaultPawnClass = ARadarViewPawn::StaticClass(); 19 | GameStateClass = ARadarGameStateBase::StaticClass(); 20 | } 21 | -------------------------------------------------------------------------------- /Config/DefaultGame.ini: -------------------------------------------------------------------------------- 1 | 2 | [/Script/EngineSettings.GeneralProjectSettings] 3 | ProjectID=7F39321944096CA10F56A094237EACDD 4 | bShouldWindowPreserveAspectRatio=False 5 | CopyrightNotice=Copyright (c) OpenStorm 6 | LicensingTerms=GPL v2 7 | Description= 8 | ProjectName=OpenStorm 9 | 10 | [/Script/UnrealEd.ProjectPackagingSettings] 11 | +DirectoriesToAlwaysStageAsNonUFS=(Path="Data") 12 | BuildConfiguration=PPBC_Shipping 13 | PerPlatformBuildConfig=(("Android", PPBC_Development)) 14 | StagingDirectory=(Path="Packaged") 15 | IncludeDebugFiles=True 16 | 17 | -------------------------------------------------------------------------------- /Source/OpenStorm/UI/Slate/SlateUIResources.h: -------------------------------------------------------------------------------- 1 | #include "CoreMinimal.h" 2 | #include "UObject/Object.h" 3 | #include "Engine/Texture2D.h" 4 | #include "../../Application/GlobalState.h" 5 | #include "SlateUIResources.generated.h" 6 | 7 | UCLASS() 8 | class USlateUIResources : public UObject{ 9 | GENERATED_BODY() 10 | 11 | public: 12 | UPROPERTY(EditAnywhere) 13 | UTexture2D* crosshairTexture; 14 | 15 | GlobalState* globalState = NULL; 16 | 17 | USlateUIResources(); 18 | ~USlateUIResources(); 19 | 20 | static USlateUIResources* Instance; 21 | private: 22 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/NexradSites/NexradSites.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class NexradSites{ 4 | public: 5 | struct Site{ 6 | const char* name = ""; 7 | double latitude = 0.0; 8 | double longitude = 0.0; 9 | //elevation above sea level in meters 10 | double altitude = 0.0; 11 | }; 12 | static Site sites[]; 13 | static int numberOfSites; 14 | static inline Site* GetSite(const char* name){ 15 | for(int i = 0; i < numberOfSites; i ++){ 16 | if(strcmp(sites[i].name, name) == 0){ 17 | return &sites[i]; 18 | } 19 | } 20 | return NULL; 21 | } 22 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/Objects/RadarGameStateBase.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | #include "../Application/GlobalState.h" 5 | #include "CoreMinimal.h" 6 | #include "GameFramework/GameStateBase.h" 7 | #include "RadarGameStateBase.generated.h" 8 | 9 | /** 10 | * 11 | */ 12 | UCLASS() 13 | class OPENSTORM_API ARadarGameStateBase : public AGameStateBase 14 | { 15 | GENERATED_BODY() 16 | 17 | public: 18 | ARadarGameStateBase(); 19 | 20 | public: 21 | //New Global State 22 | GlobalState globalState = GlobalState(); 23 | 24 | }; 25 | -------------------------------------------------------------------------------- /Plugins/CustomShaders/CustomShaders.uplugin: -------------------------------------------------------------------------------- 1 | { 2 | "FileVersion": 3, 3 | "Version": 1, 4 | "VersionName": "1.0", 5 | "FriendlyName": "CustomShaders", 6 | "Description": "", 7 | "Category": "Other", 8 | "CreatedBy": "", 9 | "CreatedByURL": "", 10 | "DocsURL": "", 11 | "MarketplaceURL": "", 12 | "SupportURL": "", 13 | "CanContainContent": true, 14 | "IsBetaVersion": false, 15 | "IsExperimentalVersion": false, 16 | "Installed": false, 17 | "Modules": [ 18 | { 19 | "Name": "CustomShaders", 20 | "Type": "Runtime", 21 | "LoadingPhase": "PreDefault" 22 | } 23 | ] 24 | } -------------------------------------------------------------------------------- /Source/OpenStorm/UI/Slate/SlateUIResources.cpp: -------------------------------------------------------------------------------- 1 | #include "SlateUIResources.h" 2 | #include "UObject/ConstructorHelpers.h" 3 | 4 | USlateUIResources::USlateUIResources(){ 5 | crosshairTexture = ConstructorHelpers::FObjectFinder(TEXT("Texture2D'/Game/Textures/crosshair.crosshair'")).Object; 6 | Instance = this; 7 | } 8 | 9 | USlateUIResources::~USlateUIResources(){ 10 | if(Instance == this){ 11 | Instance = NULL; 12 | } 13 | } 14 | 15 | USlateUIResources* USlateUIResources::Instance = NULL; 16 | 17 | /* 18 | USlateUIResources* USlateUIResources::Get() { 19 | return Instance; 20 | }*/ 21 | -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Products/VelocityDealiasProduct.h: -------------------------------------------------------------------------------- 1 | #include "RadarProduct.h" 2 | 3 | class RadarProductVelocityDealiased : public RadarProduct { 4 | public: 5 | static bool verbose; 6 | RadarProductVelocityDealiased(); 7 | virtual RadarData* deriveVolume(std::map inputProducts) override; 8 | }; 9 | 10 | class RadarProductVelocityDealiasedGroupTest : public RadarProduct { 11 | public: 12 | RadarProductVelocityDealiasedGroupTest(RadarData::VolumeType dynamicVolumeType); 13 | virtual RadarData* deriveVolume(std::map inputProducts) override; 14 | }; 15 | -------------------------------------------------------------------------------- /Source/OpenStorm/Mapping/Data/ElevationData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace ElevationData{ 6 | // load data into memory from path 7 | void LoadData(std::string dataFilePath); 8 | 9 | // unload data from memory 10 | void UnloadData(); 11 | 12 | // get point from the data with interpolation 13 | float GetDataAtPointRadians(float latitude, float longitude); 14 | 15 | // load and increment reference counter 16 | // make sure to call StopUsing after 17 | void StartUsing(); 18 | 19 | // decrement reference counter and unload 20 | // make sure to call StartUsing before 21 | void StopUsing(); 22 | } -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Deps/bzip2/libbz2.def: -------------------------------------------------------------------------------- 1 | DESCRIPTION "libbzip2: library for data compression" 2 | EXPORTS 3 | BZ2_bzCompressInit 4 | BZ2_bzCompress 5 | BZ2_bzCompressEnd 6 | BZ2_bzDecompressInit 7 | BZ2_bzDecompress 8 | BZ2_bzDecompressEnd 9 | BZ2_bzReadOpen 10 | BZ2_bzReadClose 11 | BZ2_bzReadGetUnused 12 | BZ2_bzRead 13 | BZ2_bzWriteOpen 14 | BZ2_bzWrite 15 | BZ2_bzWriteClose 16 | BZ2_bzWriteClose64 17 | BZ2_bzBuffToBuffCompress 18 | BZ2_bzBuffToBuffDecompress 19 | BZ2_bzlibVersion 20 | BZ2_bzopen 21 | BZ2_bzdopen 22 | BZ2_bzread 23 | BZ2_bzwrite 24 | BZ2_bzflush 25 | BZ2_bzclose 26 | BZ2_bzerror 27 | -------------------------------------------------------------------------------- /Script/android-upload-demo.bat: -------------------------------------------------------------------------------- 1 | adb shell mkdir -p /storage/emulated/0/Android/data/com.YourCompany.OpenStorm/files/UnrealGame/OpenStorm/OpenStorm/Content/Data/Demo/ 2 | adb push ../Content/Data/Demo/KLCH20200827_034044_V06 /storage/emulated/0/Android/data/com.YourCompany.OpenStorm/files/UnrealGame/OpenStorm/OpenStorm/Content/Data/Demo/ 3 | adb push ../Content/Data/Demo/KMKX_20220723_235820 /storage/emulated/0/Android/data/com.YourCompany.OpenStorm/files/UnrealGame/OpenStorm/OpenStorm/Content/Data/Demo/ 4 | adb push ../Content/Data/Demo/KTLX20130531_231434_V06 /storage/emulated/0/Android/data/com.YourCompany.OpenStorm/files/UnrealGame/OpenStorm/OpenStorm/Content/Data/Demo/ -------------------------------------------------------------------------------- /Source/OpenStorm/Mapping/Data/Tar.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | class Tar{ 5 | public: 6 | class TarFile { 7 | public: 8 | std::string name; 9 | size_t size = 0; 10 | size_t offset = 0; 11 | uint8_t* data = NULL; 12 | ~TarFile(){ 13 | if(data != NULL){ 14 | delete[] data; 15 | } 16 | } 17 | }; 18 | 19 | 20 | bool valid = false; 21 | std::string tarFileName = ""; 22 | std::map fileMap = {}; 23 | // open a tar file 24 | Tar(std::string filename); 25 | // get the contents of a file from the tar, caller must delete TarFile 26 | TarFile* GetFile(std::string filename); 27 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Nexrad.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "RadarReader.h" 4 | 5 | namespace Nexrad{ 6 | // recompress an archive using gzip, retuns zero on success 7 | int RecompressArchive(std::string inFile, std::string outFile); 8 | // decompress an archive, returns zero on success 9 | int DecompressArchive(std::string inFile, std::string outFile); 10 | }; 11 | 12 | 13 | class NexradRadarReader : public RadarReader{ 14 | public: 15 | void* rslData = NULL; 16 | 17 | virtual bool LoadFile(std::string filename); 18 | 19 | virtual bool LoadVolume(RadarData* radarData, RadarData::VolumeType volumeType); 20 | 21 | virtual void UnloadFile(); 22 | 23 | virtual ~NexradRadarReader(); 24 | }; -------------------------------------------------------------------------------- /Source/OpenStorm.Target.cs: -------------------------------------------------------------------------------- 1 | // Copyright Epic Games, Inc. All Rights Reserved. 2 | 3 | using UnrealBuildTool; 4 | using System.Collections.Generic; 5 | 6 | public class OpenStormTarget : TargetRules 7 | { 8 | public OpenStormTarget( TargetInfo Target) : base(Target) 9 | { 10 | Name = "OpenStorm"; 11 | Type = TargetType.Game; 12 | DefaultBuildSettings = BuildSettingsVersion.Latest; 13 | ExtraModuleNames.AddRange( new string[] { "OpenStorm" } ); 14 | 15 | bUseUnityBuild = false; 16 | bUsePCHFiles = false; 17 | 18 | bUseLoggingInShipping = true; 19 | 20 | //SourceFileWorkingSet.Provider = "None"; 21 | //SourceFileWorkingSet.RepositoryPath = ""; 22 | //SourceFileWorkingSet.GitPath = ""; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Source/OpenStorm/OpenStormGameModeBase.h: -------------------------------------------------------------------------------- 1 | // Copyright Epic Games, Inc. All Rights Reserved. 2 | 3 | #pragma once 4 | #include "./Objects/RadarGameStateBase.h" 5 | #include "CoreMinimal.h" 6 | #include "GameFramework/GameModeBase.h" 7 | #include "./Objects/RadarViewPawn.h" 8 | #include "GameFramework/DefaultPawn.h" 9 | #include "OpenStormGameModeBase.generated.h" 10 | 11 | /** 12 | * 13 | */ 14 | UCLASS() 15 | class OPENSTORM_API AOpenStormGameModeBase : public AGameModeBase 16 | { 17 | GENERATED_BODY() 18 | 19 | public: 20 | void InitGameState() override; 21 | 22 | /*UPROPERTY(EditAnywhere, NoClear) 23 | TSubclassOf CustomRadarPawnClass = ARadarViewPawn::StaticClass();*/ 24 | 25 | AOpenStormGameModeBase(); 26 | }; 27 | -------------------------------------------------------------------------------- /OpenStorm.uproject: -------------------------------------------------------------------------------- 1 | { 2 | "FileVersion": 3, 3 | "EngineAssociation": "5.2", 4 | "Category": "", 5 | "Description": "", 6 | "Modules": [ 7 | { 8 | "Name": "OpenStorm", 9 | "Type": "Runtime", 10 | "LoadingPhase": "Default", 11 | "AdditionalDependencies": [ 12 | "Engine" 13 | ] 14 | } 15 | ], 16 | "Plugins": [ 17 | { 18 | "Name": "ModelingToolsEditorMode", 19 | "Enabled": true, 20 | "TargetAllowList": [ 21 | "Editor" 22 | ] 23 | }, 24 | { 25 | "Name": "Test", 26 | "Enabled": false 27 | }, 28 | { 29 | "Name": "OpenXR", 30 | "Enabled": true, 31 | "SupportedTargetPlatforms": [ 32 | "Win64", 33 | "Linux", 34 | "Android", 35 | "HoloLens" 36 | ] 37 | } 38 | ] 39 | } -------------------------------------------------------------------------------- /Source/OpenStorm/UI/ImGuiUI.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | 6 | #include 7 | 8 | class AImGuiController; 9 | namespace pfd{ 10 | class public_open_file; 11 | } 12 | 13 | class ImGuiUI 14 | { 15 | 16 | public: 17 | // Sets default values for this actor's properties 18 | ImGuiUI(); 19 | ~ImGuiUI(); 20 | 21 | bool showDemoWindow = false; 22 | bool scalabilityTest = false; 23 | AImGuiController* imGuiController = NULL; 24 | 25 | pfd::public_open_file* fileChooser = NULL; 26 | 27 | // choose a directory or specific files 28 | void ChooseFiles(); 29 | 30 | 31 | public: 32 | // main settings UI 33 | void MainUI(); 34 | 35 | void Tick(float deltaTime); 36 | 37 | void ligma(bool Value); 38 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/RadarReader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "RadarData.h" 5 | 6 | 7 | class RadarReader { 8 | public: 9 | bool verbose = false; 10 | 11 | // load in file 12 | // must run UnloadFile if this function returns true to free 13 | virtual bool LoadFile(std::string filename) = 0; 14 | 15 | // load volume into radarData object from loaded file 16 | virtual bool LoadVolume(RadarData* radarData, RadarData::VolumeType volumeType) = 0; 17 | 18 | // unload file and free memory 19 | virtual void UnloadFile() = 0; 20 | 21 | // get a RadarReader object for a given file 22 | // the type of file will be automatically determined 23 | // delete the object when finished 24 | static RadarReader* GetLoaderForFile(std::string filename); 25 | 26 | virtual ~RadarReader(); 27 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/Application/DiscordPresence.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "GameFramework/Actor.h" 5 | #include "DiscordPresence.generated.h" 6 | 7 | UCLASS() 8 | class OPENSTORM_API ADiscordPresence : public AActor 9 | { 10 | GENERATED_BODY() 11 | 12 | public: 13 | // Sets default values for this actor's properties 14 | ADiscordPresence(); 15 | 16 | protected: 17 | // Called when the game starts or when spawned 18 | virtual void BeginPlay() override; 19 | virtual void EndPlay(const EEndPlayReason::Type endPlayReason) override; 20 | 21 | public: 22 | // Called every frame 23 | virtual void Tick(float DeltaTime) override; 24 | 25 | bool isPresenceActive = false; 26 | double lastPresenceTime = 0; 27 | 28 | void StartDiscordPresence(); 29 | void StopDiscordPresence(); 30 | }; 31 | -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/SystemAPI.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include 5 | #include 6 | 7 | class SystemAPI{ 8 | public: 9 | struct FileStats{ 10 | bool exists = false; 11 | bool isDirectory = false; 12 | size_t size = 0; 13 | double mtime = 0; 14 | std::string name = ""; 15 | bool operator < (const FileStats& other) const 16 | { 17 | return (name < other.name); 18 | } 19 | }; 20 | static double CurrentTime(); 21 | // find all files in a directory and return a vector of FileStats. Optionally include a pointer to a bool to allow canceling the operation. 22 | static std::vector ReadDirectory(std::string path, bool* canceled = NULL); 23 | static FileStats GetFileStats(std::string path); 24 | static bool CreateDirectory(std::string path); 25 | static void Sleep(float seconds); 26 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/Objects/Joke.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "UObject/Object.h" 5 | #include "GameFramework/Actor.h" 6 | 7 | #include "AudioCaptureCore.h" 8 | //#include "AudioCapture.h" 9 | 10 | #include "Joke.generated.h" 11 | 12 | UCLASS() 13 | class AJoke : public AActor { 14 | GENERATED_BODY() 15 | 16 | public: 17 | AJoke(); 18 | 19 | bool capturing = false; 20 | float totalVolume = 0; 21 | float totalNumSamples = 0; 22 | float totalPeak = 0; 23 | 24 | Audio::FAudioCapture audioCapture; 25 | 26 | void AudioHandler(const float* AudioData, int32 NumFrames, int32 NumChannels, int32 SampleRate, double StreamTime, bool bOverFlow); 27 | void StartAudioCapture(); 28 | void StopAudioCapture(); 29 | 30 | virtual void BeginPlay() override; 31 | virtual void Tick(float DeltaTime) override; 32 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/UI/Slate/SCompass.h: -------------------------------------------------------------------------------- 1 | #include "CoreMinimal.h" 2 | //#include "Widgets/SOverlay.h" 3 | #include "Widgets/SCanvas.h" 4 | #include "Widgets/Layout/SConstraintCanvas.h" 5 | #include "Widgets/Text/STextBlock.h" 6 | #include "Widgets/Images/SImage.h" 7 | 8 | 9 | 10 | class SCompass : public SConstraintCanvas { 11 | public: 12 | float lastRotation = -1; 13 | float size = 75; 14 | TSharedPtr northText; 15 | TSharedPtr southText; 16 | TSharedPtr eastText; 17 | TSharedPtr westText; 18 | TSharedPtr rose; 19 | 20 | FSlateBrush roseBrush; 21 | 22 | //TSharedPtr roseTexture; 23 | 24 | SCompass(); 25 | void Construct(const FArguments& inArgs); 26 | virtual FVector2D ComputeDesiredSize(float layoutScaleMultiplier) const override; 27 | void Rotate(float rotation); 28 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/Application/RadarDataDownloader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "CoreMinimal.h" 5 | #include "GameFramework/Actor.h" 6 | #include "RadarDataDownloader.generated.h" 7 | 8 | class RadarDownloaderTask; 9 | 10 | UCLASS() 11 | class OPENSTORM_API ARadarDataDownloader : public AActor 12 | { 13 | GENERATED_BODY() 14 | 15 | public: 16 | // Sets default values for this actor's properties 17 | ARadarDataDownloader(); 18 | 19 | protected: 20 | // Called when the game starts or when spawned 21 | virtual void BeginPlay() override; 22 | virtual void EndPlay(const EEndPlayReason::Type endPlayReason) override; 23 | 24 | public: 25 | // Called every frame 26 | virtual void Tick(float DeltaTime) override; 27 | 28 | RadarDownloaderTask* downloaderTask = NULL; 29 | std::vector callbackIds = {}; 30 | }; 31 | -------------------------------------------------------------------------------- /Source/OpenStorm/Deps/discord-rpc/src/backoff.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | struct Backoff { 9 | int64_t minAmount; 10 | int64_t maxAmount; 11 | int64_t current; 12 | int fails; 13 | std::mt19937_64 randGenerator; 14 | std::uniform_real_distribution<> randDistribution; 15 | 16 | double rand01() { return randDistribution(randGenerator); } 17 | 18 | Backoff(int64_t min, int64_t max) 19 | : minAmount(min) 20 | , maxAmount(max) 21 | , current(min) 22 | , fails(0) 23 | , randGenerator((uint64_t)time(0)) 24 | { 25 | } 26 | 27 | void reset() 28 | { 29 | fails = 0; 30 | current = minAmount; 31 | } 32 | 33 | int64_t nextDelay() 34 | { 35 | ++fails; 36 | int64_t delay = (int64_t)((double)current * 2.0 * rand01()); 37 | current = std::min(current + delay, maxAmount); 38 | return current; 39 | } 40 | }; 41 | -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Deps/zlib/gzclose.c: -------------------------------------------------------------------------------- 1 | /* gzclose.c -- zlib gzclose() function 2 | * Copyright (C) 2004, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | #pragma clang diagnostic push 7 | #pragma clang diagnostic ignored "-Wdeprecated-non-prototype" 8 | 9 | #include "gzguts.h" 10 | 11 | /* gzclose() is in a separate file so that it is linked in only if it is used. 12 | That way the other gzclose functions can be used instead to avoid linking in 13 | unneeded compression or decompression routines. */ 14 | int ZEXPORT gzclose(file) 15 | gzFile file; 16 | { 17 | #ifndef NO_GZCOMPRESS 18 | gz_statep state; 19 | 20 | if (file == NULL) 21 | return Z_STREAM_ERROR; 22 | state = (gz_statep)file; 23 | 24 | return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); 25 | #else 26 | return gzclose_r(file); 27 | #endif 28 | } 29 | 30 | #pragma clang diagnostic pop -------------------------------------------------------------------------------- /Source/OpenStorm/UI/UiWindow.h: -------------------------------------------------------------------------------- 1 | #include "CoreMinimal.h" 2 | 3 | class SWindow; 4 | class UGameViewportClient; 5 | class SWidget; 6 | class SOverlay; 7 | class SInputProxy; 8 | struct FSlateColorBrush; 9 | 10 | class UIWindow{ 11 | public: 12 | TSharedPtr window = NULL; 13 | TSharedPtr imGuiWidget = NULL; 14 | TSharedPtr windowContent; 15 | 16 | // viewport overlay of main window (not UIWindow) 17 | TSharedPtr mainViewportOverlayWidget = NULL; 18 | 19 | FSlateColorBrush* backgroundBrush; 20 | 21 | bool isOpen = false; 22 | 23 | // create a new window and steal ImGui from viewport 24 | UIWindow(UGameViewportClient* viewport); 25 | 26 | ~UIWindow(); 27 | 28 | // gracefully close the window 29 | void Close(); 30 | 31 | 32 | // return ImGui to main window. this is called automatically when Close is called. 33 | void ReturnImGui(); 34 | void Tick(); 35 | protected: 36 | void CloseDelegate(const TSharedRef& window); 37 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/EngineHelpers/StringUtils.cpp: -------------------------------------------------------------------------------- 1 | #include "StringUtils.h" 2 | #include "Misc/Paths.h" 3 | #include "HAL/FileManager.h" 4 | 5 | #if PLATFORM_WINDOWS 6 | #include "Windows/WindowsPlatformProcess.h" 7 | #else 8 | #include "Linux/LinuxPlatformProcess.h" 9 | #endif 10 | 11 | // #include "GenericPlatform/GenericPlatformProcess.h" 12 | 13 | 14 | 15 | // get path relative to project root 16 | std::string StringUtils::GetRelativePath(FString inString){ 17 | FString file = FPaths::Combine(FPaths::ProjectDir(), inString); 18 | FString fullFilePath = IFileManager::Get().ConvertToAbsolutePathForExternalAppForRead(*file); 19 | return FStringToSTDString(fullFilePath); 20 | } 21 | 22 | std::string StringUtils::GetUserPath(FString inString){ 23 | FString file = FPaths::Combine(FPaths::Combine(FPlatformProcess::UserSettingsDir(), TEXT("OpenStorm")), inString); 24 | FString fullFilePath = IFileManager::Get().ConvertToAbsolutePathForExternalAppForRead(*file); 25 | return FStringToSTDString(fullFilePath); 26 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "Build Unreal Development Win64", 6 | "type": "shell", 7 | // Assign output file name with VSCode inner variables like ${fileBasename} 8 | //"command": "C:/files/Epic/UE_5.2/Engine/Build/BatchFiles/Build.bat OpenStormEditor Win64 Development -Project=\"${workspaceFolder}/OpenStorm.uproject\"", 9 | //"command": "${workspaceFolder}/../UnrealEngine/Build/BatchFiles/Build.bat OpenStormEditor Win64 Development -Project=\"${workspaceFolder}/OpenStorm.uproject\"", 10 | "windows":{ 11 | "command": "${workspaceFolder}/.vscode/build.bat OpenStormEditor Win64 Development -Project=\"${workspaceFolder}/OpenStorm.uproject\"" 12 | }, 13 | "linux":{ 14 | "command": "${workspaceFolder}/../UnrealEngine/Engine/Build/BatchFiles/Linux/Build.sh OpenStormEditor Linux Development -Project=\"${workspaceFolder}/OpenStorm.uproject\"" 15 | }, 16 | "group": { 17 | "kind": "build", 18 | "isDefault": true 19 | } 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /Source/OpenStorm/Deps/discord-rpc/src/msg_queue.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | // A simple queue. No locks, but only works with a single thread as producer and a single thread as 6 | // a consumer. Mutex up as needed. 7 | 8 | template 9 | class MsgQueue { 10 | ElementType queue_[QueueSize]; 11 | std::atomic_uint nextAdd_{0}; 12 | std::atomic_uint nextSend_{0}; 13 | std::atomic_uint pendingSends_{0}; 14 | 15 | public: 16 | MsgQueue() {} 17 | 18 | ElementType* GetNextAddMessage() 19 | { 20 | // if we are falling behind, bail 21 | if (pendingSends_.load() >= QueueSize) { 22 | return nullptr; 23 | } 24 | auto index = (nextAdd_++) % QueueSize; 25 | return &queue_[index]; 26 | } 27 | void CommitAdd() { ++pendingSends_; } 28 | 29 | bool HavePendingSends() const { return pendingSends_.load() != 0; } 30 | ElementType* GetNextSendMessage() 31 | { 32 | auto index = (nextSend_++) % QueueSize; 33 | return &queue_[index]; 34 | } 35 | void CommitSend() { --pendingSends_; } 36 | }; 37 | -------------------------------------------------------------------------------- /Source/OpenStorm/UI/Slate/SlateUI.h: -------------------------------------------------------------------------------- 1 | #include "CoreMinimal.h" 2 | #include "UObject/Object.h" 3 | #include "GameFramework/Actor.h" 4 | #include "SlateUI.generated.h" 5 | 6 | 7 | 8 | class SOverlay; 9 | class SDPIScaler; 10 | class SCompass; 11 | class SCacheState; 12 | class STextBlock; 13 | class UGameViewportClient; 14 | class USlateUIResources; 15 | 16 | UCLASS() 17 | class ASlateUI : public AActor{ 18 | GENERATED_BODY() 19 | 20 | public: 21 | TSharedPtr compass; 22 | TSharedPtr cacheState; 23 | TSharedPtr hudWidget; 24 | TSharedPtr fileName; 25 | TSharedPtr scaleWidget; 26 | ASlateUI(); 27 | ~ASlateUI(); 28 | 29 | UPROPERTY(EditAnywhere) 30 | USlateUIResources* resources = NULL; 31 | 32 | void AddToViewport(UGameViewportClient* gameViewport); 33 | void SetCompassRotation(float rotation); 34 | virtual void BeginPlay() override; 35 | virtual void EndPlay(const EEndPlayReason::Type endPlayReason) override; 36 | virtual void Tick(float DeltaTime) override; 37 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/Mapping/LocationMarkerManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include "CoreMinimal.h" 8 | #include "UObject/Object.h" 9 | #include "GameFramework/Actor.h" 10 | #include "LocationMarkerManager.generated.h" 11 | 12 | class ALocationMarker; 13 | 14 | UCLASS() 15 | class ALocationMarkerManager : public AActor{ 16 | GENERATED_BODY() 17 | public: 18 | std::map locationMarkerObjects = {}; 19 | std::vector callbackIds = {}; 20 | 21 | float maxSiteMarkerDistance = 7500; 22 | 23 | ALocationMarkerManager(); 24 | 25 | virtual void BeginPlay() override; 26 | virtual void EndPlay(const EEndPlayReason::Type endPlayReason) override; 27 | virtual void Tick(float DeltaTime) override; 28 | 29 | // update all waypoint location markers 30 | void UpdateWaypointMarkers(); 31 | 32 | // add any site markers that need to be added 33 | void AddSiteMarkers(); 34 | 35 | // update all location markers based on globalState 36 | void UpdateMarkerLocations(); 37 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/UI/ClickableInterface.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "UObject/Interface.h" 7 | #include "ClickableInterface.generated.h" 8 | 9 | // This class does not need to be modified. 10 | UINTERFACE(MinimalAPI) 11 | class UClickableInterface : public UInterface 12 | { 13 | GENERATED_BODY() 14 | }; 15 | 16 | /** 17 | * Actors that use this interface will be clickable by the mouse 18 | */ 19 | class OPENSTORM_API IClickableInterface 20 | { 21 | GENERATED_BODY() 22 | 23 | // Add interface functions to this class. This is the class that will be inherited to implement this interface. 24 | public: 25 | enum ClickableType { 26 | ClickableTypeClick, // fires OnClick after the mouse is released 27 | // ClickableTypeDrag, 28 | }; 29 | // when the raycast hit this function is called to determine what type of interaction will happen 30 | virtual ClickableType GetClickableType(); 31 | // fired when the object is clicked 32 | virtual void OnClick(); 33 | }; 34 | -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Deps/zlib/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright notice: 2 | 3 | (C) 1995-2022 Jean-loup Gailly and Mark Adler 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | Jean-loup Gailly Mark Adler 22 | jloup@gzip.org madler@alumni.caltech.edu 23 | -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Products/RadarProduct.cpp: -------------------------------------------------------------------------------- 1 | #include "RadarProduct.h" 2 | 3 | 4 | RadarProduct* RadarProduct::GetProduct(RadarData::VolumeType type){ 5 | // if(productsMap.find(type) != productsMap.end()){ 6 | // return productsMap[type]; 7 | // }else{ 8 | // return NULL; 9 | // } 10 | for(RadarProduct* product : RadarProduct::products){ 11 | if(product->volumeType == type){ 12 | return product; 13 | } 14 | } 15 | return NULL; 16 | } 17 | 18 | int RadarProduct::dynamicVolumeTypeId = 1000; 19 | 20 | RadarData::VolumeType RadarProduct::CreateDynamicVolumeType(){ 21 | return (RadarData::VolumeType)dynamicVolumeTypeId++; 22 | } 23 | 24 | RadarData *RadarProduct::deriveVolume(std::map inputProducts) { 25 | return NULL; 26 | } 27 | 28 | RadarProduct::~RadarProduct(){ 29 | 30 | } 31 | 32 | RadarProductBase::RadarProductBase(RadarData::VolumeType type, std::string productName, std::string shortProductName){ 33 | volumeType = type; 34 | productType = PRODUCT_BASE; 35 | name = productName; 36 | shortName = shortProductName; 37 | } -------------------------------------------------------------------------------- /Source/OpenStorm/Deps/discord-rpc/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2017 Discord, Inc. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /Source/OpenStorm/Objects/RadarViewport.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | 6 | #include "RadarVolumeRender.h" 7 | 8 | #include "UObject/Object.h" 9 | #include "UObject/ConstructorHelpers.h" 10 | #include "CoreMinimal.h" 11 | #include "GameFramework/Actor.h" 12 | #include "Materials/MaterialInstanceDynamic.h" 13 | #include "Components/StaticMeshComponent.h" 14 | #include "RadarViewport.generated.h" 15 | 16 | UCLASS() 17 | class OPENSTORM_API ARadarViewport : public AActor 18 | { 19 | GENERATED_BODY() 20 | 21 | public: 22 | // Sets default values for this actor's properties 23 | ARadarViewport(); 24 | UPROPERTY(VisibleAnywhere) 25 | UStaticMeshComponent* meshComponent; 26 | 27 | UPROPERTY(EditAnywhere) 28 | ARadarVolumeRender* mainVolumeRender = NULL; 29 | 30 | UMaterialInstanceDynamic* radarMaterialInstance = NULL; 31 | 32 | protected: 33 | // Called when the game starts or when spawned 34 | virtual void BeginPlay() override; 35 | 36 | public: 37 | // Called every frame 38 | virtual void Tick(float DeltaTime) override; 39 | 40 | }; 41 | -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Deps/json11/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Dropbox, Inc. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Source/OpenStorm/EngineHelpers/StringUtils.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "CoreMinimal.h" 4 | 5 | namespace StringUtils { 6 | // convert FString to std::string 7 | inline std::string FStringToSTDString(FString inStr){ 8 | // return std::string(StringCast(*inStr).Get()); 9 | return std::string(TCHAR_TO_UTF8(*inStr)); 10 | } 11 | 12 | //convert std::string to FString 13 | inline FString STDStringToFString(std::string inStr){ 14 | return FString(UTF8_TO_TCHAR(inStr.c_str())); 15 | } 16 | 17 | // get path relative to project root 18 | std::string GetRelativePath(FString inString); 19 | 20 | // get path relative to project root 21 | inline std::string GetRelativePath(std::string inString){ 22 | return GetRelativePath(STDStringToFString(inString)); 23 | } 24 | 25 | // get path relative to user settings directory, it is AppData/OpenStorm/ on windows 26 | std::string GetUserPath(FString inString); 27 | 28 | // get path relative to user settings directory, it is AppData/OpenStorm/ on windows 29 | inline std::string GetUserPath(std::string inString){ 30 | return GetUserPath(STDStringToFString(inString)); 31 | } 32 | } -------------------------------------------------------------------------------- /Config/HoloLens/HoloLensEngine.ini: -------------------------------------------------------------------------------- 1 | 2 | 3 | [/Script/HoloLensPlatformEditor.HoloLensTargetSettings] 4 | bBuildForEmulation=False 5 | bBuildForDevice=True 6 | bUseNameForLogo=True 7 | bBuildForRetailWindowsStore=False 8 | bAutoIncrementVersion=False 9 | bShouldCreateAppInstaller=False 10 | AppInstallerInstallationURL= 11 | HoursBetweenUpdateChecks=0 12 | bEnablePIXProfiling=False 13 | TileBackgroundColor=(B=64,G=0,R=0,A=255) 14 | SplashScreenBackgroundColor=(B=64,G=0,R=0,A=255) 15 | +PerCultureResources=(CultureId="",Strings=(PackageDisplayName="",PublisherDisplayName="",PackageDescription="",ApplicationDisplayName="",ApplicationDescription=""),Images=()) 16 | TargetDeviceFamily=Windows.Holographic 17 | MinimumPlatformVersion= 18 | MaximumPlatformVersionTested=10.0.19041.0 19 | MaxTrianglesPerCubicMeter=500.000000 20 | SpatialMeshingVolumeSize=20.000000 21 | CompilerVersion=Default 22 | Windows10SDKVersion=10.0.18362.0 23 | +CapabilityList=internetClientServer 24 | +CapabilityList=privateNetworkClientServer 25 | +Uap2CapabilityList=spatialPerception 26 | bSetDefaultCapabilities=False 27 | SpatializationPlugin= 28 | ReverbPlugin= 29 | OcclusionPlugin= 30 | SoundCueCookQualityIndex=-1 31 | 32 | -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Products/ProductList.cpp: -------------------------------------------------------------------------------- 1 | #include "RadarProduct.h" 2 | #include "VelocityDealiasProduct.h" 3 | #include "VelocityRelativeProduct.h" 4 | #include "NormalizedRotationProduct.h" 5 | #include "RotationProduct.h" 6 | 7 | std::vector RadarProduct::products = { 8 | new RadarProductBase(RadarData::VOLUME_REFLECTIVITY, "Reflectivity", "REF"), 9 | new RadarProductBase(RadarData::VOLUME_VELOCITY, "Radial Velocity","RV"), 10 | new RadarProductBase(RadarData::VOLUME_SPECTRUM_WIDTH, "Spectrum Width","SW"), 11 | new RadarProductBase(RadarData::VOLUME_CORELATION_COEFFICIENT, "Correlation Coefficient","CC"), 12 | new RadarProductBase(RadarData::VOLUME_DIFFERENTIAL_REFLECTIVITY, "Differential Reflectivity","DR"), 13 | new RadarProductBase(RadarData::VOLUME_DIFFERENTIAL_PHASE_SHIFT, "Differential Phase Shift","DPS"), 14 | new RadarProductVelocityDealiased(), 15 | new RadarProductStormRelativeVelocity(), 16 | new RadarProductNormalizedRotation(), 17 | // new RadarProductRotation(), 18 | new RadarProductVelocityDealiasedGroupTest(RadarProduct::CreateDynamicVolumeType()), 19 | }; 20 | 21 | //std::map RadarProduct::productsMap = {}; 22 | 23 | -------------------------------------------------------------------------------- /Plugins/CustomShaders/Source/CustomShaders/Private/CustomShaders.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Epic Games, Inc. All Rights Reserved. 2 | 3 | #include "CustomShaders.h" 4 | #include "ShaderCore.h" 5 | 6 | #define LOCTEXT_NAMESPACE "FCustomShadersModule" 7 | 8 | void FCustomShadersModule::StartupModule() 9 | { 10 | // This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module 11 | FString ShaderDir = FPaths::Combine(FPaths::ProjectPluginsDir(), TEXT("/CustomShaders/Shaders")); 12 | AddShaderSourceDirectoryMapping("/CustomShaders/Shaders", ShaderDir); 13 | 14 | FString ProjectShaderDir = FPaths::Combine(FPaths::ProjectDir(), TEXT("/Shaders")); 15 | AddShaderSourceDirectoryMapping("/Shaders", ProjectShaderDir); 16 | 17 | 18 | UE_LOG(LogTemp, Display, TEXT("CustomShaders: /Shaders Mapped")); 19 | } 20 | 21 | void FCustomShadersModule::ShutdownModule() 22 | { 23 | // This function may be called during shutdown to clean up your module. For modules that support dynamic reloading, 24 | // we call this function before unloading the module. 25 | } 26 | 27 | #undef LOCTEXT_NAMESPACE 28 | 29 | IMPLEMENT_MODULE(FCustomShadersModule, CustomShaders) -------------------------------------------------------------------------------- /Source/OpenStorm/Mapping/Data/HTTPRequest.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | class HTTPRequest{ 5 | public: 6 | // if the request is done 7 | bool done = false; 8 | // if the request is currently running 9 | bool running = false; 10 | // if the request has been canceled with delete 11 | bool canceled = false; 12 | 13 | // if the data should be downloaded to memory 14 | bool toMemory = true; 15 | // data from http request, populated if successful and toMemory is true 16 | uint8_t* data = NULL; 17 | // size of data downloaded 18 | int dataSize = 0; 19 | 20 | 21 | 22 | std::function readyCallback = NULL; 23 | // set callback, this only works if using with an HTTPPool 24 | void SetCallback(std::function callback); 25 | 26 | // run the http request 27 | void Execute(); 28 | 29 | void Delete(); 30 | private: 31 | // use Delete 32 | ~HTTPRequest(); 33 | }; 34 | 35 | 36 | class HTTPPool{ 37 | public: 38 | int maxConnections = 10; 39 | std::list currentConnections; 40 | std::list pendingConnections; 41 | // call this function often on the main thread 42 | void EventLoop(); 43 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/Mapping/GISPolyline.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "./Data/ShapeFile.h" 4 | #include "CoreMinimal.h" 5 | #include "UObject/Object.h" 6 | #include "GameFramework/Actor.h" 7 | #include "GISPolyline.generated.h" 8 | 9 | class Globe; 10 | class GISObject; 11 | class UProceduralMeshComponent; 12 | class UMaterialInterface; 13 | class UMaterialInstanceDynamic; 14 | 15 | UCLASS() 16 | class AGISPolyline : public AActor{ 17 | GENERATED_BODY() 18 | 19 | public: 20 | 21 | UPROPERTY(EditAnywhere) 22 | UMaterialInterface* material; 23 | 24 | UPROPERTY(VisibleAnywhere) 25 | UMaterialInstanceDynamic* materialInstance = NULL; 26 | 27 | UPROPERTY(EditAnywhere); 28 | UProceduralMeshComponent* proceduralMesh; 29 | 30 | // update position of all meshes after globe update 31 | void DisplayObject(GISObject* object, GISGroup* group); 32 | 33 | // position object onto a globe 34 | void PositionObject(Globe* globe); 35 | 36 | // set brightness of material 37 | void SetBrightness(float brightness); 38 | 39 | AGISPolyline(); 40 | ~AGISPolyline(); 41 | 42 | virtual void BeginPlay() override; 43 | //virtual void EndPlay(const EEndPlayReason::Type endPlayReason) override; 44 | //virtual void Tick(float DeltaTime) override; 45 | 46 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/UI/Slate/SCacheState.h: -------------------------------------------------------------------------------- 1 | #include "CoreMinimal.h" 2 | //#include "Widgets/SOverlay.h" 3 | #include "Widgets/SCanvas.h" 4 | #include "Widgets/Layout/SConstraintCanvas.h" 5 | #include "Widgets/Images/SImage.h" 6 | #include "Brushes/SlateColorBrush.h" 7 | 8 | #include 9 | 10 | 11 | class STextBlock; 12 | class SCacheState : public SConstraintCanvas { 13 | public: 14 | float height = 15; 15 | float width = 400; 16 | float boarder = 0.0; 17 | int cellCount = 0; 18 | 19 | std::vector> cells; 20 | TSharedPtr selector; 21 | TSharedPtr fileName; 22 | 23 | FSlateBrush selectorBrush = FSlateColorBrush(FLinearColor(1.0, 1.0, 1.0, 0.5)); 24 | FSlateColorBrush unloadedBrush = FSlateColorBrush(FLinearColor(0.1, 0.1, 0.1, 0.5)); 25 | FSlateColorBrush loadingBrush = FSlateColorBrush(FLinearColor(0.1, 0.1, 0.4, 0.5)); 26 | FSlateColorBrush loadedBrush = FSlateColorBrush(FLinearColor(0.1, 0.4, 0.1, 0.5)); 27 | FSlateColorBrush errorBrush = FSlateColorBrush(FLinearColor(0.6, 0.1, 0.1, 0.5)); 28 | //TSharedPtr roseTexture; 29 | 30 | SCacheState(); 31 | void Construct(const FArguments& inArgs); 32 | virtual FVector2D ComputeDesiredSize(float layoutScaleMultiplier) const override; 33 | //void Tick(float deltaTime); 34 | void UpdateState(); 35 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/RadarReader.cpp: -------------------------------------------------------------------------------- 1 | #include "RadarReader.h" 2 | #include "Nexrad.h" 3 | #include "OdimH5.h" 4 | #include "MiniRad.h" 5 | #include 6 | #include 7 | 8 | inline bool hasEnding (std::string const &fullString, std::string const &ending) { 9 | if (fullString.length() >= ending.length()) { 10 | return (0 == fullString.compare (fullString.length() - ending.length(), ending.length(), ending)); 11 | } else { 12 | return false; 13 | } 14 | } 15 | 16 | RadarReader* RadarReader::GetLoaderForFile(const std::string filename){ 17 | std::string filenameLower = filename + ""; 18 | std::transform(filenameLower.begin(), filenameLower.end(), filenameLower.begin(), [](unsigned char c){ return std::tolower(c); }); 19 | if(hasEnding(filenameLower, ".h5") || hasEnding(filenameLower, ".hdf5") || hasEnding(filenameLower, ".hdf")){ 20 | return new OdimH5RadarReader(); 21 | } 22 | if(hasEnding(filenameLower, ".gz") || hasEnding(filenameLower, ".bz2")){ 23 | return new NexradRadarReader(); 24 | } 25 | if(hasEnding(filenameLower, ".minirad")){ 26 | return new MiniRadRadarReader(); 27 | } 28 | // TODO: read a small section of the file if the type is not apparent from the name and then analyze it 29 | return new NexradRadarReader(); 30 | } 31 | 32 | RadarReader::~RadarReader(){ 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Plugins/CustomShaders/Source/CustomShaders/CustomShaders.Build.cs: -------------------------------------------------------------------------------- 1 | // Copyright Epic Games, Inc. All Rights Reserved. 2 | 3 | using UnrealBuildTool; 4 | 5 | public class CustomShaders : ModuleRules 6 | { 7 | public CustomShaders(ReadOnlyTargetRules Target) : base(Target) 8 | { 9 | PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; 10 | 11 | PublicIncludePaths.AddRange( 12 | new string[] { 13 | // ... add public include paths required here ... 14 | } 15 | ); 16 | 17 | 18 | PrivateIncludePaths.AddRange( 19 | new string[] { 20 | // ... add other private include paths required here ... 21 | } 22 | ); 23 | 24 | 25 | PublicDependencyModuleNames.AddRange( 26 | new string[] 27 | { 28 | "Core", 29 | // ... add other public dependencies that you statically link with here ... 30 | } 31 | ); 32 | 33 | 34 | PrivateDependencyModuleNames.AddRange( 35 | new string[] 36 | { 37 | "CoreUObject", 38 | "Engine", 39 | "Slate", 40 | "SlateCore", 41 | "RenderCore", 42 | // ... add private dependencies that you statically link with here ... 43 | } 44 | ); 45 | 46 | 47 | DynamicallyLoadedModuleNames.AddRange( 48 | new string[] 49 | { 50 | // ... add any modules that your module loads dynamically here ... 51 | } 52 | ); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /TODO.md: -------------------------------------------------------------------------------- 1 | # TODO 2 | 3 | ## Current: 4 | - [X] Add Support for stepping though radar data 5 | - [X] Mouse grabbing and DPI support for UI 6 | - [X] Create settings window 7 | - [X] Implement directory polling 8 | - [X] Allow variable radar sizes and angles 9 | - [X] Make temporal interpolation optional 10 | - [X] Location markers 11 | - [X] Fix ImGui input state 12 | - [X] Initial public release 13 | - [ ] Add Support for filtering or modifying Color/Opacity in radar data 14 | - [X] Find and order by radar dates 15 | - [X] Allow multiple products 16 | - [X] Allow computed products 17 | - [X] Pull data from http server 18 | - [ ] Add designated thread pools to AsyncTask and multi-thread radar decompression 19 | - [X] Add linux support to ImGUI and get linux working for everything 20 | - [X] Support gzip nexrad archives 21 | - [ ] More Advanced Tools/Options for interacting, measuring, and viewing data 22 | - [ ] Top down radar view panning 23 | - [X] Save settings to disk 24 | - [X] Implement map data 25 | - [X] Pseudo-2D single sweep view 26 | - [X] Add GIS boundaries and roads 27 | - [ ] Record videos and screenshots 28 | - [ ] Display warning polygons 29 | 30 | ## Future: 31 | - [ ] Mobile Support 32 | - [ ] Combining radar data from multiple stations 33 | - [ ] Change radar decoder to one that is more performant and uses less memory 34 | - [ ] Display real time lightning 35 | 36 | 37 | ## Small: 38 | - [ ] Configurable inputs 39 | -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/AsyncTask.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class AsyncTaskRunner{ 6 | public: 7 | // this represents if the task has been canceled. 8 | // if it is true the code in Task should not modify outside memory and should exit as soon as possible 9 | bool canceled = false; 10 | 11 | // is task finished 12 | bool finished = false; 13 | // if the task is currently running 14 | bool running = false; 15 | 16 | // main lock for changing state of the task 17 | // acquire this lock when doing anything inside the task that relies on the task not being canceled 18 | // can be used in the task for general synchronization 19 | std::mutex lock; 20 | 21 | // this function must be overriden and will be run on a separate thread 22 | virtual void Task() = 0; 23 | 24 | // start the task 25 | void Start(); 26 | // start the task, if autoDelete is true it is not safe to access this object again 27 | void Start(bool autoDelete); 28 | // cancel the task. the task may continue running in the background 29 | void Cancel(); 30 | // delete memory associated with task, it is not safe to access this object again 31 | void Delete(); 32 | 33 | 34 | virtual ~AsyncTaskRunner(); 35 | private: 36 | // if the task will be automaticaly freed upon completion 37 | bool autoDelete = false; 38 | 39 | bool clearedForDeletion = false; 40 | 41 | void InternalTask(); 42 | 43 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/UI/Font.cpp: -------------------------------------------------------------------------------- 1 | #include "Font.h" 2 | #include "imgui.h" 3 | #include "ImGuiModule.h" 4 | #include "FontData.h" 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | void LoadFonts(){ 13 | //static const ImWchar OpenFontIcons_ranges[] = { 0xe000, 0xe0fe, 0 }; // Will not be copied by AddFont* so keep in scope. 14 | static const ImWchar FontAwesome_ranges[] = { ICON_MIN_FA, ICON_MAX_16_FA, 0 }; // Will not be copied by AddFont* so keep in scope. 15 | ImGuiIO& io = ImGui::GetIO(); 16 | io.Fonts->Clear(); 17 | ImFontConfig config = {}; 18 | strncpy(config.Name, "Roboto and Font Awesome", 24); 19 | //ImFont* font = io.Fonts->AddFontDefault(); 20 | //ImFont* fontRoboto = io.Fonts->AddFontFromMemoryCompressedTTF(Roboto_compressed_data, Roboto_compressed_size, 32, &config); 21 | ImFont* fontRoboto = io.Fonts->AddFontFromMemoryCompressedBase85TTF(Roboto_compressed_data_base85, 32, &config); 22 | fontRoboto->Scale = 0.4; 23 | config.MergeMode = true; 24 | //config.SizePixels = 0.1; 25 | config.GlyphOffset = ImVec2(-2, 1.5); 26 | //ImFont* fontOpenFontIcons = io.Fonts->AddFontFromMemoryCompressedTTF(OpenFontIcons_compressed_data, OpenFontIcons_compressed_size, 32, &config, OpenFontIcons_ranges); 27 | ImFont* fontIcons = io.Fonts->AddFontFromMemoryCompressedBase85TTF(FontAwesome_compressed_data_base85, 32, &config, FontAwesome_ranges); 28 | fontIcons->Scale = 0.4; 29 | //io.Fonts->Build(); 30 | FImGuiModule::Get().RebuildFontAtlas(); 31 | } -------------------------------------------------------------------------------- /Source/OpenStorm/Mapping/MapMeshManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../Radar/SimpleVector3.h" 4 | 5 | #include 6 | 7 | #include "CoreMinimal.h" 8 | #include "UObject/Object.h" 9 | #include "GameFramework/Actor.h" 10 | #include "MapMeshManager.generated.h" 11 | 12 | class AMapMesh; 13 | class Globe; 14 | class TileProvider; 15 | 16 | UCLASS() 17 | class AMapMeshManager : public AActor{ 18 | GENERATED_BODY() 19 | 20 | public: 21 | // always load in up to this layer 22 | int minLayer = 2; 23 | // max layers of zoom 24 | int maxLayer = 15; 25 | // location of camera/pawn 26 | SimpleVector3<> cameraLocation = {}; 27 | // globe used for generating meshes 28 | Globe* globe; 29 | // if the map is enabled 30 | bool enabled = false; 31 | // the brightness of the map texture 32 | float mapBrightness = 0.2; 33 | // callback ids for global state 34 | std::vector callbackIds = {}; 35 | // root of map mesh tree 36 | UPROPERTY(EditAnywhere); 37 | AMapMesh* rootMapMesh = NULL; 38 | 39 | // number of ticks to wait after game start to start map 40 | int preTicks = 10; 41 | 42 | TileProvider* tileProvider = NULL; 43 | 44 | 45 | AMapMeshManager(); 46 | ~AMapMeshManager(); 47 | 48 | virtual void BeginPlay() override; 49 | virtual void EndPlay(const EEndPlayReason::Type endPlayReason) override; 50 | virtual void Tick(float DeltaTime) override; 51 | 52 | void EnableMap(); 53 | void DisableMap(); 54 | 55 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/Mapping/Data/ShapeFile.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "../../Radar/SimpleVector3.h" 5 | 6 | class GISObject { 7 | public: 8 | // center in lat lon 9 | // SimpleVector3 center; 10 | 11 | // location in cartesian space on an un-oriented globe in meters 12 | SimpleVector3 location; 13 | // array pairs of latitude,longitude floats and separate parts are delineated by NaNs 14 | float* geometry = NULL; 15 | // number of floats in geometry buffer 16 | uint32_t geometryCount = 0; 17 | // if the object is currently show in game 18 | bool shown = false; 19 | // index of group that this object belongs to 20 | uint8_t groupId = 0; 21 | 22 | void Delete(); 23 | }; 24 | 25 | class GISGroup{ 26 | public: 27 | // distance in real world meters from camera to show objects 28 | float showDistance = 500000; 29 | // width of lines 30 | float width = 10; 31 | float colorR = 1; 32 | float colorG = 1; 33 | float colorB = 1; 34 | inline GISGroup(){} 35 | inline GISGroup(float showDistance, float width){ 36 | this->showDistance = showDistance; 37 | this->width = width; 38 | } 39 | inline GISGroup(float showDistance, float width, float r, float g, float b){ 40 | this->showDistance = showDistance; 41 | this->width = width; 42 | this->colorR = r; 43 | this->colorG = g; 44 | this->colorB = b; 45 | } 46 | }; 47 | 48 | bool ReadShapeFile(std::string fileName, std::vector* output, uint8_t groupId = 0); -------------------------------------------------------------------------------- /Source/OpenStorm/Objects/Satellite.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | #include "RadarGameStateBase.h" 5 | #include "../Radar/Globe.h" 6 | 7 | #include "CoreMinimal.h" 8 | #include "UObject/Object.h" 9 | #include "GameFramework/Actor.h" 10 | #include "Satellite.generated.h" 11 | 12 | // Basic object to test the Glob class by orbiting around it 13 | UCLASS() 14 | class ASatellite : public AActor{ 15 | GENERATED_BODY() 16 | Globe globe; 17 | 18 | double latitude = 0; 19 | double longitude = 0; 20 | 21 | UPROPERTY(EditAnywhere); 22 | double globeUpLatitude = 0; 23 | UPROPERTY(EditAnywhere); 24 | double globeUpLongitude = 0; 25 | UPROPERTY(EditAnywhere); 26 | double globeCenterX = 0; 27 | UPROPERTY(EditAnywhere); 28 | double globeCenterY = 0; 29 | UPROPERTY(EditAnywhere); 30 | double globeCenterZ = 0; 31 | 32 | 33 | UPROPERTY(EditAnywhere); 34 | double startLatitude = 0; 35 | UPROPERTY(EditAnywhere); 36 | double startLongitude = 0; 37 | UPROPERTY(EditAnywhere); 38 | double altitude = 0; 39 | UPROPERTY(EditAnywhere); 40 | double speedLatitude = 0; 41 | UPROPERTY(EditAnywhere); 42 | double speedLongitude = 100; 43 | UPROPERTY(EditAnywhere); 44 | bool doReset = false; 45 | UPROPERTY(EditAnywhere); 46 | bool doSetGlobe = false; 47 | UPROPERTY(EditAnywhere); 48 | bool doUseGlobalGlobe = true; 49 | 50 | ASatellite(); 51 | void Reset(); 52 | void SetGlobe(); 53 | 54 | virtual void BeginPlay() override; 55 | virtual void Tick(float DeltaTime) override; 56 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/Deps/discord-rpc/src/rpc_connection.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "connection.h" 4 | #include "serialization.h" 5 | 6 | // I took this from the buffer size libuv uses for named pipes; I suspect ours would usually be much 7 | // smaller. 8 | constexpr size_t MaxRpcFrameSize = 64 * 1024; 9 | 10 | struct RpcConnection { 11 | enum class ErrorCode : int { 12 | Success = 0, 13 | PipeClosed = 1, 14 | ReadCorrupt = 2, 15 | }; 16 | 17 | enum class Opcode : uint32_t { 18 | Handshake = 0, 19 | Frame = 1, 20 | Close = 2, 21 | Ping = 3, 22 | Pong = 4, 23 | }; 24 | 25 | struct MessageFrameHeader { 26 | Opcode opcode; 27 | uint32_t length; 28 | }; 29 | 30 | struct MessageFrame : public MessageFrameHeader { 31 | char message[MaxRpcFrameSize - sizeof(MessageFrameHeader)]; 32 | }; 33 | 34 | enum class State : uint32_t { 35 | Disconnected, 36 | SentHandshake, 37 | AwaitingResponse, 38 | Connected, 39 | }; 40 | 41 | BaseConnection* connection{nullptr}; 42 | State state{State::Disconnected}; 43 | void (*onConnect)(json11::Json& message){nullptr}; 44 | void (*onDisconnect)(int errorCode, const char* message){nullptr}; 45 | char appId[64]{}; 46 | int lastErrorCode{0}; 47 | char lastErrorMessage[256]{}; 48 | RpcConnection::MessageFrame sendFrame; 49 | 50 | static RpcConnection* Create(const char* applicationId); 51 | static void Destroy(RpcConnection*&); 52 | 53 | inline bool IsOpen() const { return state == State::Connected; } 54 | 55 | void Open(); 56 | void Close(); 57 | bool Write(const void* data, size_t length); 58 | bool Read(json11::Json& message); 59 | }; 60 | -------------------------------------------------------------------------------- /Source/OpenStormEditor.Target.cs: -------------------------------------------------------------------------------- 1 | // Copyright Epic Games, Inc. All Rights Reserved. 2 | 3 | using UnrealBuildTool; 4 | using System.Collections.Generic; 5 | 6 | using System; 7 | using System.Reflection; 8 | 9 | public class OpenStormEditorTarget : TargetRules 10 | { 11 | /*public static void SetProperty(object instance, string propertyName, object newValue) 12 | { 13 | Type type = instance.GetType(); 14 | PropertyInfo prop = type.BaseType.GetProperty(propertyName); 15 | prop.SetValue(instance, newValue, null); 16 | } 17 | public static object GetProperty(object instance, string propertyName) 18 | { 19 | Type type = instance.GetType(); 20 | PropertyInfo prop = type.BaseType.GetProperty(propertyName); 21 | return prop.GetValue(instance, null); 22 | }*/ 23 | public OpenStormEditorTarget( TargetInfo Target) : base(Target) 24 | { 25 | Name = "OpenStormEditor"; 26 | Type = TargetType.Editor; 27 | DefaultBuildSettings = BuildSettingsVersion.Latest; 28 | ExtraModuleNames.AddRange( new string[] { "OpenStorm" } ); 29 | 30 | bUseUnityBuild = false; 31 | //bUsePCHFiles = false; 32 | 33 | 34 | //SourceFileWorkingSet.Provider = "None"; 35 | //SourceFileWorkingSet.RepositoryPath = ""; 36 | //SourceFileWorkingSet.GitPath = ""; 37 | 38 | //object SourceFileWorkingSetAccessible = GetProperty((TargetRules)this,"SourceFileWorkingSet"); 39 | //SetProperty(SourceFileWorkingSetAccessible,"Provider","None"); 40 | //SetProperty(SourceFileWorkingSetAccessible,"RepositoryPath",""); 41 | //SetProperty(SourceFileWorkingSetAccessible,"GitPath",""); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Source/OpenStorm/Mapping/GISManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../Radar/SimpleVector3.h" 4 | 5 | #include 6 | #include 7 | 8 | #include "CoreMinimal.h" 9 | #include "UObject/Object.h" 10 | #include "GameFramework/Actor.h" 11 | #include "GISManager.generated.h" 12 | 13 | class GISLoaderTask; 14 | class Globe; 15 | class AGISPolyline; 16 | 17 | UCLASS() 18 | class AGISManager : public AActor{ 19 | GENERATED_BODY() 20 | 21 | public: 22 | // location of camera/pawn 23 | SimpleVector3 cameraLocation = {}; 24 | // globe used for generating meshes 25 | Globe* globe; 26 | // if the map is enabled 27 | bool enabled = false; 28 | // if the camera has moved and the task needs to be re-run 29 | bool needsRecalculation = true; 30 | // the brightness of the map 31 | float mapBrightness = 0.2; 32 | // callback ids for global state 33 | std::vector callbackIds = {}; 34 | // all displayed polylines with indexes of the object they were created from in the object vector in the task 35 | std::map polylines; 36 | // number of ticks to wait after game start to start map 37 | int preTicks = 10; 38 | 39 | GISLoaderTask* loaderTask; 40 | 41 | // update position of all meshes after globe update 42 | void UpdatePositionsFromGlobe(); 43 | 44 | AGISManager(); 45 | ~AGISManager(); 46 | 47 | virtual void BeginPlay() override; 48 | virtual void EndPlay(const EEndPlayReason::Type endPlayReason) override; 49 | virtual void Tick(float DeltaTime) override; 50 | 51 | void EnableMap(); 52 | void DisableMap(); 53 | 54 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/Objects/RadarViewport.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | 4 | #include "RadarViewport.h" 5 | 6 | 7 | // Sets default values 8 | ARadarViewport::ARadarViewport() 9 | { 10 | // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. 11 | PrimaryActorTick.bCanEverTick = true; 12 | 13 | meshComponent = CreateDefaultSubobject(TEXT("ViewportMesh")); 14 | 15 | // Set the component's mesh 16 | 17 | UStaticMesh* cubeMesh = ConstructorHelpers::FObjectFinder(TEXT("StaticMesh'/Engine/BasicShapes/Cube.Cube'")).Object; 18 | 19 | UMaterial* material = ConstructorHelpers::FObjectFinder(TEXT("Material'/Game/Materials/RadarVolumeMaterial.RadarVolumeMaterial'")).Object; 20 | 21 | 22 | 23 | meshComponent->SetStaticMesh(cubeMesh); 24 | 25 | meshComponent->SetMaterial(0, material); 26 | 27 | // Set as root component 28 | RootComponent = meshComponent; 29 | } 30 | 31 | // Called when the game starts or when spawned 32 | void ARadarViewport::BeginPlay() 33 | { 34 | Super::BeginPlay(); 35 | 36 | } 37 | 38 | // Called every frame 39 | void ARadarViewport::Tick(float DeltaTime) 40 | { 41 | Super::Tick(DeltaTime); 42 | if (radarMaterialInstance == NULL) { 43 | if (mainVolumeRender != NULL) { 44 | if (mainVolumeRender->radarMaterialInstance != NULL) { 45 | radarMaterialInstance = mainVolumeRender->radarMaterialInstance; 46 | meshComponent->SetMaterial(0, radarMaterialInstance); 47 | } 48 | } 49 | } 50 | } 51 | 52 | -------------------------------------------------------------------------------- /Source/OpenStorm/Application/SettingsSaver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CoreMinimal.h" 3 | #include "UObject/Object.h" 4 | #include "GameFramework/Actor.h" 5 | #include "Dom/JsonObject.h" 6 | #include 7 | #include "SettingsSaver.generated.h" 8 | 9 | UCLASS() 10 | class OPENSTORM_API ASettingsSaver : public AActor 11 | { 12 | GENERATED_BODY() 13 | 14 | public: 15 | ASettingsSaver(); 16 | // ~ASettingsSaver(); 17 | 18 | protected: 19 | virtual void BeginPlay() override; 20 | virtual void EndPlay(const EEndPlayReason::Type endPlayReason) override; 21 | 22 | public: 23 | virtual void Tick(float DeltaTime) override; 24 | 25 | 26 | // load JSON from disk 27 | TSharedPtr LoadJson(FString filename); 28 | 29 | // save JSON to disk 30 | bool SaveJson(FString filename, TSharedPtr jsonObject); 31 | 32 | // load settings from disk into global state 33 | void LoadSettings(); 34 | 35 | // save non-default settings from global state onto disk 36 | void SaveSettings(); 37 | 38 | // reset all simple settings that do not require much setup 39 | void ResetBasicSettings(); 40 | 41 | // reset all settings to defaults 42 | void ResetAllSettings(); 43 | 44 | // load location markers from disk into global state 45 | void LoadLocationMarkers(); 46 | 47 | // save location markers from global state onto disk 48 | void SaveLocationMarkers(); 49 | 50 | FString settingsFile; 51 | FString locationMarkersFile; 52 | double saveLocationMarkersCountdown = -1; 53 | bool ignoreUpdateLocationMarkers = false; 54 | std::vector callbackIds = {}; 55 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "*.ush": "hlsl", 4 | "algorithm": "cpp", 5 | "atomic": "cpp", 6 | "chrono": "cpp", 7 | "cmath": "cpp", 8 | "condition_variable": "cpp", 9 | "csignal": "cpp", 10 | "cstddef": "cpp", 11 | "cstdint": "cpp", 12 | "cstdio": "cpp", 13 | "cstdlib": "cpp", 14 | "cstring": "cpp", 15 | "ctime": "cpp", 16 | "cwchar": "cpp", 17 | "exception": "cpp", 18 | "functional": "cpp", 19 | "future": "cpp", 20 | "initializer_list": "cpp", 21 | "ios": "cpp", 22 | "iosfwd": "cpp", 23 | "iostream": "cpp", 24 | "istream": "cpp", 25 | "iterator": "cpp", 26 | "limits": "cpp", 27 | "list": "cpp", 28 | "locale": "cpp", 29 | "map": "cpp", 30 | "memory": "cpp", 31 | "mutex": "cpp", 32 | "new": "cpp", 33 | "ostream": "cpp", 34 | "ratio": "cpp", 35 | "regex": "cpp", 36 | "set": "cpp", 37 | "stdexcept": "cpp", 38 | "streambuf": "cpp", 39 | "string": "cpp", 40 | "system_error": "cpp", 41 | "thread": "cpp", 42 | "tuple": "cpp", 43 | "type_traits": "cpp", 44 | "typeinfo": "cpp", 45 | "unordered_map": "cpp", 46 | "utility": "cpp", 47 | "vector": "cpp", 48 | "xfacet": "cpp", 49 | "xhash": "cpp", 50 | "xiosbase": "cpp", 51 | "xlocale": "cpp", 52 | "xlocbuf": "cpp", 53 | "xlocinfo": "cpp", 54 | "xlocmes": "cpp", 55 | "xlocmon": "cpp", 56 | "xlocnum": "cpp", 57 | "xloctime": "cpp", 58 | "xmemory": "cpp", 59 | "xmemory0": "cpp", 60 | "xstddef": "cpp", 61 | "xstring": "cpp", 62 | "xtr1common": "cpp", 63 | "xtree": "cpp", 64 | "xutility": "cpp" 65 | } 66 | } -------------------------------------------------------------------------------- /Source/OpenStorm/Mapping/Data/TileProvider.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "HTTPRequest.h" 4 | 5 | class TileProvider; 6 | class Tar; 7 | 8 | class Tile{ 9 | public: 10 | std::function readyCallback = NULL; 11 | bool isReady = false; 12 | uint8_t* data = NULL; 13 | int dataSize = 0; 14 | TileProvider* tileProvider; 15 | std::string fileName; 16 | 17 | // binary data for tile if available 18 | //uint8_t* GetData(int* size); 19 | 20 | // set the callback to be called when tile is loaded or failed 21 | void SetCallback(std::function callback); 22 | // free data and cancel loading if in progress 23 | ~Tile(); 24 | }; 25 | 26 | class TileProvider{ 27 | public: 28 | HTTPPool httpPool; 29 | std::string name; 30 | std::string url; 31 | std::string imageType; 32 | // use set cache 33 | std::string staticCache; 34 | Tar* staticCacheTar = NULL; 35 | // use set cache 36 | std::string dynamicCache; 37 | int maxZoom; 38 | 39 | TileProvider(std::string name, std::string url, std::string imageType, int maxZoom); 40 | // set the folders to be used for caching tile image data 41 | // the static cache is meant for pre-downloaded data and the dynamicCacheFolder will have any tiles written to it 42 | // empty strings will disable the caches 43 | void SetCache(std::string staticCacheFolder, std::string dynamicCacheFolder); 44 | // set location of tar file to pull files from 45 | void SetTarCache(std::string staticCacheTar); 46 | // get a tile for a given location, it needs to be manually deleted 47 | Tile* GetTile(int zoom, int y, int x); 48 | void EventLoop(); 49 | ~TileProvider(); 50 | }; -------------------------------------------------------------------------------- /docs/GlobalState.md: -------------------------------------------------------------------------------- 1 | # Global State 2 | Application/GlobalState.h 3 | GlobalState holds the settings and state of the application. A majority of it will be saved to disk so that settings persist but that is not currently implemented. It also allows broadcasting events. 4 | 5 | ## Events 6 | Events are named. They can also have some data associated with them. Extra data is shown in parentheses. The data can either be a string or/and void*. Both are always passed but may not be used. Items with no parentheses accept no extra data at all. 7 | * `BackwardStep` - Move to the next file backwards in time 8 | * `ForwardStep` - Move to the next file forwards in time 9 | * `JumpToIndex(unused, size_t*)` - Change to a file by its index in the directory 10 | * `UpdateVolumeParameters` - Used after changing settings involving the volume shader that may require expensive operations on the shader to apply 11 | * `ChangeProduct(unused, RadarData::VolumeType*)` - Change the type of product being displayed 12 | * `LocationMarkersUpdate` - Update location markers from global state 13 | * `GlobeUpdate` - Updated orientation of the globe 14 | * `VolumeUpdate(unused, RadarData*)` - A new radar volume was displayed 15 | * `LoadDirectory(directory to load,Null)` - Load a directory of radar files 16 | * `DevReloadFile` - Reload the current file 17 | * `Teleport(unused, SimpleVector3*)` - Teleport the camera to the game location specified by SimpleVector3 18 | * `ResetBasicSettings` - Reset all simple settings that do not require much setup 19 | * `ResetAllSettings` - Reset all settings to default 20 | * `UpdateEngineSettings` - Update engine settings from global state 21 | * `CameraMove(unused, SimpleVector3*)` - The camera has changed location -------------------------------------------------------------------------------- /Source/OpenStorm/UI/ImGuiController.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "GameFramework/Actor.h" 7 | #include 8 | #include "ImGuiController.generated.h" 9 | 10 | class UIWindow; 11 | class ImGuiUI; 12 | class GlobalState; 13 | namespace pfd{ 14 | class public_open_file; 15 | } 16 | 17 | UCLASS() 18 | class OPENSTORM_API AImGuiController : public AActor 19 | { 20 | GENERATED_BODY() 21 | 22 | public: 23 | // Sets default values for this actor's properties 24 | AImGuiController(); 25 | ~AImGuiController(); 26 | int unsafeFrames = 0; 27 | UIWindow* uiWindow = NULL; 28 | ImGuiUI* imGuiUI = NULL; 29 | pfd::public_open_file* fileChooser = NULL; 30 | std::vector callbackIds = {}; 31 | 32 | // if the left click is down and it has not been locked yet 33 | bool isLeftClicking = false; 34 | // actor selected by click that may be acted upon by further input 35 | AActor* selectedActor = NULL; 36 | 37 | // called when left clicking outside of UI 38 | void LeftClick(); 39 | void LockMouse(); 40 | void UnlockMouse(); 41 | void InitializeConsole(); 42 | // move gui to external window 43 | void ExternalWindow(); 44 | // move gui to main viewport 45 | void InternalWindow(); 46 | // set engine settings from global state 47 | void UpdateEngineSettings(); 48 | // get reference to global state 49 | GlobalState* GetGlobalState(); 50 | protected: 51 | // Called when the game starts or when spawned 52 | virtual void BeginPlay() override; 53 | virtual void EndPlay(const EEndPlayReason::Type endPlayReason) override; 54 | 55 | public: 56 | // Called every frame 57 | virtual void Tick(float DeltaTime) override; 58 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/OpenStorm.Build.cs: -------------------------------------------------------------------------------- 1 | // Copyright Epic Games, Inc. All Rights Reserved. 2 | 3 | using UnrealBuildTool; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.IO; 7 | 8 | public class OpenStorm : ModuleRules 9 | { 10 | public OpenStorm(ReadOnlyTargetRules Target) : base(Target) 11 | { 12 | PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; 13 | 14 | PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "RenderCore", "Engine", "Slate", "SlateCore"}); 15 | 16 | PrivateDependencyModuleNames.AddRange(new string[] { "InputCore", "ImGui", "AudioCaptureCore", "ProceduralMeshComponent", "ImageWrapper", "RHI", "Json", "HTTP"}); 17 | 18 | bEnableExceptions = true; 19 | 20 | // string pluginsLocation = Path.Combine(ModuleDirectory, "../../Plugins"); 21 | // // add UnrealHDF5 only if it exists 22 | // if(Directory.Exists(Path.Combine(pluginsLocation, "UnrealHDF5"))){ 23 | // PrivateDependencyModuleNames.Add("UnrealHDF5"); 24 | // } 25 | 26 | // define if exists 27 | if(Directory.Exists(Path.Combine(ModuleDirectory, "Radar/Deps/hdf5"))){ 28 | PublicDefinitions.Add("HDF5=1"); 29 | } 30 | 31 | PublicDefinitions.Add("_CRT_SECURE_NO_WARNINGS"); 32 | 33 | if (Target.bBuildEditor) 34 | { 35 | PrivateDependencyModuleNames.Add("UnrealEd"); 36 | } 37 | // Uncomment if you are using Slate UI 38 | // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" }); 39 | 40 | // Uncomment if you are using online features 41 | // PrivateDependencyModuleNames.Add("OnlineSubsystem"); 42 | 43 | // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Shaders/sphere.ush: -------------------------------------------------------------------------------- 1 | 2 | 3 | struct F 4 | { 5 | static float3 HUEtoRGB(float H){ 6 | float R = abs(H * 6 - 3) - 1; 7 | float G = 2 - abs(H * 6 - 2); 8 | float B = 2 - abs(H * 6 - 4); 9 | return saturate(float3(R,G,B)); 10 | } 11 | }; 12 | 13 | 14 | 15 | //float3 pos = cordinate * 0.1; 16 | // 17 | 18 | //for 19 | 20 | float3 rayDirection = normalize(hitPos - cameraPos); 21 | 22 | //#define STEP_SIZE 1; 23 | //#define MAX_DISTANCE 200; 24 | const float stepSize = 1; 25 | const float maxStepDistance = 200; 26 | const float PI = 3.14159265f; 27 | const float PI2 = 3.14159265f * 2; 28 | 29 | float3 color = 0; 30 | float alpha = 0; 31 | 32 | animationTime = (1 - cos(PI2 * animationTime))/2; 33 | 34 | for(float travelDistance = 0.0; travelDistance <= maxStepDistance && alpha < 0.99; travelDistance += stepSize){ 35 | float3 location = hitPos + travelDistance * rayDirection; 36 | //float3 localColor = location * 0.1; 37 | float sphereDistance = saturate((30 - distance(location,0)) / 30); 38 | 39 | float3 localColor = F::HUEtoRGB(sphereDistance) * 0.5; 40 | float localAlpha = sphereDistance; 41 | //localAlpha = sphereDistance > 0 ? 0.7 : 0; 42 | localAlpha = sphereDistance > 0 ? sphereDistance * 1.4 + 0.4 : 0; 43 | 44 | //float radius = sqrt(X * X + Y * Y + Z * Z) 45 | //float theta = atan2(Y, X) 46 | //float phi = acos(Z / radius) 47 | 48 | localAlpha = (1-alpha) * localAlpha * stepSize / 10; 49 | 50 | localAlpha = sphereDistance > animationTime ? localAlpha : 0; 51 | 52 | color += localColor * localAlpha; 53 | alpha += localAlpha; 54 | 55 | //if(distance(location,0) < 30){ 56 | // color = location * 0.1; 57 | // alpha = 1; 58 | // break; 59 | //} 60 | } 61 | 62 | //color -= 1; 63 | 64 | return float4(color.x,color.y,color.z,alpha); -------------------------------------------------------------------------------- /Source/OpenStorm/Mapping/LocationMarker.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "CoreMinimal.h" 6 | #include "UObject/Object.h" 7 | #include "UObject/Object.h" 8 | #include "Components/BoxComponent.h" 9 | #include "GameFramework/Actor.h" 10 | #include "../UI/ClickableInterface.h" 11 | #include "LocationMarker.generated.h" 12 | 13 | class UTextRenderComponent; 14 | class UMaterial; 15 | class UMaterialInstanceDynamic; 16 | 17 | UCLASS() 18 | class ALocationMarker : public AActor, public IClickableInterface{ 19 | GENERATED_BODY() 20 | 21 | public: 22 | 23 | enum MarkerType { 24 | MarkerTypeWaypoint, 25 | MarkerTypeRadarSite 26 | }; 27 | 28 | MarkerType markerType = MarkerTypeWaypoint; 29 | 30 | double latitude = 0; 31 | double longitude = 0; 32 | double altitude = 0; 33 | 34 | // maximum distance from camera before the marker is destroyed 35 | float maxDistance = 0; 36 | 37 | // used for storing site id 38 | std::string data; 39 | 40 | UPROPERTY(EditAnywhere); 41 | UTextRenderComponent* textComponent = NULL; 42 | UPROPERTY(EditAnywhere); 43 | UStaticMeshComponent* meshComponent = NULL; 44 | UPROPERTY(EditAnywhere); 45 | UBoxComponent* collisionComponent = NULL; 46 | 47 | ALocationMarker(); 48 | 49 | virtual void BeginPlay() override; 50 | virtual void Tick(float DeltaTime) override; 51 | 52 | void SetText(std::string text); 53 | void SetColor(FVector color); 54 | void EnableCollision(); 55 | 56 | virtual void OnClick() override; 57 | private: 58 | UPROPERTY(EditAnywhere); 59 | UMaterial* meshMaterial = NULL; 60 | UPROPERTY(EditAnywhere); 61 | UMaterialInstanceDynamic* meshMaterialInstance = NULL; 62 | UPROPERTY(EditAnywhere); 63 | UMaterial* textMaterial = NULL; 64 | UPROPERTY(EditAnywhere); 65 | UMaterialInstanceDynamic* textMaterialInstance = NULL; 66 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Deps/bzip2/makefile.msc: -------------------------------------------------------------------------------- 1 | # Makefile for Microsoft Visual C++ 6.0 2 | # usage: nmake -f makefile.msc 3 | # K.M. Syring (syring@gsf.de) 4 | # Fixed up by JRS for bzip2-0.9.5d release. 5 | 6 | CC=cl 7 | CFLAGS= -DWIN32 -MD -Ox -D_FILE_OFFSET_BITS=64 -nologo 8 | 9 | OBJS= blocksort.obj \ 10 | huffman.obj \ 11 | crctable.obj \ 12 | randtable.obj \ 13 | compress.obj \ 14 | decompress.obj \ 15 | bzlib.obj 16 | 17 | all: lib bzip2 test 18 | 19 | bzip2: lib 20 | $(CC) $(CFLAGS) -o bzip2 bzip2.c libbz2.lib setargv.obj 21 | $(CC) $(CFLAGS) -o bzip2recover bzip2recover.c 22 | 23 | lib: $(OBJS) 24 | lib /out:libbz2.lib $(OBJS) 25 | 26 | test: bzip2 27 | type words1 28 | .\\bzip2 -1 < sample1.ref > sample1.rb2 29 | .\\bzip2 -2 < sample2.ref > sample2.rb2 30 | .\\bzip2 -3 < sample3.ref > sample3.rb2 31 | .\\bzip2 -d < sample1.bz2 > sample1.tst 32 | .\\bzip2 -d < sample2.bz2 > sample2.tst 33 | .\\bzip2 -ds < sample3.bz2 > sample3.tst 34 | @echo All six of the fc's should find no differences. 35 | @echo If fc finds an error on sample3.bz2, this could be 36 | @echo because WinZip's 'TAR file smart CR/LF conversion' 37 | @echo is too clever for its own good. Disable this option. 38 | @echo The correct size for sample3.ref is 120,244. If it 39 | @echo is 150,251, WinZip has messed it up. 40 | fc sample1.bz2 sample1.rb2 41 | fc sample2.bz2 sample2.rb2 42 | fc sample3.bz2 sample3.rb2 43 | fc sample1.tst sample1.ref 44 | fc sample2.tst sample2.ref 45 | fc sample3.tst sample3.ref 46 | 47 | 48 | 49 | clean: 50 | del *.obj 51 | del libbz2.lib 52 | del bzip2.exe 53 | del bzip2recover.exe 54 | del sample1.rb2 55 | del sample2.rb2 56 | del sample3.rb2 57 | del sample1.tst 58 | del sample2.tst 59 | del sample3.tst 60 | 61 | .c.obj: 62 | $(CC) $(CFLAGS) -c $*.c -o $*.obj 63 | 64 | -------------------------------------------------------------------------------- /Source/OpenStorm/EngineHelpers/MaterialRenderTarget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CoreMinimal.h" 4 | #include "UObject/Object.h" 5 | #include "Materials/Material.h" 6 | #include "MaterialRenderTarget.generated.h" 7 | 8 | class UCanvasRenderTarget2D; 9 | class UTexture; 10 | 11 | UCLASS() 12 | class UMaterialRenderTarget : public UObject { 13 | 14 | GENERATED_BODY() 15 | 16 | public: 17 | UPROPERTY(VisibleAnywhere) 18 | UMaterialInterface* renderMaterial; 19 | UPROPERTY(VisibleAnywhere) 20 | UCanvasRenderTarget2D* canvasRenderTarget; 21 | 22 | UMaterialRenderTarget(); 23 | 24 | 25 | 26 | static UMaterialRenderTarget* Create(int width, int height, EPixelFormat pixelFormat, UMaterialInterface* material, UObject* parent, const char* name = ""); 27 | 28 | void Initialize(int width, int height, EPixelFormat pixelFormat); 29 | 30 | void Update(); 31 | 32 | UTexture* GetTexture(); 33 | 34 | UFUNCTION() 35 | void DrawMaterial(UCanvas* canvas, int32 width, int32 height); 36 | //virtual void ReceiveUpdate(UCanvas* Canvas, int32 Width, int32 Height); 37 | 38 | // virtual uint32 CalcTextureMemorySizeEnum(ETextureMipCount Enum) const override; 39 | // why the fuck is this not defined properly in engine code? 40 | // inline uint32 CalcTextureMemorySizeEnum(ETextureMipCount Enum) const { 41 | // // Calculate size based on format. All mips are resident on render targets so we always return the same value. 42 | // EPixelFormat Format = GetFormat(); 43 | // int32 BlockSizeX = GPixelFormats[Format].BlockSizeX; 44 | // int32 BlockSizeY = GPixelFormats[Format].BlockSizeY; 45 | // int32 BlockBytes = GPixelFormats[Format].BlockBytes; 46 | // int32 NumBlocksX = (SizeX + BlockSizeX - 1) / BlockSizeX; 47 | // int32 NumBlocksY = (SizeY + BlockSizeY - 1) / BlockSizeY; 48 | // int32 NumBytes = NumBlocksX * NumBlocksY * BlockBytes; 49 | // return NumBytes; 50 | // } 51 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/Application/GlobalState.cpp: -------------------------------------------------------------------------------- 1 | #include "GlobalState.h" 2 | #include "../Radar/Globe.h" 3 | 4 | #include 5 | 6 | uint64_t GlobalState::RegisterEvent(std::string name, std::function callback) { 7 | if(callbacks.find(name) == callbacks.end()){ 8 | callbacks[name] = {}; 9 | } 10 | uint64_t uid = callbackUid++; 11 | callbacks[name][uid] = callback; 12 | callbacksUidNames[uid] = name; 13 | return uid; 14 | } 15 | 16 | void GlobalState::UnregisterEvent(uint64_t uid) { 17 | if(callbacksUidNames.find(uid) != callbacksUidNames.end()){ 18 | std::string name = callbacksUidNames[uid]; 19 | callbacksUidNames.erase(uid); 20 | if(callbacks.find(name) != callbacks.end()){ 21 | callbacks[name].erase(uid); 22 | if(callbacks[name].size() == 0){ 23 | callbacks.erase(name); 24 | } 25 | } 26 | } 27 | } 28 | 29 | void GlobalState::EmitEvent(std::string name, std::string stringData, void* extraData) { 30 | if(callbacks.find(name) != callbacks.end()){ 31 | for(auto callback : callbacks[name]){ 32 | callback.second(stringData, extraData); 33 | } 34 | } 35 | } 36 | 37 | void GlobalState::EmitEvent(std::string name) { 38 | EmitEvent(name,"",NULL); 39 | } 40 | 41 | void GlobalState::test() { 42 | fprintf(stderr, "testFloat %f\n", testFloat); 43 | } 44 | 45 | GlobalState::GlobalState(){ 46 | #ifdef PLATFORM_ANDROID 47 | #if PLATFORM_ANDROID 48 | // temporal interpolation crashes on android 49 | // the render target seems to be the cause 50 | temporalInterpolation = false; 51 | #endif 52 | #endif 53 | 54 | this->defaults = new GlobalState(true); 55 | globe = new Globe(); 56 | 57 | } 58 | 59 | GlobalState::GlobalState(bool doNotInitDefaults){ 60 | // no defaults init 61 | } 62 | 63 | GlobalState::~GlobalState(){ 64 | if(this->defaults != NULL){ 65 | delete this->defaults; 66 | } 67 | } 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Deps/bzip2/Makefile-libbz2_so: -------------------------------------------------------------------------------- 1 | 2 | # This Makefile builds a shared version of the library, 3 | # libbz2.so.1.0.6, with soname libbz2.so.1.0, 4 | # at least on x86-Linux (RedHat 7.2), 5 | # with gcc-2.96 20000731 (Red Hat Linux 7.1 2.96-98). 6 | # Please see the README file for some important info 7 | # about building the library like this. 8 | 9 | # ------------------------------------------------------------------ 10 | # This file is part of bzip2/libbzip2, a program and library for 11 | # lossless, block-sorting data compression. 12 | # 13 | # bzip2/libbzip2 version 1.0.6 of 6 September 2010 14 | # Copyright (C) 1996-2010 Julian Seward 15 | # 16 | # Please read the WARNING, DISCLAIMER and PATENTS sections in the 17 | # README file. 18 | # 19 | # This program is released under the terms of the license contained 20 | # in the file LICENSE. 21 | # ------------------------------------------------------------------ 22 | 23 | 24 | SHELL=/bin/sh 25 | CC=gcc 26 | BIGFILES=-D_FILE_OFFSET_BITS=64 27 | CFLAGS=-fpic -fPIC -Wall -Winline -O2 -g $(BIGFILES) 28 | 29 | OBJS= blocksort.o \ 30 | huffman.o \ 31 | crctable.o \ 32 | randtable.o \ 33 | compress.o \ 34 | decompress.o \ 35 | bzlib.o 36 | 37 | all: $(OBJS) 38 | $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.6 $(OBJS) 39 | $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6 40 | rm -f libbz2.so.1.0 41 | ln -s libbz2.so.1.0.6 libbz2.so.1.0 42 | 43 | clean: 44 | rm -f $(OBJS) bzip2.o libbz2.so.1.0.6 libbz2.so.1.0 bzip2-shared 45 | 46 | blocksort.o: blocksort.c 47 | $(CC) $(CFLAGS) -c blocksort.c 48 | huffman.o: huffman.c 49 | $(CC) $(CFLAGS) -c huffman.c 50 | crctable.o: crctable.c 51 | $(CC) $(CFLAGS) -c crctable.c 52 | randtable.o: randtable.c 53 | $(CC) $(CFLAGS) -c randtable.c 54 | compress.o: compress.c 55 | $(CC) $(CFLAGS) -c compress.c 56 | decompress.o: decompress.c 57 | $(CC) $(CFLAGS) -c decompress.c 58 | bzlib.o: bzlib.c 59 | $(CC) $(CFLAGS) -c bzlib.c 60 | -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Deps/bzip2/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------- 3 | 4 | This program, "bzip2", the associated library "libbzip2", and all 5 | documentation, are copyright (C) 1996-2010 Julian R Seward. All 6 | rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions 10 | are met: 11 | 12 | 1. Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | 15 | 2. The origin of this software must not be misrepresented; you must 16 | not claim that you wrote the original software. If you use this 17 | software in a product, an acknowledgment in the product 18 | documentation would be appreciated but is not required. 19 | 20 | 3. Altered source versions must be plainly marked as such, and must 21 | not be misrepresented as being the original software. 22 | 23 | 4. The name of the author may not be used to endorse or promote 24 | products derived from this software without specific prior written 25 | permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 28 | OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 30 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 31 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 32 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 33 | GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 34 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 36 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 37 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | 39 | Julian Seward, jseward@bzip.org 40 | bzip2/libbzip2 version 1.0.6 of 6 September 2010 41 | 42 | -------------------------------------------------------------------------- 43 | -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Deps/rsl/endian.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | NASA/TRMM, Code 910.1. 3 | This is the TRMM Office Radar Software Library. 4 | Copyright (C) 1996, 1997 5 | John H. Merritt 6 | Space Applications Corporation 7 | Vienna, Virginia 8 | 9 | This library is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU Library General Public 11 | License as published by the Free Software Foundation; either 12 | version 2 of the License, or (at your option) any later version. 13 | 14 | This library is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | Library General Public License for more details. 18 | 19 | You should have received a copy of the GNU Library General Public 20 | License along with this library; if not, write to the Free 21 | Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | */ 23 | int big_endian(void); 24 | int little_endian(void); 25 | void swap_4_bytes(void *word); 26 | void swap_2_bytes(void *word); 27 | 28 | int big_endian(void) 29 | { 30 | union { 31 | unsigned char byte[4]; 32 | int val; 33 | } word; 34 | 35 | word.val = 0; 36 | word.byte[3] = 0x1; 37 | return word.val == 1; 38 | } 39 | 40 | int little_endian(void) 41 | { 42 | union { 43 | unsigned char byte[4]; 44 | int val; 45 | } word; 46 | word.val = 0; 47 | word.byte[3] = 0x1; 48 | return word.val != 1; 49 | } 50 | 51 | 52 | void swap_4_bytes(void *word) 53 | { 54 | unsigned char *byte; 55 | unsigned char temp; 56 | byte = (unsigned char*)word; 57 | temp = byte[0]; 58 | byte[0] = byte[3]; 59 | byte[3] = temp; 60 | temp = byte[1]; 61 | byte[1] = byte[2]; 62 | byte[2] = temp; 63 | } 64 | 65 | void swap_2_bytes(void *word) 66 | { 67 | unsigned char *byte; 68 | unsigned char temp; 69 | byte = (unsigned char*)word; 70 | temp = byte[0]; 71 | byte[0] = byte[1]; 72 | byte[1] = temp; 73 | } 74 | -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Deps/bzip2/meson.build: -------------------------------------------------------------------------------- 1 | project('bzip2', 'c', version : '1.0.6', meson_version : '>=0.49') 2 | 3 | bzip2_sources = [ 4 | 'blocksort.c', 5 | 'huffman.c', 6 | 'crctable.c', 7 | 'randtable.c', 8 | 'compress.c', 9 | 'decompress.c', 10 | 'bzlib.c' 11 | ] 12 | 13 | bz2_c_args = [] 14 | 15 | cc = meson.get_compiler('c') 16 | if cc.get_id() == 'msvc' 17 | # Ignore C4996 about "insecure functions" 18 | bz2_c_args += ['/wd4996'] 19 | else 20 | # bzip2.c:557: warning: variable nread set but not used 21 | bz2_c_args += ['-Wno-unused-but-set-variable'] 22 | endif 23 | 24 | bz2_incs = include_directories('.') 25 | 26 | install_headers(['bzlib.h']) 27 | 28 | # libbz2 is unversioned on Windows 29 | libkwargs = {} 30 | if host_machine.system() != 'windows' 31 | libkwargs = {'version': meson.project_version()} 32 | endif 33 | 34 | libbz2 = library('bz2', bzip2_sources, 35 | c_args : bz2_c_args, 36 | include_directories : bz2_incs, 37 | install : true, 38 | vs_module_defs : 'libbz2.def', 39 | darwin_versions : ['1', meson.project_version()], 40 | kwargs : libkwargs, 41 | ) 42 | 43 | bz2_dep = declare_dependency(link_with : libbz2, 44 | include_directories : bz2_incs) 45 | pkg = import('pkgconfig') 46 | pkg.generate(name: 'bzip2', 47 | description: 'bzip2 data compression library', 48 | version: meson.project_version(), 49 | libraries: libbz2) 50 | 51 | executable('bzip2', 'bzip2.c', 52 | install : true, 53 | dependencies : bz2_dep, 54 | c_args: bz2_c_args) 55 | 56 | executable('bunzip2', 'bzip2.c', 57 | install : true, 58 | dependencies : bz2_dep, 59 | c_args: bz2_c_args) 60 | 61 | executable('bzcat', 'bzip2.c', 62 | install : true, 63 | dependencies : bz2_dep, 64 | c_args: bz2_c_args) 65 | 66 | executable('bzip2recover', 'bzip2recover.c', 67 | install : true, 68 | c_args: bz2_c_args) 69 | 70 | install_man('bzdiff.1', 'bzgrep.1', 'bzip2.1', 'bzmore.1') 71 | install_data('bzgrep', 'bzmore', 'bzdiff', install_dir : 'bin', 72 | install_mode : 'rwxr-xr-x') 73 | 74 | # FIXME: build docs 75 | -------------------------------------------------------------------------------- /Source/OpenStorm/Objects/Satellite.cpp: -------------------------------------------------------------------------------- 1 | #include "Satellite.h" 2 | 3 | #include "../Application/GlobalState.h" 4 | 5 | #include "Engine/Texture2D.h" 6 | #include "UObject/Object.h" 7 | #include "Materials/Material.h" 8 | #include "Engine/StaticMesh.h" 9 | #include "Engine/World.h" 10 | #include "Components/StaticMeshComponent.h" 11 | #include "UObject/ConstructorHelpers.h" 12 | #include "Materials/MaterialInstanceDynamic.h" 13 | #include "Components/StaticMeshComponent.h" 14 | 15 | ASatellite::ASatellite() 16 | { 17 | PrimaryActorTick.bCanEverTick = true; 18 | UStaticMeshComponent* meshComponent = CreateDefaultSubobject(TEXT("Sphere")); 19 | UStaticMesh* mesh = ConstructorHelpers::FObjectFinder(TEXT("StaticMesh'/Engine/BasicShapes/Sphere.Sphere'")).Object; 20 | UMaterial* material = ConstructorHelpers::FObjectFinder(TEXT("Material'/Game/Materials/TestImageMaterial.TestImageMaterial'")).Object; 21 | 22 | meshComponent->SetStaticMesh(mesh); 23 | meshComponent->SetMaterial(0, material); 24 | RootComponent = meshComponent; 25 | } 26 | 27 | void ASatellite::Reset() { 28 | latitude = startLatitude; 29 | longitude = startLongitude; 30 | } 31 | 32 | void ASatellite::SetGlobe() { 33 | globe.SetCenter(globeCenterX, globeCenterY, globeCenterZ); 34 | globe.SetRotationDegrees(90 - globeUpLatitude, -globeUpLongitude); 35 | } 36 | 37 | void ASatellite::BeginPlay() { 38 | Super::BeginPlay(); 39 | } 40 | 41 | void ASatellite::Tick(float DeltaTime){ 42 | latitude += speedLatitude * DeltaTime; 43 | longitude += speedLongitude * DeltaTime; 44 | if(doSetGlobe){ 45 | SetGlobe(); 46 | } 47 | if(doReset){ 48 | Reset(); 49 | } 50 | if(doUseGlobalGlobe){ 51 | GlobalState* globalState = &GetWorld()->GetGameState()->globalState; 52 | globe = *globalState->globe; 53 | } 54 | SimpleVector3 vector = globe.GetPointScaledDegrees(latitude, longitude, altitude); 55 | //fprintf(stderr, "vec %f %f %f \n", vector.x,vector.y,vector.z); 56 | //fprintf(stderr, "lng %f\n", longitude); 57 | SetActorLocation(FVector(vector.x,vector.y,vector.z)); 58 | //fprintf(stderr,"tick2 "); 59 | } -------------------------------------------------------------------------------- /Source/OpenStorm/Mapping/Data/Tar.cpp: -------------------------------------------------------------------------------- 1 | #include "Tar.h" 2 | 3 | #define BLOCKSIZE 512 4 | 5 | typedef struct TarHeader{ 6 | char name[100]; 7 | char mode[8]; 8 | char owner[8]; 9 | char group[8]; 10 | char size[12]; 11 | char modificationDate[12]; 12 | char checksum[8]; 13 | char linkIndicator[1]; 14 | char linkName[100]; 15 | } TarHeader; 16 | 17 | 18 | Tar::Tar(std::string filename){ 19 | tarFileName = filename; 20 | FILE* file = fopen(tarFileName.c_str(), "r"); 21 | if(file == NULL){ 22 | valid = false; 23 | return; 24 | } 25 | uint8_t block[BLOCKSIZE]; 26 | size_t offset = 0; 27 | //fprintf(stderr, "Begin tar parse\n"); 28 | while(fread(block, 1, BLOCKSIZE, file) == BLOCKSIZE){ 29 | offset += BLOCKSIZE; 30 | //fprintf(stderr, "read "); 31 | if(block[0] != 0){ 32 | TarHeader* header = (TarHeader*)block; 33 | TarFile tarFile = {}; 34 | header->name[99] = 0; 35 | tarFile.name = std::string(header->name); 36 | tarFile.offset = offset; 37 | int index = 0; 38 | while(index < 12 && header->size[index] != 0){ 39 | tarFile.size *= 8; 40 | tarFile.size += header->size[index] - '0'; 41 | index++; 42 | } 43 | size_t seekAmount = tarFile.size; 44 | size_t seekAmountExtra = seekAmount % BLOCKSIZE; 45 | if(seekAmountExtra > 0){ 46 | seekAmount += BLOCKSIZE - seekAmountExtra; 47 | } 48 | fseek(file, seekAmount, SEEK_CUR); 49 | offset += seekAmount; 50 | //fprintf(stderr, "%s %i\n", tarFile.name.c_str(), (int)tarFile.size); 51 | fileMap[tarFile.name] = tarFile; 52 | } 53 | } 54 | fclose(file); 55 | valid = true; 56 | //fprintf(stderr, "Finish tar parse\n"); 57 | } 58 | 59 | Tar::TarFile* Tar::GetFile(std::string filename){ 60 | if(fileMap.find(filename) == fileMap.end()){ 61 | return NULL; 62 | } 63 | FILE* file = fopen(tarFileName.c_str(), "r"); 64 | if(file == NULL){ 65 | return NULL; 66 | } 67 | TarFile* tarFile = new TarFile(); 68 | *tarFile = fileMap[filename]; 69 | tarFile->data = new uint8_t[tarFile->size]; 70 | fseek(file, tarFile->offset, SEEK_SET); 71 | fread(tarFile->data, 1, tarFile->size, file); 72 | fclose(file); 73 | return tarFile; 74 | } -------------------------------------------------------------------------------- /Source/OpenStorm/UI/Theme.cpp: -------------------------------------------------------------------------------- 1 | #include "Theme.h" 2 | #include "imgui.h" 3 | 4 | 5 | namespace Theme{ 6 | void Green(){ 7 | ImVec4* colors = ImGui::GetStyle().Colors; 8 | colors[ImGuiCol_FrameBg] = ImVec4(0.01f, 0.37f, 0.01f, 0.54f); 9 | colors[ImGuiCol_FrameBgHovered] = ImVec4(0.26f, 0.98f, 0.40f, 0.40f); 10 | colors[ImGuiCol_FrameBgActive] = ImVec4(0.00f, 0.61f, 0.06f, 0.67f); 11 | colors[ImGuiCol_TitleBgActive] = ImVec4(0.16f, 0.48f, 0.21f, 1.00f); 12 | colors[ImGuiCol_CheckMark] = ImVec4(0.26f, 0.98f, 0.38f, 1.00f); 13 | colors[ImGuiCol_SliderGrab] = ImVec4(0.24f, 0.88f, 0.37f, 1.00f); 14 | colors[ImGuiCol_SliderGrabActive] = ImVec4(0.26f, 0.98f, 0.36f, 1.00f); 15 | colors[ImGuiCol_Button] = ImVec4(0.26f, 0.98f, 0.46f, 0.40f); 16 | colors[ImGuiCol_ButtonHovered] = ImVec4(0.26f, 0.98f, 0.38f, 1.00f); 17 | colors[ImGuiCol_ButtonActive] = ImVec4(0.06f, 0.98f, 0.20f, 1.00f); 18 | colors[ImGuiCol_Header] = ImVec4(0.26f, 0.98f, 0.28f, 0.31f); 19 | colors[ImGuiCol_HeaderHovered] = ImVec4(0.26f, 0.98f, 0.29f, 0.80f); 20 | colors[ImGuiCol_HeaderActive] = ImVec4(0.26f, 0.98f, 0.32f, 1.00f); 21 | colors[ImGuiCol_SeparatorHovered] = ImVec4(0.10f, 0.75f, 0.12f, 0.78f); 22 | colors[ImGuiCol_SeparatorActive] = ImVec4(0.10f, 0.75f, 0.17f, 1.00f); 23 | colors[ImGuiCol_ResizeGrip] = ImVec4(0.26f, 0.98f, 0.36f, 0.20f); 24 | colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.26f, 0.98f, 0.29f, 0.67f); 25 | colors[ImGuiCol_ResizeGripActive] = ImVec4(0.26f, 0.98f, 0.31f, 0.95f); 26 | colors[ImGuiCol_Tab] = ImVec4(0.18f, 0.58f, 0.26f, 0.86f); 27 | colors[ImGuiCol_TabHovered] = ImVec4(0.26f, 0.98f, 0.44f, 0.80f); 28 | colors[ImGuiCol_TabActive] = ImVec4(0.20f, 0.68f, 0.26f, 1.00f); 29 | colors[ImGuiCol_TabUnfocused] = ImVec4(0.07f, 0.15f, 0.09f, 0.97f); 30 | colors[ImGuiCol_TabUnfocusedActive] = ImVec4(0.14f, 0.42f, 0.16f, 1.00f); 31 | colors[ImGuiCol_NavHighlight] = ImVec4(0.26f, 0.98f, 0.35f, 1.00f); 32 | 33 | 34 | } 35 | } -------------------------------------------------------------------------------- /Shaders/interpolate.ush: -------------------------------------------------------------------------------- 1 | 2 | 3 | int radius = (radiusSize * UV.x); 4 | int yPos = (UV.y * (thetaSize * sweepCount)); 5 | int thetaSizeInt = thetaSize; 6 | int theta = yPos % thetaSizeInt; 7 | int sweep = yPos / thetaSizeInt; 8 | 9 | float value1 = texture1[uint2(radius,yPos)].r; 10 | float value2 = texture2[uint2(radius,yPos)].r; 11 | value1 = max(value1,minimum); 12 | value2 = max(value2,minimum); 13 | 14 | float base = lerp(value1,value2,amount); 15 | 16 | /* 17 | Use 3 surrounding pixels from both textures to calculate components for the gradient of each texture pointing towards increasing value. 18 | Then use the gradients to create a curve between the values. Agreeing gradients result in a roughly linear curve. 19 | Conflicting values result in a more parabolic curve. Vectors pointing away from each other result in an upwards curve. 20 | This can likely be done by multiplier=(multiplier-1)*(1-abs(Amount*2-1))+1 or by offset=offset*(1-abs(Amount*2-1)) 21 | */ 22 | 23 | //* 24 | // get values from the opposite direction of the volume shader to keep the theta padding it uses pristine 25 | float3 vec1 = value1 - float3( 26 | texture1[uint2(radius - 1, yPos )].r, 27 | texture1[uint2(radius , theta - 1 + sweep * thetaSizeInt)].r, 28 | texture1[uint2(radius , theta + (sweep - 1) * thetaSizeInt)].r 29 | ); 30 | float3 vec2 = value2 - float3( 31 | texture2[uint2(radius - 1, yPos )].r, 32 | texture2[uint2(radius , theta - 1 + sweep * thetaSizeInt)].r, 33 | texture2[uint2(radius , theta + (sweep - 1) * thetaSizeInt)].r 34 | ); 35 | float dist1 = distance(vec1,0); 36 | float dist2 = distance(vec2,0); 37 | float offset = dot(vec1,vec2) / dist1 / dist2 * (-0.5) + 0.5; 38 | 39 | // The offset is a bit too much in lower value areas which causes the green regions of reflectivity to pulsate. 40 | offset = offset * min(dist1, dist2) * (1 - abs(amount * 2 - 1)); 41 | base += isfinite(offset) ? offset : 0; 42 | 43 | //float multiplier = offset / 10 * (1 - abs(amount * 2 - 1)) + 1; 44 | //base *= multiplier; 45 | // */ 46 | 47 | //base = lerp(base,max(value1,value2), 1 - abs(amount * 2 - 1)); 48 | 49 | return base; -------------------------------------------------------------------------------- /Source/OpenStorm/EngineHelpers/MaterialRenderTarget.cpp: -------------------------------------------------------------------------------- 1 | #include "MaterialRenderTarget.h" 2 | #include "Engine/CanvasRenderTarget2D.h" 3 | #include "Engine/Canvas.h" 4 | 5 | UMaterialRenderTarget* UMaterialRenderTarget::Create(int width, int height, EPixelFormat pixelFormat, UMaterialInterface* material, UObject* parent, const char* name){ 6 | UMaterialRenderTarget* renderTarget = (UMaterialRenderTarget*)NewObject(parent, name); 7 | renderTarget->renderMaterial = material; 8 | renderTarget->Initialize(width, height, pixelFormat); 9 | return renderTarget; 10 | } 11 | 12 | UMaterialRenderTarget::UMaterialRenderTarget(){ 13 | } 14 | 15 | void UMaterialRenderTarget::Initialize(int width, int height, EPixelFormat pixelFormat){ 16 | if(canvasRenderTarget == nullptr){ 17 | canvasRenderTarget = NewObject(); 18 | canvasRenderTarget->OnCanvasRenderTargetUpdate.AddDynamic(this, &UMaterialRenderTarget::DrawMaterial); 19 | } 20 | 21 | //InitCustomFormat(width, height, pixelFormat, true); 22 | 23 | // overide without arbitrary pixel format restrictions 24 | canvasRenderTarget->OverrideFormat = pixelFormat; 25 | canvasRenderTarget->bForceLinearGamma = true; 26 | canvasRenderTarget->InitAutoFormat(width, height); 27 | canvasRenderTarget->UpdateResource(); 28 | } 29 | 30 | void UMaterialRenderTarget::Update(){ 31 | //fprintf(stderr,"Update2 %i\n",OnCanvasRenderTargetUpdate.IsBound()); 32 | //canvasRenderTarget->RepaintCanvas(); 33 | canvasRenderTarget->UpdateResource(); 34 | //UpdateResource(); 35 | //ReceiveUpdate(NULL,1,1); 36 | } 37 | 38 | //void UMaterialRenderTarget::ReceiveUpdate(UCanvas* canvas, int32 width, int32 height){ 39 | //DrawMaterial(canvas, width, height); 40 | //} 41 | 42 | UTexture* UMaterialRenderTarget::GetTexture(){ 43 | return (UTexture*)canvasRenderTarget; 44 | } 45 | 46 | void UMaterialRenderTarget::DrawMaterial(UCanvas* canvas, int32 width, int32 height){ 47 | //fprintf(stderr,"Update %p %i %i\n",canvas, width, height); 48 | //return; 49 | //canvas->K2_DrawMaterial(renderMaterial, FVector2D(0, 0), FVector2D(1, 1), FVector2D(0, 0), FVector2D(width, height), 0, FVector2D(0, 0)); 50 | canvas->K2_DrawMaterial(renderMaterial, FVector2D(0, 0), FVector2D(width, height), FVector2D(0, 0)); 51 | } 52 | 53 | 54 | -------------------------------------------------------------------------------- /docs/Products.md: -------------------------------------------------------------------------------- 1 | # Radar Products 2 | 3 | 4 | ## Base Product Types 5 | Base products are generated by the radar with minimal processing 6 | 7 | ### Reflectivity (REF) 8 | The most commonly used product. It indicates how much of the radar was reflected and corresponds to how dense the precipitation is. 9 | 10 | ### Radial Velocity (RV) 11 | How fast the precipitation is moving towards or away from the radar. 12 | 13 | ### Spectrum Width (SW) 14 | How much variation there is within the radial velocity. 15 | 16 | ### Correlation Coefficient (CC) 17 | It measures how similar objects are in the radar volume. 18 | High values mean the contents of the volume are all similar wile lower values indicate variation in shape of the objects reflecting the radar beam. 19 | 20 | ### Differential Reflectivity (DR) 21 | It is the ratio between vertical and horizontal reflectivity. It can give some insight into the shape of precipitation. 22 | 23 | ### Differential Phase Shift (DPS) 24 | It is a measure of the difference in 2-way attenuation for the horizontal and vertical pulses in a pulse volume. 25 | 26 | 27 | 28 | ## Derived Product Types 29 | Derived products are generated from the base products within OpenStorm 30 | 31 | ### Radial Velocity De-aliased (RVD) 32 | Dependencies: Radial Velocity 33 | Radial velocity has some artifacts where the velocity wraps around to the wrong direction. 34 | This derived products tries remove them, but does not always work perfect. 35 | 36 | ### Storm Relative Velocity (SRV) 37 | Dependencies: Radial Velocity De-aliased 38 | This product is very similar to Radial Velocity De-aliased except it has the average velocity subtracted from it to make variations in velocity more visible. 39 | 40 | ### Rotaion (ROT) 41 | Dependencies: Radial Velocity De-aliased, Spectrum Width 42 | Attempts to detect rotation by measuring how large of a difference there is in velocities. 43 | 44 | 45 | 46 | ## Adding a product 47 | * Add a volume type in RadarData.h 48 | * Create a new class derived from RadarProduct. Look at RadarProductRotation for an example. 49 | * Add that new product to the list in ProductList.cpp 50 | * Add a new color index if necessary 51 | * Modify RadarColorIndex::GetDefaultColorIndexForData to choose the correct color index for the data 52 | * Rebuild the project outside of the editor to apply the changes in ProductList.cpp live build will not properly update it -------------------------------------------------------------------------------- /Source/OpenStorm/Objects/RadarSlice.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../Radar/SimpleVector3.h" 4 | #include "../Application/GlobalState.h" 5 | 6 | #include "CoreMinimal.h" 7 | #include "UObject/Object.h" 8 | #include "GameFramework/Actor.h" 9 | #include "RadarSlice.generated.h" 10 | 11 | class UProceduralMeshComponent; 12 | class UMaterialInterface; 13 | class Globe; 14 | class AMapMeshManager; 15 | class UMaterialInstanceDynamic; 16 | class UTexture2D; 17 | class UTexture; 18 | class ARadarVolumeRender; 19 | 20 | #ifndef UPROPERTY 21 | #define UPROPERTY(a) ; 22 | #endif 23 | 24 | 25 | UCLASS() 26 | class ARadarSlice : public AActor{ 27 | GENERATED_BODY() 28 | 29 | public: 30 | 31 | // height above sea level 32 | float sliceAltitude = 10000; 33 | // angle of slice in degrees 34 | float sliceAngle = 1; 35 | // x location of vertical slice 36 | float locationX = 0; 37 | // y location of vertical slice 38 | float locationY = 0; 39 | // rotation of vertical slice 40 | float rotation = 0; 41 | 42 | // width or radius of mesh in game units 43 | float radius = 100 * 50; 44 | // maximum radius of the volume 45 | float radiusMax = 100 * 50; 46 | // bottom of volume 47 | float bottomHeight = 0; 48 | // top of volume 49 | float topHeight = 0; 50 | // number of times to divide mesh on each side to generate divisions*divisions quads for flat slices 51 | float divisions = 40; 52 | // number of triangles to divide the mesh into for circular sweeps 53 | float sectors = 100; 54 | // location of camera to use for sorting triangles 55 | SimpleVector3 cameraLocation; 56 | float lastCameraAngle = 0; 57 | // globe to place on 58 | Globe* globe; 59 | GlobalState::SliceMode sliceMode = GlobalState::SLICE_MODE_SWEEP_ANGLE; 60 | 61 | 62 | std::vector callbackIds = {}; 63 | 64 | UPROPERTY(EditAnywhere) 65 | UProceduralMeshComponent* proceduralMesh; 66 | 67 | 68 | UPROPERTY(EditAnywhere) 69 | ARadarVolumeRender* mainVolumeRender = NULL; 70 | 71 | 72 | UPROPERTY(EditAnywhere) 73 | UMaterialInstanceDynamic* radarMaterialInstance = NULL; 74 | 75 | ARadarSlice(); 76 | 77 | template 78 | T* FindActor(); 79 | 80 | virtual void BeginPlay() override; 81 | virtual void EndPlay(const EEndPlayReason::Type endPlayReason) override; 82 | virtual void Tick(float DeltaTime) override; 83 | 84 | void GenerateMesh(); 85 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/Mapping/Data/SimpleConfig.cpp: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include "SimpleConfig.h" 4 | #include 5 | #include "../../Radar/SystemAPI.h" 6 | 7 | SimpleConfig::SimpleConfig(std::string fileName){ 8 | SystemAPI::FileStats stats = SystemAPI::GetFileStats(fileName); 9 | if(!stats.exists || stats.size == 0){ 10 | return; 11 | } 12 | FILE* file = fopen(fileName.c_str(), "r"); 13 | if(file == NULL){ 14 | return; 15 | } 16 | char* buffer = new char[stats.size + 1]; 17 | buffer[stats.size] = 0; 18 | fread(buffer, 1, stats.size, file); 19 | fclose(file); 20 | char* line = strtok(buffer, "\n"); 21 | // loop through the string to extract all other tokens 22 | while( line != NULL ) { 23 | std::string lineString = std::string(line); 24 | 25 | // remove carriage returns 26 | size_t endPos = lineString.find('\r'); 27 | if(endPos == std::string::npos){ 28 | endPos = lineString.size(); 29 | } 30 | 31 | size_t splitPos = lineString.find('='); 32 | if(splitPos > endPos){ 33 | splitPos = endPos; 34 | } 35 | 36 | if(splitPos < endPos){ 37 | values[lineString.substr(0, splitPos)] = lineString.substr(splitPos + 1, endPos); 38 | }else{ 39 | values[lineString.substr(0, splitPos)] = ""; 40 | } 41 | 42 | line = strtok(NULL, "\n"); 43 | } 44 | } 45 | 46 | bool SimpleConfig::HasOption(std::string name){ 47 | return values.count(name) > 0; 48 | } 49 | 50 | bool SimpleConfig::GetBool(std::string name, bool defaultValue){ 51 | if(HasOption(name)){ 52 | std::string value = values[name]; 53 | std::transform(value.begin(), value.end(), value.begin(), [](unsigned char c){ return std::tolower(c); }); 54 | bool isFalse = (value == "false" || value == "0" || value == "no"); 55 | bool isTrue = (value == "true" || value == "1" || value == "yes"); 56 | return (isFalse || isTrue) ? isTrue : defaultValue; 57 | }else{ 58 | return defaultValue; 59 | } 60 | } 61 | 62 | double SimpleConfig::GetDouble(std::string name, double defaultValue){ 63 | if(HasOption(name)){ 64 | std::string value = values[name]; 65 | return std::stod(value); 66 | }else{ 67 | return defaultValue; 68 | } 69 | } 70 | 71 | float SimpleConfig::GetFloat(std::string name, float defaultValue){ 72 | return (float)GetDouble(name, defaultValue); 73 | } 74 | 75 | std::string SimpleConfig::GetString(std::string name, std::string defaultValue){ 76 | if(HasOption(name)){ 77 | return values[name]; 78 | }else{ 79 | return defaultValue; 80 | } 81 | } -------------------------------------------------------------------------------- /Source/OpenStorm/Objects/RadarViewPawn.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | #include "RadarVolumeRender.h" 5 | #include "CoreMinimal.h" 6 | #include "GameFramework/Pawn.h" 7 | #include "Camera/CameraComponent.h" 8 | #include "Components/InputComponent.h" 9 | #include "RadarViewPawn.generated.h" 10 | 11 | class ASlateUI; 12 | class AImGuiController; 13 | 14 | UCLASS() 15 | class OPENSTORM_API ARadarViewPawn : public APawn 16 | { 17 | GENERATED_BODY() 18 | 19 | public: 20 | // Sets default values for this pawn's properties 21 | ARadarViewPawn(); 22 | ~ARadarViewPawn(); 23 | 24 | protected: 25 | // Called when the game starts or when spawned 26 | virtual void BeginPlay() override; 27 | virtual void EndPlay(const EEndPlayReason::Type endPlayReason) override; 28 | 29 | public: 30 | // Called every frame 31 | virtual void Tick(float DeltaTime) override; 32 | 33 | // Called to bind functionality to input 34 | virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override; 35 | 36 | template 37 | T* FindActor(); 38 | 39 | float forwardMovement = 0; 40 | float sidewaysMovement = 0; 41 | float verticalMovement = 0; 42 | float speedBoost = 0; 43 | float verticalRotation = 0; 44 | float horizontalRotation = 0; 45 | float verticalRotationAmount = 0; 46 | float horizontalRotationAmount = 0; 47 | 48 | bool isTAAEnabled = false; 49 | 50 | bool isRadarVolumeViewActive = true; 51 | 52 | FVector oldCameraPosition = FVector(0, 0, 0.0000000000000001); 53 | 54 | std::vector callbackIds = {}; 55 | 56 | void MoveFB(float value); 57 | void MoveLR(float value); 58 | void MoveUD(float value); 59 | void SpeedBoost(float value); 60 | void RotateLR(float value); 61 | void RotateUD(float value); 62 | void RotateMouseLR(float value); 63 | void RotateMouseUD(float value); 64 | void ReleaseMouse(); 65 | void PressMouse(); 66 | 67 | 68 | UPROPERTY(EditAnywhere) 69 | float moveSpeed = 300.0f; 70 | UPROPERTY(EditAnywhere) 71 | float rotateSpeed = 200.0f; 72 | 73 | UPROPERTY(EditAnywhere) 74 | UStaticMeshComponent* meshComponent; 75 | 76 | UPROPERTY(EditAnywhere) 77 | ARadarVolumeRender* mainVolumeRender = NULL; 78 | 79 | UPROPERTY(EditAnywhere) 80 | AImGuiController* gui = NULL; 81 | 82 | UPROPERTY(EditAnywhere) 83 | UMaterialInstanceDynamic* radarMaterialInstance = NULL; 84 | 85 | UPROPERTY(EditAnywhere) 86 | UCameraComponent * camera = NULL; 87 | 88 | UPROPERTY(EditAnywhere) 89 | ASlateUI* hud = NULL; 90 | }; 91 | -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Products/RadarProduct.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../RadarData.h" 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | // defines a radar product 9 | class RadarProduct { 10 | public: 11 | enum ProductType{ 12 | // base radar volume products loaded from files 13 | PRODUCT_BASE, 14 | // derived radar volume products created from other products 15 | // use deriveVolume to get the derived volume 16 | PRODUCT_DERIVED_VOLUME, 17 | // derived arbatrary data products created from other products 18 | PRODUCT_DERIVED_DATA, 19 | }; 20 | 21 | 22 | // the type of volume that this product is ex: reflectivity, velocity, etc 23 | RadarData::VolumeType volumeType = RadarData::VOLUME_UNKNOWN; 24 | 25 | // the class of product that this product is ex: base or derived 26 | ProductType productType = PRODUCT_DERIVED_VOLUME; 27 | 28 | // if the product is for development and should not be shown by default 29 | // this could be set because the product is not ready for use or is strictly for debugging 30 | bool development = false; 31 | 32 | // full descriptive name of radar product 33 | std::string name = "Missing Name"; 34 | 35 | // short abbreviated name of radar product 36 | std::string shortName = "MISSING"; 37 | 38 | // the products that a derived product relies on 39 | std::vector dependencies = {}; 40 | 41 | // derive the product from a map containing its dependencies 42 | // this should not be called if the dependencies are not fulfilled or this is not a derived product 43 | // inputProducts should contain all dependencies 44 | // the dependencies may be compressed and need to be be decompressed in deriveVolume 45 | virtual RadarData* deriveVolume(std::map inputProducts); 46 | 47 | // list of all volume products 48 | static std::vector products; 49 | //static std::map productsMap; 50 | 51 | // get the RadarProduct subclass for a given volume type 52 | static RadarProduct* GetProduct(RadarData::VolumeType type); 53 | 54 | // starts at 1000 and is incremented to provide volume types for products defined durring runtime 55 | static int dynamicVolumeTypeId; 56 | 57 | // get new VolumeType for products defined during runtime 58 | static RadarData::VolumeType CreateDynamicVolumeType(); 59 | 60 | virtual ~RadarProduct(); 61 | }; 62 | 63 | // class for base radar products 64 | class RadarProductBase : public RadarProduct { 65 | public: 66 | RadarProductBase(RadarData::VolumeType type, std::string productName, std::string shortProductName); 67 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/UI/Slate/SlateUI.cpp: -------------------------------------------------------------------------------- 1 | #include "SlateUI.h" 2 | #include "SlateUIResources.h" 3 | 4 | #include "../../Objects/RadarGameStateBase.h" 5 | 6 | #include "UObject/UObjectGlobals.h" 7 | #include "Engine/World.h" 8 | #include "Engine/GameViewportClient.h" 9 | #include "Widgets/SOverlay.h" 10 | #include "Widgets/SWindow.h" 11 | #include "Widgets/Layout/SDPIScaler.h" 12 | #include "Widgets/Text/STextBlock.h" 13 | #include "SCompass.h" 14 | #include "SCacheState.h" 15 | 16 | 17 | ASlateUI::ASlateUI(){ 18 | resources = CreateDefaultSubobject(TEXT("SlateUIResources")); 19 | //NewObject(this); 20 | PrimaryActorTick.bCanEverTick = true; 21 | PrimaryActorTick.bStartWithTickEnabled = true; 22 | } 23 | 24 | void ASlateUI::AddToViewport(UGameViewportClient* gameViewport) { 25 | SAssignNew(scaleWidget, SDPIScaler); 26 | SAssignNew(hudWidget, SOverlay); 27 | SAssignNew(compass, SCompass); 28 | SAssignNew(cacheState, SCacheState); 29 | 30 | hudWidget->AddSlot(2)[compass.ToSharedRef()].HAlign(HAlign_Right).VAlign(VAlign_Bottom); 31 | hudWidget->AddSlot(1)[cacheState.ToSharedRef()].HAlign(HAlign_Right).VAlign(VAlign_Bottom); 32 | 33 | 34 | scaleWidget->SetContent(hudWidget.ToSharedRef()); 35 | gameViewport->AddViewportWidgetContent(scaleWidget.ToSharedRef(), 5); 36 | } 37 | 38 | ASlateUI::~ASlateUI(){ 39 | 40 | } 41 | 42 | void ASlateUI::SetCompassRotation(float rotation) { 43 | if (compass.IsValid()) { 44 | compass->Rotate(rotation); 45 | } 46 | } 47 | 48 | void ASlateUI::BeginPlay() { 49 | Super::BeginPlay(); 50 | AddToViewport(GetWorld()->GetGameViewport()); 51 | GlobalState* globalState = &GetWorld()->GetGameState()->globalState; 52 | resources->globalState = globalState; 53 | } 54 | 55 | void ASlateUI::EndPlay(const EEndPlayReason::Type endPlayReason) { 56 | resources->globalState = NULL; 57 | if(hudWidget.IsValid()){ 58 | // the dumb/smart way to remove element from the viewport 59 | auto overlay = StaticCastSharedPtr(scaleWidget->GetParentWidget()); 60 | if (overlay.IsValid()) { 61 | overlay->RemoveSlot(scaleWidget.ToSharedRef()); 62 | } 63 | 64 | //gameViewport->RemoveViewportWidgetContent(hudWidget.ToSharedRef()); 65 | } 66 | } 67 | 68 | void ASlateUI::Tick(float DeltaTime){ 69 | // update scale based on system scalling 70 | if (scaleWidget.IsValid()) { 71 | SWindow* swindow = GetWorld()->GetGameViewport()->GetWindow().Get(); 72 | //float nativeScale = swindow->GetDPIScaleFactor(); 73 | if(resources->globalState->guiScale > 0){ 74 | scaleWidget->SetDPIScale(resources->globalState->guiScale); 75 | } 76 | } 77 | 78 | if(cacheState.IsValid()){ 79 | cacheState->UpdateState(); 80 | } 81 | 82 | 83 | } -------------------------------------------------------------------------------- /Source/OpenStorm/Application/DiscordPresence.cpp: -------------------------------------------------------------------------------- 1 | #include "DiscordPresence.h" 2 | #include "Kismet/GameplayStatics.h" 3 | #include "Engine/World.h" 4 | 5 | #include "../Objects/RadarGameStateBase.h" 6 | #include "../Radar/SystemAPI.h" 7 | 8 | 9 | #include "../Deps/discord-rpc/include/discord_rpc.h" 10 | 11 | 12 | // Sets default values 13 | ADiscordPresence::ADiscordPresence() 14 | { 15 | // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. 16 | PrimaryActorTick.bCanEverTick = true; 17 | 18 | } 19 | 20 | // Called when the game starts or when spawned 21 | void ADiscordPresence::BeginPlay() 22 | { 23 | Super::BeginPlay(); 24 | StartDiscordPresence(); 25 | } 26 | 27 | void ADiscordPresence::EndPlay(const EEndPlayReason::Type endPlayReason){ 28 | Super::EndPlay(endPlayReason); 29 | StopDiscordPresence(); 30 | } 31 | 32 | // Called every frame 33 | void ADiscordPresence::Tick(float DeltaTime) 34 | { 35 | Super::Tick(DeltaTime); 36 | 37 | ARadarGameStateBase* gameMode = GetWorld()->GetGameState(); 38 | if(gameMode != NULL){ 39 | GlobalState* globalState = &gameMode->globalState; 40 | if(globalState->discordPresence){ 41 | StartDiscordPresence(); 42 | }else{ 43 | StopDiscordPresence(); 44 | } 45 | } 46 | 47 | if(isPresenceActive){ 48 | double now = SystemAPI::CurrentTime(); 49 | if(lastPresenceTime + 20 < now){ 50 | lastPresenceTime = now; 51 | DiscordRichPresence presence = {}; 52 | presence.details = "A 3D radar viewer"; 53 | presence.state = "Open source and free"; 54 | presence.largeImageKey = "openstormlogo"; 55 | presence.largeImageText = "OpenStorm"; 56 | presence.startTimestamp = now - UGameplayStatics::GetRealTimeSeconds(GetWorld()); 57 | presence.button1Enabled = true; 58 | presence.button1Label = "Get OpenStorm on GitHub"; 59 | presence.button1Url = "https://github.com/JordanSchlick/OpenStorm"; 60 | Discord_UpdatePresence(&presence); 61 | } 62 | 63 | } 64 | #ifdef DISCORD_DISABLE_IO_THREAD 65 | Discord_UpdateConnection(); 66 | #endif 67 | Discord_RunCallbacks(); 68 | } 69 | 70 | 71 | 72 | void ADiscordPresence::StartDiscordPresence(){ 73 | if(isPresenceActive){ 74 | return; 75 | } 76 | isPresenceActive = true; 77 | 78 | DiscordEventHandlers handlers; 79 | memset(&handlers, 0, sizeof(handlers)); 80 | 81 | Discord_Initialize("1168656505059426455", &handlers, false, NULL); 82 | 83 | // set presence in 5 seconds 84 | lastPresenceTime = SystemAPI::CurrentTime() - 15; 85 | } 86 | 87 | void ADiscordPresence::StopDiscordPresence(){ 88 | if(!isPresenceActive){ 89 | return; 90 | } 91 | isPresenceActive = false; 92 | Discord_Shutdown(); 93 | } 94 | 95 | -------------------------------------------------------------------------------- /Content/Textures/crosshair.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 24 | 42 | 44 | 45 | 47 | image/svg+xml 48 | 50 | 51 | 52 | 53 | 54 | 59 | 67 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Globe.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "SimpleVector3.h" 4 | 5 | // Represents the earth in meters and radian 6 | class Globe{ 7 | public: 8 | 9 | 10 | // scale between real life and in game units 11 | // multiplying real life units by this will return game units 12 | double scale = 1.0 / 10000.0 * 100.0; 13 | 14 | // radius of the surface of the globe 15 | double surfaceRadius = 6371000.0; 16 | 17 | // in meters, use SetCenter to change 18 | SimpleVector3<> center = SimpleVector3<>(0.0, 0.0, 0.0); 19 | 20 | // in radians, use SetRotation to change 21 | double rotationAroundPolls = 0; 22 | double rotationAroundX = 0; 23 | 24 | // set center in meters from origin 25 | void SetCenter(double centerMetersX, double centerMetersY, double centerMetersZ); 26 | 27 | // latitude and longitude in radians to rotate the globe 28 | void SetRotation(double latitudeRadians, double longitudeRadians); 29 | 30 | // latitude and longitude in degrees to rotate the globe 31 | void SetRotationDegrees(double latitudeDegrees, double longitudeDegrees); 32 | 33 | // set the rotation so that the coordinates that will be at the top of the globe 34 | void SetTopCoordinates(double latitudeDegrees, double longitudeDegrees); 35 | 36 | // returns the latitude in degrees that is at the top based on the rotation 37 | double GetTopLatitudeDegrees(); 38 | 39 | // returns the longitude in degrees that is at the top based on the rotation 40 | double GetTopLongitudeDegrees(); 41 | 42 | // get point in meters from latitude radians, longitude radians and altitude meters 43 | SimpleVector3<> GetPoint(double latitudeRadians, double longitudeRadians, double altitude); 44 | 45 | // get point in meters from location in radians 46 | SimpleVector3<> GetPoint(SimpleVector3<> location); 47 | 48 | // get point in game units from latitude radians, longitude radians and altitude meters 49 | SimpleVector3<> GetPointScaled(double latitudeRadians, double longitudeRadians, double altitude); 50 | 51 | // get point in game units from location in radians 52 | SimpleVector3<> GetPointScaled(SimpleVector3<> location); 53 | 54 | // get point in game units from latitude degrees, longitude degrees and altitude meters 55 | SimpleVector3<> GetPointScaledDegrees(double latitudeDegrees, double longitudeDegrees, double altitude); 56 | 57 | // get point in meters from latitude degrees, longitude degrees and altitude meters 58 | SimpleVector3<> GetPointDegrees(double latitudeDegrees, double longitudeDegrees, double altitude); 59 | 60 | // get location in radians from point in meters 61 | SimpleVector3<> GetLocation(SimpleVector3<> point); 62 | 63 | // get location in radians from point in game units 64 | SimpleVector3<> GetLocationScaled(SimpleVector3<> point); 65 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/NexradSites/generate.js: -------------------------------------------------------------------------------- 1 | //@ts-check 2 | 3 | var fs = require("fs") 4 | 5 | var csv = { 6 | /** 7 | * convert a csv string into an array of objects 8 | * @param {string} input 9 | * @returns {Array>} 10 | */ 11 | decode(input){ 12 | var output = [] 13 | var lines = input.split(/[\r\n]{1,2}/g) 14 | var columns = lines[0].split(",") 15 | for(var i = 1; i < lines.length; i++){ 16 | if(lines[i] == ""){ 17 | break 18 | } 19 | var line = lines[i].split(",") 20 | var decodedLine = Object.create(null) 21 | for(var x = 0; x < columns.length; x++){ 22 | decodedLine[columns[x]] = line[x] || "" 23 | } 24 | output.push(decodedLine) 25 | } 26 | return output 27 | }, 28 | /** 29 | * convert an array of objects to a csv string 30 | * @param {Array>} input 31 | * @returns {string} 32 | */ 33 | encode(input){ 34 | var output = "" 35 | var columnsSet = new Set() 36 | for(let x in input){ 37 | var entry = input[x] 38 | for(let y in entry){ 39 | columnsSet.add(y) 40 | } 41 | } 42 | var columns = Array.from(columnsSet) 43 | var comma = false 44 | for(let y = 0; y < columns.length; y++){ 45 | output += (comma?",":"") + columns[y] 46 | comma = true 47 | } 48 | output += "\n" 49 | for(let x in input){ 50 | var entry = input[x] 51 | comma = false 52 | var line = "" 53 | for(let y = 0; y < columns.length; y++){ 54 | line += (comma?",":"") + (entry[columns[y]] || "") 55 | comma = true 56 | } 57 | output += line + "\n" 58 | } 59 | return output 60 | } 61 | } 62 | 63 | 64 | var sites = csv.decode(fs.readFileSync("stations.csv").toString()) 65 | sites.sort((a, b) => { 66 | if(a.STATION_ID < b.STATION_ID){ 67 | return -1 68 | }else if(a.STATION_ID > b.STATION_ID){ 69 | return 1 70 | }else{ 71 | return 0 72 | } 73 | }) 74 | var out = ` 75 | #include "NexradSites.h" 76 | 77 | NexradSites::Site NexradSites::sites[] = { 78 | 79 | ` 80 | 81 | function stringOption(value){ 82 | return '"' + value + '",' 83 | } 84 | function numberOption(value){ 85 | return Math.round(value * 100000) / 100000 + ',' 86 | } 87 | 88 | var siteCount = 0 89 | for(var x in sites){ 90 | var site = sites[x] 91 | out += "\t{" + 92 | stringOption(site.STATION_ID.split(":")[1]) + 93 | numberOption(site.LATITUDE) + 94 | numberOption(site.LONGITUDE) + 95 | numberOption(parseFloat(site["ELEVATION_(FT)"]) * 0.304800609601) + 96 | "},\n" 97 | siteCount++ 98 | } 99 | 100 | out += ` 101 | }; 102 | 103 | int NexradSites::numberOfSites = ${siteCount}; 104 | 105 | ` 106 | 107 | fs.writeFileSync("NexradSites.cpp", out) -------------------------------------------------------------------------------- /Source/OpenStorm/UI/portable-file-dialogs.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | 6 | namespace pfd 7 | { 8 | enum class button 9 | { 10 | cancel = -1, 11 | ok, 12 | yes, 13 | no, 14 | abort, 15 | retry, 16 | ignore, 17 | }; 18 | 19 | enum class choice 20 | { 21 | ok = 0, 22 | ok_cancel, 23 | yes_no, 24 | yes_no_cancel, 25 | retry_cancel, 26 | abort_retry_ignore, 27 | }; 28 | 29 | enum class icon 30 | { 31 | info = 0, 32 | warning, 33 | error, 34 | question, 35 | }; 36 | 37 | // Additional option flags for various dialog constructors 38 | enum class opt : uint8_t 39 | { 40 | none = 0, 41 | // For file open, allow multiselect. 42 | multiselect = 0x1, 43 | // For file save, force overwrite and disable the confirmation dialog. 44 | force_overwrite = 0x2, 45 | // For folder select, force path to be the provided argument instead 46 | // of the last opened directory, which is the Microsoft-recommended, 47 | // user-friendly behaviour. 48 | force_path = 0x4, 49 | }; 50 | 51 | inline opt operator |(opt a, opt b) { return opt(uint8_t(a) | uint8_t(b)); } 52 | inline bool operator &(opt a, opt b) { return bool(uint8_t(a) & uint8_t(b)); } 53 | 54 | // The settings class, only exposing to the user a way to set verbose mode 55 | // and to force a rescan of installed desktop helpers (zenity, kdialog…). 56 | class settings 57 | { 58 | public: 59 | static bool available(); 60 | 61 | static void verbose(bool value); 62 | static void rescan(); 63 | 64 | protected: 65 | explicit settings(bool resync = false); 66 | 67 | bool check_program(std::string const &program); 68 | 69 | inline bool is_osascript() const; 70 | inline bool is_zenity() const; 71 | inline bool is_kdialog() const; 72 | 73 | enum class flag 74 | { 75 | is_scanned = 0, 76 | is_verbose, 77 | 78 | has_zenity, 79 | has_matedialog, 80 | has_qarma, 81 | has_kdialog, 82 | is_vista, 83 | 84 | max_flag, 85 | }; 86 | 87 | // Static array of flags for internal state 88 | bool const &flags(flag in_flag) const; 89 | 90 | // Non-const getter for the static array of flags 91 | bool &flags(flag in_flag); 92 | }; 93 | 94 | 95 | class open_file; 96 | 97 | class public_open_file{ 98 | public: 99 | public_open_file(std::string const &title, 100 | std::string const &default_path = "", 101 | std::vector const &filters = { "All Files", "*" }, 102 | opt options = opt::none); 103 | ~public_open_file(); 104 | bool ready(int timeout = 0) const; 105 | bool kill() const; 106 | std::vector result(); 107 | 108 | open_file* ptr = NULL; 109 | }; 110 | } -------------------------------------------------------------------------------- /.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Win32", 5 | "includePath": [ 6 | "${workspaceFolder}/Source/**", 7 | "${workspaceFolder}/Plugins/**", 8 | "${workspaceFolder}/Intermediate/**", 9 | "${default}", 10 | //"${workspaceFolder}/Plugins/UnrealHDF5/Source/UnrealHDF5/hdf5", 11 | 12 | // make a simlink to the engine beside this repository 13 | // windows example: mklink /D UnrealEngine C:\files\Epic\UE_5.2\Engine 14 | // linux example: ln -s /path/to/Engine UnrealEngine 15 | "${workspaceFolder}/../UnrealEngine/Engine/Plugins/Runtime/**", 16 | "${workspaceFolder}/../UnrealEngine/Engine/Source/Runtime/**", 17 | "${workspaceFolder}/../UnrealEngine/Engine/Source/Editor/**", 18 | "${workspaceFolder}/../UnrealEngine/Engine/Source/Developer/**", 19 | "${workspaceFolder}/../UnrealEngine/Engine/Source/", 20 | "${workspaceFolder}/../UnrealEngine/Engine/Plugins/Runtime/**", 21 | "${workspaceFolder}/../UnrealEngine/Engine/Shaders/Shared", 22 | "${workspaceFolder}/../UnrealEngine/Engine/Intermediate/Build/Win64/UnrealEditor/Inc/**" 23 | ], 24 | "forcedInclude": [ 25 | "${workspaceFolder}/Intermediate/Build/Win64/x64/UnrealEditor/Development/OpenStorm/Definitions.OpenStorm.h" 26 | ], 27 | "defines": [ 28 | "_DEBUG", 29 | "UNICODE", 30 | "_UNICODE", 31 | "HDF5" 32 | ], 33 | "windowsSdkVersion": "10.0.19041.0", 34 | "compilerPath": "cl.exe", 35 | "cStandard": "c17", 36 | "cppStandard": "c++17", 37 | "intelliSenseMode": "windows-msvc-x64" 38 | }, 39 | { 40 | "name": "Linux", 41 | "includePath": [ 42 | "${workspaceFolder}/Source/**", 43 | "${workspaceFolder}/Plugins/**", 44 | "${workspaceFolder}/Intermediate/**", 45 | "${default}", 46 | //"${workspaceFolder}/Plugins/UnrealHDF5/Source/UnrealHDF5/hdf5", 47 | 48 | // make a simlink to the engine beside this repository 49 | // windows example: mklink /D UnrealEngine C:\files\Epic\UE_5.2\Engine 50 | // linux example: ln -s /path/to/Engine UnrealEngine 51 | "${workspaceFolder}/../UnrealEngine/Engine/Plugins/Runtime/**", 52 | "${workspaceFolder}/../UnrealEngine/Engine/Source/Runtime/**", 53 | "${workspaceFolder}/../UnrealEngine/Engine/Source/Editor/**", 54 | "${workspaceFolder}/../UnrealEngine/Engine/Source/Developer/**", 55 | "${workspaceFolder}/../UnrealEngine/Engine/Source/", 56 | "${workspaceFolder}/../UnrealEngine/Engine/Plugins/Runtime/**", 57 | "${workspaceFolder}/../UnrealEngine/Engine/Shaders/Shared", 58 | "${workspaceFolder}/../UnrealEngine/Engine/Intermediate/Build/Linux/UnrealEditor/Inc/**" 59 | ], 60 | "forcedInclude": [ 61 | "${workspaceFolder}/Intermediate/Build/Linux/x64/UnrealEditor/Development/OpenStorm/Definitions.OpenStorm.h" 62 | ], 63 | "defines": [ 64 | "_DEBUG", 65 | "UNICODE", 66 | "_UNICODE", 67 | "HDF5" 68 | ] 69 | } 70 | ], 71 | "version": 4 72 | } -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Deps/zlib/inftrees.h: -------------------------------------------------------------------------------- 1 | /* inftrees.h -- header to use inftrees.c 2 | * Copyright (C) 1995-2005, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | /* Structure for decoding tables. Each entry provides either the 12 | information needed to do the operation requested by the code that 13 | indexed that table entry, or it provides a pointer to another 14 | table that indexes more bits of the code. op indicates whether 15 | the entry is a pointer to another table, a literal, a length or 16 | distance, an end-of-block, or an invalid code. For a table 17 | pointer, the low four bits of op is the number of index bits of 18 | that table. For a length or distance, the low four bits of op 19 | is the number of extra bits to get after the code. bits is 20 | the number of bits in this code or part of the code to drop off 21 | of the bit buffer. val is the actual byte to output in the case 22 | of a literal, the base length or distance, or the offset from 23 | the current table to the next table. Each entry is four bytes. */ 24 | typedef struct { 25 | unsigned char op; /* operation, extra bits, table bits */ 26 | unsigned char bits; /* bits in this part of the code */ 27 | unsigned short val; /* offset in table or code value */ 28 | } code; 29 | 30 | /* op values as set by inflate_table(): 31 | 00000000 - literal 32 | 0000tttt - table link, tttt != 0 is the number of table index bits 33 | 0001eeee - length or distance, eeee is the number of extra bits 34 | 01100000 - end of block 35 | 01000000 - invalid code 36 | */ 37 | 38 | /* Maximum size of the dynamic table. The maximum number of code structures is 39 | 1444, which is the sum of 852 for literal/length codes and 592 for distance 40 | codes. These values were found by exhaustive searches using the program 41 | examples/enough.c found in the zlib distribution. The arguments to that 42 | program are the number of symbols, the initial root table size, and the 43 | maximum bit length of a code. "enough 286 9 15" for literal/length codes 44 | returns returns 852, and "enough 30 6 15" for distance codes returns 592. 45 | The initial root table size (9 or 6) is found in the fifth argument of the 46 | inflate_table() calls in inflate.c and infback.c. If the root table size is 47 | changed, then these maximum sizes would be need to be recalculated and 48 | updated. */ 49 | #define ENOUGH_LENS 852 50 | #define ENOUGH_DISTS 592 51 | #define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS) 52 | 53 | /* Type of code to build for inflate_table() */ 54 | typedef enum { 55 | CODES, 56 | LENS, 57 | DISTS 58 | } codetype; 59 | 60 | int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens, 61 | unsigned codes, code FAR * FAR *table, 62 | unsigned FAR *bits, unsigned short FAR *work)); 63 | -------------------------------------------------------------------------------- /Source/OpenStorm/Deps/discord-rpc/include/discord_rpc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | // clang-format off 5 | 6 | #if defined(DISCORD_DYNAMIC_LIB) 7 | # if defined(_WIN32) 8 | # if defined(DISCORD_BUILDING_SDK) 9 | # define DISCORD_EXPORT __declspec(dllexport) 10 | # else 11 | # define DISCORD_EXPORT __declspec(dllimport) 12 | # endif 13 | # else 14 | # define DISCORD_EXPORT __attribute__((visibility("default"))) 15 | # endif 16 | #else 17 | # define DISCORD_EXPORT 18 | #endif 19 | 20 | // clang-format on 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | typedef struct DiscordRichPresence { 27 | const char* state; /* max 128 bytes */ 28 | const char* details; /* max 128 bytes */ 29 | int64_t startTimestamp; 30 | int64_t endTimestamp; 31 | const char* largeImageKey; /* max 32 bytes */ 32 | const char* largeImageText; /* max 128 bytes */ 33 | const char* smallImageKey; /* max 32 bytes */ 34 | const char* smallImageText; /* max 128 bytes */ 35 | const char* partyId; /* max 128 bytes */ 36 | int partySize; 37 | int partyMax; 38 | int partyPrivacy; 39 | const char* matchSecret; /* max 128 bytes */ 40 | const char* joinSecret; /* max 128 bytes */ 41 | const char* spectateSecret; /* max 128 bytes */ 42 | bool button1Enabled; 43 | const char* button1Label; 44 | const char* button1Url; 45 | bool button2Enabled; 46 | const char* button2Label; 47 | const char* button2Url; 48 | int8_t instance; 49 | } DiscordRichPresence; 50 | 51 | typedef struct DiscordUser { 52 | const char* userId; 53 | const char* username; 54 | const char* discriminator; 55 | const char* avatar; 56 | } DiscordUser; 57 | 58 | typedef struct DiscordEventHandlers { 59 | void (*ready)(const DiscordUser* request); 60 | void (*disconnected)(int errorCode, const char* message); 61 | void (*errored)(int errorCode, const char* message); 62 | void (*joinGame)(const char* joinSecret); 63 | void (*spectateGame)(const char* spectateSecret); 64 | void (*joinRequest)(const DiscordUser* request); 65 | } DiscordEventHandlers; 66 | 67 | #define DISCORD_REPLY_NO 0 68 | #define DISCORD_REPLY_YES 1 69 | #define DISCORD_REPLY_IGNORE 2 70 | #define DISCORD_PARTY_PRIVATE 0 71 | #define DISCORD_PARTY_PUBLIC 1 72 | 73 | DISCORD_EXPORT void Discord_Initialize(const char* applicationId, 74 | DiscordEventHandlers* handlers, 75 | int autoRegister, 76 | const char* optionalSteamId); 77 | DISCORD_EXPORT void Discord_Shutdown(void); 78 | 79 | /* checks for incoming messages, dispatches callbacks */ 80 | DISCORD_EXPORT void Discord_RunCallbacks(void); 81 | 82 | /* If you disable the lib starting its own io thread, you'll need to call this from your own */ 83 | #ifdef DISCORD_DISABLE_IO_THREAD 84 | DISCORD_EXPORT void Discord_UpdateConnection(void); 85 | #endif 86 | 87 | DISCORD_EXPORT void Discord_UpdatePresence(const DiscordRichPresence* presence); 88 | DISCORD_EXPORT void Discord_ClearPresence(void); 89 | 90 | DISCORD_EXPORT void Discord_Respond(const char* userid, /* DISCORD_REPLY_ */ int reply); 91 | 92 | DISCORD_EXPORT void Discord_UpdateHandlers(DiscordEventHandlers* handlers); 93 | 94 | #ifdef __cplusplus 95 | } /* extern "C" */ 96 | #endif 97 | -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Deps/zlib/gz_compress.c: -------------------------------------------------------------------------------- 1 | /* compress.c -- compress a memory buffer 2 | * Copyright (C) 1995-2005, 2014, 2016 Jean-loup Gailly, Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #pragma clang diagnostic push 9 | #pragma clang diagnostic ignored "-Wdeprecated-non-prototype" 10 | 11 | #define ZLIB_INTERNAL 12 | #include "zlib.h" 13 | 14 | /* =========================================================================== 15 | Compresses the source buffer into the destination buffer. The level 16 | parameter has the same meaning as in deflateInit. sourceLen is the byte 17 | length of the source buffer. Upon entry, destLen is the total size of the 18 | destination buffer, which must be at least 0.1% larger than sourceLen plus 19 | 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. 20 | 21 | compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough 22 | memory, Z_BUF_ERROR if there was not enough room in the output buffer, 23 | Z_STREAM_ERROR if the level parameter is invalid. 24 | */ 25 | int ZEXPORT compress2(dest, destLen, source, sourceLen, level) 26 | Bytef *dest; 27 | uLongf *destLen; 28 | const Bytef *source; 29 | uLong sourceLen; 30 | int level; 31 | { 32 | z_stream stream; 33 | int err; 34 | const uInt max = (uInt)-1; 35 | uLong left; 36 | 37 | left = *destLen; 38 | *destLen = 0; 39 | 40 | stream.zalloc = (alloc_func)0; 41 | stream.zfree = (free_func)0; 42 | stream.opaque = (voidpf)0; 43 | 44 | err = deflateInit(&stream, level); 45 | if (err != Z_OK) return err; 46 | 47 | stream.next_out = dest; 48 | stream.avail_out = 0; 49 | stream.next_in = (z_const Bytef *)source; 50 | stream.avail_in = 0; 51 | 52 | do { 53 | if (stream.avail_out == 0) { 54 | stream.avail_out = left > (uLong)max ? max : (uInt)left; 55 | left -= stream.avail_out; 56 | } 57 | if (stream.avail_in == 0) { 58 | stream.avail_in = sourceLen > (uLong)max ? max : (uInt)sourceLen; 59 | sourceLen -= stream.avail_in; 60 | } 61 | err = deflate(&stream, sourceLen ? Z_NO_FLUSH : Z_FINISH); 62 | } while (err == Z_OK); 63 | 64 | *destLen = stream.total_out; 65 | deflateEnd(&stream); 66 | return err == Z_STREAM_END ? Z_OK : err; 67 | } 68 | 69 | /* =========================================================================== 70 | */ 71 | int ZEXPORT compress(dest, destLen, source, sourceLen) 72 | Bytef *dest; 73 | uLongf *destLen; 74 | const Bytef *source; 75 | uLong sourceLen; 76 | { 77 | return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION); 78 | } 79 | 80 | /* =========================================================================== 81 | If the default memLevel or windowBits for deflateInit() is changed, then 82 | this function needs to be updated. 83 | */ 84 | uLong ZEXPORT compressBound(sourceLen) 85 | uLong sourceLen; 86 | { 87 | return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 88 | (sourceLen >> 25) + 13; 89 | } 90 | 91 | #pragma clang diagnostic pop -------------------------------------------------------------------------------- /Source/OpenStorm/Deps/discord-rpc/src/connection_unix.cpp: -------------------------------------------------------------------------------- 1 | #ifndef _WIN32 2 | 3 | #include "connection.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | int GetProcessId() 15 | { 16 | return ::getpid(); 17 | } 18 | 19 | struct BaseConnectionUnix : public BaseConnection { 20 | int sock{-1}; 21 | }; 22 | 23 | static BaseConnectionUnix Connection; 24 | static sockaddr_un PipeAddr{}; 25 | #ifdef MSG_NOSIGNAL 26 | static int MsgFlags = MSG_NOSIGNAL; 27 | #else 28 | static int MsgFlags = 0; 29 | #endif 30 | 31 | static const char* GetTempPath() 32 | { 33 | const char* temp = getenv("XDG_RUNTIME_DIR"); 34 | temp = temp ? temp : getenv("TMPDIR"); 35 | temp = temp ? temp : getenv("TMP"); 36 | temp = temp ? temp : getenv("TEMP"); 37 | temp = temp ? temp : "/tmp"; 38 | return temp; 39 | } 40 | 41 | /*static*/ BaseConnection* BaseConnection::Create() 42 | { 43 | PipeAddr.sun_family = AF_UNIX; 44 | return &Connection; 45 | } 46 | 47 | /*static*/ void BaseConnection::Destroy(BaseConnection*& c) 48 | { 49 | auto self = reinterpret_cast(c); 50 | self->Close(); 51 | c = nullptr; 52 | } 53 | 54 | bool BaseConnection::Open() 55 | { 56 | const char* tempPath = GetTempPath(); 57 | auto self = reinterpret_cast(this); 58 | self->sock = socket(AF_UNIX, SOCK_STREAM, 0); 59 | if (self->sock == -1) { 60 | return false; 61 | } 62 | fcntl(self->sock, F_SETFL, O_NONBLOCK); 63 | #ifdef SO_NOSIGPIPE 64 | int optval = 1; 65 | setsockopt(self->sock, SOL_SOCKET, SO_NOSIGPIPE, &optval, sizeof(optval)); 66 | #endif 67 | 68 | for (int pipeNum = 0; pipeNum < 10; ++pipeNum) { 69 | snprintf( 70 | PipeAddr.sun_path, sizeof(PipeAddr.sun_path), "%s/discord-ipc-%d", tempPath, pipeNum); 71 | int err = connect(self->sock, (const sockaddr*)&PipeAddr, sizeof(PipeAddr)); 72 | if (err == 0) { 73 | self->isOpen = true; 74 | return true; 75 | } 76 | } 77 | self->Close(); 78 | return false; 79 | } 80 | 81 | bool BaseConnection::Close() 82 | { 83 | auto self = reinterpret_cast(this); 84 | if (self->sock == -1) { 85 | return false; 86 | } 87 | close(self->sock); 88 | self->sock = -1; 89 | self->isOpen = false; 90 | return true; 91 | } 92 | 93 | bool BaseConnection::Write(const void* data, size_t length) 94 | { 95 | auto self = reinterpret_cast(this); 96 | 97 | if (self->sock == -1) { 98 | return false; 99 | } 100 | 101 | ssize_t sentBytes = send(self->sock, data, length, MsgFlags); 102 | if (sentBytes < 0) { 103 | Close(); 104 | } 105 | return sentBytes == (ssize_t)length; 106 | } 107 | 108 | bool BaseConnection::Read(void* data, size_t length) 109 | { 110 | auto self = reinterpret_cast(this); 111 | 112 | if (self->sock == -1) { 113 | return false; 114 | } 115 | 116 | int res = (int)recv(self->sock, data, length, MsgFlags); 117 | if (res < 0) { 118 | if (errno == EAGAIN) { 119 | return false; 120 | } 121 | Close(); 122 | } 123 | else if (res == 0) { 124 | Close(); 125 | } 126 | return res == (int)length; 127 | } 128 | 129 | #endif -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Deps/rsl/prune.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | NASA/TRMM, Code 910.1. 3 | This is the TRMM Office Radar Software Library. 4 | Copyright (C) 1996, 1997 5 | John H. Merritt 6 | Space Applications Corporation 7 | Vienna, Virginia 8 | 9 | This library is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU Library General Public 11 | License as published by the Free Software Foundation; either 12 | version 2 of the License, or (at your option) any later version. 13 | 14 | This library is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | Library General Public License for more details. 18 | 19 | You should have received a copy of the GNU Library General Public 20 | License along with this library; if not, write to the Free 21 | Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | */ 23 | /* 24 | * The PRUNE functions eliminate NULL or non-present (no data present) 25 | * substructures. This tightens the structures for output. Development 26 | * was sparked by failing NCAR UF ingest programs; they cannot handle 27 | * 0 sized volumes/sweeps/rays dispite conformity to the UF specification. 28 | * 29 | * These routines free memory that is pruned. 30 | * 31 | * John H. Merritt 32 | * Space Applications Corporation 33 | * December 12, 1995 34 | */ 35 | 36 | #include "rsl.h" 37 | extern int radar_verbose_flag; 38 | 39 | Ray *RSL_prune_ray(Ray *ray) 40 | { 41 | if (ray == NULL) return NULL; 42 | if (ray->h.nbins > 0) return ray; 43 | RSL_free_ray(ray); 44 | return NULL; 45 | } 46 | 47 | Sweep *RSL_prune_sweep(Sweep *s) 48 | { 49 | int i, j; 50 | 51 | if (s == NULL) return NULL; 52 | if (s->h.nrays == 0) { 53 | RSL_free_sweep(s); 54 | return NULL; 55 | } 56 | /* 57 | * Squash out all dataless rays. 'j' is the index for the squashed (pruned) 58 | * rays. 59 | */ 60 | for (i=0,j=0; ih.nrays; i++) 61 | if ((s->ray[i] = RSL_prune_ray(s->ray[i]))) 62 | s->ray[j++] = s->ray[i]; /* Keep this ray. */ 63 | 64 | if (j==0) { 65 | RSL_free_sweep(s); 66 | return NULL; /* All rays were pruned. */ 67 | } 68 | for (i=j; ih.nrays; i++) s->ray[i] = NULL; 69 | s->h.nrays = j; 70 | return s; 71 | } 72 | 73 | Volume *RSL_prune_volume(Volume *v) 74 | { 75 | int i, j; 76 | 77 | if (v == NULL) return NULL; 78 | if (v->h.nsweeps == 0) { 79 | RSL_free_volume(v); 80 | return NULL; 81 | } 82 | /* 83 | * Squash out all dataless sweeps. 'j' is the index for sweep containing data. 84 | */ 85 | for (i=0,j=0; ih.nsweeps; i++) 86 | if ((v->sweep[i] = RSL_prune_sweep(v->sweep[i]))) 87 | v->sweep[j++] = v->sweep[i]; /* Keep this sweep. */ 88 | 89 | if (j==0) { 90 | RSL_free_volume(v); 91 | return NULL; /* All sweeps were pruned. */ 92 | } 93 | for (i=j; ih.nsweeps; i++) v->sweep[i] = NULL; 94 | v->h.nsweeps = j; 95 | return v; 96 | } 97 | 98 | Radar *RSL_prune_radar(Radar *radar) 99 | { 100 | int i; 101 | /* Volume indexes are fixed so we just prune the substructures. */ 102 | if (radar == NULL) return NULL; 103 | for (i=0; ih.nvolumes; i++) 104 | radar->v[i] = RSL_prune_volume(radar->v[i]); 105 | 106 | return radar; 107 | } 108 | -------------------------------------------------------------------------------- /Source/OpenStorm/Deps/discord-rpc/src/connection_win.cpp: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | 3 | #include "connection.h" 4 | 5 | #define WIN32_LEAN_AND_MEAN 6 | #define NOMCX 7 | #define NOSERVICE 8 | #define NOIME 9 | #include 10 | #include 11 | 12 | int GetProcessId() 13 | { 14 | return (int)::GetCurrentProcessId(); 15 | } 16 | 17 | struct BaseConnectionWin : public BaseConnection { 18 | HANDLE pipe{INVALID_HANDLE_VALUE}; 19 | }; 20 | 21 | static BaseConnectionWin Connection; 22 | 23 | /*static*/ BaseConnection* BaseConnection::Create() 24 | { 25 | return &Connection; 26 | } 27 | 28 | /*static*/ void BaseConnection::Destroy(BaseConnection*& c) 29 | { 30 | auto self = reinterpret_cast(c); 31 | self->Close(); 32 | c = nullptr; 33 | } 34 | 35 | bool BaseConnection::Open() 36 | { 37 | wchar_t pipeName[]{L"\\\\?\\pipe\\discord-ipc-0"}; 38 | const size_t pipeDigit = sizeof(pipeName) / sizeof(wchar_t) - 2; 39 | pipeName[pipeDigit] = L'0'; 40 | auto self = reinterpret_cast(this); 41 | for (;;) { 42 | self->pipe = ::CreateFileW( 43 | pipeName, GENERIC_READ | GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, 0, nullptr); 44 | if (self->pipe != INVALID_HANDLE_VALUE) { 45 | self->isOpen = true; 46 | return true; 47 | } 48 | 49 | auto lastError = GetLastError(); 50 | if (lastError == ERROR_FILE_NOT_FOUND) { 51 | if (pipeName[pipeDigit] < L'9') { 52 | pipeName[pipeDigit]++; 53 | continue; 54 | } 55 | } 56 | else if (lastError == ERROR_PIPE_BUSY) { 57 | if (!WaitNamedPipeW(pipeName, 10000)) { 58 | return false; 59 | } 60 | continue; 61 | } 62 | return false; 63 | } 64 | } 65 | 66 | bool BaseConnection::Close() 67 | { 68 | auto self = reinterpret_cast(this); 69 | ::CloseHandle(self->pipe); 70 | self->pipe = INVALID_HANDLE_VALUE; 71 | self->isOpen = false; 72 | return true; 73 | } 74 | 75 | bool BaseConnection::Write(const void* data, size_t length) 76 | { 77 | if (length == 0) { 78 | return true; 79 | } 80 | auto self = reinterpret_cast(this); 81 | assert(self); 82 | if (!self) { 83 | return false; 84 | } 85 | if (self->pipe == INVALID_HANDLE_VALUE) { 86 | return false; 87 | } 88 | assert(data); 89 | if (!data) { 90 | return false; 91 | } 92 | const DWORD bytesLength = (DWORD)length; 93 | DWORD bytesWritten = 0; 94 | return ::WriteFile(self->pipe, data, bytesLength, &bytesWritten, nullptr) == TRUE && 95 | bytesWritten == bytesLength; 96 | } 97 | 98 | bool BaseConnection::Read(void* data, size_t length) 99 | { 100 | assert(data); 101 | if (!data) { 102 | return false; 103 | } 104 | auto self = reinterpret_cast(this); 105 | assert(self); 106 | if (!self) { 107 | return false; 108 | } 109 | if (self->pipe == INVALID_HANDLE_VALUE) { 110 | return false; 111 | } 112 | DWORD bytesAvailable = 0; 113 | if (::PeekNamedPipe(self->pipe, nullptr, 0, nullptr, &bytesAvailable, nullptr)) { 114 | if (bytesAvailable >= length) { 115 | DWORD bytesToRead = (DWORD)length; 116 | DWORD bytesRead = 0; 117 | if (::ReadFile(self->pipe, data, bytesToRead, &bytesRead, nullptr) == TRUE) { 118 | assert(bytesToRead == bytesRead); 119 | return true; 120 | } 121 | else { 122 | Close(); 123 | } 124 | } 125 | } 126 | else { 127 | Close(); 128 | } 129 | return false; 130 | } 131 | 132 | #endif -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Deps/zlib/uncompr.c: -------------------------------------------------------------------------------- 1 | /* uncompr.c -- decompress a memory buffer 2 | * Copyright (C) 1995-2003, 2010, 2014, 2016 Jean-loup Gailly, Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | 9 | #pragma clang diagnostic push 10 | #pragma clang diagnostic ignored "-Wdeprecated-non-prototype" 11 | 12 | #define ZLIB_INTERNAL 13 | #include "zlib.h" 14 | 15 | /* =========================================================================== 16 | Decompresses the source buffer into the destination buffer. *sourceLen is 17 | the byte length of the source buffer. Upon entry, *destLen is the total size 18 | of the destination buffer, which must be large enough to hold the entire 19 | uncompressed data. (The size of the uncompressed data must have been saved 20 | previously by the compressor and transmitted to the decompressor by some 21 | mechanism outside the scope of this compression library.) Upon exit, 22 | *destLen is the size of the decompressed data and *sourceLen is the number 23 | of source bytes consumed. Upon return, source + *sourceLen points to the 24 | first unused input byte. 25 | 26 | uncompress returns Z_OK if success, Z_MEM_ERROR if there was not enough 27 | memory, Z_BUF_ERROR if there was not enough room in the output buffer, or 28 | Z_DATA_ERROR if the input data was corrupted, including if the input data is 29 | an incomplete zlib stream. 30 | */ 31 | int ZEXPORT uncompress2(dest, destLen, source, sourceLen) 32 | Bytef *dest; 33 | uLongf *destLen; 34 | const Bytef *source; 35 | uLong *sourceLen; 36 | { 37 | z_stream stream; 38 | int err; 39 | const uInt max = (uInt)-1; 40 | uLong len, left; 41 | Byte buf[1]; /* for detection of incomplete stream when *destLen == 0 */ 42 | 43 | len = *sourceLen; 44 | if (*destLen) { 45 | left = *destLen; 46 | *destLen = 0; 47 | } 48 | else { 49 | left = 1; 50 | dest = buf; 51 | } 52 | 53 | stream.next_in = (z_const Bytef *)source; 54 | stream.avail_in = 0; 55 | stream.zalloc = (alloc_func)0; 56 | stream.zfree = (free_func)0; 57 | stream.opaque = (voidpf)0; 58 | 59 | err = inflateInit(&stream); 60 | if (err != Z_OK) return err; 61 | 62 | stream.next_out = dest; 63 | stream.avail_out = 0; 64 | 65 | do { 66 | if (stream.avail_out == 0) { 67 | stream.avail_out = left > (uLong)max ? max : (uInt)left; 68 | left -= stream.avail_out; 69 | } 70 | if (stream.avail_in == 0) { 71 | stream.avail_in = len > (uLong)max ? max : (uInt)len; 72 | len -= stream.avail_in; 73 | } 74 | err = inflate(&stream, Z_NO_FLUSH); 75 | } while (err == Z_OK); 76 | 77 | *sourceLen -= len + stream.avail_in; 78 | if (dest != buf) 79 | *destLen = stream.total_out; 80 | else if (stream.total_out && err == Z_BUF_ERROR) 81 | left = 1; 82 | 83 | inflateEnd(&stream); 84 | return err == Z_STREAM_END ? Z_OK : 85 | err == Z_NEED_DICT ? Z_DATA_ERROR : 86 | err == Z_BUF_ERROR && left + stream.avail_out ? Z_DATA_ERROR : 87 | err; 88 | } 89 | 90 | int ZEXPORT uncompress(dest, destLen, source, sourceLen) 91 | Bytef *dest; 92 | uLongf *destLen; 93 | const Bytef *source; 94 | uLong sourceLen; 95 | { 96 | return uncompress2(dest, destLen, source, &sourceLen); 97 | } 98 | 99 | #pragma clang diagnostic pop -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Deps/bzip2/xmlproc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # see the README file for usage etc. 3 | # 4 | # ------------------------------------------------------------------ 5 | # This file is part of bzip2/libbzip2, a program and library for 6 | # lossless, block-sorting data compression. 7 | # 8 | # bzip2/libbzip2 version 1.0.6 of 6 September 2010 9 | # Copyright (C) 1996-2010 Julian Seward 10 | # 11 | # Please read the WARNING, DISCLAIMER and PATENTS sections in the 12 | # README file. 13 | # 14 | # This program is released under the terms of the license contained 15 | # in the file LICENSE. 16 | # ---------------------------------------------------------------- 17 | 18 | 19 | usage() { 20 | echo ''; 21 | echo 'Usage: xmlproc.sh -[option] '; 22 | echo 'Specify a target from:'; 23 | echo '-v verify xml file conforms to dtd'; 24 | echo '-html output in html format (single file)'; 25 | echo '-ps output in postscript format'; 26 | echo '-pdf output in pdf format'; 27 | exit; 28 | } 29 | 30 | if test $# -ne 2; then 31 | usage 32 | fi 33 | # assign the variable for the output type 34 | action=$1; shift 35 | # assign the output filename 36 | xmlfile=$1; shift 37 | # and check user input it correct 38 | if !(test -f $xmlfile); then 39 | echo "No such file: $xmlfile"; 40 | exit; 41 | fi 42 | # some other stuff we will use 43 | OUT=output 44 | xsl_fo=bz-fo.xsl 45 | xsl_html=bz-html.xsl 46 | 47 | basename=$xmlfile 48 | basename=${basename//'.xml'/''} 49 | 50 | fofile="${basename}.fo" 51 | htmlfile="${basename}.html" 52 | pdffile="${basename}.pdf" 53 | psfile="${basename}.ps" 54 | xmlfmtfile="${basename}.fmt" 55 | 56 | # first process the xmlfile with CDATA tags 57 | ./format.pl $xmlfile $xmlfmtfile 58 | # so the shell knows where the catalogs live 59 | export XML_CATALOG_FILES=/etc/xml/catalog 60 | 61 | # post-processing tidy up 62 | cleanup() { 63 | echo "Cleaning up: $@" 64 | while [ $# != 0 ] 65 | do 66 | arg=$1; shift; 67 | echo " deleting $arg"; 68 | rm $arg 69 | done 70 | } 71 | 72 | case $action in 73 | -v) 74 | flags='--noout --xinclude --noblanks --postvalid' 75 | dtd='--dtdvalid http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd' 76 | xmllint $flags $dtd $xmlfmtfile 2> $OUT 77 | egrep 'error' $OUT 78 | rm $OUT 79 | ;; 80 | 81 | -html) 82 | echo "Creating $htmlfile ..." 83 | xsltproc --nonet --xinclude -o $htmlfile $xsl_html $xmlfmtfile 84 | cleanup $xmlfmtfile 85 | ;; 86 | 87 | -pdf) 88 | echo "Creating $pdffile ..." 89 | xsltproc --nonet --xinclude -o $fofile $xsl_fo $xmlfmtfile 90 | pdfxmltex $fofile >$OUT $OUT $OUT $OUT $OUT $OUT $OUT $OUT $OUT Globe::GetPoint(double latitudeRadians, double longitudeRadians, double altitude){ 35 | SimpleVector3<> vector = SimpleVector3<>(altitude + surfaceRadius, M_PI / 2.0 - longitudeRadians - rotationAroundPolls, M_PI/2 - latitudeRadians); 36 | vector.SphericalToRectangular(); 37 | vector.RotateAroundX(rotationAroundX); 38 | vector.Add(center); 39 | return vector; 40 | } 41 | 42 | SimpleVector3<> Globe::GetPoint(SimpleVector3<> location){ 43 | SimpleVector3<> vector = SimpleVector3<>(location.radius() + surfaceRadius, M_PI / 2.0 - location.theta() - rotationAroundPolls, M_PI/2 - location.phi()); 44 | vector.SphericalToRectangular(); 45 | vector.RotateAroundX(rotationAroundX); 46 | vector.Add(center); 47 | return vector; 48 | return SimpleVector3<>(); 49 | } 50 | 51 | SimpleVector3<> Globe::GetPointScaled(double latitudeRadians, double longitudeRadians, double altitude){ 52 | SimpleVector3<> vector = GetPoint(latitudeRadians,longitudeRadians, altitude); 53 | vector.Multiply(scale); 54 | return vector; 55 | } 56 | 57 | SimpleVector3<> Globe::GetPointScaled(SimpleVector3<> location){ 58 | SimpleVector3<> vector = GetPoint(location); 59 | vector.Multiply(scale); 60 | return vector; 61 | } 62 | 63 | SimpleVector3<> Globe::GetPointDegrees(double latitudeDegrees, double longitudeDegrees, double altitude) { 64 | SimpleVector3<> vector = GetPoint(latitudeDegrees / 180 * M_PI, longitudeDegrees / 180 * M_PI, altitude); 65 | return vector; 66 | } 67 | 68 | SimpleVector3<> Globe::GetPointScaledDegrees(double latitudeDegrees, double longitudeDegrees, double altitude) { 69 | SimpleVector3<> vector = GetPoint(latitudeDegrees / 180 * M_PI, longitudeDegrees / 180 * M_PI, altitude); 70 | vector.Multiply(scale); 71 | return vector; 72 | } 73 | 74 | SimpleVector3<> Globe::GetLocation(SimpleVector3<> point){ 75 | SimpleVector3<> vector = SimpleVector3<>(point); 76 | vector.Add(center); 77 | vector.RotateAroundX(-rotationAroundX); 78 | vector.RectangularToSpherical(); 79 | vector.radius() -= surfaceRadius; 80 | vector.theta() = -vector.theta() + M_PI / 2.0 - rotationAroundPolls; 81 | vector.phi() = -vector.phi() + M_PI * 1.5; 82 | return vector; 83 | return SimpleVector3<>(); 84 | } 85 | 86 | SimpleVector3<> Globe::GetLocationScaled(SimpleVector3<> point){ 87 | SimpleVector3<> vector = SimpleVector3<>(point); 88 | vector.Multiply(-1.0 / scale); 89 | vector = GetLocation(vector); 90 | return vector; 91 | } -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Deps/rsl/wsr88d_get_site.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | NASA/TRMM, Code 910.1. 3 | This is the TRMM Office Radar Software Library. 4 | Copyright (C) 1996, 1997 5 | John H. Merritt 6 | Space Applications Corporation 7 | Vienna, Virginia 8 | 9 | This library is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU Library General Public 11 | License as published by the Free Software Foundation; either 12 | version 2 of the License, or (at your option) any later version. 13 | 14 | This library is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | Library General Public License for more details. 18 | 19 | You should have received a copy of the GNU Library General Public 20 | License along with this library; if not, write to the Free 21 | Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 | */ 23 | /* 24 | * get_site - fills structure containing radar site info 25 | * parameters: 26 | * char *in_sitenm - ptr to radar site name 27 | * returns: struct radar_site *currsite->- ptr to current site structure 28 | * Returns NULL on failure of 'in_sitenm' lookup. 29 | * calls from: Proc_file 30 | */ 31 | 32 | #include 33 | #include 34 | int strcasecmp(const char *s1, const char *s2); 35 | #include 36 | #include "wsr88d.h" 37 | 38 | Wsr88d_site_info *wsr88d_get_site(char *in_sitenm) 39 | { 40 | /* variable declarations */ 41 | char line[100]; 42 | int scan_count,i; 43 | int in_number,in_latd,in_latm,in_lats,in_lond,in_lonm,in_lons; 44 | int in_height; 45 | char in_site[5],in_city[16],in_state[4]; /* One extra for \0 */ 46 | struct radar_site *currsite=NULL; 47 | // the file will never exist so just return 48 | return currsite; 49 | FILE *in_file; 50 | 51 | if((in_file=fopen(WSR88D_SITE_INFO_FILE, "r")) !=NULL) 52 | { 53 | /* read each line */ 54 | while (fgets(line,sizeof(line),in_file) != NULL) 55 | { 56 | scan_count=sscanf(line,"%d %s %s %s %d %d %d %d %d %d %d",&in_number,in_site,in_city,in_state,&in_latd,&in_latm,&in_lats,&in_lond,&in_lonm,&in_lons,&in_height); 57 | if(scan_count != 11 && scan_count != 0) 58 | fprintf(stderr,"get_site: sitedb read"); 59 | else 60 | { 61 | /* get the radar site info */ 62 | 63 | /* check for the matching site name*/ 64 | if(strcasecmp(in_sitenm,in_site)== 0) 65 | { 66 | if((currsite=(struct radar_site *)malloc(sizeof(struct radar_site)))==NULL) { 67 | perror("wsr88d_get_site"); 68 | return NULL; 69 | } 70 | currsite->number = in_number; 71 | for(i=0;i<4;i++){ 72 | currsite->name[i] = in_site[i]; 73 | } 74 | for(i=0;i<15;i++){ 75 | currsite->city[i] = in_city[i]; 76 | } 77 | for(i=0;i<2;i++){ 78 | currsite->state[i] = in_state[i]; 79 | } 80 | currsite->latd = in_latd; 81 | currsite->latm = in_latm; 82 | currsite->lats = in_lats; 83 | currsite->lond = in_lond; 84 | currsite->lonm = in_lonm; 85 | currsite->lons = in_lons; 86 | currsite->height = in_height; 87 | currsite->bwidth = -999; 88 | currsite->spulse = 1530; 89 | currsite->lpulse = 4630; 90 | break; 91 | } 92 | } 93 | } 94 | /* close the file */ 95 | (void)fclose(in_file); 96 | } 97 | else{ 98 | perror(WSR88D_SITE_INFO_FILE); 99 | } 100 | 101 | 102 | return(currsite); 103 | } 104 | 105 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "*.ush": "hlsl", 4 | "algorithm": "cpp", 5 | "cmath": "cpp", 6 | "cstddef": "cpp", 7 | "cstdint": "cpp", 8 | "cstdio": "cpp", 9 | "cstdlib": "cpp", 10 | "cstring": "cpp", 11 | "cwchar": "cpp", 12 | "exception": "cpp", 13 | "initializer_list": "cpp", 14 | "iosfwd": "cpp", 15 | "limits": "cpp", 16 | "map": "cpp", 17 | "new": "cpp", 18 | "stdexcept": "cpp", 19 | "tuple": "cpp", 20 | "type_traits": "cpp", 21 | "utility": "cpp", 22 | "xmemory": "cpp", 23 | "xmemory0": "cpp", 24 | "xstddef": "cpp", 25 | "xstring": "cpp", 26 | "xtr1common": "cpp", 27 | "xtree": "cpp", 28 | "xutility": "cpp", 29 | "*.rh": "cpp", 30 | "ios": "cpp", 31 | "istream": "cpp", 32 | "memory": "cpp", 33 | "ostream": "cpp", 34 | "streambuf": "cpp", 35 | "string": "cpp", 36 | "system_error": "cpp", 37 | "typeinfo": "cpp", 38 | "xfacet": "cpp", 39 | "xiosbase": "cpp", 40 | "xlocale": "cpp", 41 | "xlocinfo": "cpp", 42 | "xlocnum": "cpp", 43 | "functional": "cpp", 44 | "list": "cpp", 45 | "unordered_map": "cpp", 46 | "vector": "cpp", 47 | "xhash": "cpp", 48 | "filesystem": "cpp", 49 | "atomic": "cpp", 50 | "chrono": "cpp", 51 | "codecvt": "cpp", 52 | "ctime": "cpp", 53 | "iomanip": "cpp", 54 | "iostream": "cpp", 55 | "locale": "cpp", 56 | "ratio": "cpp", 57 | "string_view": "cpp", 58 | "xlocbuf": "cpp", 59 | "xlocmes": "cpp", 60 | "xlocmon": "cpp", 61 | "xloctime": "cpp", 62 | "array": "cpp", 63 | "iterator": "cpp", 64 | "condition_variable": "cpp", 65 | "csignal": "cpp", 66 | "resumable": "cpp", 67 | "future": "cpp", 68 | "mutex": "cpp", 69 | "regex": "cpp", 70 | "set": "cpp", 71 | "xthread": "cpp", 72 | "thread": "cpp", 73 | "queue": "cpp", 74 | "deque": "cpp", 75 | "bit": "cpp", 76 | "*.tcc": "cpp", 77 | "bitset": "cpp", 78 | "cctype": "cpp", 79 | "clocale": "cpp", 80 | "compare": "cpp", 81 | "concepts": "cpp", 82 | "cstdarg": "cpp", 83 | "cwctype": "cpp", 84 | "memory_resource": "cpp", 85 | "numeric": "cpp", 86 | "optional": "cpp", 87 | "random": "cpp", 88 | "fstream": "cpp", 89 | "ranges": "cpp", 90 | "sstream": "cpp", 91 | "stop_token": "cpp", 92 | "gzguts.h": "c", 93 | "io.h": "c", 94 | "inffast.h": "c", 95 | "stdlib.h": "c", 96 | "cinttypes": "cpp", 97 | "complex": "cpp", 98 | "xxatomic": "cpp", 99 | "charconv": "cpp", 100 | "format": "cpp", 101 | "forward_list": "cpp", 102 | "span": "cpp", 103 | "coroutine": "cpp", 104 | "any": "cpp", 105 | "cfenv": "cpp", 106 | "shared_mutex": "cpp", 107 | "source_location": "cpp", 108 | "strstream": "cpp", 109 | "typeindex": "cpp", 110 | "unordered_set": "cpp", 111 | "variant": "cpp", 112 | "__bit_reference": "cpp", 113 | "__bits": "cpp", 114 | "__config": "cpp", 115 | "__debug": "cpp", 116 | "__errc": "cpp", 117 | "__hash_table": "cpp", 118 | "__locale": "cpp", 119 | "__mutex_base": "cpp", 120 | "__node_handle": "cpp", 121 | "__split_buffer": "cpp", 122 | "__threading_support": "cpp", 123 | "__tree": "cpp", 124 | "__tuple": "cpp", 125 | "__verbose_abort": "cpp", 126 | "hash_map": "cpp", 127 | "stack": "cpp", 128 | "valarray": "cpp", 129 | "*.ipp": "cpp", 130 | "alignedvector3": "cpp", 131 | "core": "cpp", 132 | "*.m": "cpp", 133 | "*.mm": "cpp" 134 | }, 135 | "editor.insertSpaces": false, 136 | "cSpell.words": [ 137 | "minirad", 138 | "nyquist", 139 | "polyline", 140 | "polylines" 141 | ] 142 | } -------------------------------------------------------------------------------- /Source/OpenStorm/Objects/RadarVolumeRender.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | 6 | #include "../Radar/RadarCollection.h" 7 | #include "../Radar/RadarColorIndex.h" 8 | 9 | #include 10 | 11 | #include "CoreMinimal.h" 12 | #include "GameFramework/Actor.h" 13 | #include "Engine/StaticMesh.h" 14 | #include "Components/StaticMeshComponent.h" 15 | #include "UObject/Object.h" 16 | #include "Materials/Material.h" 17 | #include "Engine/Texture2D.h" 18 | //#include "Engine/TextureRenderTarget2D.h" 19 | //#include "Engine/CanvasRenderTarget2D.h" 20 | #include "RadarVolumeRender.generated.h" 21 | 22 | 23 | class UMaterialRenderTarget; 24 | class FRenderTarget; 25 | 26 | UCLASS() 27 | class OPENSTORM_API ARadarVolumeRender : public AActor 28 | { 29 | GENERATED_BODY() 30 | 31 | public: 32 | // Sets default values for this actor's properties 33 | ARadarVolumeRender(); 34 | ~ARadarVolumeRender(); 35 | 36 | UPROPERTY(VisibleAnywhere) 37 | UStaticMeshComponent* cubeMeshComponent; 38 | //UPROPERTY(VisibleAnywhere) 39 | UPROPERTY(VisibleAnywhere) 40 | UMaterialInstanceDynamic* radarMaterialInstance = NULL; 41 | UPROPERTY(VisibleAnywhere) 42 | UMaterialInstanceDynamic* interpolationMaterialInstance = NULL; 43 | UPROPERTY(VisibleAnywhere) 44 | UStaticMesh* cubeMesh = NULL; 45 | UPROPERTY(VisibleAnywhere) 46 | UMaterial* storedMaterial = NULL; 47 | UPROPERTY(EditAnywhere) 48 | UMaterial* storedInterpolationMaterial = NULL; 49 | 50 | // true if time interpolation is enabled. call InitializeTextures after changing 51 | bool doTimeInterpolation = false; 52 | 53 | // if interpolation is being animated 54 | bool interpolationAnimating = false; 55 | float interpolationStartValue = 0; 56 | float interpolationEndValue = 0; 57 | double interpolationStartTime = 0; 58 | double interpolationEndTime = 0; 59 | 60 | // index used for choosing noise. wraps at 64 61 | int frameIndex = 0; 62 | 63 | // write to volume 1 if true and write to volume 2 if false 64 | bool usePrimaryTexture = true; 65 | UPROPERTY(VisibleAnywhere) 66 | UTexture2D* volumeTexture = NULL; 67 | //FByteBulkData* volumeImageData; 68 | UPROPERTY(VisibleAnywhere) 69 | UTexture2D* volumeTexture2 = NULL; 70 | //FByteBulkData* volumeImageData2; 71 | UPROPERTY(VisibleAnywhere) 72 | UMaterialRenderTarget* volumeMaterialRenderTarget = NULL; 73 | 74 | FRenderTarget* volumeRenderTarget; 75 | UPROPERTY(VisibleAnywhere) 76 | UTexture2D* angleIndexTexture = NULL; 77 | //FByteBulkData* angleIndexImageData; 78 | UPROPERTY(VisibleAnywhere) 79 | UTexture2D* valueIndexTexture = NULL; 80 | //FByteBulkData* valueIndexImageData; 81 | static ARadarVolumeRender* instance; 82 | RadarCollection* radarCollection = NULL; 83 | RadarData* radarData; 84 | 85 | //GlobalState* globalState = NULL; 86 | std::vector callbackIds = {}; 87 | RadarColorIndex* radarColor = &RadarColorIndexReflectivity::defaultInstance; 88 | RadarColorIndex::Result radarColorResult = {}; 89 | RadarColorIndex::Result radarColorResultAlternate = {}; 90 | 91 | // load data from RadarUpdateEvent into shader 92 | void HandleRadarDataEvent(RadarCollection::RadarUpdateEvent event); 93 | 94 | void RandomizeTexture(); 95 | 96 | //Initialize all textures or reinitialize ones that need it 97 | void InitializeTextures(); 98 | 99 | 100 | 101 | protected: 102 | // Called when the game starts or when spawned 103 | virtual void BeginPlay() override; 104 | virtual void EndPlay(const EEndPlayReason::Type endPlayReason) override; 105 | 106 | public: 107 | // Called every frame 108 | virtual void Tick(float DeltaTime) override; 109 | 110 | }; 111 | -------------------------------------------------------------------------------- /Source/OpenStorm/Mapping/MapMesh.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../Radar/SimpleVector3.h" 4 | 5 | #include "CoreMinimal.h" 6 | #include "UObject/Object.h" 7 | #include "GameFramework/Actor.h" 8 | #include "MapMesh.generated.h" 9 | 10 | class UProceduralMeshComponent; 11 | class UMaterialInterface; 12 | class Globe; 13 | class AMapMeshManager; 14 | class UMaterialInstanceDynamic; 15 | class UTexture2D; 16 | class UTexture; 17 | class AsyncTaskRunner; 18 | 19 | UCLASS() 20 | class AMapMesh : public AActor{ 21 | GENERATED_BODY() 22 | 23 | public: 24 | // number of sections to divide each axis of the mesh into 25 | UPROPERTY(EditAnywhere) 26 | int divisions = 8; 27 | // id of the child for the parent 28 | UPROPERTY(EditAnywhere) 29 | int childId = -1; 30 | // what zoom layer this is a part of 31 | UPROPERTY(EditAnywhere) 32 | int layer = 0; 33 | // tile for given zoom layer 34 | UPROPERTY(EditAnywhere) 35 | int tileX = 0; 36 | // tile for given zoom layer 37 | UPROPERTY(EditAnywhere) 38 | int tileY = 0; 39 | // max layers of zoom 40 | UPROPERTY(EditAnywhere) 41 | int maxLayer = 15; 42 | // if this mesh is loaded 43 | UPROPERTY(EditAnywhere) 44 | bool loaded = true; 45 | // if this mesh has a texture loaded 46 | UPROPERTY(EditAnywhere) 47 | bool fullyLoaded = false; 48 | // location 49 | UPROPERTY(EditAnywhere) 50 | double latitudeRadians = 0; 51 | UPROPERTY(EditAnywhere) 52 | // location 53 | double longitudeRadians = 0; 54 | // height 55 | UPROPERTY(EditAnywhere) 56 | double latitudeHeightRadians = 1; 57 | // width 58 | UPROPERTY(EditAnywhere) 59 | double longitudeWidthRadians = 1; 60 | // when closer than this to the camera subdivide into next layer 61 | UPROPERTY(EditAnywhere) 62 | float subdivideDistance = 0; 63 | // center of the tile in game units 64 | SimpleVector3<> centerPosition = {}; 65 | // last rotation from UpdateRotation to pass to children 66 | SimpleVector3<> appliedRotation = {}; 67 | 68 | 69 | Globe* globe = NULL; 70 | 71 | UPROPERTY(EditAnywhere) 72 | UMaterialInterface* material; 73 | 74 | UPROPERTY(VisibleAnywhere) 75 | UMaterialInstanceDynamic* materialInstance = NULL; 76 | 77 | // texture generated asynchronously 78 | UPROPERTY(VisibleAnywhere) 79 | UTexture2D* texture = NULL; 80 | // is a new texture ready 81 | bool pendingTexture = false; 82 | 83 | UPROPERTY(EditAnywhere); 84 | UProceduralMeshComponent* proceduralMesh; 85 | 86 | UPROPERTY(EditAnywhere); 87 | AMapMeshManager* manager = NULL; 88 | 89 | AsyncTaskRunner* tileLoader = NULL; 90 | AsyncTaskRunner* textureLoader = NULL; 91 | 92 | UPROPERTY(EditAnywhere); 93 | AMapMesh* mapParent = NULL; 94 | 95 | UPROPERTY(EditAnywhere); 96 | AMapMesh* mapChildren[4] = {}; 97 | 98 | AMapMesh(); 99 | 100 | virtual void BeginPlay() override; 101 | virtual void EndPlay(const EEndPlayReason::Type endPlayReason) override; 102 | virtual void Tick(float DeltaTime) override; 103 | 104 | void GenerateMesh(); 105 | 106 | // attempt to load the tile texture 107 | void LoadTile(); 108 | 109 | // set the bounds of for the section 110 | void SetBounds(double latitudeRadians, double longitudeRadians, double latitudeHeightRadians, double longitudeWidthRadians); 111 | 112 | // duality of man 113 | void MakeChildren(); 114 | void DestroyChildren(); 115 | 116 | // update and check for changes, is run every tick 117 | void Update(); 118 | 119 | // pull updated data from AMapMeshManager 120 | void UpdateParameters(); 121 | 122 | // set center and rotation of globe 123 | void UpdatePosition(SimpleVector3<> position, SimpleVector3<> rotation); 124 | 125 | // propagate loaded texture 126 | void UpdateTexture(UTexture* texture, bool fromParent); 127 | 128 | void ProjectionOntoGlobeTest(); 129 | }; -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Products/RotationProduct.cpp: -------------------------------------------------------------------------------- 1 | #include "RotationProduct.h" 2 | #include 3 | 4 | RadarProductRotation::RadarProductRotation(){ 5 | volumeType = RadarData::VOLUME_ROTATION; 6 | productType = PRODUCT_DERIVED_VOLUME; 7 | name = "Rotation"; 8 | shortName = "ROT"; 9 | dependencies = {RadarData::VOLUME_VELOCITY_DEALIASED, RadarData::VOLUME_SPECTRUM_WIDTH}; 10 | // this currently does not work very well so it is hidden by default 11 | development = true; 12 | } 13 | 14 | 15 | RadarData* RadarProductRotation::deriveVolume(std::map inputProducts){ 16 | RadarData* radarData = new RadarData(); 17 | radarData->CopyFrom(inputProducts[RadarData::VOLUME_VELOCITY_DEALIASED]); 18 | std::fill(radarData->buffer, radarData->buffer + radarData->usedBufferSize, 0.0f); 19 | float maxValue = 0; 20 | RadarData* vol = radarData; 21 | RadarData* src = inputProducts[RadarData::VOLUME_VELOCITY_DEALIASED]; 22 | src->Decompress(); 23 | RadarData* srcSW = inputProducts[RadarData::VOLUME_SPECTRUM_WIDTH]; 24 | srcSW->Decompress(); 25 | // when the spectrum width is below this the outout will be decreased 26 | float spectrumWidthThreshold = 20; 27 | for(int sweep = 0; sweep < vol->sweepBufferCount; sweep++){ 28 | for(int theta = 0; theta < vol->thetaBufferCount; theta++){ 29 | RadarData::RayInfo* rayInfo = &vol->rayInfo[sweep * (vol->thetaBufferCount + 2) + theta + 1]; 30 | if(!rayInfo->interpolated){ 31 | int location = vol->thetaBufferSize * (theta + 1) + vol->sweepBufferSize * sweep; 32 | float* ray = vol->buffer + location; 33 | float* raySrc = src->buffer + location; 34 | float* raySrcSW = srcSW->buffer + location; 35 | float* raySrcPrev = raySrc + rayInfo->previousTheta * vol->thetaBufferSize; 36 | float* raySrcNext = raySrc + rayInfo->nextTheta * vol->thetaBufferSize; 37 | for(int radius = 2; radius < vol->radiusBufferCount - 1; radius++){ 38 | float minVal = 1000; 39 | float maxVal = -1000; 40 | float val = 0; 41 | // val = raySrcPrev[radius - 1]; 42 | // if(val != 0){ 43 | // minVal = std::min(minVal, val); 44 | // maxVal = std::max(maxVal, val); 45 | // } 46 | val = raySrcPrev[radius]; 47 | if(val != 0){ 48 | minVal = std::min(minVal, val); 49 | maxVal = std::max(maxVal, val); 50 | } 51 | // val = raySrcPrev[radius + 1]; 52 | // if(val != 0){ 53 | // minVal = std::min(minVal, val); 54 | // maxVal = std::max(maxVal, val); 55 | // } 56 | // val = raySrc[radius - 1]; 57 | // if(val != 0){ 58 | // minVal = std::min(minVal, val); 59 | // maxVal = std::max(maxVal, val); 60 | // } 61 | val = raySrc[radius]; 62 | if(val != 0){ 63 | minVal = std::min(minVal, val); 64 | maxVal = std::max(maxVal, val); 65 | } 66 | // val = raySrc[radius + 1]; 67 | // if(val != 0){ 68 | // minVal = std::min(minVal, val); 69 | // maxVal = std::max(maxVal, val); 70 | // } 71 | // val = raySrcNext[radius - 1]; 72 | // if(val != 0){ 73 | // minVal = std::min(minVal, val); 74 | // maxVal = std::max(maxVal, val); 75 | // } 76 | val = raySrcNext[radius]; 77 | if(val != 0){ 78 | minVal = std::min(minVal, val); 79 | maxVal = std::max(maxVal, val); 80 | } 81 | val = raySrcNext[radius + 1]; 82 | // if(val != 0){ 83 | // minVal = std::min(minVal, val); 84 | // maxVal = std::max(maxVal, val); 85 | // } 86 | val = std::max(maxVal - minVal, 0.0f) * std::min(raySrcSW[radius] , spectrumWidthThreshold) / spectrumWidthThreshold; 87 | ray[radius] = val; 88 | maxValue = std::max(maxValue, val); 89 | } 90 | } 91 | } 92 | } 93 | radarData->stats.minValue = 0; 94 | radarData->stats.maxValue = std::max(maxValue, 0.0001f); 95 | radarData->stats.volumeType = volumeType; 96 | radarData->Interpolate(); 97 | return radarData; 98 | } -------------------------------------------------------------------------------- /Source/OpenStorm/UI/Slate/SCompass.cpp: -------------------------------------------------------------------------------- 1 | #include "SCompass.h" 2 | 3 | #include "UObject/ConstructorHelpers.h" 4 | #include "Brushes/SlateImageBrush.h" 5 | #include "Rendering/SlateRenderTransform.h" 6 | #include "Misc/Paths.h" 7 | #include "SlateUIResources.h" 8 | 9 | #include 10 | 11 | #define PIF 3.14159265358979323846f 12 | #define PIF2 6.283185307179586f 13 | 14 | 15 | SCompass::SCompass() { 16 | //roseTexture = MakeShareable(ConstructorHelpers::FObjectFinder(TEXT("Texture2D'/Game/Textures/crosshair.crosshair'")).Object); 17 | } 18 | 19 | 20 | void SCompass::Construct(const FArguments& inArgs) { 21 | SAssignNew(northText, STextBlock); 22 | SAssignNew(southText, STextBlock); 23 | SAssignNew(eastText, STextBlock); 24 | SAssignNew(westText, STextBlock); 25 | //northSlot = AddSlot(); 26 | //northSlot.AttachWidget(northText.ToSharedRef()); 27 | 28 | AddSlot().Anchors(FAnchors(0.5f, 0.5f)).AutoSize(true)[northText.ToSharedRef()]; 29 | AddSlot().Anchors(FAnchors(0.5f, 0.5f)).AutoSize(true)[southText.ToSharedRef()]; 30 | AddSlot().Anchors(FAnchors(0.5f, 0.5f)).AutoSize(true)[eastText.ToSharedRef()]; 31 | AddSlot().Anchors(FAnchors(0.5f, 0.5f)).AutoSize(true)[westText.ToSharedRef()]; 32 | northText->SetText(FText::FromString(TEXT("N"))); 33 | southText->SetText(FText::FromString(TEXT("S"))); 34 | eastText->SetText(FText::FromString(TEXT("E"))); 35 | westText->SetText(FText::FromString(TEXT("W"))); 36 | 37 | FSlateFontInfo textStyle = FCoreStyle::Get().GetFontStyle("EmbossedText"); 38 | textStyle.Size = size / 6.6f; 39 | textStyle.OutlineSettings.OutlineSize = size / 50.0f; 40 | northText->SetFont(textStyle); 41 | southText->SetFont(textStyle); 42 | eastText->SetFont(textStyle); 43 | westText->SetFont(textStyle); 44 | 45 | 46 | SAssignNew(rose, SImage); 47 | 48 | //if (roseTexture.IsValid()) { 49 | // roseBrush.SetResourceObject(roseTexture.Get()); 50 | /// roseBrush.ImageSize.X = roseTexture->GetSurfaceWidth(); 51 | // roseBrush.ImageSize.Y = roseTexture->GetSurfaceHeight(); 52 | // roseBrush.DrawAs = ESlateBrushDrawType::Image; 53 | //} 54 | //FVector2D(512, 512) 55 | //static const FName roseTexture(TEXT("Texture2D'/Game/Textures/crosshair.crosshair'")); 56 | //FString imagePath = FPaths::Combine(FPaths::ProjectDir(), TEXT("Content/Textures/crosshair.png")); 57 | //roseBrush = FSlateImageBrush(imagePath, FVector2D(size * 0.8, size * 0.8)); 58 | //roseBrush = FSlateDynamicImageBrush(roseTexture, FVector2D(size * 0.8, size * 0.8)); 59 | roseBrush = FSlateImageBrush(USlateUIResources::Instance->crosshairTexture, FVector2D(size * 0.5, size * 0.5)); 60 | rose->SetImage(&roseBrush); 61 | rose->SetRenderOpacity(0.25); 62 | AddSlot().Anchors(FAnchors(0.5f, 0.5f)).AutoSize(true)[rose.ToSharedRef()]; 63 | 64 | Rotate(0); 65 | //SOverlay::ComputeDesiredSize 66 | //slot->SetPosition 67 | //slot.Position(FVector2D(size / 2.0f, size / 2.0f)); 68 | } 69 | 70 | FVector2D SCompass::ComputeDesiredSize(float layoutScaleMultiplier) const{ 71 | return FVector2D(size, size); 72 | } 73 | 74 | void SCompass::Rotate(float rotation) { 75 | FVector2D center = FVector2D(size / 2.0f, size / 2.0f); 76 | southText->SetRenderTransform(FVector2D(size * rotation, 0)); 77 | float radians = -(rotation + 0.5) * PIF2; 78 | float radius = size / 3.0; 79 | northText->SetRenderTransform(FVector2D(std::cos(radians) * radius, std::sin(radians) * radius)); 80 | eastText-> SetRenderTransform(FVector2D(std::cos(radians + PIF2 * 0.25f) * radius, std::sin(radians + PIF2 * 0.25f) * radius)); 81 | southText->SetRenderTransform(FVector2D(std::cos(radians + PIF2 * 0.50f) * radius, std::sin(radians + PIF2 * 0.50f) * radius)); 82 | westText-> SetRenderTransform(FVector2D(std::cos(radians + PIF2 * 0.75f) * radius, std::sin(radians + PIF2 * 0.75f) * radius)); 83 | rose->SetRenderTransformPivot(FVector2D(0.5,0.5)); 84 | FSlateRenderTransform roseTransform = FSlateRenderTransform(FQuat2D(radians)); 85 | rose->SetRenderTransform(roseTransform); 86 | } 87 | 88 | 89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /Source/OpenStorm/Radar/Deps/bzip2/randtable.cpp: -------------------------------------------------------------------------------- 1 | 2 | /*-------------------------------------------------------------*/ 3 | /*--- Table for randomising repetitive blocks ---*/ 4 | /*--- randtable.c ---*/ 5 | /*-------------------------------------------------------------*/ 6 | 7 | /* ------------------------------------------------------------------ 8 | This file is part of bzip2/libbzip2, a program and library for 9 | lossless, block-sorting data compression. 10 | 11 | bzip2/libbzip2 version 1.0.6 of 6 September 2010 12 | Copyright (C) 1996-2010 Julian Seward 13 | 14 | Please read the WARNING, DISCLAIMER and PATENTS sections in the 15 | README file. 16 | 17 | This program is released under the terms of the license contained 18 | in the file LICENSE. 19 | ------------------------------------------------------------------ */ 20 | 21 | 22 | #include "bzlib_private.h" 23 | 24 | 25 | /*---------------------------------------------*/ 26 | Int32 BZ2_rNums[512] = { 27 | 619, 720, 127, 481, 931, 816, 813, 233, 566, 247, 28 | 985, 724, 205, 454, 863, 491, 741, 242, 949, 214, 29 | 733, 859, 335, 708, 621, 574, 73, 654, 730, 472, 30 | 419, 436, 278, 496, 867, 210, 399, 680, 480, 51, 31 | 878, 465, 811, 169, 869, 675, 611, 697, 867, 561, 32 | 862, 687, 507, 283, 482, 129, 807, 591, 733, 623, 33 | 150, 238, 59, 379, 684, 877, 625, 169, 643, 105, 34 | 170, 607, 520, 932, 727, 476, 693, 425, 174, 647, 35 | 73, 122, 335, 530, 442, 853, 695, 249, 445, 515, 36 | 909, 545, 703, 919, 874, 474, 882, 500, 594, 612, 37 | 641, 801, 220, 162, 819, 984, 589, 513, 495, 799, 38 | 161, 604, 958, 533, 221, 400, 386, 867, 600, 782, 39 | 382, 596, 414, 171, 516, 375, 682, 485, 911, 276, 40 | 98, 553, 163, 354, 666, 933, 424, 341, 533, 870, 41 | 227, 730, 475, 186, 263, 647, 537, 686, 600, 224, 42 | 469, 68, 770, 919, 190, 373, 294, 822, 808, 206, 43 | 184, 943, 795, 384, 383, 461, 404, 758, 839, 887, 44 | 715, 67, 618, 276, 204, 918, 873, 777, 604, 560, 45 | 951, 160, 578, 722, 79, 804, 96, 409, 713, 940, 46 | 652, 934, 970, 447, 318, 353, 859, 672, 112, 785, 47 | 645, 863, 803, 350, 139, 93, 354, 99, 820, 908, 48 | 609, 772, 154, 274, 580, 184, 79, 626, 630, 742, 49 | 653, 282, 762, 623, 680, 81, 927, 626, 789, 125, 50 | 411, 521, 938, 300, 821, 78, 343, 175, 128, 250, 51 | 170, 774, 972, 275, 999, 639, 495, 78, 352, 126, 52 | 857, 956, 358, 619, 580, 124, 737, 594, 701, 612, 53 | 669, 112, 134, 694, 363, 992, 809, 743, 168, 974, 54 | 944, 375, 748, 52, 600, 747, 642, 182, 862, 81, 55 | 344, 805, 988, 739, 511, 655, 814, 334, 249, 515, 56 | 897, 955, 664, 981, 649, 113, 974, 459, 893, 228, 57 | 433, 837, 553, 268, 926, 240, 102, 654, 459, 51, 58 | 686, 754, 806, 760, 493, 403, 415, 394, 687, 700, 59 | 946, 670, 656, 610, 738, 392, 760, 799, 887, 653, 60 | 978, 321, 576, 617, 626, 502, 894, 679, 243, 440, 61 | 680, 879, 194, 572, 640, 724, 926, 56, 204, 700, 62 | 707, 151, 457, 449, 797, 195, 791, 558, 945, 679, 63 | 297, 59, 87, 824, 713, 663, 412, 693, 342, 606, 64 | 134, 108, 571, 364, 631, 212, 174, 643, 304, 329, 65 | 343, 97, 430, 751, 497, 314, 983, 374, 822, 928, 66 | 140, 206, 73, 263, 980, 736, 876, 478, 430, 305, 67 | 170, 514, 364, 692, 829, 82, 855, 953, 676, 246, 68 | 369, 970, 294, 750, 807, 827, 150, 790, 288, 923, 69 | 804, 378, 215, 828, 592, 281, 565, 555, 710, 82, 70 | 896, 831, 547, 261, 524, 462, 293, 465, 502, 56, 71 | 661, 821, 976, 991, 658, 869, 905, 758, 745, 193, 72 | 768, 550, 608, 933, 378, 286, 215, 979, 792, 961, 73 | 61, 688, 793, 644, 986, 403, 106, 366, 905, 644, 74 | 372, 567, 466, 434, 645, 210, 389, 550, 919, 135, 75 | 780, 773, 635, 389, 707, 100, 626, 958, 165, 504, 76 | 920, 176, 193, 713, 857, 265, 203, 50, 668, 108, 77 | 645, 990, 626, 197, 510, 357, 358, 850, 858, 364, 78 | 936, 638 79 | }; 80 | 81 | 82 | /*-------------------------------------------------------------*/ 83 | /*--- end randtable.c ---*/ 84 | /*-------------------------------------------------------------*/ 85 | --------------------------------------------------------------------------------