[Scummvm-cvs-logs] CVS: scummvm/sword2 build_display.cpp,1.70,1.71 build_display.h,1.15,1.16 defs.h,1.15,1.16 function.cpp,1.78,1.79 layers.cpp,1.36,1.37 mouse.h,1.17,1.18 sound.h,1.17,1.18 sword2.cpp,1.137,1.138 sword2.h,1.78,1.79

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Sun Feb 27 08:11:58 CET 2005


Update of /cvsroot/scummvm/scummvm/sword2
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3044

Modified Files:
	build_display.cpp build_display.h defs.h function.cpp 
	layers.cpp mouse.h sound.h sword2.cpp sword2.h 
Log Message:
Got rid of all the .h files but one in the 'driver' directory. They were
either very small or, in the case of driver96.h, a disorganized jumbles.


Index: build_display.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/build_display.cpp,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- build_display.cpp	19 Feb 2005 14:02:09 -0000	1.70
+++ build_display.cpp	27 Feb 2005 16:11:16 -0000	1.71
@@ -204,7 +204,7 @@
 
 	spriteInfo.x = _screenWide / 2 - frame->width / 2;
 	if (!time)
-		spriteInfo.y = _screenDeep / 2 - frame->height / 2 - RDMENU_MENUDEEP;
+		spriteInfo.y = _screenDeep / 2 - frame->height / 2 - MENUDEEP;
 	else
 		spriteInfo.y = 400 - frame->height;
 	spriteInfo.w = frame->width;

Index: build_display.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/build_display.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- build_display.h	19 Feb 2005 14:02:10 -0000	1.15
+++ build_display.h	27 Feb 2005 16:11:17 -0000	1.16
@@ -37,6 +37,10 @@
 #define BLOCKHEIGHT      64
 #define MAXLAYERS        5
 
+#define MENUDEEP         40
+#define RENDERWIDE       640
+#define RENDERDEEP       (480 - (MENUDEEP * 2))
+
 // Maximum scaled size of a sprite
 #define SCALE_MAXWIDTH   512
 #define SCALE_MAXHEIGHT  512
@@ -47,10 +51,57 @@
 
 namespace Sword2 {
 
+class Sword2Engine;
+
 struct ObjectMouse;
 struct ObjectGraphic;
 struct ObjectMega;
 
+// Sprite defines
+
+enum {
+	// This is the low byte part of the sprite type.
+
+	RDSPR_TRANS			= 0x0001,
+	RDSPR_BLEND			= 0x0004,
+	RDSPR_FLIP			= 0x0008,
+	RDSPR_SHADOW			= 0x0010,
+	RDSPR_DISPLAYALIGN		= 0x0020,
+	RDSPR_NOCOMPRESSION		= 0x0040,
+	RDSPR_EDGEBLEND			= 0x0080,	// Unused
+
+	// This is the high byte part of the sprite type, which defines what
+	// type of compression is used. Unless RDSPR_NOCOMPRESSION is set.
+
+	RDSPR_RLE16			= 0x0000,
+	RDSPR_RLE256			= 0x0100,
+	RDSPR_RLE256FAST		= 0x0200
+};
+
+// Fading defines
+
+enum {
+	RDFADE_NONE,
+	RDFADE_UP,
+	RDFADE_DOWN,
+	RDFADE_BLACK
+};
+
+// Palette defines
+
+enum {
+	RDPAL_FADE,
+	RDPAL_INSTANT
+};
+
+// Blitting FX defines
+
+enum {
+	RDBLTFX_SPRITEBLEND		= 0x01,
+	RDBLTFX_SHADOWBLEND		= 0x02,
+	RDBLTFX_EDGEBLEND		= 0x04
+};
+
 // Structure filled out by each object to register its graphic printing
 // requrements
 
@@ -78,14 +129,6 @@
 	bool shadingFlag;
 };
 
-enum {
-	MOUSE_normal		= 0,	// normal in game
-	MOUSE_menu		= 1,	// menu chooser
-	MOUSE_drag		= 2,	// dragging luggage
-	MOUSE_system_menu	= 3,	// system menu chooser
-	MOUSE_holding		= 4	// special
-};
-
 struct ScreenInfo {
 	uint16 scroll_offset_x;		// Position x
 	uint16 scroll_offset_y;		// Position y
@@ -133,6 +176,20 @@
 	bool transparent;
 };
 
