[Scummvm-cvs-logs] CVS: scummvm/bs2 controls.cpp,1.25,1.26 controls.h,1.5,1.6 mem_view.cpp,1.14,1.15 memory.cpp,1.12,1.13 memory.h,1.6,1.7 resman.cpp,1.50,1.51 resman.h,1.8,1.9 sword2.cpp,1.47,1.48 sword2.h,1.14,1.15

Max Horn fingolfin at users.sourceforge.net
Fri Oct 3 18:12:06 CEST 2003


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

Modified Files:
	controls.cpp controls.h mem_view.cpp memory.cpp memory.h 
	resman.cpp resman.h sword2.cpp sword2.h 
Log Message:
removed Sword2 prefixes of most classes (made obsolete by our namespace usage); renamed Sword2State to Sword2Engine

Index: controls.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/controls.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- controls.cpp	4 Oct 2003 00:52:25 -0000	1.25
+++ controls.cpp	4 Oct 2003 01:09:29 -0000	1.26
@@ -44,7 +44,7 @@
 // our fonts start on SPACE character (32)
 #define SIZE_OF_CHAR_SET (256 - 32)
 
-Sword2Gui gui;
+Gui gui;
 
 enum {
 	kAlignLeft,
@@ -52,7 +52,7 @@
 	kAlignCenter
 };
 
