Skip to content

Instantly share code, notes, and snippets.

View zturtleman's full-sized avatar
💭
I may be slow to respond.

Zack Middleton zturtleman

💭
I may be slow to respond.
View GitHub Profile
@zturtleman
zturtleman / build-sdl-libs.sh
Last active October 30, 2023 07:24
Scripts for building SDL 2 libraries for Windows (MinGW, MSVC) and macOS.
#!/bin/bash
# Run in SDL 2 source directory on Linux.
# Built libraries will be copied to ./ztm-libs/{win32,win64,macos-ub1,macos-ub2}
#
# Set up:
# 1. Windows libaries:
# Install mingw-w64 for i686 and x86_64
#
# 2. macOS libraries:
# Follow osxcross directions to set up macOS (11.3) SDK to build a Universal 2 (arm64/x86_64) dylib.
@zturtleman
zturtleman / SeriousTexture.md
Last active May 29, 2021 06:48
Serious Engine 2 .tex file structure.

Serious Engine 2 .tex file structure. | Zack Middleton (zturtleman), April 2021

The beginning of the file is the serialized form of a C++ class, which seems to be the same in most (all?) images.

There is compressed pixel data in a zlib compressed stream (begining with 78 9C). For image type 0, 2, and 6 the pixel data is BGR888. For image type 1, 3, 4, and 5 the pixel data is BGRA8888. For image type 7, 8, and 9 the pixel data is DXT1, DXT3, and DXT5 image data respectfully with a full mipmap pryamid and possibly 6 images for a cubemap (see image flags? and image type? below).

"(marker)" "(string)" are non-null terminated plain text. Markers are typically 4 bytes but start and end markers are 8 and 7 bytes. For strings, the string length proceeds it but it's listed here as well.

"(int32)" and "(uint32)" are signed and unsigned little endian 32-bit integers. Though uint32 is just used here for lengths or counts that negative values wouldn't make sense.

@zturtleman
zturtleman / q3rally_sf_svn.log
Created March 27, 2021 07:20
svn log of old (deleted) q3rally repo on sourceforge.
------------------------------------------------------------------------
r392 | perle2212 | 2011-01-23 16:55:18 -0600 (Sun, 23 Jan 2011) | 2 lines
Reactivated q3r_test. Layout changes.
------------------------------------------------------------------------
r391 | perle2212 | 2011-01-23 16:54:39 -0600 (Sun, 23 Jan 2011) | 1 line
Reactivated q3r_test. Layout changes.
------------------------------------------------------------------------
@zturtleman
zturtleman / mm3d-build-linux.md
Last active September 21, 2021 09:19
How to build Maverick Model 3D on GNU/Linux.

Maverick Model 3D

GNU/Linux build dependencies and build steps are listed in the readme. Though this does assume some knowledge about Unix terminal, git version control, and building C++ software.

This is a more step-by-step guide that I should probably integrate with Maverick documentation at some point.

Open a Terminal

Open a terminal using the system applications menu. In the terminal type commands and press enter to run them.

@zturtleman
zturtleman / xx_q3_ui-widescreen-virtual-coords.diff
Last active June 27, 2020 15:45
Patch for ioquake3 (2020-02-11) Quake 3 UI to use 16:9 widescreen virtual UI coordinates instead of 640x480.
diff --git a/code/q3_ui/ui_atoms.c b/code/q3_ui/ui_atoms.c
index ac17814f..a25b1c4a 100644
--- a/code/q3_ui/ui_atoms.c
+++ b/code/q3_ui/ui_atoms.c
@@ -351,8 +351,8 @@ static void UI_DrawBannerString2( int x, int y, const char* str, vec4_t color )
// draw the colored text
trap_R_SetColor( color );
- ax = x * uis.xscale + uis.bias;
- ay = y * uis.yscale;
@zturtleman
zturtleman / ztm_quake3_faq.md
Last active April 18, 2020 22:58
zturtleman's Quake 3 FAQ

zturtleman's Quake 3 FAQ

Can I play the Quake 3 demo with an open source engine?

Yes. But not network compatible with the official demo.

Spearmint

Spearmint includes demoq3 support. Add demoq3/pak0.pk3 to the demoq3 directory. If it's the only game you have installed it will start automatically when you launch Spearmint. If you have baseq3 installed then choose "Spearmint Quake 3 (Demo)" from the mods menu.

@zturtleman
zturtleman / iqm-load.md
Last active January 12, 2020 09:46
some info about loading IQM models
@zturtleman
zturtleman / fetch-serverinfo
Last active May 5, 2023 09:38
Shell script to display raw Quake 3 server info and status responses.
#!/bin/bash
# Shell script to display raw Quake 3 server info and status responses.
# Author: Zack Middleton (zturtleman)
# License: Creative Commons Zero (CC0)
# Note: Default 'classic' netcat doesn't support IPv6 (debian package netcat-traditional)
# so I use the OpenBSD rewrite instead. (debian package netcat-openbsd)
# There is also a nc6 command in netcat6 package...
# netcat arguments:
@zturtleman
zturtleman / sdl2-issues.md
Last active August 29, 2015 14:06
SDL2 issues

NEW SDL2 X11 ISSUES SINCE 2.0.3

  • TextInput is now sent before Key event.
    • ioquake3 toggles console on both Key and TextInput events, resulting in the console staying closed. The TextInput event is ignored if last key was console, now that the order is switch it is broken. Now the console can only be opened using Shift+ESC.
    • SDL bug report
  • SDL_SetWindowGrab( SDL_window, SDL_FALSE ) does not disable grab if relative mouse mode is enabled. SDL_SetRelativeMouseMode( SDL_TRUE ).
    • ioquake3's in_nograb cvar no longer disables mouse grab.

OLDER SDL2 X11 ISSUES

@zturtleman
zturtleman / qq_reflow_console.diff
Last active August 29, 2015 14:03
ioq3 dynamic client console width / reflow client console buffer (WIP)
diff --git a/code/client/cl_console.c b/code/client/cl_console.c
index a3d4d32..08ede9a 100644
--- a/code/client/cl_console.c
+++ b/code/client/cl_console.c
@@ -29,7 +29,7 @@ int g_console_field_width = 78;
#define NUM_CON_TIMES 4
-#define CON_TEXTSIZE 32768
+#define CON_TEXTSIZE (32768*2)