Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,9 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
endif()

if(MMAPPER_IS_DEBUG)
# segfaults in ASAN initializer on 32-bit Ubuntu 18.04.1 with clang 6.0
# note: apparently -fsanitize=address can't be used with gnu libc 2.25+
# Ubuntu 18.04.1 has libc 2.27.
message(STATUS "Building with Clang address sanitizer")
add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address)
Expand Down
6 changes: 5 additions & 1 deletion cmake/MakeAppX.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@ set(APPX_PDB_SOURCE_PATH "${CPACK_TEMPORARY_DIRECTORY}/${APPX_PDB_FILE_NAME}")

## Prepare Staging Directory

# Flatten all subdirectories in the staging root for MakeAppx.
# Flatten all subdirectories in the staging root for MakeAppx, EXCEPT Assets.
file(GLOB staging_items "${CPACK_TEMPORARY_DIRECTORY}/*")
foreach(item ${staging_items})
if(IS_DIRECTORY "${item}")
get_filename_component(item_name "${item}" NAME)
if(item_name STREQUAL "Assets")
continue()
endif()
message(STATUS "Flattening directory: ${item}")
file(GLOB subdir_contents "${item}/*")
foreach(subitem ${subdir_contents})
Expand Down
8 changes: 4 additions & 4 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<script src="{{ '/assets/js/download-highlight.js' | relative_url }}"></script>
</head>
<body>
<a href="#main-content" class="skip-link">Skip to content</a>
<div class="content-wrapper">
<div style="display: flex; justify-content: space-between; align-items: center;">
<header style="display: flex; flex-direction: column; align-items: center;">
Expand All @@ -26,17 +27,16 @@
<h1><a href="{{ '/' | relative_url }}">{{ page.title | default: site.title }}</a></h1>
</div>
</header>
<nav>
<nav aria-label="Main Navigation">
<ul style="list-style: none; padding: 0; margin: 0;">
<li style="display: inline; margin-left: 10px;"><a href="{{ '/demo/' | relative_url }}">Demo</a></li>
<li style="display: inline; margin-left: 10px;"><a href="{{ '/#download-mmapper' | relative_url }}">Download</a></li>
<li style="display: inline; margin-left: 10px;"><a href="{{ '/#get-mmapper' | relative_url }}">Get</a></li>
<li style="display: inline; margin-left: 10px;"><a href="{{ '/changelog.html' | relative_url }}">Changelog</a></li>
<li style="display: inline; margin-left: 10px;"><a href="{{ '/about.html' | relative_url }}">About</a></li>
</ul>
</nav>
</div>

<main>
<main id="main-content">
{{ content }}
</main>

Expand Down
16 changes: 16 additions & 0 deletions docs/assets/css/style.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
/* Minimal MMapper Website Styles */

/* Basic Reset & Body */
.skip-link {
position: absolute;
top: -40px;
left: 0;
background: #cc9933;
color: #1a1a1a;
padding: 8px;
z-index: 100;
transition: top 0.3s;
}

.skip-link:focus,
.skip-link:focus-visible {
top: 0;
}

