[Scummvm-cvs-logs] CVS: scummvm/bs2 controls.cpp,1.10,1.11 controls.h,1.1,1.2 sword2.cpp,1.18,1.19

Torbj?rn Andersson eriktorbjorn at users.sourceforge.net
Mon Aug 25 23:54:12 CEST 2003


Update of /cvsroot/scummvm/scummvm/bs2
In directory sc8-pr-cvs1:/tmp/cvs-serv20187

Modified Files:
	controls.cpp controls.h sword2.cpp 
Log Message:
The graphics detail settings partially work now. They only affect how
sprites are drawn, but I think that's how it should be.

1: No bells or whistles.
2: This setting adds sprite blending, e.g. the smoke at the docks or the
   display cases at the Glease Gallery. 
3: This setting adds light map support, e.g. when walking under the shack
   at the docks.
4: This setting adds better scaling algorithms.

The first three settings should work fine now. In fact, the third setting
is what we used to implement. The fourth setting still needs work and
testing. I've added code for downscaling case, but frankly I'm not
convinced the result is any better than with the simpler scaler. I usually
can't even tell the difference.

Of course, my translation of the original code could very well be buggy.


Index: controls.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/controls.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- controls.cpp	24 Aug 2003 14:13:12 -0000	1.10
+++ controls.cpp	26 Aug 2003 06:52:59 -0000	1.11
@@ -1919,7 +1919,7 @@
 	g_sword2->_sound->MuteFx(buff[5]);
 
 
-	UpdateGraphicsLevel(GetRenderType(), buff[6]);	// (James13jun97)
+	UpdateGraphicsLevel(buff[6]);	// (James13jun97)
 
 	speechSelected      = !buff[4];
 	subtitles			= buff[7];
@@ -2091,7 +2091,6 @@
 	//uint8   safe_musicVolume  = musicVolume;
 	//uint8   safe_speechVolume = speechVolume;
 	//uint8   safe_fxVolume     = fxVolume;
-	uint8   safe_grfxLevel    = grfxLevel;
 
 // button state variables
 	uint8	dreverse_stereo_state = 0, dmusic_mute_state = 0, dspeech_mute_state = 0, dfx_mute_state = 0, dobject_state = 0, dsubtitle_state = 0;
@@ -2540,7 +2539,7 @@
 				lb_down = 0;
 				if	(touching_restore_button && restore_button_state)	// ok to settings
 				{
-					UpdateGraphicsLevel(safe_grfxLevel, grfxLevel);	// (James13jun97)
+					UpdateGraphicsLevel(grfxLevel);	// (James13jun97)
 
 					g_sword2->_sound->MuteMusic(music_mute_state);					// Ensure all the levels are recorded correctly (Pete21Aug97)
 					g_sword2->_sound->MuteSpeech(speech_mute_state);
@@ -2784,106 +2783,34 @@
 	return;	//just return to game
 }
 
