18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-14 09:06:58 +01:00
Files
maszyna/stdafx.h
jerrrrycho 22c588d8f9 feat(cab): 401Da oil pump lamp and slotted speedometer lever (eu07/maszyna#546) (#261)
* feat: 401da oil pump lamp and slotted lever animation (eu07/maszyna#546)

i-oilpump lights while the pre-lubrication oil pump works, so it goes
off once the engine runs. animslottedlever: in the .mmd turns a lever
by a pin on the coupling rod sliding in the lever's slot, which the
speedometer drive of 401Da needs.

The compressor start delay of #546 came with CompressorStartDelay
(Brake section) of master.

* fix: force GLM AVX2 only when the compiler targets AVX2

ENABLE_AVX2=OFF left GLM_FORCE_AVX2 defined, so MSVC still emitted
AVX2 intrinsics and the exe crashed on CPUs without AVX2.

* test: cover the compressor start delay and the oil pump lamp

The delay of an engine stopped before it passed starts over, a
compressor switched on by hand waits too, and the key is read from the
Brake section. In the converter-fed set-up of 401Da the compressor
waits for ConverterStartDelay and then its own delay. The oil pump
(i-oilpump lamp) works before the engine start and stops once the
engine runs.
2026-11-08 14:48:42 +01:00

135 lines
3.0 KiB
C++

// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#ifndef STDAFX_H
#define STDAFX_H
#ifdef __APPLE__
#ifndef __unix__
#define __unix__ 1
#endif
#endif
#define _USE_MATH_DEFINES
#define NOMINMAX
#include <cmath>
#ifdef _MSC_VER
// memory debug functions
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#endif
// operating system
#ifdef _WIN32
#include "targetver.h"
#define NOMINMAX
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <shlobj.h>
#undef NOMINMAX
#endif
#ifdef __unix__
#include <sys/stat.h>
#endif
// stl
#define _USE_MATH_DEFINES
#include <cmath>
#include <cstddef>
#include <cstdlib>
#include <cstdio>
#include <cassert>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <string>
#include <array>
#include <vector>
#include <deque>
#include <list>
#include <forward_list>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <tuple>
#include <cctype>
#include <locale>
#include <iterator>
#include <random>
#include <algorithm>
#include <functional>
#include <numeric>
#include <regex>
#include <limits>
#include <memory>
#include <thread>
#include <atomic>
#include <mutex>
#include <condition_variable>
#include <typeinfo>
#include <bitset>
#include <chrono>
#include <optional>
#include <filesystem>
#include <variant>
#include "glad/glad.h"
#define GLFW_INCLUDE_NONE
#include <GLFW/glfw3.h>
#ifndef GLFW_TRUE
#define GLFW_FALSE 0
#define GLFW_TRUE 1
#define glfwGetKeyName(a, b) ("")
#define glfwFocusWindow(w)
#endif
#if defined(__aarch64__) || defined(__arm64__)
#define GLM_FORCE_NEON
#elif defined(__AVX2__) // set by /arch:AVX2 or -mavx2 (ENABLE_AVX2); without it GLM falls back to SSE2
#define GLM_FORCE_AVX2
#endif
#define GLM_FORCE_SWIZZLE
#define GLM_ENABLE_EXPERIMENTAL
#define GLM_FORCE_CTOR_INIT
#ifdef _MSC_VER
#define GLM_FORCE_INLINE
#endif
#define GLM_FORCE_INTRINSICS
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtx/matrix_transform_2d.hpp>
#include <glm/gtc/matrix_access.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <glm/gtc/epsilon.hpp>
#include <glm/gtc/packing.hpp>
#include <glm/gtx/rotate_vector.hpp>
#include <glm/gtx/euler_angles.hpp>
#include <glm/gtx/norm.hpp>
#include <glm/gtx/string_cast.hpp>
#ifndef PACKED_VEC3_DEFINED
#define PACKED_VEC3_DEFINED
// 12-byte vec3 that stays packed regardless of GLM_FORCE_DEFAULT_ALIGNED_GENTYPES.
// Use in structs that must match an exact binary layout (UBOs, vertex data, serialized formats).
using packed_vec3 = glm::vec<3, float, glm::packed_highp>;
#endif
#include "rendering/openglmatrixstack.h"
#define STRINGIZE_DETAIL(x) #x
#define STRINGIZE(x) STRINGIZE_DETAIL(x)
#define glDebug(x) if (GLAD_GL_GREMEDY_string_marker) glStringMarkerGREMEDY(0, __FILE__ ":" STRINGIZE(__LINE__) ": " x);
#include "imgui/imgui.h"
#define ImVec2S(a, b) ImVec2(a * Global.ui_scale, b * Global.ui_scale)
#include "utilities/crashreporter.h"
#endif