Add XDG Games desktop shortcut, hicolor icons, and installable asset lookup

This commit is contained in:
Luxferre committed 2026-12-01 09:51:29 +02:00
1 parent 554958db9a
commit d001f214aa
12 files changed
+445 -35

No files matched your search

+79 -6
View File
@@ -7,18 +7,23 @@ CXX = c++
AR = ar AR = ar
ARFLAGS = rcs ARFLAGS = rcs
RM = rm -f RM = rm -f
INSTALL = install INSTALL = install
PREFIX = /usr/local PREFIX = /usr/local
BINDIR = $(PREFIX)/bin BINDIR = $(PREFIX)/bin
DESTDIR = DATADIR = $(PREFIX)/share
DATA_DIR = ./data PKGDATADIR = $(DATADIR)/$(TARGET)
APPLICATIONSDIR = $(DATADIR)/applications
ICONDIR = $(DATADIR)/icons/hicolor
DESTDIR =
DATA_DIR = ./data
STDFLAGS = -std=c++20 -Isrc STDFLAGS = -std=c++20 -Isrc
WARNFLAGS = -Wall -Wextra -Wpedantic -Wno-missing-field-initializers WARNFLAGS = -Wall -Wextra -Wpedantic -Wno-missing-field-initializers
RELEASE_FLAGS = -O2 -DNDEBUG RELEASE_FLAGS = -O2 -DNDEBUG
DEBUG_FLAGS = -g -O0 DEBUG_FLAGS = -g -O0
OPTFLAGS = $(RELEASE_FLAGS) OPTFLAGS = $(RELEASE_FLAGS)
CXXFLAGS = $(STDFLAGS) $(WARNFLAGS) $(OPTFLAGS) INSTALL_DEFS = -DHIOCTANE_INSTALL_DATA_DIR=\"$(PKGDATADIR)/data\"
CXXFLAGS = $(STDFLAGS) $(WARNFLAGS) $(OPTFLAGS) $(INSTALL_DEFS)
LDFLAGS = LDFLAGS =
TEST_DEFS = -DHIOCTANE_DEFAULT_DATA_DIR=\"$(DATA_DIR)\" TEST_DEFS = -DHIOCTANE_DEFAULT_DATA_DIR=\"$(DATA_DIR)\"
@@ -170,9 +175,77 @@ smoke: release
install: release install: release
$(INSTALL) -d "$(DESTDIR)$(BINDIR)" $(INSTALL) -d "$(DESTDIR)$(BINDIR)"
$(INSTALL) -m 755 $(TARGET) "$(DESTDIR)$(BINDIR)/$(TARGET)" $(INSTALL) -m 755 $(TARGET) "$(DESTDIR)$(BINDIR)/$(TARGET)"
@if [ -d "$(DATA_DIR)" ]; then \
$(INSTALL) -d "$(DESTDIR)$(PKGDATADIR)/data" && \
dest_data=$$(cd "$(DESTDIR)$(PKGDATADIR)/data" && pwd) && \
( \
set -e; \
cd "$(DATA_DIR)"; \
find . -type d | LC_ALL=C sort | while IFS= read -r d; do \
rel="$${d#./}"; \
[ "$$rel" = "." ] && continue; \
$(INSTALL) -d "$$dest_data/$$rel"; \
done; \
find . -type f | LC_ALL=C sort | while IFS= read -r f; do \
rel="$${f#./}"; \
$(INSTALL) -m 644 "$$f" "$$dest_data/$$rel"; \
done; \
); \
fi
$(INSTALL) -d "$(DESTDIR)$(APPLICATIONSDIR)"
@bin_path="$(BINDIR)/$(TARGET)"; \
esc_bin=$$(printf '%s\n' "$$bin_path" | sed 's/[&|\\]/\\&/g'); \
case "$$bin_path" in \
*" "*|*" "*) exec_val="\"$$esc_bin\"" ;; \
*) exec_val="$$esc_bin" ;; \
esac; \
tmp_desktop=$$(mktemp "$${TMPDIR:-/tmp}/$(TARGET).desktop.XXXXXX"); \
rc=0; \
sed -e "s|^Exec=.*|Exec=$$exec_val|" -e "s|^TryExec=.*|TryExec=$$esc_bin|" \
"xdg/$(TARGET).desktop" > "$$tmp_desktop" && \
$(INSTALL) -m 644 "$$tmp_desktop" "$(DESTDIR)$(APPLICATIONSDIR)/$(TARGET).desktop" || rc=$$?; \
rm -f "$$tmp_desktop"; \
exit $$rc
$(INSTALL) -d "$(DESTDIR)$(ICONDIR)/scalable/apps"
$(INSTALL) -m 644 "xdg/icons/scalable/$(TARGET).svg" "$(DESTDIR)$(ICONDIR)/scalable/apps/$(TARGET).svg"
@set -e; for sz in 48x48 64x64 128x128 256x256; do \
$(INSTALL) -d "$(DESTDIR)$(ICONDIR)/$$sz/apps"; \
$(INSTALL) -m 644 "xdg/icons/$$sz/$(TARGET).png" "$(DESTDIR)$(ICONDIR)/$$sz/apps/$(TARGET).png"; \
done
@if [ -z "$(DESTDIR)" ]; then \
if command -v update-desktop-database >/dev/null 2>&1; then \
update-desktop-database "$(APPLICATIONSDIR)" >/dev/null 2>&1 || true; \
fi; \
if command -v gtk-update-icon-cache >/dev/null 2>&1; then \
gtk-update-icon-cache -f -t "$(ICONDIR)" >/dev/null 2>&1 || true; \
fi; \
fi
uninstall: uninstall:
$(RM) "$(DESTDIR)$(BINDIR)/$(TARGET)" $(RM) "$(DESTDIR)$(BINDIR)/$(TARGET)"
$(RM) "$(DESTDIR)$(APPLICATIONSDIR)/$(TARGET).desktop"
$(RM) "$(DESTDIR)$(ICONDIR)/scalable/apps/$(TARGET).svg"
@for sz in 48x48 64x64 128x128 256x256; do \
$(RM) "$(DESTDIR)$(ICONDIR)/$$sz/apps/$(TARGET).png"; \
done
rm -rf "$(DESTDIR)$(PKGDATADIR)/data"
@rmdir "$(DESTDIR)$(PKGDATADIR)" 2>/dev/null || true
@if [ -z "$(DESTDIR)" ]; then \
if command -v update-desktop-database >/dev/null 2>&1; then \
update-desktop-database "$(APPLICATIONSDIR)" >/dev/null 2>&1 || true; \
fi; \
if command -v gtk-update-icon-cache >/dev/null 2>&1; then \
gtk-update-icon-cache -f -t "$(ICONDIR)" >/dev/null 2>&1 || true; \
fi; \
fi
install-user: release
@xdg_data="$${XDG_DATA_HOME:-$$HOME/.local/share}"; \
$(MAKE) DESTDIR="$(DESTDIR)" PREFIX="$$HOME/.local" DATADIR="$$xdg_data" install
uninstall-user:
@xdg_data="$${XDG_DATA_HOME:-$$HOME/.local/share}"; \
$(MAKE) DESTDIR="$(DESTDIR)" PREFIX="$$HOME/.local" DATADIR="$$xdg_data" uninstall
clean: clean:
$(RM) $(ALL_OBJS) $(ALL_LIBS) $(TARGET) $(TEST_BINS) .buildmode $(RM) $(ALL_OBJS) $(ALL_LIBS) $(TARGET) $(TEST_BINS) .buildmode
+4 -3
View File
@@ -13,7 +13,7 @@ A modern, cross-platform **SDL2 + OpenGL 3.3 Core** C++20 source port of Bullfro
- POSIX `make` - POSIX `make`
- `SDL2` development libraries & headers (`pkg-config` or `sdl2-config`) - `SDL2` development libraries & headers (`pkg-config` or `sdl2-config`)
- OpenGL 3.3+ drivers / system headers - OpenGL 3.3+ drivers / system headers
- Essential game assets in `./data` (default lookup; can also be overridden via `--data-dir` or `HIOCTANE_DATA`, with `./HiOctane` supported as a legacy fallback). Optional `DATA/INTRO.DAT` is excluded by default so the game boots cleanly to the title screen. - Essential game assets in `./data` (default lookup; also searches relocatable `../share/top-octane/data` and XDG `XDG_DATA_HOME`/`XDG_DATA_DIRS` directories when installed, or can be overridden via `--data-dir` or `HIOCTANE_DATA`, with `./HiOctane` supported as a legacy fallback). Optional `DATA/INTRO.DAT` is excluded by default so the game boots cleanly to the title screen.
## Building & running ## Building & running
@@ -27,7 +27,8 @@ make smoke # runs `./top-octane --smoke-test 30`
Other make targets: Other make targets:
- `make debug`: builds `./top-octane` with `-g -O0` (automatically cleans stale release objects). - `make debug`: builds `./top-octane` with `-g -O0` (automatically cleans stale release objects).
- `make install` / `make uninstall`: installs/removes `top-octane` in `$(DESTDIR)$(PREFIX)/bin` (default `PREFIX=/usr/local`). - `make install` / `make uninstall`: installs/removes `top-octane`, game assets (`$(PREFIX)/share/top-octane/data`), XDG desktop shortcut (`$(PREFIX)/share/applications/top-octane.desktop`, **Games** menu group), and hicolor icons (`scalable`, `48x48`–`256x256`) into `$(DESTDIR)$(PREFIX)` (default `PREFIX=/usr/local`).
- `make install-user` / `make uninstall-user`: installs/removes per-user (rootless) into `~/.local/bin` and `${XDG_DATA_HOME:-~/.local/share}` (adds **Top-Octane** to the desktop **Games** menu for the current user).
- `make clean`: removes built objects, libraries, binaries, and `.buildmode`. - `make clean`: removes built objects, libraries, binaries, and `.buildmode`.
### Windows (MSYS2 / MinGW) ### Windows (MSYS2 / MinGW)
@@ -38,7 +39,7 @@ make test
``` ```
## CLI options ## CLI options
- `--data-dir <path>`: Path to the read-only assets directory (default: `./data`; also reads `HIOCTANE_DATA` env var). - `--data-dir <path>`: Path to the read-only assets directory (default: `./data` or installed/XDG data dirs; also reads `HIOCTANE_DATA` env var).
- `--track <1..6>`: Jump directly into a race on track 1–6. - `--track <1..6>`: Jump directly into a race on track 1–6.
- `--track-viewer <1..6>`: Open interactive 3D track inspection camera. - `--track-viewer <1..6>`: Open interactive 3D track inspection camera.
- `--classic`: Launch in 4:3 classic palette visual mode. - `--classic`: Launch in 4:3 classic palette visual mode.
+101 -25
View File
@@ -38,6 +38,20 @@ std::vector<std::string> split_rel_path(const std::string& rel) {
return parts; return parts;
} }
std::filesystem::path strip_trailing_sep(std::filesystem::path p) {
while (p.has_relative_path() && p.filename().empty()) {
p = p.parent_path();
}
return p;
}
void append_unique(std::vector<std::filesystem::path>& out, const std::filesystem::path& p) {
if (p.empty()) return;
if (std::find(out.begin(), out.end(), p) == out.end()) {
out.push_back(p);
}
}
bool is_valid_hioctane_dir(const std::filesystem::path& p) { bool is_valid_hioctane_dir(const std::filesystem::path& p) {
std::error_code ec; std::error_code ec;
if (!std::filesystem::is_directory(p, ec)) { if (!std::filesystem::is_directory(p, ec)) {
@@ -58,18 +72,100 @@ bool is_valid_hioctane_dir(const std::filesystem::path& p) {
} // namespace } // namespace
bool Vfs::init(const std::string& explicit_data_dir) { std::vector<std::filesystem::path> Vfs::build_search_paths(
const std::string& explicit_data_dir,
const std::filesystem::path& cwd,
const std::filesystem::path& base_dir,
const std::filesystem::path& pref_dir) {
std::vector<std::filesystem::path> candidates; std::vector<std::filesystem::path> candidates;
if (!explicit_data_dir.empty()) { if (!explicit_data_dir.empty()) {
candidates.emplace_back(explicit_data_dir); append_unique(candidates, std::filesystem::path(explicit_data_dir));
} }
if (const char* env_dir = std::getenv("HIOCTANE_DATA")) { if (const char* env_dir = std::getenv("HIOCTANE_DATA")) {
if (*env_dir) { if (*env_dir) {
candidates.emplace_back(env_dir); append_unique(candidates, std::filesystem::path(env_dir));
} }
} }
const std::filesystem::path clean_cwd = strip_trailing_sep(cwd);
const std::filesystem::path clean_base = strip_trailing_sep(base_dir);
auto add_folder_candidates = [&](const char* folder_name) {
if (!clean_cwd.empty()) {
append_unique(candidates, clean_cwd / folder_name);
if (clean_cwd.has_parent_path() && clean_cwd.parent_path() != clean_cwd) {
append_unique(candidates, clean_cwd.parent_path() / folder_name);
}
}
if (!clean_base.empty()) {
append_unique(candidates, clean_base / folder_name);
if (clean_base.has_parent_path() && clean_base.parent_path() != clean_base) {
append_unique(candidates, clean_base.parent_path() / folder_name);
}
}
};
add_folder_candidates("data");
add_folder_candidates("HiOctane");
// Relocatable installed prefix paths (<prefix>/bin/top-octane -> <prefix>/share[/games]/top-octane[/data])
if (!clean_base.empty() && clean_base.has_parent_path() && clean_base.parent_path() != clean_base) {
const std::filesystem::path prefix = clean_base.parent_path();
append_unique(candidates, prefix / "share" / "top-octane" / "data");
append_unique(candidates, prefix / "share" / "top-octane");
append_unique(candidates, prefix / "share" / "games" / "top-octane" / "data");
append_unique(candidates, prefix / "share" / "games" / "top-octane");
}
#ifndef _WIN32
// XDG Base Directory Specification asset lookup (XDG_DATA_HOME, then XDG_DATA_DIRS)
std::filesystem::path xdg_data_home;
if (const char* xdh = std::getenv("XDG_DATA_HOME"); xdh && xdh[0] == '/') {
xdg_data_home = strip_trailing_sep(std::filesystem::path(xdh));
} else if (const char* home = std::getenv("HOME"); home && *home) {
xdg_data_home = strip_trailing_sep(std::filesystem::path(home)) / ".local" / "share";
}
if (!xdg_data_home.empty()) {
append_unique(candidates, xdg_data_home / "top-octane" / "data");
append_unique(candidates, xdg_data_home / "top-octane");
}
const char* xdd_env = std::getenv("XDG_DATA_DIRS");
const std::string xdd = (xdd_env && *xdd_env) ? std::string(xdd_env) : std::string("/usr/local/share:/usr/share");
std::stringstream ss(xdd);
std::string entry;
while (std::getline(ss, entry, ':')) {
if (entry.empty() || entry[0] != '/') continue;
const std::filesystem::path base = strip_trailing_sep(std::filesystem::path(entry));
append_unique(candidates, base / "top-octane" / "data");
append_unique(candidates, base / "top-octane");
append_unique(candidates, base / "games" / "top-octane" / "data");
append_unique(candidates, base / "games" / "top-octane");
}
#endif
#ifdef HIOCTANE_INSTALL_DATA_DIR
if (HIOCTANE_INSTALL_DATA_DIR[0] != '\0') {
append_unique(candidates, std::filesystem::path(HIOCTANE_INSTALL_DATA_DIR));
}
#endif
if (!pref_dir.empty()) {
append_unique(candidates, strip_trailing_sep(pref_dir) / "data");
}
return candidates;
}
bool Vfs::init(const std::string& explicit_data_dir) {
std::error_code ec; std::error_code ec;
if (char* pref = SDL_GetPrefPath("top-octane", "TopOctane")) {
pref_dir_ = pref;
SDL_free(pref);
} else {
pref_dir_ = std::filesystem::current_path(ec) / "save";
}
std::filesystem::create_directories(pref_dir_, ec);
std::filesystem::path cwd = std::filesystem::current_path(ec); std::filesystem::path cwd = std::filesystem::current_path(ec);
std::filesystem::path base_dir; std::filesystem::path base_dir;
if (char* base_p = SDL_GetBasePath()) { if (char* base_p = SDL_GetBasePath()) {
@@ -77,19 +173,7 @@ bool Vfs::init(const std::string& explicit_data_dir) {
SDL_free(base_p); SDL_free(base_p);
} }
auto add_folder_candidates = [&](const char* folder_name) { const auto candidates = build_search_paths(explicit_data_dir, cwd, base_dir, pref_dir_);
if (!cwd.empty()) {
candidates.emplace_back(cwd / folder_name);
candidates.emplace_back(cwd.parent_path() / folder_name);
}
if (!base_dir.empty()) {
candidates.emplace_back(base_dir / folder_name);
candidates.emplace_back(base_dir.parent_path() / folder_name);
}
};
add_folder_candidates("data");
add_folder_candidates("HiOctane");
data_root_.clear(); data_root_.clear();
for (const auto& c : candidates) { for (const auto& c : candidates) {
if (is_valid_hioctane_dir(c)) { if (is_valid_hioctane_dir(c)) {
@@ -99,16 +183,8 @@ bool Vfs::init(const std::string& explicit_data_dir) {
} }
} }
if (char* pref = SDL_GetPrefPath("top-octane", "TopOctane")) {
pref_dir_ = pref;
SDL_free(pref);
} else {
pref_dir_ = std::filesystem::current_path() / "save";
}
std::filesystem::create_directories(pref_dir_, ec);
if (data_root_.empty()) { if (data_root_.empty()) {
LOG_ERROR("Could not locate Top-Octane asset directory (expected ./data or --data-dir)"); LOG_ERROR("Could not locate Top-Octane asset directory (checked --data-dir, HIOCTANE_DATA, ./data, and XDG data dirs)");
return false; return false;
} }
LOG_INFO("Using read-only asset directory: %s", data_root_.string().c_str()); LOG_INFO("Using read-only asset directory: %s", data_root_.string().c_str());
+8 -1
View File
@@ -9,9 +9,16 @@ namespace top_octane {
class Vfs { class Vfs {
public: public:
// Initializes read-only asset lookup from explicit path, HIOCTANE_DATA env, ./data (default), or ./HiOctane fallback // Initializes read-only asset lookup from explicit path, HIOCTANE_DATA env, ./data, ./HiOctane, or installed/XDG data dirs
bool init(const std::string& explicit_data_dir = ""); bool init(const std::string& explicit_data_dir = "");
// Builds prioritized candidate directories to search for Hi-Octane assets (GAME DATA + MAPS).
static std::vector<std::filesystem::path> build_search_paths(
const std::string& explicit_data_dir,
const std::filesystem::path& cwd,
const std::filesystem::path& base_dir,
const std::filesystem::path& pref_dir);
const std::filesystem::path& data_root() const { return data_root_; } const std::filesystem::path& data_root() const { return data_root_; }
const std::filesystem::path& pref_dir() const { return pref_dir_; } const std::filesystem::path& pref_dir() const { return pref_dir_; }
+6
View File
@@ -207,6 +207,12 @@ bool GameApp::init(const LaunchOptions& opts) {
hiscores_.load(vfs_.pref_dir() / "hiscores.dat"); hiscores_.load(vfs_.pref_dir() / "hiscores.dat");
#ifdef SDL_HINT_APP_NAME
SDL_SetHint(SDL_HINT_APP_NAME, "Top-Octane");
#endif
SDL_SetHint("SDL_VIDEO_X11_WMCLASS", "top-octane");
SDL_SetHint("SDL_VIDEO_WAYLAND_WMCLASS", "top-octane");
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) != 0) { if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) != 0) {
LOG_ERROR("SDL_Init failed: %s", SDL_GetError()); LOG_ERROR("SDL_Init failed: %s", SDL_GetError());
return false; return false;
+65
View File
@@ -10,9 +10,12 @@
#include "core/config.hpp" #include "core/config.hpp"
#include "core/vfs.hpp" #include "core/vfs.hpp"
#include <algorithm>
#include <cstdio> #include <cstdio>
#include <cstdlib>
#include <filesystem> #include <filesystem>
#include <iostream> #include <iostream>
#include <optional>
using namespace top_octane; using namespace top_octane;
using namespace top_octane::assets; using namespace top_octane::assets;
@@ -236,5 +239,67 @@ int main() {
CHECK(sf_bank.find_preset(0, 0) != nullptr); CHECK(sf_bank.find_preset(0, 0) != nullptr);
std::cout << "[PASS] MUSIC.DAT (20 XMI tracks), SAMPLE.OPL (162 timbres), BULLFROG.SBK (17 presets) validated\n"; std::cout << "[PASS] MUSIC.DAT (20 XMI tracks), SAMPLE.OPL (162 timbres), BULLFROG.SBK (17 presets) validated\n";
// 8. VFS relocatable prefix & XDG Base Directory search path order
{
auto find_idx = [](const std::vector<std::filesystem::path>& list, const std::filesystem::path& target) -> ptrdiff_t {
auto it = std::find(list.begin(), list.end(), target);
return (it == list.end()) ? -1 : std::distance(list.begin(), it);
};
#ifndef _WIN32
struct ScopedEnv {
const char* key;
std::optional<std::string> prev;
ScopedEnv(const char* k, const char* val) : key(k) {
if (const char* old = std::getenv(k)) prev = std::string(old);
if (val) setenv(k, val, 1);
else unsetenv(k);
}
~ScopedEnv() {
if (prev.has_value()) setenv(key, prev->c_str(), 1);
else unsetenv(key);
}
};
ScopedEnv env_ho("HIOCTANE_DATA", nullptr);
ScopedEnv env_xdh("XDG_DATA_HOME", "/tmp/top-octane-xdg-home/");
ScopedEnv env_xdd("XDG_DATA_DIRS", "/tmp/top-octane-xdg1:/tmp/top-octane-xdg2/");
#endif
auto paths = Vfs::build_search_paths(
"/explicit/data",
std::filesystem::path("/work/dir/"),
std::filesystem::path("/opt/test-prefix/bin/"),
std::filesystem::path("/tmp/pref/"));
CHECK(!paths.empty());
CHECK(paths.front() == std::filesystem::path("/explicit/data"));
const ptrdiff_t prefix_idx = find_idx(paths, std::filesystem::path("/opt/test-prefix/share/top-octane/data"));
const ptrdiff_t pref_idx = find_idx(paths, std::filesystem::path("/tmp/pref/data"));
CHECK(prefix_idx >= 0);
CHECK(pref_idx > prefix_idx);
#ifndef _WIN32
const ptrdiff_t xdh_idx = find_idx(paths, std::filesystem::path("/tmp/top-octane-xdg-home/top-octane/data"));
const ptrdiff_t xdd1_idx = find_idx(paths, std::filesystem::path("/tmp/top-octane-xdg1/top-octane/data"));
const ptrdiff_t xdd2_idx = find_idx(paths, std::filesystem::path("/tmp/top-octane-xdg2/top-octane/data"));
CHECK(xdh_idx > prefix_idx);
CHECK(xdd1_idx > xdh_idx);
CHECK(xdd2_idx > xdd1_idx);
CHECK(pref_idx > xdd2_idx);
ScopedEnv env_ho_set("HIOCTANE_DATA", "/env/hioctane");
auto prio_paths = Vfs::build_search_paths(
"/cli/data",
std::filesystem::path("/work/dir"),
std::filesystem::path("/opt/test-prefix/bin/"),
std::filesystem::path());
CHECK(prio_paths.size() >= 2);
CHECK(prio_paths[0] == std::filesystem::path("/cli/data"));
CHECK(prio_paths[1] == std::filesystem::path("/env/hioctane"));
#endif
std::cout << "[PASS] Vfs relocatable & XDG data directory lookup validated\n";
}
return 0; return 0;
} }
Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

+168
View File
@@ -0,0 +1,168 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
<defs>
<!-- Deep navy/indigo badge background -->
<linearGradient id="bgGrad" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stop-color="#182848"/>
<stop offset="55%" stop-color="#0E1730"/>
<stop offset="100%" stop-color="#070C1A"/>
</linearGradient>
<!-- Warm engine/action glow in lower-left quadrant -->
<radialGradient id="orangeGlow" cx="28%" cy="74%" r="58%">
<stop offset="0%" stop-color="#FF5E1A" stop-opacity="0.52"/>
<stop offset="48%" stop-color="#FF3B00" stop-opacity="0.18"/>
<stop offset="100%" stop-color="#FF3B00" stop-opacity="0"/>
</radialGradient>
<!-- Cool high-tech cyan glow upper-right -->
<radialGradient id="cyanGlow" cx="76%" cy="24%" r="52%">
<stop offset="0%" stop-color="#00E5FF" stop-opacity="0.28"/>
<stop offset="100%" stop-color="#00E5FF" stop-opacity="0"/>
</radialGradient>
<!-- Brushed steel bevel border -->
<linearGradient id="bevelBorder" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stop-color="#A6B8D4"/>
<stop offset="35%" stop-color="#536582"/>
<stop offset="68%" stop-color="#2B374D"/>
<stop offset="100%" stop-color="#7B8FA8"/>
</linearGradient>
<!-- Subtle inner track grid arc accent -->
<linearGradient id="accentTrim" x1="0%" y1="100%" x2="100%" y2="0%">
<stop offset="0%" stop-color="#FF6A00" stop-opacity="0.75"/>
<stop offset="50%" stop-color="#FFB300" stop-opacity="0.22"/>
<stop offset="100%" stop-color="#00E5FF" stop-opacity="0.7"/>
</linearGradient>
<!-- Titanium / silver hull lighting -->
<linearGradient id="hullTop" x1="0%" y1="100%" x2="80%" y2="0%">
<stop offset="0%" stop-color="#B8C7DC"/>
<stop offset="55%" stop-color="#E5EDF8"/>
<stop offset="100%" stop-color="#FFFFFF"/>
</linearGradient>
<linearGradient id="hullBot" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stop-color="#6A7C96"/>
<stop offset="100%" stop-color="#96A8C2"/>
</linearGradient>
<!-- Racing red-orange stripes -->
<linearGradient id="stripeGrad" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" stop-color="#E62E00"/>
<stop offset="60%" stop-color="#FF5500"/>
<stop offset="100%" stop-color="#FF9900"/>
</linearGradient>
<!-- Cyan cockpit canopy -->
<linearGradient id="canopyGrad" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stop-color="#A8FFFF"/>
<stop offset="45%" stop-color="#00D9FF"/>
<stop offset="100%" stop-color="#006A9E"/>
</linearGradient>
<!-- Flame outer / inner gradients -->
<linearGradient id="flameOuter" x1="100%" y1="50%" x2="0%" y2="50%">
<stop offset="0%" stop-color="#FF6A00"/>
<stop offset="55%" stop-color="#FF3300" stop-opacity="0.92"/>
<stop offset="100%" stop-color="#CC1100" stop-opacity="0"/>
</linearGradient>
<linearGradient id="flameCore" x1="100%" y1="50%" x2="0%" y2="50%">
<stop offset="0%" stop-color="#FFFFFF"/>
<stop offset="45%" stop-color="#FFE159"/>
<stop offset="100%" stop-color="#FF7700" stop-opacity="0"/>
</linearGradient>
<!-- Cyan hover / speed trail -->
<linearGradient id="trailCyan" x1="100%" y1="50%" x2="0%" y2="50%">
<stop offset="0%" stop-color="#5CF2FF" stop-opacity="0.95"/>
<stop offset="65%" stop-color="#00A8E8" stop-opacity="0.45"/>
<stop offset="100%" stop-color="#0066AA" stop-opacity="0"/>
</linearGradient>
<clipPath id="badgeClip">
<rect x="40" y="40" width="432" height="432" rx="88"/>
</clipPath>
</defs>
<!-- Outer drop-shadow rim (dark metallic framing) -->
<rect x="32" y="32" width="448" height="448" rx="96" fill="url(#bevelBorder)"/>
<rect x="42" y="42" width="428" height="428" rx="86" fill="url(#bgGrad)"/>
<!-- Background atmospheric glows & speed lines clipped inside badge -->
<g clip-path="url(#badgeClip)">
<rect x="40" y="40" width="432" height="432" fill="url(#orangeGlow)"/>
<rect x="40" y="40" width="432" height="432" fill="url(#cyanGlow)"/>
<!-- Subtle high-speed diagonal track chevrons / grid lines -->
<g stroke="#2C4470" stroke-width="3" opacity="0.45">
<line x1="20" y1="360" x2="340" y2="95"/>
<line x1="145" y1="490" x2="495" y2="195"/>
</g>
<!-- Craft + exhaust + trails rotated diagonally up-right (-40 deg) -->
<g transform="translate(270 246) rotate(-40)">
<!-- Sleek cyan hover speed trails extending down-left -->
<path d="M -95,-118 L -280,-118 L -280,-106 L -85,-106 Z" fill="url(#trailCyan)" opacity="0.85"/>
<path d="M -95,118 L -280,118 L -280,106 L -85,106 Z" fill="url(#trailCyan)" opacity="0.85"/>
<path d="M -115,-74 L -265,-74 L -265,-66 L -115,-66 Z" fill="url(#trailCyan)" opacity="0.65"/>
<path d="M -115,74 L -265,74 L -265,66 L -115,66 Z" fill="url(#trailCyan)" opacity="0.65"/>
<!-- Drop shadow under hovercraft for depth -->
<ellipse cx="-8" cy="14" rx="135" ry="72" fill="#040814" opacity="0.55"/>
<!-- Twin afterburner thruster plumes -->
<!-- Upper-port nacelle plume -->
<path d="M -94,-64 C -135,-68 -195,-58 -236,-46 C -195,-34 -135,-24 -94,-28 Z" fill="url(#flameOuter)"/>
<path d="M -96,-56 C -126,-57 -164,-51 -188,-46 C -164,-41 -126,-35 -96,-36 Z" fill="url(#flameCore)"/>
<!-- Lower-starboard nacelle plume -->
<path d="M -94,28 C -135,24 -195,34 -236,46 C -195,58 -135,68 -94,64 Z" fill="url(#flameOuter)"/>
<path d="M -96,36 C -126,35 -164,41 -188,46 C -164,51 -126,57 -96,56 Z" fill="url(#flameCore)"/>
<!-- Central boost glow -->
<path d="M -92,-16 C -125,-18 -155,-10 -174,0 C -155,10 -125,18 -92,16 Z" fill="url(#flameOuter)" opacity="0.85"/>
<!-- Forward minigun / twin cannon barrels mounted ahead of nacelles -->
<rect x="64" y="-58" width="44" height="10" rx="3" fill="#8C9DB5" stroke="#1E293B" stroke-width="2.5"/>
<rect x="102" y="-57" width="12" height="8" rx="2" fill="#00E5FF"/>
<rect x="64" y="48" width="44" height="10" rx="3" fill="#5D6F8A" stroke="#1E293B" stroke-width="2.5"/>
<rect x="102" y="49" width="12" height="8" rx="2" fill="#00E5FF"/>
<!-- Swept Delta Wings (Upper & Lower facets for crisp 3D bevel) -->
<polygon points="38,-22 -64,-128 -106,-116 -84,-24" fill="url(#hullTop)" stroke="#162238" stroke-width="4" stroke-linejoin="round"/>
<polygon points="38,22 -64,128 -106,116 -84,24" fill="url(#hullBot)" stroke="#162238" stroke-width="4" stroke-linejoin="round"/>
<!-- Bold Orange-Red Racing Wing Stripes -->
<polygon points="10,-38 -68,-115 -88,-108 -34,-34" fill="url(#stripeGrad)"/>
<polygon points="10,38 -68,115 -88,108 -34,34" fill="url(#stripeGrad)"/>
<!-- Wingtip stabilizer fins -->
<polygon points="-64,-128 -108,-128 -118,-106 -96,-112" fill="#00D9FF" stroke="#162238" stroke-width="3" stroke-linejoin="round"/>
<polygon points="-64,128 -108,128 -118,106 -96,112" fill="#0099CC" stroke="#162238" stroke-width="3" stroke-linejoin="round"/>
<!-- Twin Engine Nacelles -->
<!-- Upper nacelle -->
<path d="M -98,-64 L 68,-62 L 82,-46 L 68,-30 L -98,-28 Z" fill="url(#hullTop)" stroke="#162238" stroke-width="4" stroke-linejoin="round"/>
<rect x="-104" y="-61" width="14" height="30" rx="4" fill="#3B4963" stroke="#162238" stroke-width="3"/>
<!-- Lower nacelle -->
<path d="M -98,28 L 68,30 L 82,46 L 68,62 L -98,64 Z" fill="url(#hullBot)" stroke="#162238" stroke-width="4" stroke-linejoin="round"/>
<rect x="-104" y="31" width="14" height="30" rx="4" fill="#2A354A" stroke="#162238" stroke-width="3"/>
<!-- Main Central Delta Fuselage (2-tone bevel for strong 3D read) -->
<polygon points="-96,-34 38,-34 156,0 -96,0" fill="url(#hullTop)"/>
<polygon points="-96,0 156,0 38,34 -96,34" fill="url(#hullBot)"/>
<polygon points="-96,-34 38,-34 156,0 38,34 -96,34" fill="none" stroke="#162238" stroke-width="4.5" stroke-linejoin="round"/>
<!-- Center dorsal spine stripe (tucks cleanly under canopy) -->
<polygon points="-88,-7 8,-7 8,7 -88,7" fill="url(#stripeGrad)"/>
<!-- Glowing Cyan Cockpit Canopy -->
<path d="M -4,-15 L 44,-14 L 84,0 L 44,14 L -4,15 Q -16,0 -4,-15 Z" fill="url(#canopyGrad)" stroke="#0D1D33" stroke-width="3.5" stroke-linejoin="round"/>
<!-- Canopy specular highlight -->
<path d="M 4,-9 L 42,-8 L 66,-1 L 34,-3 Z" fill="#E6FFFF" opacity="0.88"/>
</g>
</g>
<!-- Crisp inner metallic rim highlight -->
<rect x="42" y="42" width="428" height="428" rx="86" fill="none" stroke="url(#accentTrim)" stroke-width="4"/>
</svg>

After

Width:  |  Height:  |  Size: 8.6 KiB

+14
View File
@@ -0,0 +1,14 @@
[Desktop Entry]
Version=1.0
Type=Application
Name=Top-Octane
GenericName=Vehicular Combat Racer
Comment=Modern SDL2 + OpenGL 3.3 source port of Bullfrog's Hi-Octane
Exec=top-octane
TryExec=top-octane
Icon=top-octane
Terminal=false
Categories=Game;ActionGame;ArcadeGame;
Keywords=racing;hovercraft;combat;hi-octane;bullfrog;retro;arcade;
StartupNotify=false
StartupWMClass=top-octane