On Saturday,  2 December 2006 at 19:11, Dennis Schridde wrote:
> Am Samstag, 2. Dezember 2006 18:51 schrieb Christian Ohm:
> > There have been quite a few patches fixing things, or adding small
> > features while touching only a few lines of code in the trunk (the
> > playlist fix, and the SDL_QUIT and gamma patches, for example). Any
> > plans to apply those to 2.0 as well?
> Go for it... ;)
> Actually it was not directly planed, but if someone wants to do it...

I had a look at the SVN changelog. In most cases, I don't know if the
fix applies to 2.0 as well or just a new feature. And there are quite a
few patches where I can't find the supposed fix in the remaining
changes, so the original author might want to have a look:

r371: Fixed script compilation bugs

r383: Remove an unnecessary and wrong cast
applies

r386: Disabled "Allied players send vision to each other automatically (only 
once)" for "Allow alliances" alliance mode

r397: Correct openal buffer
applies, but needs another change

r405: Fixed difficulty slider applying settings to the wrong players
r407: Fixed disabled AIs showing up in the game
r411: fixed and enabled shared ally vision for TEAMPLAY and 'Locked Teams' modes
      fixed disabled players allying their team members
r413: Fixed double messages in online games
r415: Fixed AIs getting renamed when changing player number in MP games.
      Prevented NETbcast() from flooding the log in games with no network 
communication.
      orderDroidObj() scripting function will no longer cause ASSERT when 
