v0.3.0: display abstraction, map-browser menu, SAGE terrain tiling/blends
- ra3.client::display: shared interactive loops; SDL and Vulkan backends implement only the primitives (init/present/poll_event/window_size/ key_down/present_terrain). ra3.display picks the backend. - Menu: maps by localized name (gamestrings.csf), red/gold theme, hover highlight, mouse + keyboard, wheel scroll, fullscreen and FPS/vsync options, loading progress bar. - Terrain: continuous tile sampling via a texture array (REPEAT, uv = cell/(2*cellSize)) removes per-cell grid seams; SAGE blend ramp for material transitions; FPS label + top-right minimap overlays. - Skip the skirmish sim for map views; reuse the Vulkan texture; no idle terrain redraw.
This commit is contained in:
+12
-10
@@ -3,19 +3,21 @@ export module ra3.ui;
|
||||
import std;
|
||||
export import ra3.core;
|
||||
import ra3.render;
|
||||
import ra3.client;
|
||||
|
||||
/**
|
||||
* Fallback viewer used when the build has no SDL3. It never opens a window;
|
||||
* the caller should write an offscreen image instead.
|
||||
* Fallback SDL backend used when the build has no SDL3. It never opens a window;
|
||||
* `init` fails so the caller can fall back to an offscreen image.
|
||||
*/
|
||||
export namespace ra3::ui {
|
||||
/** Window parameters (mirrors the SDL backend). */
|
||||
struct viewer_options {
|
||||
std::string title = "OpenRA3";
|
||||
int width = 1024;
|
||||
int height = 768;
|
||||
class sdl_display final : public ra3::client::display {
|
||||
public:
|
||||
[[nodiscard]] auto init(const ra3::client::display_options &) -> bool override { return false; }
|
||||
[[nodiscard]] auto present(const ra3::render::image &, const ra3::render::view_rect &, bool) -> bool override { return false; }
|
||||
[[nodiscard]] auto poll_event(ra3::render::ui_event &) -> bool override { return false; }
|
||||
[[nodiscard]] auto window_size() const -> std::pair<int, int> override { return {0, 0}; }
|
||||
[[nodiscard]] auto key_down(ra3::render::ui_key) const -> bool override { return false; }
|
||||
auto shutdown() -> void override {}
|
||||
[[nodiscard]] auto name() const -> std::string_view override { return "sdl(null)"; }
|
||||
};
|
||||
|
||||
/** Always returns false: this build has no windowing backend. */
|
||||
[[nodiscard]] inline auto run_viewer(const ra3::render::image &, const viewer_options &) -> bool { return false; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user