Skip to content

Instantly share code, notes, and snippets.

View ananace's full-sized avatar

Alexander "Ananace" Olofsson ananace

  • Linköping University
  • Sweden
View GitHub Profile
@ananace
ananace / PackingExample.cpp
Last active May 6, 2018 05:41
Message packing example for libyojimbo, with built-in compression.
#include <yojimbo.h>
#include <miniz.h>
class PackedMessage : public yojimbo::BlockMessage
{
public:
enum { MsgType = 0x00 };
template <typename Stream>
bool Serialize(Stream& stream)
@ananace
ananace / user_settings.py
Created August 22, 2018 15:56
Example configuration for Steam Proton user settings
#!/usr/bin/env python3
import os
user_settings = {
#logs are saved to $HOME/steam-$STEAM_APP_ID.log, overwriting any previous log with that name
# "WINEDEBUG": "+timestamp,+pid,+tid,+seh,+debugstr,+module",
# "DXVK_LOG_LEVEL": "info",
@ananace
ananace / joyaxis-6.18.patch
Last active September 25, 2021 07:39
Quick hack to get the expanded joyaxises patch to apply on Wine 6.18
diff --git a/dlls/joy.cpl/joy.h b/dlls/joy.cpl/joy.h
index 64df21963b9..c05880d88ba 100644
--- a/dlls/joy.cpl/joy.h
+++ b/dlls/joy.cpl/joy.h
@@ -49,8 +49,8 @@ struct Joystick {
struct Effect *effects;
};
-#define TEST_MAX_BUTTONS 32
-#define TEST_MAX_AXES 4
@ananace
ananace / 6.20-joyaxis-lite.patch
Created October 23, 2021 12:24
Simpler joyaxis patch for Wine 6.20
diff --git a/dlls/winejoystick.drv/joystick_linux.c b/dlls/winejoystick.drv/joystick_linux.c
index 8d1a7b1a25a..4057ec52a1e 100644
--- a/dlls/winejoystick.drv/joystick_linux.c
+++ b/dlls/winejoystick.drv/joystick_linux.c
@@ -260,9 +260,9 @@ LRESULT driver_joyGetDevCaps(DWORD_PTR dwDevID, LPJOYCAPSW lpCaps, DWORD dwSize)
lpCaps->wUmax = 0xFFFF;
lpCaps->wVmin = 0;
lpCaps->wVmax = 0xFFFF;
- lpCaps->wMaxAxes = 6; /* same as MS Joystick Driver */
+ lpCaps->wMaxAxes = 16; /* same as MS Joystick Driver */
@ananace
ananace / kernel32-SetThreadInformation-stub.mypatch
Last active May 4, 2022 08:13
Quick and ugly Kernel32.SetThreadInformation stub
Add a stub for missing Kernel32.SetThreadInformation, needed for Star Citizen 3.17.1
https://bugs.winehq.org/show_bug.cgi?id=52956
https://bugs.winehq.org/attachment.cgi?id=72326
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec
index 818e7d87a2f..706c518dbe1 100644
--- a/dlls/kernel32/kernel32.spec
+++ b/dlls/kernel32/kernel32.spec
@@ -1470,6 +1470,7 @@
@ stdcall -import SetThreadGroupAffinity(long ptr ptr)
@ananace
ananace / disable-eac.sh
Last active May 23, 2022 19:03
Star Citizen EAC disable one-liner
#!/bin/bash
ls -1 */EasyAntiCheat/Settings.json | xargs -rn 1 sed -e 's/id":\s*"[^L]/id": "LUG/g' -i
@ananace
ananace / lib-facter-pi.rb
Created September 29, 2022 18:03
Puppet profile manifests for improved handling of Raspberry Pi nodes
# frozen_string_literal: true
# Fact to check Raspberry Pi information;
Facter.add(:pi) do
pi_dtb = '/sys/firmware/devicetree/base'
confine { File.exist? pi_dtb }
setcode do
{
@ananace
ananace / fake_aio.pp
Created March 1, 2023 10:00
Faking an AIO install for modern Puppet on Raspberry Pi
class profiles::raspberry_pi::fake_aio {
file {
default:
ensure => file;
'/etc/facter/facts.d/aio_agent_version.txt':
content => "aio_agent_version=${fact('puppetversion')}";
'/etc/facter/facts.d/aio_fake_agent.txt':
content => "aio_fake_agent=true";
}
@ananace
ananace / keyboard.patch
Created March 28, 2023 18:26
Wine keyboard layout mapping patch
diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
index b1c47d5258e..a7a393b5102 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -1402,6 +1402,35 @@ BOOL X11DRV_KeyEvent( HWND hwnd, XEvent *xev )
return TRUE;
}
+/* From the point of view of this function there are two types of
+ * keys: those for which the mapping to vkey and scancode depends on
@ananace
ananace / gist:de7f30454e99b3952405
Last active July 12, 2023 05:57
OpenMW Windows Development Environment Setup - Appveyor scripts

NB; (An updated version of this guide can be found on the wiki)

OpenMW Windows Dev-Env

What you need?

  • Visual Studio 2013 or 2015 (Community edition is enough)
  • MSYSGit or Git for Windows as it's also called (cinst git.install if you have Chocolatey)