This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/neo/d3xp/anim/Anim_Blend.cpp b/neo/d3xp/anim/Anim_Blend.cpp | |
index cacf5f1..4215336 100644 | |
--- a/neo/d3xp/anim/Anim_Blend.cpp | |
+++ b/neo/d3xp/anim/Anim_Blend.cpp | |
@@ -5490,19 +5490,19 @@ bool idAnimator::GetJointLocalTransform( jointHandle_t jointHandle, int currentT | |
// FIXME: overkill | |
CreateFrame( currentTime, false ); | |
- if( jointHandle > 0 ) | |
- { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void idGameLocal::CalcFov( float base_fov, float &fov_x, float &fov_y ) const { | |
float x; | |
float y; | |
float ratio_x; | |
float ratio_y; | |
assert(base_fov > 0); | |
// first, calculate the vertical fov based on a 640x480 view | |
// XXX: will be positive because tan() is positive if the given value is positive as asserted above |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Makefile for Deep Impact: Freefall | |
# (C) 2013 Daniel Gibson, do whatever you want with it | |
# | |
# needs GNU make, tested on Linux, should work on other unix-like systems as well | |
# also needs SDL2, SDL2 image and SDL2 ttf + development headers etc | |
# and a C++11 and GCC compatible C++ compiler (tested g++ 4.7 and clang++ 3.3) | |
# CC := clang | |
# CXX := clang++ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The Results: http://wp.me/pEPJ4-4S | |
// you can define USE_LIBPNG to decode with libpng XOR USE_LODEPNG to decode with lodepng | |
// XOR USE_LIBJPEG to decode with libjpeg or libjpeg-turbo XOR nothing to use stb_image. | |
// you'll have to provide the corresponding headers and (for libjpeg and libpng) libs to link against | |
// for lodepng also compile lodepng.c into the binary | |
// ex: gcc -O4 -DUSE_LODEPNG imgLoadBench.c lodepng.c -o imgLoadBench_lodepng_gcc_O4 | |
// or: gcc -O0 -DUSE_LIBPNG imgLoadBench.c -o imgLoadBench_libpng_gcc_O0 -lpng | |
// or: gcc -O2 -DUSE_LIBJPEG imgLoadBench.c -o imgLoadBench_libjpeg_gcc_O2 -ljpeg | |
// or: clang -O3 imgLoadBench.c -o imgLoadBench_stb_clang_O3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* SDL2 mousebutton test | |
* | |
* build with: | |
* $ gcc $(sdl2-config --cflags) -o sdl2test sdl2test.c $(sdl2-config --libs) | |
*/ | |
#include <stdio.h> | |
#include <SDL.h> | |
#include <errno.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* A simple allocator that uses a fixed sized memory buffer and doesn't reuse | |
* memory until it's Reset() | |
* It's untested and not thread-safe (achieving that shouldn't be hard, though, | |
* see comment at AllocBlock()) | |
* | |
* | |
* (C) 2015 Daniel Gibson | |
* | |
* License: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Encodes a given file to png using stb_image_write, miniz, lodepng and libpng | |
* | |
* Useful to compare the compression ratios achievable with the different encoders. | |
* Blog post with results: http://wp.me/pEPJ4-5U | |
* | |
* Needs: | |
* - stb_image.h and stb_image_write.h from https://github.com/nothings/stb | |
* - lodepng.c and lodepng.h from http://lodev.org/lodepng/ | |
* - miniz.c from https://github.com/richgel999/miniz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The Daikatana .wal format is similar to Quake2, but supports a palette per texture | |
(even if it's not always used, see below) and 9 mipmap levels instead of 4. | |
If you wanna check whether a .wal is in daikatana or q2 format, check whether | |
the first byte is == 3 (daikatana) or > 32 (ASCII ' '; then it's likely Quake2) | |
because in Quake2 it's the name which should start with a printable ASCII char. | |
Having 9 MipMap levels implies that for many textures, the last levels will be | |
1x1 pixels... Daikatana itself stops loading more mipmaps once the last loaded | |
one has a width or height of 1. | |
Each mipmap level has half the width and height of the previous one. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Daikatana .pak format. It's similar to Quake/Quake2 format, but supports compressed files as well. | |
// I think that only the following file types are compressed: .tga .bmp .wal .pcx .bsp | |
// I wouldn't rely on this list when unpacking, but when packing, only compress those. | |
// the structs are based on pakextract.c from https://github.com/yquake2/pakextract | |
// all ints are 32bit Little Endian. | |
struct pak_header | |
{ | |
char signature[4]; // {'P','A','C','K'}, like in Quake/Quake2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Kinda messy code to parse and display 8bit BMPs and Daikatana wals | |
* Can also be compiled to check whether the colormaps of textures in a | |
* directory match that of the corresponding colormap.bmp | |
* | |
* Note that it currently only displays the first mipmap level of a .wal texture | |
* and ignores the animname, flags, contents and value fields of the header. | |
* | |
* (C) 2016 Daniel Gibson | |
* |
OlderNewer