DORDER_DROIDPERAIR is passed as parameter.
r422: It is now possible to win in a team in 'Locked Alliances' mode, also in 
this mode a player doesn't lose until all of his team members were defeated
      Game now shows a text message when player has won/lost the game (just a 
temporary solution to bug #7317)
      Added extra heap debug, should be there at least until we fix bug #6530, 
as PTRVALID() doesn't seem to detect corrupted DROID pointers on win
      Increased number of iterations A* is allowed to do per frame, which will 
hopefully speed up pathfinding
      Fixed multiplayer menu slider bug (bug #6529)
      Fixed players not forwarding enemy units visibility to their allies in 
'TEAMPLAY' and 'Locked Alliances' modes
r424: Re-enabled some debug keys and disabled unused ones

r427: Process SDL_QUIT
applies

r428, r430, r508: Add gamma controls
combined patch may be attached

r436: fixed implicit bool/int to string convertion for the scripting language
      minor scripting function fixes
r440: Make lots of __inline, _inline, FUNCINLINE and whatnot static inline. See 
bug#7591
r448: Fixed double declaration of "FUNCTION" token for bison

r451: resolution config value has been changed to width and height (easier to 
parse). I probably forgot to tell that I changed the --viewport cl option to 
--resolution, which should be more clear to non programmers
needs parts of the previous one as well. I think we should use
--resolution in 2.0 as well, so we do not need to document the different
versions.

r452: Report wrong tracknumbers to LOG_SOUND and don't crash in 
sound_Play*DTrack
      Correct --help text
      Make console backlog key configurable

r459: HP/Reload bars overlaping
only for multi-turret?

r460: commander-related crash fix
r472: sensorcrash.patch: fixes a crash when repairing a not damaged command 
center, corrects the mouse cursor

r474: Fix for bug #7708: isHumanPlayer() now checks for player numbers outside 
the range if [0,MAX_PLAYERS)
applies

r492: License clarification about original data files
add this or whatever we decide on 

r499: fixes disappearing oil derricks (bug #7740)

r501: Fix typos in COMPILE and remove outdated COMPILE.html
plus check other docs

r502: Check for '\r' as well as '\n'. This should make playlists with DOS line 
endings work
applies

r511: Attempt to fix a script callback bug as described on IRC
r515: Fixed target prediction finally
      Fixed a bug which prevents AA weapon area of effect damage from working 
properly
      Fixed crashes when firing at baba people,baba vehicle in singleplayer 
campaign
r517: Fixed a potential crash with transport
      Fixed a crash/repair units disorder when linked to a commander




-- 
You can never do just one thing.
                -- Hardin
Sun Dec  3 02:59:40 CET 2006  [EMAIL PROTECTED]
  * r428, r430, r508: Add gamma controls
diff -rN -u -ud old-wz-2.0/lib/ivis_common/piestate.h 
new-wz-2.0/lib/ivis_common/piestate.h
--- old-wz-2.0/lib/ivis_common/piestate.h       2006-12-03 03:38:07.700173179 
+0100
+++ new-wz-2.0/lib/ivis_common/piestate.h       2006-12-03 03:38:08.003129225 
+0100
@@ -143,7 +143,7 @@
 /***************************************************************************/
 extern void pie_SetDefaultStates();//Sets all states
 extern void pie_SetDepthBufferStatus(DEPTH_MODE depthMode);
-extern WZ_DEPRECATED void pie_SetGammaValue(float val);
+extern void pie_SetGammaValue(float val);
 //renderer capability
 extern void pie_SetTranslucent(BOOL val);
 extern BOOL pie_Translucent(void);
diff -rN -u -ud old-wz-2.0/lib/ivis_opengl/piestate.c 
new-wz-2.0/lib/ivis_opengl/piestate.c
--- old-wz-2.0/lib/ivis_opengl/piestate.c       2006-12-03 03:38:07.699173324 
+0100
+++ new-wz-2.0/lib/ivis_opengl/piestate.c       2006-12-03 03:38:08.004129079 
+0100
@@ -11,6 +11,7 @@
 #ifdef _MSC_VER
 #include <windows.h>  //needed for gl.h!  --Qamly
 #endif
+#include <SDL/SDL.h>
 #include <SDL/SDL_opengl.h>
 
 #include "lib/framework/frame.h"
@@ -207,6 +208,8 @@
 }
 
 /***************************************************************************/
-void pie_SetGammaValue(float val) // FIXME Remove if unused
+void pie_SetGammaValue(float val)
 {
+       debug(LOG_VIDEO, "%s(%f)", __FUNCTION__, val);
+       SDL_SetGamma(val, val, val);
 }
diff -rN -u -ud old-wz-2.0/src/configuration.c new-wz-2.0/src/configuration.c
--- old-wz-2.0/src/configuration.c      2006-12-03 03:38:07.699173324 +0100
+++ new-wz-2.0/src/configuration.c      2006-12-03 03:38:08.020126758 +0100
@@ -32,7 +32,7 @@
 
 #define DEFAULTFXVOL   80
 #define DEFAULTCDVOL   60
-#define DEFAULTGAMMA   25
+#define DEFAULTGAMMA   20
 #define DEFAULTSCROLL  800
 #define DEFAULTMAPNAME "Rush"
 
@@ -89,18 +89,20 @@
 
        // //////////////////////////
        // gamma
-       if(getWarzoneKeyNumeric("gamma", &val))
+       if (getWarzoneKeyNumeric("gamma", &val))
        {
-               gammaValue =(float)val/(float)25;
-               if(gammaValue<0.5)gammaValue =(float).5;
-               pie_SetGammaValue(gammaValue);
+               gammaValue = val;
+               if (gammaValue < 10)
+                       gammaValue = 10;
+               pie_SetGammaValue((float)gammaValue / 20.0f);
        }
        else
        {
-               gammaValue =(float)DEFAULTGAMMA/(float)25;
-               pie_SetGammaValue(gammaValue);
-               if(gammaValue<0.5)gammaValue =(float).5;
-               setWarzoneKeyNumeric("gamma", DEFAULTGAMMA);
+               gammaValue = DEFAULTGAMMA;
+               if (gammaValue < 10)
+                       gammaValue = 10;
+               pie_SetGammaValue((float)gammaValue / 20.0f);
+               setWarzoneKeyNumeric("gamma", gammaValue);
        }
 
        // //////////////////////////
@@ -535,7 +537,7 @@
                setDifficultyLevel(DL_NORMAL);
        }
        setWarzoneKeyNumeric("allowSubtitles", war_GetAllowSubtitles());
-       setWarzoneKeyNumeric("gamma",(DWORD)(gammaValue*25));                   
// gamma
+       setWarzoneKeyNumeric("gamma", (SDWORD)(gammaValue));
        setWarzoneKeyNumeric("scroll",(DWORD)scroll_speed_accel);               
// scroll
        setWarzoneKeyNumeric("difficulty", getDifficultyLevel());               
// level
        setWarzoneKeyNumeric("barmode",(DWORD)barMode);                 
//energybars
diff -rN -u -ud old-wz-2.0/src/display3d.c new-wz-2.0/src/display3d.c
--- old-wz-2.0/src/display3d.c  2006-12-03 03:38:07.698173469 +0100
+++ new-wz-2.0/src/display3d.c  2006-12-03 03:38:08.029125453 +0100
@@ -1030,9 +1030,6 @@
        gridCentreX = ( player.p.x + ((visibleXTiles/2)<<TILE_SHIFT) );
        gridCentreZ = ( player.p.z + ((visibleYTiles/2)<<TILE_SHIFT) );
 
-
-       pie_SetGammaValue(gammaValue);
-
        edgeTile.texture = 0;
 
        bEnergyBars = TRUE;
diff -rN -u -ud old-wz-2.0/src/display.c new-wz-2.0/src/display.c
--- old-wz-2.0/src/display.c    2006-12-03 03:38:07.699173324 +0100
+++ new-wz-2.0/src/display.c    2006-12-03 03:38:08.028125598 +0100
@@ -259,7 +259,7 @@
 BOOL   bigBlueInWorld = FALSE;
 BOOL   missionComplete = FALSE;
 UWORD  RadarZoomLevel = 0;
-float  gammaValue = (float)1.0;
+int gammaValue = 20;
 DROID  *psSelectedVtol;
 DROID  *psDominantSelected;
 
diff -rN -u -ud old-wz-2.0/src/display.h new-wz-2.0/src/display.h
--- old-wz-2.0/src/display.h    2006-12-03 03:38:07.698173469 +0100
+++ new-wz-2.0/src/display.h    2006-12-03 03:38:08.028125598 +0100
@@ -187,7 +187,7 @@
 extern BOOL CheckScrollLimits(void);
 //extern BOOL  widgetsOn;
 extern BOOL    rotActive;
-extern float   gammaValue;
+extern int gammaValue;
 //extern BOOL  forceWidgetsOn;
 
 BASE_OBJECT    *mouseTarget( void );
diff -rN -u -ud old-wz-2.0/src/keybind.c new-wz-2.0/src/keybind.c
--- old-wz-2.0/src/keybind.c    2006-12-03 03:38:07.697173614 +0100
+++ new-wz-2.0/src/keybind.c    2006-12-03 03:38:08.039124002 +0100
@@ -424,7 +424,8 @@
 /* Raises the 3dfx gamma value */
 void   kf_RaiseGamma( void )
 {
-
+       gammaValue++;
+       pie_SetGammaValue((float)gammaValue / 20.0f);
 }
 
 // --------------------------------------------------------------------------
@@ -432,7 +433,8 @@
 /* Lowers the threedfx gamma value */
 void   kf_LowerGamma( void )
 {
-
+       gammaValue--;
+       pie_SetGammaValue((float)gammaValue / 20.0f);
 }
 
 // --------------------------------------------------------------------------
diff -rN -u -ud old-wz-2.0/src/keymap.c new-wz-2.0/src/keymap.c
--- old-wz-2.0/src/keymap.c     2006-12-03 03:38:07.696173759 +0100
+++ new-wz-2.0/src/keymap.c     2006-12-03 03:38:08.039124002 +0100
@@ -250,6 +250,8 @@
        kf_TriFlip,
        kf_UpDroidScale,
        kf_DownDroidScale,
+       kf_RaiseGamma,
+       kf_LowerGamma,
 
        NULL            // last function!
 };