body {
margin: 0;
padding: 0;
Expand Down
31 changes: 22 additions & 9 deletions docs/assets/js/download-highlight.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
document.addEventListener('DOMContentLoaded', function() {
let detectedArch = null;
let isChromeOS = false;
const downloadLinks = document.querySelectorAll('.download-link');
const downloadLinks = document.querySelectorAll('.download-link, .platform-link');

// --- Architecture Detection (Best Effort) ---
if (navigator.userAgentData && navigator.userAgentData.architecture) {
Expand All @@ -23,17 +23,34 @@ document.addEventListener('DOMContentLoaded', function() {
}

// --- Highlight Download Link ---
function addRecommendation(link) {
link.classList.add('recommended-download');
const recommendation = document.createElement('span');
recommendation.textContent = ' Recommended';
recommendation.classList.add('recommendation-text');

// Place recommendation outside the link as per user preference
if (link.classList.contains('platform-link')) {
recommendation.classList.add('platform-recommendation');
}
link.parentNode.insertBefore(recommendation, link.nextSibling);
}

downloadLinks.forEach(link => {
const href = link.href.toLowerCase();
const platform = link.getAttribute('data-platform');

// Do not recommend Windows .exe installers
if (href.includes('.exe')) {
return;
}

// Only recommend .deb for ChromeOS
if (isChromeOS && (href.includes('appimage') || href.includes('flatpak'))) {
return;
// For ChromeOS, only recommend the Web version
if (isChromeOS) {
if (platform === 'web') {
addRecommendation(link);
}
return; // Don't recommend anything else on ChromeOS
}

let linkArch = null;
Expand All @@ -44,11 +61,7 @@ document.addEventListener('DOMContentLoaded', function() {
}

if (detectedArch && linkArch === detectedArch) {
link.classList.add('recommended-download');
const recommendation = document.createElement('span');
recommendation.textContent = ' Recommended';
recommendation.classList.add('recommendation-text');
link.parentNode.insertBefore(recommendation, link.nextSibling);
addRecommendation(link);
}
});
});
21 changes: 13 additions & 8 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,26 @@ title: Play MUME with MMapper
MMapper is a game client and graphical mapping tool that enhances the MUME (Multi-Users in Middle Earth) experience. It acts as a bridge between the MUME server and your mud client, analyzing real-time game data and visually displaying your character’s position on the map.
</div>

## Download MMapper
## Get MMapper
{: #get-mmapper}

Choose your operating system to download the latest version {{ site.github.latest_release.tag_name }}:
Choose your preferred platform to start using MMapper {{ site.github.latest_release.tag_name }}:

<div class="platform-links">
<a href="{{ '/windows.html' | relative_url }}" class="platform-link">
<i class="fab fa-windows"></i>
<a href="{{ '/demo/' | relative_url }}" class="platform-link" aria-label="Use MMapper in your Web Browser" data-platform="web">
<i class="fas fa-globe" aria-hidden="true"></i>
<span>Web</span>
</a>
<a href="{{ '/windows.html' | relative_url }}" class="platform-link" aria-label="Get MMapper for Windows">
<i class="fab fa-windows" aria-hidden="true"></i>
<span>Windows</span>
</a>
<a href="{{ '/macos.html' | relative_url }}" class="platform-link">
<i class="fab fa-apple"></i>
<a href="{{ '/macos.html' | relative_url }}" class="platform-link" aria-label="Get MMapper for macOS">
<i class="fab fa-apple" aria-hidden="true"></i>
<span>macOS</span>
</a>
<a href="{{ '/linux.html' | relative_url }}" class="platform-link">
<i class="fab fa-linux"></i>
<a href="{{ '/linux.html' | relative_url }}" class="platform-link" aria-label="Get MMapper for Linux">
<i class="fab fa-linux" aria-hidden="true"></i>
<span>Linux</span>
</a>
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/linux.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
layout: default
title: Download MMapper for Linux
title: Get MMapper for Linux
---

## Download MMapper for Linux
Choose your preferred distribution method below. We recommend using Flathub for a sandboxed environment and easy updates across most Linux distributions.

<a href='https://flathub.org/apps/org.mume.MMapper'>
<img width='200' alt='Get it on Flathub' src='https://flathub.org/api/badge?locale=en' style="vertical-align: middle;"/>
Expand Down
5 changes: 3 additions & 2 deletions docs/macos.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
layout: default
title: Download MMapper for macOS
title: Get MMapper for macOS
---

## Download MMapper for macOS
To install MMapper on macOS, download the Disk Image (DMG) file provided below. MMapper is compatible with both Intel and Apple Silicon processors.

{% for asset in site.github.latest_release.assets %}
{% if asset.name contains 'sha256' %}
{% elsif asset.name contains 'dmg' %}
Expand Down
9 changes: 5 additions & 4 deletions docs/windows.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
layout: default
title: Download MMapper for Windows
title: Get MMapper for Windows
---

## Download MMapper for Windows
MMapper can be installed from the Microsoft Store for a seamless experience, including automatic updates. Alternatively, you can download the standalone installer below.

<a href="https://apps.microsoft.com/detail/9p6f2b68rf7g?referrer=appbadge&mode=direct">
<a href="https://apps.microsoft.com/detail/9p6f2b68rf7g?referrer=appbadge&mode=direct" style="display: inline-flex; align-items: center; text-decoration: none;">
<img src="https://get.microsoft.com/images/en-us%20dark.svg" width="200" style="vertical-align: middle;"/>
</a><span class="recommendation-text"> Recommended</span>
</a>
<span class="recommendation-text"> Recommended</span>

{% for asset in site.github.latest_release.assets %}
{% if asset.name contains 'sha256' %}
Expand Down
2 changes: 1 addition & 1 deletion src/display/mapcanvas_gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void MapCanvas::reportGLVersion()
logMsg("Highest OpenGL:", mmqt::toQByteArrayUtf8(OpenGLConfig::getGLVersionString()));
}
if constexpr (!NO_GLES) {
logMsg("Highest GLES:", mmqt::toQByteArrayUtf8(OpenGLConfig::getESVersionString()));
logMsg("Highest ES:", mmqt::toQByteArrayUtf8(OpenGLConfig::getESVersionString()));
}

logMsg("Display:", QString("%1 DPI").arg(QPaintDevice::devicePixelRatioF()).toUtf8());
Expand Down
12 changes: 10 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "./opengl/OpenGLConfig.h"
#include "./opengl/OpenGLProber.h"

#include <cstring>
#include <memory>
#include <optional>

Expand Down Expand Up @@ -143,21 +144,28 @@ static bool setSurfaceFormat()
if constexpr (CURRENT_PLATFORM == PlatformEnum::Wasm) {
msg += "WebGL 2.0";
} else {
msg += "GLES 3.0";
msg += "ES 3.0";
}
}
msg += " support to run.";
QMessageBox::critical(nullptr, "Fatal Error", msg);
return false;
}
OpenGLConfig::setBackendType(probeResult.backendType);
OpenGLConfig::setIsCompat(probeResult.isCompat);
QSurfaceFormat::setDefaultFormat(probeResult.format);
return true;
}

int main(int argc, char **argv)
{
#ifndef Q_OS_WASM
for (int i = 1; i < argc; ++i) {
if (std::strcmp(argv[i], "--probe") == 0) {
return OpenGLProber::runSurveyMode(argc, argv);
}
}
#endif

setHighDpiScaleFactorRoundingPolicy();
setEnteredMain();
if constexpr (IS_DEBUG_BUILD) {
Expand Down
18 changes: 13 additions & 5 deletions src/opengl/OpenGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ OpenGL::OpenGL()
case OpenGLProber::BackendType::GL:
m_opengl = Legacy::Functions::alloc<Legacy::FunctionsGL33>(m_uboManager);
break;
case OpenGLProber::BackendType::GLES:
case OpenGLProber::BackendType::ES:
m_opengl = Legacy::Functions::alloc<Legacy::FunctionsES30>(m_uboManager);
break;
case OpenGLProber::BackendType::None:
Expand Down Expand Up @@ -94,12 +94,12 @@ UniqueMesh OpenGL::createPointBatch(const std::vector<ColorVert> &batch)

UniqueMesh OpenGL::createPlainLineBatch(const std::vector<glm::vec3> &batch)
{
return getFunctions().createPlainBatch(DrawModeEnum::LINES, batch);
return getFunctions().createPlainLineBatch(batch);
}

UniqueMesh OpenGL::createColoredLineBatch(const std::vector<ColorVert> &batch)
{
return getFunctions().createColoredBatch(DrawModeEnum::LINES, batch);
return getFunctions().createColoredLineBatch(batch);
}

UniqueMesh OpenGL::createPlainTriBatch(const std::vector<glm::vec3> &batch)
Expand Down Expand Up @@ -165,14 +165,22 @@ void OpenGL::renderPlain(const DrawModeEnum type,
const std::vector<glm::vec3> &verts,
const GLRenderState &state)
{
getFunctions().renderPlain(type, verts, state);
if (type == DrawModeEnum::LINES) {
getFunctions().renderPlainLines(verts, state);
} else {
getFunctions().renderPlain(type, verts, state);
}
}

void OpenGL::renderColored(const DrawModeEnum type,
const std::vector<ColorVert> &verts,
const GLRenderState &state)
{
getFunctions().renderColored(type, verts, state);
if (type == DrawModeEnum::LINES) {
getFunctions().renderColoredLines(verts, state);
} else {
getFunctions().renderColored(type, verts, state);
}
}

void OpenGL::renderPoints(const std::vector<ColorVert> &verts, const GLRenderState &state)
Expand Down
11 changes: 0 additions & 11 deletions src/opengl/OpenGLConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
namespace OpenGLConfig {

static OpenGLProber::BackendType g_backendType;
static bool g_isCompat = false;
static std::string g_glVersionString;
static std::string g_esVersionString;
static int g_maxSamples = 0;
Expand All @@ -21,16 +20,6 @@ void setBackendType(OpenGLProber::BackendType type)
g_backendType = type;
}

NODISCARD bool getIsCompat()
{
return g_isCompat;
}

void setIsCompat(bool isCompat)
{
g_isCompat = isCompat;
}

NODISCARD std::string getGLVersionString()
{
return g_glVersionString;
Expand Down
3 changes: 0 additions & 3 deletions src/opengl/OpenGLConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ namespace OpenGLConfig {
NODISCARD extern OpenGLProber::BackendType getBackendType();
extern void setBackendType(OpenGLProber::BackendType type);

NODISCARD extern bool getIsCompat();
extern void setIsCompat(bool isCompat);

NODISCARD extern std::string getGLVersionString();
extern void setGLVersionString(const std::string &versionString);

Expand Down
Loading