summaryrefslogtreecommitdiff
path: root/games/abuse/patches/patch-am
blob: 0becb6e48b64b9500be97ac373f99e0f1ece5257 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$NetBSD: patch-am,v 1.1 2004/07/11 00:11:26 wiz Exp $

--- abuse/src/gamma.c.orig	1996-04-14 22:14:21.000000000 +0200
+++ abuse/src/gamma.c
@@ -136,12 +136,11 @@ void gamma_correct(palette *&pal, int fo
   pal=new palette;
   for (int i=0;i<256;i++)
   {
-    double r,g,b;
-    uchar or,og,ob;
-    old_pal->get(i,or,og,ob);
-    pal->set(i,(int)(pow(or/255.0,gamma)*255),
-	     (int)(pow(og/255.0,gamma)*255),
-	     (int)(pow(ob/255.0,gamma)*255));
+    uchar oldr,oldg,oldb;
+    old_pal->get(i,oldr,oldg,oldb);
+    pal->set(i,(int)(pow(oldr/255.0,gamma)*255),
+	     (int)(pow(oldg/255.0,gamma)*255),
+	     (int)(pow(oldb/255.0,gamma)*255));
   }
 
   pal->load();