xp12camera
Owner: IIIlllIIIllI URL: git@github.com:nyangkosense/xp12camera.git
license
Commit 253bb4dc0bdc4417b3d38d94e25a504bc6795035 by SM <seb.michalk@gmail.com> on 2025-06-30 20:29:30 +0200
diff --git a/FLIR_Camera.cpp b/FLIR_Camera.cpp
index 7881bf6..6c8c180 100644
--- a/FLIR_Camera.cpp
+++ b/FLIR_Camera.cpp
@@ -1,6 +1,28 @@
/*
* X-Plane 12 FLIR camera simulation plugin with realistic belly-mounted camera positioning,
* optical zoom, pan/tilt controls, military-style targeting reticles, and thermal overlay effects
+ *
+ * MIT License
+ *
+ * Copyright (c) 2025 sebastian <sebastian@eingabeausgabe.io>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*/
#include <string.h>
@@ -377,4 +399,4 @@ static void DrawRealisticThermalOverlay(void)
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
-}
\ No newline at end of file
+}
diff --git a/FLIR_HUD.lua b/FLIR_HUD.lua
index 4527f6a..4804f7d 100644
--- a/FLIR_HUD.lua
+++ b/FLIR_HUD.lua
@@ -1,4 +1,26 @@
-- FLIR Camera HUD Display Script for FlyWithLua with realistic military HUD that auto-toggles based on camera view
+--
+-- MIT License
+--
+-- Copyright (c) 2025 sebastian <sebastian@eingabeausgabe.io>
+--
+-- Permission is hereby granted, free of charge, to any person obtaining a copy
+-- of this software and associated documentation files (the "Software"), to deal
+-- in the Software without restriction, including without limitation the rights
+-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+-- copies of the Software, and to permit persons to whom the Software is
+-- furnished to do so, subject to the following conditions:
+--
+-- The above copyright notice and this permission notice shall be included in all
+-- copies or substantial portions of the Software.
+--
+-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+-- SOFTWARE.
flir_start_time = flir_start_time or os.time()
flir_hud_enabled = flir_hud_enabled or true
@@ -80,4 +102,4 @@ end
do_on_keystroke("flir_hud_key_handler()")
-logMsg("FLIR HUD Script Loaded - Press F9 to toggle")
\ No newline at end of file
+logMsg("FLIR HUD Script Loaded - Press F9 to toggle")
diff --git a/FLIR_SimpleLock.cpp b/FLIR_SimpleLock.cpp
index 3fc8e9d..26e8062 100644
--- a/FLIR_SimpleLock.cpp
+++ b/FLIR_SimpleLock.cpp
@@ -1,5 +1,27 @@
/*
* Simple camera lock system that freezes FLIR camera movement when locked on target
+ *
+ * MIT License
+ *
+ * Copyright (c) 2025 sebastian <sebastian@eingabeausgabe.io>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*/
#include <string.h>
@@ -61,4 +83,4 @@ void GetSimpleLockStatus(char* statusBuffer, int bufferSize)
snprintf(statusBuffer, bufferSize, "LOCK: ON %.1f°/%.1f°", gLockedPan, gLockedTilt);
statusBuffer[bufferSize - 1] = '\0';
-}
\ No newline at end of file
+}
diff --git a/FLIR_SimpleLock.h b/FLIR_SimpleLock.h
index 1294ad2..f3733b7 100644
--- a/FLIR_SimpleLock.h
+++ b/FLIR_SimpleLock.h
@@ -1,7 +1,27 @@
/*
- * FLIR_SimpleLock.h
- *
* Simple camera lock system for FLIR targeting
+ *
+ * MIT License
+ *
+ * Copyright (c) 2025 sebastian <sebastian@eingabeausgabe.io>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*/
#ifndef FLIR_SIMPLELOCK_H
@@ -22,4 +42,4 @@ void GetSimpleLockStatus(char* statusBuffer, int bufferSize);
}
#endif
-#endif // FLIR_SIMPLELOCK_H
\ No newline at end of file
+#endif // FLIR_SIMPLELOCK_H
diff --git a/FLIR_VisualEffects.cpp b/FLIR_VisualEffects.cpp
index d0ea08d..9c98aac 100644
--- a/FLIR_VisualEffects.cpp
+++ b/FLIR_VisualEffects.cpp
@@ -1,5 +1,27 @@
/*
* Visual effects system implementing monochrome filters, thermal effects, and military camera aesthetics for realistic FLIR simulation
+ *
+ * MIT License
+ *
+ * Copyright (c) 2025 sebastian <sebastian@eingabeausgabe.io>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*/
#include <string.h>
@@ -304,4 +326,4 @@ void GetVisualEffectsStatus(char* statusBuffer, int bufferSize)
snprintf(statusBuffer, bufferSize, "VFX: %s", mode);
statusBuffer[bufferSize - 1] = '\0';
-}
\ No newline at end of file
+}
diff --git a/FLIR_VisualEffects.h b/FLIR_VisualEffects.h
index 2520947..5aa8f7e 100644
--- a/FLIR_VisualEffects.h
+++ b/FLIR_VisualEffects.h
@@ -1,5 +1,27 @@
/*
* Header file for military camera visual effects system
+ *
+ * MIT License
+ *
+ * Copyright (c) 2025 sebastian <sebastian@eingabeausgabe.io>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
*/
#ifndef FLIR_VISUALEFFECTS_H
@@ -28,4 +50,4 @@ void GetVisualEffectsStatus(char* statusBuffer, int bufferSize);
}
#endif
-#endif // FLIR_VISUALEFFECTS_H
\ No newline at end of file
+#endif // FLIR_VISUALEFFECTS_H
diff --git a/Makefile b/Makefile
index ca9626f..152f468 100644
--- a/Makefile
+++ b/Makefile
@@ -5,52 +5,41 @@
CC = x86_64-w64-mingw32-gcc
CXX = x86_64-w64-mingw32-g++
-# Plugin name and output
PLUGIN_NAME = FLIR_Camera
OUTPUT_DIR = build
PLUGIN_DIR = $(OUTPUT_DIR)/$(PLUGIN_NAME)
PLUGIN_FILE = $(PLUGIN_DIR)/win_x64/$(PLUGIN_NAME).xpl
-# SDK paths
SDK_DIR = SDK
INCLUDE_DIRS = -I$(SDK_DIR)/CHeaders/XPLM -I$(SDK_DIR)/CHeaders/Widgets
LIB_DIR = $(SDK_DIR)/Libraries/Win
LIBS = -L$(LIB_DIR) -lXPLM_64 -lXPWidgets_64
-# Compiler flags
CXXFLAGS = -std=c++11 -Wall -O2 -fPIC -DXPLM200=1 -DXPLM210=1 -DXPLM300=1 -DXPLM301=1 -DXPLM302=1 -DXPLM400=1
CXXFLAGS += $(INCLUDE_DIRS)
CXXFLAGS += -DIBM=1 -DWIN32=1 -D_WIN32=1
-# Linker flags for Windows DLL
LDFLAGS = -shared -static-libgcc -static-libstdc++
LDFLAGS += -Wl,--kill-at -Wl,--no-undefined
LDFLAGS += $(LIBS)
LDFLAGS += -lopengl32 -lgdi32
-# Source files
SOURCES = FLIR_Camera.cpp FLIR_SimpleLock.cpp FLIR_VisualEffects.cpp
-# Object files
OBJECTS = $(SOURCES:.cpp=.o)
-# Default target
all: directories $(PLUGIN_FILE)
-
# Create necessary directories
directories:
@mkdir -p $(PLUGIN_DIR)/win_x64
-# Build the plugin
$(PLUGIN_FILE): $(OBJECTS)
$(CXX) $(OBJECTS) $(LDFLAGS) -o $@
@echo "Plugin built successfully: $@"
-# Compile source files
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
-# Clean build files
clean:
rm -f $(OBJECTS)
rm -rf $(OUTPUT_DIR)
@@ -64,4 +53,4 @@ test-compile:
$(CXX) $(CXXFLAGS) -c $(SOURCES)
@echo "Compilation test successful"
-.PHONY: all clean install directories test-compile
\ No newline at end of file
+.PHONY: all clean install directories test-compile
diff --git a/README b/README
new file mode 100644
index 0000000..5c5ebaf
--- /dev/null
+++ b/README
@@ -0,0 +1,52 @@
+FLIR Camera Plugin for X-Plane 12
+===================================
+
+Realistic military-style FLIR camera simulation with belly-mounted positioning,
+optical zoom, thermal overlay effects, and targeting systems.
+
+Features
+--------
+- Belly-mounted camera positioning under aircraft
+- True optical zoom (1x-64x range)
+- Pan/tilt controls via mouse or keyboard
+- Target lock system with visual feedback
+- Multiple visual modes: standard, monochrome, thermal, IR
+- Military-style HUD overlay with telemetry
+- Camera noise and scan line effects
+- Real-time flight data display
+
+Controls
+--------
+F9 - Toggle FLIR camera on/off
++/- - Zoom in/out
+Arrows - Pan/tilt camera
+Space - Lock/unlock target
+T - Cycle visual modes
+Mouse - Pan/tilt when unlocked
+
+Files
+-----
+FLIR_Camera.cpp - Main plugin and camera control
+FLIR_SimpleLock.cpp - Target lock system
+FLIR_VisualEffects.cpp - Visual effects and filters
+FLIR_HUD.lua - HUD overlay (requires FlyWithLua)
+
+Build
+-----
+make
+
+Requirements
+------------
+- X-Plane 12
+- FlyWithLua plugin (for HUD)
+- OpenGL support
+
+Installation
+------------
+1. Build plugin with make
+2. Copy .xpl to X-Plane/Resources/plugins/
+3. Install FLIR_HUD.lua in FlyWithLua scripts folder
+
+License
+-------
+See license terms in source files.