From 91907a3009a3a6b48b7fe8f746165cb8e24594c8 Mon Sep 17 00:00:00 2001 From: Guido Falsi Date: Wed, 18 Jul 2012 11:27:01 +0000 Subject: A simple first person shooter of blowing up asteroids in 3D space. The codebase also serves as an introduction to trigonometry and OpenGL. WWW: http://sourceforge.net/projects/a3d/ http://staff.psc.edu/smp/a3d/ PR: ports/168177 Submitted by: nemysis@gmx.ch Approved by: tabthorpe (mentor) --- games/asteroids3d/files/patch-src-texture.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 games/asteroids3d/files/patch-src-texture.c (limited to 'games/asteroids3d/files') diff --git a/games/asteroids3d/files/patch-src-texture.c b/games/asteroids3d/files/patch-src-texture.c new file mode 100644 index 000000000000..d36d3dce6501 --- /dev/null +++ b/games/asteroids3d/files/patch-src-texture.c @@ -0,0 +1,28 @@ +--- src/texture.c.orig 2008-04-06 16:37:29.000000000 +0200 ++++ src/texture.c 2012-05-20 11:27:24.000000000 +0200 +@@ -99,19 +99,19 @@ + static void average_RGBA_alpha_and_floor(unsigned char *image, + int x, int y, int flr) + { +- int ir, ig, ib, ia, i, new_alpha; ++ int ir, ig, ib, ia, i; + + for (i = 0; i < x * y * 4; i += 4) { + ir = image[i]; + ig = image[i+1]; + ib = image[i+2]; +- ia = image[i+3]; ++ /* ia = image[i+3]; */ + +- new_alpha = (ir + ig + ib) / 3; +- if (new_alpha < flr) +- new_alpha = 0; ++ ia = (ir + ig + ib) / 3; ++ if (ia < flr) ++ ia = 0; + +- image[i+3] = new_alpha; ++ image[i+3] = ia; + } + + return; -- cgit v1.2.3