-//-----------------------------------------------------------------------------------------------------------------------
-void UpdateGraphicsLevel(uint8 oldLevel, uint8 newLevel)	// (James13jun97)
-{
-
-	switch (oldLevel)			// Set the graphics level
-	{
-		//-------------------------------
-		case 0:		// lowest setting: h/w only; no graphics fx
-			switch(newLevel)
-			{
-				case 0:
-					break;
-
-				case 1:
-					ClearBltFx();
-					ClearShadowFx();
-					CloseBackgroundLayer();
-					break;
-
-				case 2:
-					ClearBltFx();
-					CloseBackgroundLayer();
-					break;
-
-				case 3:	// same as case 2 until case 2 has edge-blending inactivated
-					CloseBackgroundLayer();
-					break;
-			}
+void UpdateGraphicsLevel(uint8 newLevel) {	// (James13jun97)
+	switch (newLevel) {
+		case 0:		// Lowest setting: no graphics fx
+			ClearTransFx();
+			ClearShadowFx();
+			ClearBltFx();
 			break;
-		//-------------------------------
-		case 1:		// medium-low setting: s/w transparency-blending
-			switch(newLevel)
-			{
-				case 1:
-					break;
-
-				case 0:
-					SetUpBackgroundLayers();	// InitialiseBackgroundLayer for each layer! (see layers.cpp)
-					break;
-
-				case 2:
-					SetShadowFx();
-					break;
-
-				case 3:	// same as case 2 until case 2 has edge-blending inactivated
-					SetBltFx();
-					break;
-			}
+		case 1:		// Medium-low setting: transparency-blending
+			SetTransFx();
+			ClearShadowFx();
+			ClearBltFx();
 			break;
-		//-------------------------------
-		case 2:		// medium-high setting: s/w transparency-blending + shading
-			switch(newLevel)
-			{
-				case 2:
-					break;
-
-				case 3:	// same as case 2 until case 2 has edge-blending inactivated
-					SetBltFx();
-					break;
-
-				case 1:
-					ClearShadowFx();
-					break;
-
-				case 0:
-					SetUpBackgroundLayers();	// InitialiseBackgroundLayer for each layer! (see layers.cpp)
-					break;
-			}
+		case 2:		// Medium-high setting: transparency-blending + shading
+			SetTransFx();
+			SetShadowFx();
+			ClearBltFx();
 			break;
-		//-------------------------------
-		case 3:		// highest setting: s/w transparency-blending + shading + edge-blending (& improved stretching)
-			switch(newLevel)
-			{
-				case 2:
-					ClearBltFx();
-					break;
-
-				case 3:	// same as case 2 until case 2 has edge-blending inactivated
-					break;
-
-				case 1:
-					ClearBltFx();
-					ClearShadowFx();
-					break;
-
-				case 0:
-					SetUpBackgroundLayers();	// InitialiseBackgroundLayer for each layer! (see layers.cpp)
-					break;
-			}
+		case 3:		// Highest setting: transparency-blending + shading + edge-blending + improved stretching
+			SetTransFx();
+			SetShadowFx();
+			SetBltFx();
 			break;
-		//-------------------------------
 	}
 
-	// update our global variable - which needs to be checked when dimming the palette
-	// in PauseGame() in sword2.cpp (since palette-matching cannot be done with dimmed palette
-	// so we turn down one notch while dimmed, if at top level)
+	// update our global variable - which needs to be checked when dimming
+	// the palette in PauseGame() in sword2.cpp (since palette-matching
+	// cannot be done with dimmed palette so we turn down one notch while
+	// dimmed, if at top level)
+
 	current_graphics_level = newLevel;
 }
-//-----------------------------------------------------------------------------------------------------------------------
-//-----------------------------------------------------------------------------------------------------------------------
-//-----------------------------------------------------------------------------------------------------------------------
-//-----------------------------------------------------------------------------------------------------------------------
-

Index: controls.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/controls.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- controls.h	28 Jul 2003 01:44:37 -0000	1.1
+++ controls.h	26 Aug 2003 06:52:59 -0000	1.2
@@ -29,7 +29,7 @@
 void	Restart_control(void);	//Tony4Apr97
 void	Option_control(void);	//Pete5Jun97
 int32   ReadOptionSettings(void);	//Pete10Jun97
-void	UpdateGraphicsLevel(uint8 oldLevel, uint8 newLevel);	// (James13jun97)
+void	UpdateGraphicsLevel(uint8 newLevel);	// (James13jun97)
 
 extern uint8 subtitles;		// text selected
 extern uint8 speechSelected;

Index: sword2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/sword2.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- sword2.cpp	25 Aug 2003 06:13:28 -0000	1.18
+++ sword2.cpp	26 Aug 2003 06:52:59 -0000	1.19
@@ -542,7 +542,7 @@
 
 	if (current_graphics_level==3)	// if level at max
 	{
-		UpdateGraphicsLevel(3,2);	// turn down because palette-matching won't work when dimmed
+		UpdateGraphicsLevel(2);	// turn down because palette-matching won't work when dimmed
 		graphics_level_fudged=1;
 	}
 
@@ -567,7 +567,7 @@
 
  	if (graphics_level_fudged)	// if level at max
 	{
-		UpdateGraphicsLevel(2,3);	// turn up again
+		UpdateGraphicsLevel(3);	// turn up again
 		graphics_level_fudged=0;
 	}
 





More information about the Scummvm-git-logs mailing list