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
/* | |
* 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
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
// 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 | |
* |
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
[ | |
[ | |
[ | |
"classname", | |
"worldspawn" | |
], | |
[ | |
"color", | |
"0 0 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
// this is hacky and assumes messages.json is <64k bytes. that's the case for | |
// https://github.com/kamalmarhubi/one-second/blob/master/setup/protobuf/message.json | |
#include "rapidjson/document.h" | |
#include <stdio.h> | |
#include <stdlib.h> | |
int main(int argc, char** argv) | |
{ | |
size_t numIterations = 1; |
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
// in src/events/SDL_mouse.c added some SDL_Log() calls to SDL_PrivateSendMouseMotion(): | |
#include "SDL_log.h" | |
static int | |
SDL_PrivateSendMouseMotion(SDL_Window * window, SDL_MouseID mouseID, int relative, int x, int y) | |
{ | |
SDL_Mouse *mouse = SDL_GetMouse(); | |
int posted; | |
int xrel; | |
int yrel; |
OlderNewer