@@ -397,6 +399,8 @@
        
keyAddMapping(KEYMAP_ASSIGNABLE,KEY_LALT,KEY_S,KEYMAP_PRESSED,kf_ToggleShadows, 
"Toggles shadows");
        
keyAddMapping(KEYMAP_ASSIGNABLE,KEY_LCTRL,KEY_TAB,KEYMAP_PRESSED,kf_ToggleRadarTerrain,
         "Toggle radar terrain");
        
keyAddMapping(KEYMAP_ASSIGNABLE,KEY_LSHIFT,KEY_TAB,KEYMAP_PRESSED,kf_ToggleRadarAllyEnemy,
      "Toggle ally-enemy radar view");
+       keyAddMapping(KEYMAP_ASSIGNABLE, KEY_LALT, KEY_KP_MINUS, 
KEYMAP_PRESSED, kf_LowerGamma, "Lower gamma");
+       keyAddMapping(KEYMAP_ASSIGNABLE, KEY_LALT, KEY_KP_PLUS, KEYMAP_PRESSED, 
kf_RaiseGamma, "Raise gamma");
 
        // Some extra non QWERTY mappings but functioning in same way
        
keyAddMapping(KEYMAP_ASSIGNABLE,KEY_IGNORE,KEY_COMMA,KEYMAP_PRESSED,kf_SetDroidRetreatMedium,
      strresGetString(psStringRes,STR_BIND_LDAM) );

_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev

Reply via email to