-class Sword2FontRenderer {
+class FontRenderer {
 private:
 	struct Glyph {
 		uint8 *_data;
@@ -62,7 +62,7 @@
 	int _fontId;
 
 public:
-	Sword2FontRenderer(int fontId) : _fontId(fontId) {
+	FontRenderer(int fontId) : _fontId(fontId) {
 		uint8 *font = res_man.open(fontId);
 		_frameHeader *head;
 		_spriteInfo sprite;
@@ -82,7 +82,7 @@
 		res_man.close(fontId);
 	}
 
-	~Sword2FontRenderer() {
+	~FontRenderer() {
 		for (int i = 0; i < SIZE_OF_CHAR_SET; i++)
 			DeleteSurface(_glyph[i]._data);
 	}
@@ -119,7 +119,7 @@
 	void drawText(int textId, int x, int y, int alignment = kAlignLeft);
 };
 
-void Sword2FontRenderer::drawText(char *text, int x, int y, int alignment) {
+void FontRenderer::drawText(char *text, int x, int y, int alignment) {
 	_spriteInfo sprite;
 	int i;
 
@@ -149,23 +149,23 @@
 	}
 }
 
-void Sword2FontRenderer::drawText(int textId, int x, int y, int alignment) {
+void FontRenderer::drawText(int textId, int x, int y, int alignment) {
 	char text[MAX_STRING_LEN];
 
 	fetchText(textId, text);
 	drawText(text, x, y, alignment);
 }
 
-class Sword2Dialog;
+class Dialog;
 
 typedef struct Surface {
 	uint8 *_surface;
 	bool _original;
 } WidgetSurface;
 
-class Sword2Widget {
+class Widget {
 protected:
-	Sword2Dialog *_parent;
+	Dialog *_parent;
 
 	_spriteInfo *_sprites;
 	WidgetSurface *_surfaces;
@@ -175,7 +175,7 @@
 	Common::Rect _hitRect;
 
 public:
-	Sword2Widget(Sword2Dialog *parent, int states) :
+	Widget(Dialog *parent, int states) :
 			_parent(parent), _numStates(states), _state(0) {
 		_sprites = (_spriteInfo *) calloc(states, sizeof(_spriteInfo));
 		_surfaces = (WidgetSurface *) calloc(states, sizeof(WidgetSurface));
@@ -183,7 +183,7 @@
 		_hitRect.left = _hitRect.right = _hitRect.top = _hitRect.bottom = -1;
 	}
 
-	virtual ~Sword2Widget() {
+	virtual ~Widget() {
 		for (int i = 0; i < _numStates; i++) {
 			if (_surfaces[i]._original)
 				DeleteSurface(_surfaces[i]._surface);
@@ -193,14 +193,14 @@
 	}
 
 	void createSurfaceImage(int state, uint32 res, int x, int y, uint32 pc);
-	void linkSurfaceImage(Sword2Widget *from, int state, int x, int y);
+	void linkSurfaceImage(Widget *from, int state, int x, int y);
 
 	void createSurfaceImages(uint32 res, int x, int y) {
 		for (int i = 0; i < _numStates; i++)
 			createSurfaceImage(i, res, x, y, i);
 	}
 
-	void linkSurfaceImages(Sword2Widget *from, int x, int y) {
+	void linkSurfaceImages(Widget *from, int x, int y) {
 		for (int i = 0; i < from->_numStates; i++)
 			linkSurfaceImage(from, i, x, y);
 	}
@@ -242,7 +242,7 @@
 	virtual void releaseMouse(int x, int y) {}
 };
 
-void Sword2Widget::createSurfaceImage(int state, uint32 res, int x, int y, uint32 pc) {
+void Widget::createSurfaceImage(int state, uint32 res, int x, int y, uint32 pc) {
 	uint8 *file, *colTablePtr = NULL;
 	_animHeader *anim_head;
 	_frameHeader *frame_head;
@@ -298,7 +298,7 @@
 	res_man.close(res);
 };
 
-void Sword2Widget::linkSurfaceImage(Sword2Widget *from, int state, int x, int y) {
+void Widget::linkSurfaceImage(Widget *from, int state, int x, int y) {
 	_sprites[state].x = x;
 	_sprites[state].y = y;
 	_sprites[state].w = from->_sprites[state].w;
@@ -313,30 +313,30 @@
 
 #define MAX_WIDGETS 25
 
-class Sword2Dialog {
+class Dialog {
 private:
 	int _numWidgets;
-	Sword2Widget *_widgets[MAX_WIDGETS];
+	Widget *_widgets[MAX_WIDGETS];
 	bool _finish;
 	int _result;
 
 public:
-	Sword2Dialog() : _numWidgets(0), _finish(false), _result(0) {
+	Dialog() : _numWidgets(0), _finish(false), _result(0) {
 		SetFullPalette(CONTROL_PANEL_PALETTE);
 	}
 
-	virtual ~Sword2Dialog() {
+	virtual ~Dialog() {
 		for (int i = 0; i < _numWidgets; i++)
 			delete _widgets[i];
 	}
 
-	void registerWidget(Sword2Widget *widget) {
+	void registerWidget(Widget *widget) {
 		if (_numWidgets < MAX_WIDGETS) {
 			_widgets[_numWidgets++] = widget;
 		}
 	}
 
-	virtual void onAction(Sword2Widget *widget, int result = 0) {}
+	virtual void onAction(Widget *widget, int result = 0) {}
 
 	virtual void paint() {
 		EraseBackBuffer();
@@ -352,7 +352,7 @@
 	int run();
 };
 
-int Sword2Dialog::run() {
+int Dialog::run() {
 	int i;
 
 	paint();
@@ -424,10 +424,10 @@
 	return _result;
 }
 
-class Sword2Button : public Sword2Widget {
+class Button : public Widget {
 public:
-	Sword2Button(Sword2Dialog *parent, int x, int y, int w, int h) :
-			Sword2Widget(parent, 2) {
+	Button(Dialog *parent, int x, int y, int w, int h) :
+			Widget(parent, 2) {
 		setHitRect(x, y, w, h);
 	}
 
@@ -447,13 +447,13 @@
 	}
 };
 
-class Sword2ScrollButton : public Sword2Widget {
+class ScrollButton : public Widget {
 private:
 	uint32 _holdCounter;
 
 public:
-	Sword2ScrollButton(Sword2Dialog *parent, int x, int y, int w, int h) :
-			Sword2Widget(parent, 2), _holdCounter(0) {
+	ScrollButton(Dialog *parent, int x, int y, int w, int h) :
+			Widget(parent, 2), _holdCounter(0) {
 		setHitRect(x, y, w, h);
 	}
 
@@ -480,14 +480,14 @@
 	}
 };
 
-class Sword2Switch : public Sword2Widget {
+class Switch : public Widget {
 private:
 	bool _holding, _value;
 	int _upState, _downState;
 
 public:
-	Sword2Switch(Sword2Dialog *parent, int x, int y, int w, int h) :
-			Sword2Widget(parent, 2), _holding(false),
+	Switch(Dialog *parent, int x, int y, int w, int h) :
+			Widget(parent, 2), _holding(false),
 			_value(false), _upState(0), _downState(1) {
 		setHitRect(x, y, w, h);
 	}
@@ -537,9 +537,9 @@
 	}
 };
 
-class Sword2Slider : public Sword2Widget {
+class Slider : public Widget {
 private:
-	Sword2Widget *_background;
+	Widget *_background;
 	bool _dragging;
 	int _value, _targetValue;
 	int _maxValue;
@@ -554,9 +554,9 @@
 	}
 
 public:
-	Sword2Slider(Sword2Dialog *parent, Sword2Widget *background, int max,
-		int x, int y, int w, int h, Sword2Widget *base = NULL) :
-			Sword2Widget(parent, 1), _background(background),
+	Slider(Dialog *parent, Widget *background, int max,
+		int x, int y, int w, int h, Widget *base = NULL) :
+			Widget(parent, 1), _background(background),
 			_dragging(false), _value(0), _targetValue(0),
 			_maxValue(max) {
 		setHitRect(x, y, w, h);
@@ -572,7 +572,7 @@
 		// but I doubt that will make any noticeable difference.
 
 		_background->paint(&_hitRect);
-		Sword2Widget::paint(clipRect);
+		Widget::paint(clipRect);
 	}
 
 	void setValue(int value) {
@@ -654,25 +654,25 @@
 	}
 };
 
-class Sword2MiniDialog : public Sword2Dialog {
+class MiniDialog : public Dialog {
 private:
 	int _textId;
-	Sword2FontRenderer *_fontRenderer;
-	Sword2Widget *_panel;
-	Sword2Button *_okButton;
-	Sword2Button *_cancelButton;
+	FontRenderer *_fontRenderer;
+	Widget *_panel;
+	Button *_okButton;
+	Button *_cancelButton;
 
 public:
-	Sword2MiniDialog(uint32 textId) : _textId(textId) {
-		_fontRenderer = new Sword2FontRenderer(controls_font_id);
+	MiniDialog(uint32 textId) : _textId(textId) {
+		_fontRenderer = new FontRenderer(controls_font_id);
 
-		_panel = new Sword2Widget(this, 1);
+		_panel = new Widget(this, 1);
 		_panel->createSurfaceImages(1996, 203, 104);
 
-		_okButton = new Sword2Button(this, 243, 214, 24, 24);
+		_okButton = new Button(this, 243, 214, 24, 24);
 		_okButton->createSurfaceImages(2002, 243, 214);
 
-		_cancelButton = new Sword2Button(this, 243, 276, 24, 24);
+		_cancelButton = new Button(this, 243, 276, 24, 24);
 		_cancelButton->linkSurfaceImages(_okButton, 243, 276);
 
 		registerWidget(_panel);
@@ -680,19 +680,19 @@
 		registerWidget(_cancelButton);
 	}
 
-	~Sword2MiniDialog() {
+	~MiniDialog() {
 		delete _fontRenderer;
 	}
 
 	virtual void paint() {
-		Sword2Dialog::paint();
+		Dialog::paint();
 
 		_fontRenderer->drawText(_textId, 310, 134, kAlignCenter);
 		_fontRenderer->drawText(149618688, 270, 214);	// ok
 		_fontRenderer->drawText(149618689, 270, 276);	// cancel
 	}
 
-	virtual void onAction(Sword2Widget *widget, int result = 0) {
+	virtual void onAction(Widget *widget, int result = 0) {
 		if (widget == _okButton)
 			setResult(1);
 		else if (widget == _cancelButton)
@@ -700,66 +700,66 @@
 	}
 };
 
-class Sword2OptionsDialog : public Sword2Dialog {
+class OptionsDialog : public Dialog {
 private:
-	Sword2FontRenderer *_fontRenderer;
-	Sword2Widget *_panel;
-	Sword2Switch *_objectLabelsSwitch;
-	Sword2Switch *_subtitlesSwitch;
-	Sword2Switch *_reverseStereoSwitch;
-	Sword2Switch *_musicSwitch;
-	Sword2Switch *_speechSwitch;
-	Sword2Switch *_fxSwitch;
-	Sword2Slider *_musicSlider;
-	Sword2Slider *_speechSlider;
-	Sword2Slider *_fxSlider;
-	Sword2Slider *_gfxSlider;
-	Sword2Widget *_gfxPreview;
-	Sword2Button *_okButton;
-	Sword2Button *_cancelButton;
+	FontRenderer *_fontRenderer;
+	Widget *_panel;
+	Switch *_objectLabelsSwitch;
+	Switch *_subtitlesSwitch;
+	Switch *_reverseStereoSwitch;
+	Switch *_musicSwitch;
+	Switch *_speechSwitch;
+	Switch *_fxSwitch;
+	Slider *_musicSlider;
+	Slider *_speechSlider;
+	Slider *_fxSlider;
+	Slider *_gfxSlider;
+	Widget *_gfxPreview;
+	Button *_okButton;
+	Button *_cancelButton;
 
 	int32 writeOptionSettings(void);
 
 public:
-	Sword2OptionsDialog() {
-		_fontRenderer = new Sword2FontRenderer(controls_font_id);
+	OptionsDialog() {
+		_fontRenderer = new FontRenderer(controls_font_id);
 
-		_panel = new Sword2Widget(this, 1);
+		_panel = new Widget(this, 1);
 		_panel->createSurfaceImages(3405, 0, 40);
 
-		_objectLabelsSwitch = new Sword2Switch(this, 304, 100, 53, 32);
+		_objectLabelsSwitch = new Switch(this, 304, 100, 53, 32);
 		_objectLabelsSwitch->createSurfaceImages(3687, 304, 100);
 
-		_subtitlesSwitch = new Sword2Switch(this, 510, 100, 53, 32);
+		_subtitlesSwitch = new Switch(this, 510, 100, 53, 32);
 		_subtitlesSwitch->linkSurfaceImages(_objectLabelsSwitch, 510, 100);
 
-		_reverseStereoSwitch = new Sword2Switch(this, 304, 293, 53, 32);
+		_reverseStereoSwitch = new Switch(this, 304, 293, 53, 32);
 		_reverseStereoSwitch->linkSurfaceImages(_objectLabelsSwitch, 304, 293);
 
-		_musicSwitch = new Sword2Switch(this, 516, 157, 40, 32);
+		_musicSwitch = new Switch(this, 516, 157, 40, 32);
 		_musicSwitch->createSurfaceImages(3315, 516, 157);
 		_musicSwitch->reverseStates();
 
-		_speechSwitch = new Sword2Switch(this, 516, 205, 40, 32);
+		_speechSwitch = new Switch(this, 516, 205, 40, 32);
 		_speechSwitch->linkSurfaceImages(_musicSwitch, 516, 205);
 		_speechSwitch->reverseStates();
 
-		_fxSwitch = new Sword2Switch(this, 516, 250, 40, 32);
+		_fxSwitch = new Switch(this, 516, 250, 40, 32);
 		_fxSwitch->linkSurfaceImages(_musicSwitch, 516, 250);
 		_fxSwitch->reverseStates();
 
-		_musicSlider = new Sword2Slider(this, _panel, 16, 309, 161, 170, 27);
-		_speechSlider = new Sword2Slider(this, _panel, 14, 309, 208, 170, 27, _musicSlider);
-		_fxSlider = new Sword2Slider(this, _panel, 14, 309, 254, 170, 27, _musicSlider);
-		_gfxSlider = new Sword2Slider(this, _panel, 3, 309, 341, 170, 27, _musicSlider);
+		_musicSlider = new Slider(this, _panel, 16, 309, 161, 170, 27);
+		_speechSlider = new Slider(this, _panel, 14, 309, 208, 170, 27, _musicSlider);
+		_fxSlider = new Slider(this, _panel, 14, 309, 254, 170, 27, _musicSlider);
+		_gfxSlider = new Slider(this, _panel, 3, 309, 341, 170, 27, _musicSlider);
 
-		_gfxPreview = new Sword2Widget(this, 4);
+		_gfxPreview = new Widget(this, 4);
 		_gfxPreview->createSurfaceImages(256, 495, 310);
 
-		_okButton = new Sword2Button(this, 203, 382, 53, 32);
+		_okButton = new Button(this, 203, 382, 53, 32);
 		_okButton->createSurfaceImages(901, 203, 382);
 
-		_cancelButton = new Sword2Button(this, 395, 382, 53, 32);
+		_cancelButton = new Button(this, 395, 382, 53, 32);
 		_cancelButton->linkSurfaceImages(_okButton, 395, 382);
 
 		registerWidget(_panel);
@@ -792,12 +792,12 @@
 		_gfxPreview->setState(GetRenderType());
 	}
 
-	~Sword2OptionsDialog() {
+	~OptionsDialog() {
 		delete _fontRenderer;
 	}
 
 	virtual void paint() {
-		Sword2Dialog::paint();
+		Dialog::paint();
 
 		int maxWidth = 0;
 		int width;
@@ -839,7 +839,7 @@
 		_fontRenderer->drawText(149618689, 385, 382, kAlignRight);
 	}
 
-	virtual void onAction(Sword2Widget *widget, int result = 0) {
+	virtual void onAction(Widget *widget, int result = 0) {
 		// Since there is music playing while the dialog is displayed
 		// we need to update music volume immediately. Everything else
 		// is handled when the dialog is terminated.
@@ -887,7 +887,7 @@
 	}
 };
 
-int32 Sword2OptionsDialog::writeOptionSettings(void) {
+int32 OptionsDialog::writeOptionSettings(void) {
 	uint8 buff[10];
 	char filename[256];
 	SaveFile *fp;
@@ -932,17 +932,17 @@
 	kCursorTick = 1
 };
 
-class Sword2Slot : public Sword2Widget {
+class Slot : public Widget {
 private:
 	int _mode;
-	Sword2FontRenderer *_fr;
+	FontRenderer *_fr;
 	char _text[SAVE_DESCRIPTION_LEN];
 	bool _clickable;
 	bool _editable;
 
 public:
-	Sword2Slot(Sword2Dialog *parent, int x, int y, int w, int h) :
-			Sword2Widget(parent, 2), _clickable(false),
+	Slot(Dialog *parent, int x, int y, int w, int h) :
+			Widget(parent, 2), _clickable(false),
 			_editable(false) {
 		setHitRect(x, y, w, h);
 		_text[0] = 0;
@@ -964,7 +964,7 @@
 		return _editable;
 	}
 
-	void setText(Sword2FontRenderer *fr, int slot, char *text) {
+	void setText(FontRenderer *fr, int slot, char *text) {
 		_fr = fr;
 		if (text)
 			sprintf(_text, "%d.  %s", slot, text);
@@ -977,7 +977,7 @@
 	}
 
 	virtual void paint(Common::Rect *clipRect = NULL) {
-		Sword2Widget::paint();
+		Widget::paint();
 
 		// HACK: The main dialog is responsible for drawing the text
 		// when in editing mode.
@@ -1025,66 +1025,66 @@
 	}
 };
 
-class Sword2SaveLoadDialog : public Sword2Dialog {
+class SaveLoadDialog : public Dialog {
 private:
 	int _mode, _selectedSlot;
 	char _editBuffer[SAVE_DESCRIPTION_LEN];
 	int _editPos, _firstPos;
 	int _cursorTick;
 
-	Sword2FontRenderer *_fontRenderer1;
-	Sword2FontRenderer *_fontRenderer2;
-	Sword2Widget *_panel;
-	Sword2Slot *_slotButton[8];
-	Sword2ScrollButton *_zupButton;
-	Sword2ScrollButton *_upButton;
-	Sword2ScrollButton *_downButton;
-	Sword2ScrollButton *_zdownButton;
-	Sword2Button *_okButton;
-	Sword2Button *_cancelButton;
+	FontRenderer *_fontRenderer1;
+	FontRenderer *_fontRenderer2;
+	Widget *_panel;
+	Slot *_slotButton[8];
+	ScrollButton *_zupButton;
+	ScrollButton *_upButton;
+	ScrollButton *_downButton;
+	ScrollButton *_zdownButton;
+	Button *_okButton;
+	Button *_cancelButton;
 
 	void saveLoadError(char *text);
 
 public:
-	Sword2SaveLoadDialog(int mode) : _mode(mode), _selectedSlot(-1) {
+	SaveLoadDialog(int mode) : _mode(mode), _selectedSlot(-1) {
 		int i;
 
 		// FIXME: The "control font" and the "red font" are currently
 		// always the same font, so one should be eliminated.
 
-		_fontRenderer1 = new Sword2FontRenderer(controls_font_id);
-		_fontRenderer2 = new Sword2FontRenderer(red_font_id);
+		_fontRenderer1 = new FontRenderer(controls_font_id);
+		_fontRenderer2 = new FontRenderer(red_font_id);
 
-		_panel = new Sword2Widget(this, 1);
+		_panel = new Widget(this, 1);
 		_panel->createSurfaceImages(2016, 0, 40);
 
 		for (i = 0; i < 4; i++) {
-			_slotButton[i] = new Sword2Slot(this, 114, 0, 384, 36);
+			_slotButton[i] = new Slot(this, 114, 0, 384, 36);
 			_slotButton[i]->createSurfaceImages(2006 + i, 114, 0);
 			_slotButton[i]->setMode(mode);
-			_slotButton[i + 4] = new Sword2Slot(this, 114, 0, 384, 36);
+			_slotButton[i + 4] = new Slot(this, 114, 0, 384, 36);
 			_slotButton[i + 4]->linkSurfaceImages(_slotButton[i], 114, 0);
 			_slotButton[i + 4]->setMode(mode);
 		}
 
 		updateSlots();
 
-		_zupButton = new Sword2ScrollButton(this, 516, 65, 17, 17);
+		_zupButton = new ScrollButton(this, 516, 65, 17, 17);
 		_zupButton->createSurfaceImages(1982, 516, 65);
 
-		_upButton = new Sword2ScrollButton(this, 516, 85, 17, 17);
+		_upButton = new ScrollButton(this, 516, 85, 17, 17);
 		_upButton->createSurfaceImages(2067, 516, 85);
 
-		_downButton = new Sword2ScrollButton(this, 516, 329, 17, 17);
+		_downButton = new ScrollButton(this, 516, 329, 17, 17);
 		_downButton->createSurfaceImages(1986, 516, 329);
 
-		_zdownButton = new Sword2ScrollButton(this, 516, 350, 17, 17);
+		_zdownButton = new ScrollButton(this, 516, 350, 17, 17);
 		_zdownButton->createSurfaceImages(1988, 516, 350);
 
-		_okButton = new Sword2Button(this, 130, 377, 24, 24);
+		_okButton = new Button(this, 130, 377, 24, 24);
 		_okButton->createSurfaceImages(2002, 130, 377);
 
-		_cancelButton = new Sword2Button(this, 350, 377, 24, 24);
+		_cancelButton = new Button(this, 350, 377, 24, 24);
 		_cancelButton->linkSurfaceImages(_okButton, 350, 377);
 
 		registerWidget(_panel);
@@ -1100,7 +1100,7 @@
 		registerWidget(_cancelButton);
 	}
 
-	~Sword2SaveLoadDialog() {
+	~SaveLoadDialog() {
 		delete _fontRenderer1;
 		delete _fontRenderer2;
 	}
@@ -1110,8 +1110,8 @@
 
 	void updateSlots() {
 		for (int i = 0; i < 8; i++) {
-			Sword2Slot *slot = _slotButton[(gui._baseSlot + i) % 8];
-			Sword2FontRenderer *fr;
+			Slot *slot = _slotButton[(gui._baseSlot + i) % 8];
+			FontRenderer *fr;
 			uint8 description[SAVE_DESCRIPTION_LEN];
 
 			slot->setY(72 + i * 36);
@@ -1141,7 +1141,7 @@
 		}
 	}
 
-	virtual void onAction(Sword2Widget *widget, int result = 0) {
+	virtual void onAction(Widget *widget, int result = 0) {
 		if (widget == _zupButton) {
 			if (gui._baseSlot > 0) {
 				if (gui._baseSlot >= 8)
@@ -1173,7 +1173,7 @@
 		} else if (widget == _cancelButton) {
 			setResult(0);
 		} else {
-			Sword2Slot *slot = (Sword2Slot *) widget;
+			Slot *slot = (Slot *) widget;
 
 			if (result >= kStartEditing) {
 				if (result == kStartEditing) {
@@ -1243,7 +1243,7 @@
 		}
 	}
 
-	void drawEditBuffer(Sword2Slot *slot) {
+	void drawEditBuffer(Slot *slot) {
 		if (_selectedSlot == -1)
 			return;
 
@@ -1255,7 +1255,7 @@
 	}
 
 	virtual void paint() {
-		Sword2Dialog::paint();
+		Dialog::paint();
 
 		if (_mode == kLoadDialog) {
 			// Restore
@@ -1272,7 +1272,7 @@
 		// Cancel
 
 		if (result == 0) {
-			Sword2Dialog::setResult(result);
+			Dialog::setResult(result);
 			return;
 		}
 
@@ -1340,11 +1340,11 @@
 			}
 		}
 
-		Sword2Dialog::setResult(result);
+		Dialog::setResult(result);
 	}
 };
 
-void Sword2SaveLoadDialog::saveLoadError(char* text) {
+void SaveLoadDialog::saveLoadError(char* text) {
 	// Print a message on screen. Second parameter is duration.
 	DisplayMsg((uint8 *) text, 0);
 
@@ -1373,21 +1373,21 @@
 	RemoveMsg();
 }
 
-uint32 Sword2Gui::restoreControl(void) {
+uint32 Gui::restoreControl(void) {
 	// returns 0 for no restore
 	//         1 for restored ok
 
-	Sword2SaveLoadDialog loadDialog(kLoadDialog);
+	SaveLoadDialog loadDialog(kLoadDialog);
 	return loadDialog.run();
 }
 
-void Sword2Gui::saveControl(void) {
-	Sword2SaveLoadDialog saveDialog(kSaveDialog);
+void Gui::saveControl(void) {
+	SaveLoadDialog saveDialog(kSaveDialog);
 	saveDialog.run();
 }
 
-void Sword2Gui::quitControl(void) {
-	Sword2MiniDialog quitDialog(149618692);	// quit text
+void Gui::quitControl(void) {
+	MiniDialog quitDialog(149618692);	// quit text
 
 	if (!quitDialog.run()) {
 		// just return to game
@@ -1400,10 +1400,10 @@
 	exit(0);
 }
 
-void Sword2Gui::restartControl(void) {
+void Gui::restartControl(void) {
 	uint32 temp_demo_flag;
 
-	Sword2MiniDialog restartDialog(149618693);	// restart text
+	MiniDialog restartDialog(149618693);	// restart text
 
 	if (!restartDialog.run()) {
 		// just return to game
@@ -1466,7 +1466,7 @@
  	this_screen.new_palette = 99;
 }
 
-int32 Sword2Gui::readOptionSettings(void) {
+int32 Gui::readOptionSettings(void) {
 	// settings file is 9 bytes long:
 	//   1 music volume
 	//   2 speech volume
@@ -1517,14 +1517,14 @@
 	return 0;
 }
 
-void Sword2Gui::optionControl(void) {
-	Sword2OptionsDialog optionsDialog;
+void Gui::optionControl(void) {
+	OptionsDialog optionsDialog;
 
 	optionsDialog.run();
 	return;
 }
 
-void Sword2Gui::updateGraphicsLevel(uint8 newLevel) {
+void Gui::updateGraphicsLevel(uint8 newLevel) {
 	switch (newLevel) {
 	case 0:
 		// Lowest setting: no graphics fx

Index: controls.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/controls.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- controls.h	4 Oct 2003 00:52:25 -0000	1.5
+++ controls.h	4 Oct 2003 01:09:29 -0000	1.6
@@ -22,7 +22,7 @@
 
 namespace Sword2 {
 
-class Sword2Gui {
+class Gui {
 public:
 	int _baseSlot;
 	uint8 _currentGraphicsLevel;
@@ -32,7 +32,7 @@
 	uint8 _stereoReversed;
 	uint8 _pointerTextSelected;
 
-	Sword2Gui() : _baseSlot(0), _stereoReversed(0),
+	Gui() : _baseSlot(0), _stereoReversed(0),
 		_pointerTextSelected(0) {}
 
 	uint32 restoreControl(void);
@@ -44,7 +44,7 @@
 	void updateGraphicsLevel(uint8 newLevel);
 };
 
-extern Sword2Gui gui;
+extern Gui gui;
 
 } // End of namespace Sword2
 

Index: mem_view.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/mem_view.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- mem_view.cpp	4 Oct 2003 00:52:25 -0000	1.14
+++ mem_view.cpp	4 Oct 2003 01:09:29 -0000	1.15
@@ -29,7 +29,7 @@
 // has to be global because a local in Fetch_mem_owner is destroyed on exit
 char buf[50];
 
-void Sword2MemoryManager::displayMemory(void) {
+void MemoryManager::displayMemory(void) {
 	int pass, found_end, k, j, free = 0;
 	_standardHeader	*file_header;
 	int scrolls = 0;
@@ -122,7 +122,7 @@
 		(free * 100) / _totalFreeMemory);
 }
 
-const char *Sword2MemoryManager::fetchOwner(uint32 uid) {
+const char *MemoryManager::fetchOwner(uint32 uid) {
 	switch (uid) {
 	case UID_memman:
 		return "MEMMAN";
@@ -148,7 +148,7 @@
 	}
 }
 
-void Sword2MemoryManager::memoryString(char *string) {
+void MemoryManager::memoryString(char *string) {
 	int blockNo = _baseMemBlock;
 	int blocksUsed = 0;
 	int mem_free = 0;

Index: memory.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/memory.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- memory.cpp	4 Oct 2003 00:52:25 -0000	1.12
+++ memory.cpp	4 Oct 2003 01:09:29 -0000	1.13
@@ -45,17 +45,17 @@
 
 namespace Sword2 {
 
-Sword2MemoryManager memory;
+MemoryManager memory;
 
 #define MEMORY_POOL (1024 * 12000)
 
 // #define MEMDEBUG 1
 
-void Sword2MemoryManager::exit(void) {
+void MemoryManager::exit(void) {
 	free(_freeMemman);
 }
 
-void Sword2MemoryManager::init(void) {
+void MemoryManager::init(void) {
 	uint32 j;
 	uint8 *memory_base;
 
@@ -91,7 +91,7 @@
 	_baseMemBlock = 0;			// for now
 }
 
-mem *Sword2MemoryManager::lowLevelAlloc(uint32 size, uint32 type, uint32 unique_id) {
+mem *MemoryManager::lowLevelAlloc(uint32 size, uint32 type, uint32 unique_id) {
 	// allocate a block of memory - locked or float
 
 	// returns 0 if fails to allocate the memory
@@ -225,7 +225,7 @@
 	return &_memList[nu_block];
 }
 
-void Sword2MemoryManager::freeMemory(mem *block) {
+void MemoryManager::freeMemory(mem *block) {
 	// kill a block of memory - which was presumably floating or locked
 	// once you've done this the memory may be recycled
 
@@ -237,7 +237,7 @@
 #endif
 }
 
-void Sword2MemoryManager::floatMemory(mem *block) {
+void MemoryManager::floatMemory(mem *block) {
 	// set a block to float
 	// wont be trashed but will move around in memory
 
@@ -248,7 +248,7 @@
 #endif
 }
 
-void Sword2MemoryManager::lockMemory(mem *block) {
+void MemoryManager::lockMemory(mem *block) {
 	// set a block to lock
 	// wont be moved - don't lock memory for any longer than necessary
 	// unless you know the locked memory is at the bottom of the heap
@@ -263,7 +263,7 @@
 #endif
 }
 
-int32 Sword2MemoryManager::defragMemory(uint32 req_size) {
+int32 MemoryManager::defragMemory(uint32 req_size) {
 	// moves floating blocks down and/or merges free blocks until a large
 	// enough space is found or there is nothing left to do and a big
 	// enough block cannot be found we stop when we find/create a large
@@ -422,7 +422,7 @@
 	return -1;	//no luck, couldn't find a big enough block
 }
 
-void Sword2MemoryManager::debugMemory(void) {
+void MemoryManager::debugMemory(void) {
 	// gets called with lowLevelAlloc, Mem_free, Mem_lock & Mem_float if
 	// MEMDEBUG has been #defined otherwise can be called at any time
 	// anywhere else
@@ -460,7 +460,7 @@
 	} while (j != -1);
 }
 
-mem *Sword2MemoryManager::allocMemory(uint32 size, uint32 type, uint32 unique_id) {
+mem *MemoryManager::allocMemory(uint32 size, uint32 type, uint32 unique_id) {
 	// the high level allocator
 
 	// can ask the resman to remove old resources to make space - will
@@ -499,7 +499,7 @@
 // Maximum allowed wasted memory.
 #define MAX_WASTAGE 51200
 
-int32 Sword2MemoryManager::virtualDefrag(uint32 size) {
+int32 MemoryManager::virtualDefrag(uint32 size) {
 	// Virutually defrags memory...
 	//
 	// Used to determine if there is potentially are large enough free

Index: memory.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/memory.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- memory.h	4 Oct 2003 00:52:25 -0000	1.6
+++ memory.h	4 Oct 2003 01:09:29 -0000	1.7
@@ -62,7 +62,7 @@
 #define	UID_savegame_buffer		0xfffffff6
 #define UID_restoregame_buffer		0xfffffff5
 
-class Sword2MemoryManager {
+class MemoryManager {
 private:
 	// Address of init malloc to be freed later
 	uint8 *_freeMemman;
@@ -102,7 +102,7 @@
 	void displayMemory(void);
 };
 
-extern Sword2MemoryManager memory;
+extern MemoryManager memory;
 
 } // End of namespace Sword2
 

Index: resman.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/resman.cpp,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- resman.cpp	4 Oct 2003 00:52:26 -0000	1.50
+++ resman.cpp	4 Oct 2003 01:09:29 -0000	1.51
@@ -61,7 +61,7 @@
 
 #define BUFFERSIZE	4096
 
-Sword2ResourceManager	res_man;	//declare the object global
+ResourceManager	res_man;	//declare the object global
 
 // ---------------------------------------------------------------------------
 //
@@ -92,7 +92,7 @@
 
 // FIXME: Should init() / exit() be moved to constructor / destructor instead?
 
-void Sword2ResourceManager::init(void) {
+void ResourceManager::init(void) {
 	// We read in the resource info which tells us the names of the
 	// resource cluster files ultimately, although there might be groups
 	// within the clusters at this point it makes no difference. We only
@@ -242,7 +242,7 @@
 		file.close();
 }
 
-void Sword2ResourceManager::exit(void) {
+void ResourceManager::exit(void) {
 	// free up our mallocs
 	free(_resList);
 	free(_age);
@@ -435,7 +435,7 @@
 	}
 }
 
-uint8 *Sword2ResourceManager::open(uint32 res) {
+uint8 *ResourceManager::open(uint32 res) {
 	// returns ad of resource. Loads if not in memory
 	// retains a count
 	// resource can be aged out of memory if count = 0
@@ -565,7 +565,7 @@
 	return (uint8 *) _resList[res]->ad;
 }
 
-uint8 Sword2ResourceManager::checkValid(uint32 res) {
+uint8 ResourceManager::checkValid(uint32 res) {
 	// returns '1' if resource is valid, otherwise returns '0'
 	// used in startup.cpp to ignore invalid screen-manager resources
 
@@ -586,7 +586,7 @@
 	return 1;
 }
 
-void Sword2ResourceManager::nextCycle(void) {
+void ResourceManager::nextCycle(void) {
 	// increment the cycle and calculate actual per-cycle memory useage
 
 #ifdef _SWORD2_DEBUG
@@ -616,12 +616,12 @@
 		_resTime++;
 }
 
-uint32 Sword2ResourceManager::fetchUsage(void) {
+uint32 ResourceManager::fetchUsage(void) {
 	// returns memory usage previous cycle
 	return _currentMemoryUsage;
 }
 
-void Sword2ResourceManager::close(uint32 res) {
+void ResourceManager::close(uint32 res) {
 	// decrements the count
 	// resource floats when count = 0
 
@@ -644,7 +644,7 @@
 	}
 }
 
-uint32 Sword2ResourceManager::fetchLen(uint32 res) {
+uint32 ResourceManager::fetchLen(uint32 res) {
 	// returns the total file length of a resource - i.e. all headers are
 	// included too
 
@@ -677,23 +677,23 @@
 	return len;
 }
 
-char *Sword2ResourceManager::fetchCluster(uint32 res) {
+char *ResourceManager::fetchCluster(uint32 res) {
 	// returns a pointer to the ascii name of the cluster file which
 	// contains resource res
 	return _resourceFiles[_resConvTable[res * 2]];
 }
 
-uint32 Sword2ResourceManager::fetchAge(uint32 res) {
+uint32 ResourceManager::fetchAge(uint32 res) {
 	// return the age of res
 	return _age[res];
 }
 
-uint32 Sword2ResourceManager::fetchCount(uint32 res) {
+uint32 ResourceManager::fetchCount(uint32 res) {
 	// return the open count of res
 	return _count[res];
 }
 
-uint32 Sword2ResourceManager::helpTheAgedOut(void) {
+uint32 ResourceManager::helpTheAgedOut(void) {
 	// remove from memory the oldest closed resource
 
 	uint32 oldest_res;	// holds id of oldest found so far when we have to chuck stuff out of memory
@@ -735,7 +735,7 @@
 	return _resList[oldest_res]->size;	// return bytes freed
 }
 
-void Sword2ResourceManager::printConsoleClusters(void) {
+void ResourceManager::printConsoleClusters(void) {
 	uint32 j;
 
 	if (_totalClusters) {
@@ -748,7 +748,7 @@
 	Scroll_console();
 }
 
-void Sword2ResourceManager::examine(uint8 *input) {
+void ResourceManager::examine(uint8 *input) {
 	uint32 j = 0;
 	uint32 res;
 	_standardHeader	*file_header;
@@ -861,7 +861,7 @@
 	}
 }
 
-void Sword2ResourceManager::kill(uint8 *input) {
+void ResourceManager::kill(uint8 *input) {
 	int j = 0;
 	uint32 res;
 
@@ -899,7 +899,7 @@
 	}
 }
 
-void Sword2ResourceManager::remove(uint32 res) {
+void ResourceManager::remove(uint32 res) {
 	if (_age[res]) {
 		_age[res] = 0;			// effectively gone from _resList
 		memory.freeMemory(_resList[res]);	// release the memory too
@@ -908,7 +908,7 @@
 		debug(5, "remove(%d) not even in memory!", res);
 }
 
-void Sword2ResourceManager::removeAll(void) {
+void ResourceManager::removeAll(void) {
 	// remove all res files from memory - ready for a total restart
 	// including player object & global variables resource
 
@@ -928,7 +928,7 @@
 	} while	(j != -1);
 }
 
-void Sword2ResourceManager::killAll(uint8 wantInfo) {
+void ResourceManager::killAll(uint8 wantInfo) {
 	// remove all res files from memory
 	// its quicker to search the mem blocs for res files than search
 	// resource lists for those in memory
@@ -1001,7 +1001,7 @@
 // disappear forever, or some plaster-filled holes in sand to crash the game &
 // get James in trouble again.
 
-void Sword2ResourceManager::killAllObjects(uint8 wantInfo) {
+void ResourceManager::killAllObjects(uint8 wantInfo) {
 	// remove all object res files from memory, excluding George
 	// its quicker to search the mem blocs for res files than search
 	// resource lists for those in memory
@@ -1065,7 +1065,7 @@
 		Print_to_console(" expelled %d object resource(s)", nuked);
 }
 
-void Sword2ResourceManager::cacheNewCluster(uint32 newCluster) {
+void ResourceManager::cacheNewCluster(uint32 newCluster) {
 	// Stop any music from streaming off the CD before we start the
 	// cluster-copy!
 	//
@@ -1300,7 +1300,7 @@
 	fclose(file);
 }
 
-void Sword2ResourceManager::getCd(int cd) {
+void ResourceManager::getCd(int cd) {
 	// TODO support a seperate path for cd data?
 	
 	bool done = false;

Index: resman.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/resman.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- resman.h	4 Oct 2003 00:52:26 -0000	1.8
+++ resman.h	4 Oct 2003 01:09:29 -0000	1.9
@@ -26,7 +26,7 @@
 
 #define	MAX_res_files	20
 
-class Sword2ResourceManager {
+class ResourceManager {
 public:
 	void init(void);		// read in the config file
 	void exit(void);
@@ -105,7 +105,7 @@
 	char _cdDrives[24];
 };							
 
-extern Sword2ResourceManager res_man;	//declare the object global
+extern ResourceManager res_man;	//declare the object global
 
 } // End of namespace Sword2
 

Index: sword2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/sword2.cpp,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- sword2.cpp	4 Oct 2003 00:52:26 -0000	1.47
+++ sword2.cpp	4 Oct 2003 01:09:29 -0000	1.48
@@ -64,7 +64,7 @@
 }
 
 Engine *Engine_SWORD2_create(GameDetector *detector, OSystem *syst) {
-	return new Sword2::Sword2State(detector, syst);
+	return new Sword2::Sword2Engine(detector, syst);
 }
 
 REGISTER_PLUGIN("Broken Sword II", Engine_SWORD2_targetList, Engine_SWORD2_create);
@@ -97,10 +97,10 @@
 uint8 graphics_level_fudged = 0;
 uint8 stepOneCycle = 0;			// for use while game paused
 
-Sword2State *g_sword2 = NULL;
-Sword2Sound *g_sound = NULL;
+Sword2Engine *g_sword2 = NULL;
+Sound *g_sound = NULL;
 
-Sword2State::Sword2State(GameDetector *detector, OSystem *syst)
+Sword2Engine::Sword2Engine(GameDetector *detector, OSystem *syst)
 	: Engine(detector, syst) {
 	
 	_detector = detector;
@@ -122,16 +122,16 @@
 	_mixer->setVolume(256);
 	_mixer->setMusicVolume(256);
 
-	g_sound = _sound = new Sword2Sound(_mixer);
+	g_sound = _sound = new Sound(_mixer);
 	
 	File::setDefaultDirectory(_gameDataPath);
 }
 
-void Sword2State::errorString(const char *buf1, char *buf2) {
+void Sword2Engine::errorString(const char *buf1, char *buf2) {
 	strcpy(buf2, buf1);
 }
 
-int32 Sword2State::InitialiseGame(void) {
+int32 Sword2Engine::InitialiseGame(void) {
 	// init engine drivers
 
 	uint8 *file;
@@ -254,7 +254,7 @@
 	return 0;
 }
 
-void Sword2State::go() {
+void Sword2Engine::go() {
 	OSystem::Property prop;
 	uint32 rv;
 	uint8 breakOut = 0;
@@ -433,7 +433,7 @@
 	return;			//quit the game
 }
 
-void Sword2State::Start_game(void) {
+void Sword2Engine::Start_game(void) {
 	// boot the game straight into a start script
 
 	int screen_manager_id;

Index: sword2.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/sword2.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- sword2.h	4 Oct 2003 00:52:26 -0000	1.14
+++ sword2.h	4 Oct 2003 01:09:29 -0000	1.15
@@ -52,9 +52,9 @@
 
 // TODO move stuff into class
 
-class Sword2State : public Engine {
+class Sword2Engine : public Engine {
 public:
-	Sword2State(GameDetector *detector, OSystem *syst);
+	Sword2Engine(GameDetector *detector, OSystem *syst);
 	void go(void);
 	void parseEvents(void);
 	void Start_game(void);
@@ -63,7 +63,7 @@
 	uint32 _features;
 	byte _gameId;
 	char *_game_name; // target name for saves
-	Sword2Sound *_sound;
+	Sound *_sound;
 
 private:
 	bool _quit;
@@ -74,8 +74,8 @@
 	void errorString(const char *buf_input, char *buf_output);
 };
 
-extern Sword2State *g_sword2;
-extern Sword2Sound *g_sound;
+extern Sword2Engine *g_sword2;
+extern Sound *g_sound;
 
 } // End of namespace Sword2
 





More information about the Scummvm-git-logs mailing list