2024-02-24 22:47:20 -05:00
|
|
|
# pragma once
|
2026-01-30 23:09:07 -05:00
|
|
|
|
|
|
|
|
// =============================================================================
|
|
|
|
|
// Platform Selection
|
|
|
|
|
// =============================================================================
|
|
|
|
|
// Define MCRF_HEADLESS to build without SFML graphics/audio dependencies.
|
|
|
|
|
// This enables headless operation for servers, CI, and Emscripten builds.
|
|
|
|
|
//
|
|
|
|
|
// Build with: cmake -DMCRF_HEADLESS=ON ..
|
|
|
|
|
// =============================================================================
|
|
|
|
|
|
|
|
|
|
#ifdef MCRF_HEADLESS
|
|
|
|
|
// Use headless type stubs instead of SFML
|
|
|
|
|
#include "platform/HeadlessTypes.h"
|
|
|
|
|
#define MCRF_GRAPHICS_BACKEND "headless"
|
|
|
|
|
#else
|
|
|
|
|
// Use SFML for graphics and audio
|
|
|
|
|
#include <SFML/Graphics.hpp>
|
|
|
|
|
#include <SFML/Audio.hpp>
|
|
|
|
|
#define MCRF_GRAPHICS_BACKEND "sfml"
|
|
|
|
|
#endif
|
2024-02-24 22:47:20 -05:00
|
|
|
|
2026-01-11 20:26:04 -05:00
|
|
|
// Maximum dimension for grids, layers, and heightmaps (8192x8192 = 256MB of float data)
|
|
|
|
|
// Prevents integer overflow in size calculations and limits memory allocation
|
|
|
|
|
constexpr int GRID_MAX = 8192;
|
|
|
|
|
|
2024-02-24 22:47:20 -05:00
|
|
|
#include <vector>
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <memory>
|
|
|
|
|
#include <fstream>
|
|
|
|
|
#include <sstream>
|
|
|
|
|
#include <algorithm>
|
|
|
|
|
|
|
|
|
|
// wstring<->string conversion
|
|
|
|
|
#include <locale>
|
|
|
|
|
#include <codecvt>
|
|
|
|
|
#include <filesystem>
|
|
|
|
|
|