Windows support

This commit is contained in:
Gabrieal Jimmy
2026-10-02 16:04:30 -05:00
parent 34fa21139f
commit d31689cf86
14 changed files with 242 additions and 57 deletions

View File

@@ -2,6 +2,8 @@
// Small client-wide helpers: asset paths, UI textures, color conversion.
#include "hd2d/GL.h"
#include "Paths.h"
#include "hd2d/Texture.h"
#include <imgui.h>
@@ -11,17 +13,18 @@
#include <cstdint>
#include <string>
#ifndef BS_ASSET_DIR
#define BS_ASSET_DIR "assets"
#endif
#ifndef HD2D_ENGINE_ASSET_DIR
#define HD2D_ENGINE_ASSET_DIR "../Vibe-HD-2D/assets"
#endif
namespace bs {
inline std::string gameAsset(const std::string& rel) { return std::string(BS_ASSET_DIR) + "/" + rel; }
inline std::string engineAsset(const std::string& rel) { return std::string(HD2D_ENGINE_ASSET_DIR) + "/" + rel; }
// Game assets: `<exe dir>/assets` in a release package, else the source checkout (see Paths.h).
inline std::string gameAsset(const std::string& rel) { return gameAssetDir() + "/" + rel; }
// Engine shaders, fonts, textures, models: `<exe dir>/engine` in a release package, else the
// engine checkout baked in by CMake.
const std::string& engineAssetDir();
inline std::string engineAsset(const std::string& rel) { return engineAssetDir() + "/" + rel; }
constexpr float kPixelsPerUnit = 32.0f; // world texel density shared by all pixel art
constexpr float kCreaturePixelsPerUnit = 40.0f; // creatures render a bit smaller than trainers