Skip to content

Instantly share code, notes, and snippets.

@michicc
michicc / llvmpipe.diff
Created February 27, 2021 17:11
llvmpipe
diff --git a/src/video/opengl.cpp b/src/video/opengl.cpp
index e466e506d..7075803cc 100644
--- a/src/video/opengl.cpp
+++ b/src/video/opengl.cpp
@@ -536,6 +536,10 @@ const char *OpenGLBackend::Init()
DEBUG(driver, 1, "OpenGL driver: %s - %s (%s)", vend, renderer, ver);
+ /* Don't use MESA software rendering backends as they are slower than
+ * just using a non-OpenGL video driver. */
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp
index 54c01e145..d69f8c1ba 100644
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -129,9 +129,10 @@ uint8 VideoDriver_Win32Base::GetFullscreenBpp()
/**
* Instantiate a new window.
* @param full_screen Whether to make a full screen window or not.
+ * @param resize Whether to change window size.
* @return True if the window could be created.
@michicc
michicc / refresh_rate_osx.diff
Created March 8, 2021 19:02
OSX refresh rate
diff --git a/src/video/cocoa/cocoa_v.h b/src/video/cocoa/cocoa_v.h
index 371e4b5bc..3d3db5454 100644
--- a/src/video/cocoa/cocoa_v.h
+++ b/src/video/cocoa/cocoa_v.h
@@ -47,6 +47,8 @@ public:
void EditBoxLostFocus() override;
+ std::vector<int> GetListOfMonitorRefreshRates() override;
+
diff --git a/src/video/cocoa/cocoa_v.h b/src/video/cocoa/cocoa_v.h
index 371e4b5bc..3d3db5454 100644
--- a/src/video/cocoa/cocoa_v.h
+++ b/src/video/cocoa/cocoa_v.h
@@ -47,6 +47,8 @@ public:
void EditBoxLostFocus() override;
+ std::vector<int> GetListOfMonitorRefreshRates() override;
+
diff --git a/src/lang/english.txt b/src/lang/english.txt
index ad7c55ce9..25301ccf2 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -1026,7 +1026,7 @@ STR_GAME_OPTIONS_VIDEO_ACCELERATION_RESTART :{WHITE}The sett
STR_GAME_OPTIONS_REFRESH_RATE :{BLACK}Display refresh rate
STR_GAME_OPTIONS_REFRESH_RATE_TOOLTIP :{BLACK}Select the screen refresh rate to use
STR_GAME_OPTIONS_REFRESH_RATE_OTHER :other
-STR_GAME_OPTIONS_REFRESH_RATE_ITEM :{BLACK}{NUM}Hz
+STR_GAME_OPTIONS_REFRESH_RATE_ITEM :{NUM} Hz
@michicc
michicc / clean_anim_buffer.patch
Created March 19, 2021 23:00
Clean anim buffer
From 373b1b9c470e25cab99622947c7d999002a411bf Mon Sep 17 00:00:00 2001
From: Michael Lutz <[email protected]>
Date: Fri, 19 Mar 2021 23:55:54 +0100
Subject: Fix: [OpenGL] Clear animation buffer upon creation.
---
src/video/opengl.cpp | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/video/opengl.cpp b/src/video/opengl.cpp

We tried to release OpenTTD 13 on April 1st, but supply chain issues are affecting new feature production and forced us to delay the release.

To compensate, we swept the factory floor for bits and pieces that where left around and could be repurposed. We found enough to be able to produce a 12.2 maintenance release for you.

More details in the changelog below.

diff --git a/src/command.cpp b/src/command.cpp
index 007fce35c3..65e5acf10c 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -287,9 +287,6 @@ void CommandHelperBase::LogCommandExecution(Commands cmd, StringID err_message,
*/
bool CommandHelperBase::InternalExecutePrepTest(CommandFlags cmd_flags, TileIndex tile, Backup<CompanyID> &cur_company)
{
- /* Do not even think about executing out-of-bounds tile-commands */
- if (tile != 0 && (tile >= MapSize() || (!IsValidTile(tile) && (cmd_flags & CMD_ALL_TILES) == 0))) return false;
@michicc
michicc / backport-languages.py
Last active January 27, 2023 23:26 — forked from TrueBrain/backport-languages.py
Backporting of PRs and language changes
"""
Put this file in a master checkout under .github/.
It should be next to backport.py.
"""
import argparse
import glob
import subprocess
import shlex
@michicc
michicc / a.diff
Created September 13, 2023 19:43
diff --git a/src/textbuf.cpp b/src/textbuf.cpp
index 388e480211..59e8d69e23 100644
--- a/src/textbuf.cpp
+++ b/src/textbuf.cpp
@@ -271,8 +271,10 @@ void Textbuf::DiscardMarkedText(bool update)
{
if (this->markend == 0) return;
- this->DeleteText(this->markpos, this->markend, update);
+ uint16_t old_markpos = this->markpos;