+#if !defined(__GNUC__)
+	#pragma START_PACK_STRUCTS
+#endif
+
+struct Parallax {
+	uint16 w;
+	uint16 h;
+	uint32 offset[2];	// 2 is arbitrary
+} GCC_PACK;
+
+#if !defined(__GNUC__)
+	#pragma END_PACK_STRUCTS
+#endif
+
 class Screen {
 private:
 	Sword2Engine *_vm;

Index: defs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/defs.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- defs.h	20 Feb 2005 15:38:47 -0000	1.15
+++ defs.h	27 Feb 2005 16:11:17 -0000	1.16
@@ -24,20 +24,64 @@
 #define	SIZE	0x10000			// 65536 items per section
 #define	NuSIZE	0xffff			// & with this
 
-#define TEXT_OK             0x08EB0000
-#define TEXT_CANCEL         0x08EB0001
-#define TEXT_RESTORE        0x08EB0002
-#define TEXT_SAVE           0x08EB0003
-#define TEXT_QUIT           0x08EB0004
-#define TEXT_RESTART        0x08EB0005
-#define TEXT_OPTIONS        0x08EB000A
-#define TEXT_SUBTITLES      0x08EB000B
-#define TEXT_OBJECT_LABELS  0x08EB000C
-#define TEXT_MUSIC_VOLUME   0x08EB000E
-#define TEXT_SPEECH_VOLUME  0x08EB000F
-#define TEXT_FX_VOLUME      0x08EB0010
-#define TEXT_GFX_QUALITY    0x08EB0011
-#define TEXT_REVERSE_STEREO 0x08EB0015
+// Error codes
+
+enum {
+	// Generic error codes
+
+	RD_OK,
+	RDERR_UNKNOWN,
+	RDERR_OUTOFMEMORY,
+	RDERR_INVALIDFILENAME,
+
+	// Drawing error codes
+
+	RDERR_DECOMPRESSION,
+
+	// Sprite drawing error codes
+
+	RDERR_NOTIMPLEMENTED,
+	RDERR_NOTCLOSED,
+	RDERR_NOTOPEN,
+
+	// Menubar error codes
+
+	RDERR_INVALIDMENU,
+	RDERR_INVALIDPOCKET,
+	RDERR_INVALIDCOMMAND,
+
+	// Palette fading error codes
+
+	RDERR_FADEINCOMPLETE,
+
+	// Sound engine error codes
+
+	RDERR_SPEECHPLAYING,
+	RDERR_SPEECHNOTPLAYING,
+	RDERR_INVALIDWAV,
+	RDERR_FXALREADYOPEN,
+	RDERR_FXNOTOPEN,
+	RDERR_INVALIDID
+};
+
+// Text ids for the control panel etc.
+
+enum {
+	TEXT_OK				= 0x08EB0000,
+	TEXT_CANCEL			= 0x08EB0001,
+	TEXT_RESTORE			= 0x08EB0002,
+	TEXT_SAVE			= 0x08EB0003,
+	TEXT_QUIT			= 0x08EB0004,
+	TEXT_RESTART			= 0x08EB0005,
+	TEXT_OPTIONS			= 0x08EB000A,
+	TEXT_SUBTITLES			= 0x08EB000B,
+	TEXT_OBJECT_LABELS		= 0x08EB000C,
+	TEXT_MUSIC_VOLUME		= 0x08EB000E,
+	TEXT_SPEECH_VOLUME		= 0x08EB000F,
+	TEXT_FX_VOLUME			= 0x08EB0010,
+	TEXT_GFX_QUALITY		= 0x08EB0011,
+	TEXT_REVERSE_STEREO		= 0x08EB0015
+};
 
 // always 8 (George object used for Nico player character as well)
 #define CUR_PLAYER_ID 8

Index: function.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/function.cpp,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- function.cpp	20 Feb 2005 15:38:47 -0000	1.78
+++ function.cpp	27 Feb 2005 16:11:17 -0000	1.79
@@ -35,7 +35,6 @@
 #include "sword2/router.h"
 #include "sword2/sound.h"
 #include "sword2/driver/animation.h"
-#include "sword2/driver/render.h"
 
 namespace Sword2 {
 

Index: layers.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/layers.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- layers.cpp	21 Feb 2005 02:29:14 -0000	1.36
+++ layers.cpp	27 Feb 2005 16:11:17 -0000	1.37
@@ -27,8 +27,11 @@
 //	up to 2 foreground parallax layers
 
 #include "common/stdafx.h"
+
 #include "sword2/sword2.h"
+#include "sword2/defs.h"
 #include "sword2/logic.h"
+#include "sword2/mouse.h"
 #include "sword2/resman.h"
 #include "sword2/sound.h"
 
@@ -110,7 +113,7 @@
 		// off the edge. The minimum offsets are both 0.
 
 		_thisScreen.max_scroll_offset_x = screen_head->width - _screenWide;
-		_thisScreen.max_scroll_offset_y = screen_head->height - (_screenDeep - (RDMENU_MENUDEEP * 2));
+		_thisScreen.max_scroll_offset_y = screen_head->height - (_screenDeep - (MENUDEEP * 2));
 	} else {
 		// The later fits on the phyiscal screen. Switch off scrolling.
 		_thisScreen.scroll_flag = 0;

Index: mouse.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/mouse.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- mouse.h	20 Feb 2005 15:38:47 -0000	1.17
+++ mouse.h	27 Feb 2005 16:11:17 -0000	1.18
@@ -28,6 +28,38 @@
 struct ObjectMouse;
 struct BuildUnit;
 
+// Menubar defines.
+
+#define RDMENU_TOP		0
+#define RDMENU_BOTTOM		1
+
+enum {
+	MOUSE_normal		= 0,	// normal in game
+	MOUSE_menu		= 1,	// menu chooser
+	MOUSE_drag		= 2,	// dragging luggage
+	MOUSE_system_menu	= 3,	// system menu chooser
+	MOUSE_holding		= 4	// special
+};
+
+enum {
+	RDMOUSE_NOFLASH,
+	RDMOUSE_FLASH
+};
+
+enum {
+	RDMENU_HIDDEN,
+	RDMENU_SHOWN,
+	RDMENU_OPENING,
+	RDMENU_CLOSING,
+	RDMENU_ALMOST_HIDDEN
+};
+
+#define RDMENU_ICONWIDE		35
+#define RDMENU_ICONDEEP		30
+#define RDMENU_ICONSTART	24
+#define RDMENU_ICONSPACING	5
+#define RDMENU_MAXPOCKETS	15
+
 #if !defined(__GNUC__)
 	#pragma START_PACK_STRUCTS
 #endif

Index: sound.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/sound.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- sound.h	21 Feb 2005 08:35:18 -0000	1.17
+++ sound.h	27 Feb 2005 16:11:17 -0000	1.18
@@ -63,6 +63,21 @@
 	FX_LOOPING	= 4
 };
 
+// Sound defines
+
+enum {
+	RDSE_SAMPLEFINISHED		= 0,
+	RDSE_SAMPLEPLAYING		= 1,
+	RDSE_FXTOCLEAR			= 0,		// Unused
+	RDSE_FXCACHED			= 1,		// Unused
+	RDSE_FXSPOT			= 0,
+	RDSE_FXLOOP			= 1,
+	RDSE_FXLEADIN			= 2,
+	RDSE_FXLEADOUT			= 3,
+	RDSE_QUIET			= 1,
+	RDSE_SPEAKING			= 0
+};
+
 class CLUInputStream : public AudioStream {
 private:
 	File *_file;

Index: sword2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/sword2.cpp,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -d -r1.137 -r1.138
--- sword2.cpp	21 Feb 2005 08:16:50 -0000	1.137
+++ sword2.cpp	27 Feb 2005 16:11:17 -0000	1.138
@@ -488,7 +488,7 @@
 			break;
 		case OSystem::EVENT_MOUSEMOVE:
 			if (!(_eventFilter & RD_KEYDOWN)) {
-				_mouse->setPos(event.mouse.x, event.mouse.y - RDMENU_MENUDEEP);
+				_mouse->setPos(event.mouse.x, event.mouse.y - MENUDEEP);
 			}
 			break;
 		case OSystem::EVENT_LBUTTONDOWN:

Index: sword2.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/sword2.h,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- sword2.h	22 Feb 2005 07:37:50 -0000	1.78
+++ sword2.h	27 Feb 2005 16:11:17 -0000	1.79
@@ -32,7 +32,6 @@
 
 #include "common/util.h"
 
-#include "sword2/driver/driver96.h"
 #include "sword2/build_display.h"
 #include "sword2/header.h"
 #include "sword2/icons.h"





More information about the Scummvm-git-logs mailing list