[Scummvm-cvs-logs] CVS: scummex image.cpp,1.7,1.8 image.h,1.6,1.7 scummex.cpp,1.15,1.16 scummex.h,1.8,1.9 wxwindows.cpp,1.12,1.13 wxwindows.h,1.4,1.5

Adrien Mercier yoshizf at users.sourceforge.net
Mon Sep 22 11:26:13 CEST 2003


Update of /cvsroot/scummvm/scummex
In directory sc8-pr-cvs1:/tmp/cvs-serv22420

Modified Files:
	image.cpp image.h scummex.cpp scummex.h wxwindows.cpp 
	wxwindows.h 
Log Message:
Added a menu item to display the boxes on the room image

Index: image.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummex/image.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- image.cpp	22 Sep 2003 15:23:56 -0000	1.7
+++ image.cpp	22 Sep 2003 18:25:16 -0000	1.8
@@ -112,6 +112,9 @@
 	RMHDindex = _resource->findBlock(0, _blockTable, _input, id, "RMHD", "-1");
 	width = _blockTable[RMHDindex].width;
 	height = _blockTable[RMHDindex].height;
+
+	if (newWindow == 0)
+		id = _resource->findBlock(0, _blockTable, _input, id, "BOXD", "-1");
 	
 	_input.seek(_blockTable[id].offset + 10, SEEK_SET);
 	
@@ -203,7 +206,7 @@
 	return 0;
 }
 
-int Image::drawBG(File& _input, BlockTable *_blockTable, int id, char* filename)
+int Image::drawBG(File& _input, BlockTable *_blockTable, int id)
 {
 	int RMHDindex, CLUTindex, SMAPindex, TRNSindex;
 	
@@ -215,7 +218,7 @@
 	_width = _blockTable[RMHDindex].width;
 	_height = _blockTable[RMHDindex].height;
 
-	_gui->DisplayImage("Room Image", _width, _height);
+	_gui->DisplayImage("Room Image", _width, _height, IMAGE_BOXES);
 	
 	if (_blockTable[id].blockTypeID != 209) {
 		TRNSindex = _resource->findBlock(0, _blockTable, _input, id, "TRNS", "-1");

Index: image.h
===================================================================
RCS file: /cvsroot/scummvm/scummex/image.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- image.h	22 Sep 2003 15:23:56 -0000	1.6
+++ image.h	22 Sep 2003 18:25:16 -0000	1.7
@@ -59,7 +59,7 @@
 	Image();
 	~Image();
 	int drawPalette(BlockTable *_blockTable, int id, File& _input);
-	int drawBG(File& _input, BlockTable *_blockTable, int id, char* filename);
+	int drawBG(File& _input, BlockTable *_blockTable, int id);
 	int drawObject(File& _input, BlockTable *_blockTable, int id);
 	int drawSmushFrame(BlockTable *_blockTable, int id, File& _input);
 	int drawBoxes(BlockTable *_blockTable, int id, File& _input, int newWindow = 1);

Index: scummex.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummex/scummex.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- scummex.cpp	22 Sep 2003 15:43:24 -0000	1.15
+++ scummex.cpp	22 Sep 2003 18:25:16 -0000	1.16
@@ -274,7 +274,7 @@
 void ScummEX::bgDraw()
 {
 	_image = new Image();
-	_image->drawBG(_input, _blockTable, _blockId, "");
+	_image->drawBG(_input, _blockTable, _blockId);
 }
 
 void ScummEX::SmushFrameDraw()
@@ -293,6 +293,12 @@
 {
 	_image = new Image();
 	_image->drawBoxes(_blockTable, _blockId, _input);
+}
+
+void ScummEX::boxesDrawOverlay()
+{
+	_image = new Image();
+	_image->drawBoxes(_blockTable, _blockId, _input, 0);
 }
 
 void ScummEX::FileInfo() {

Index: scummex.h
===================================================================
RCS file: /cvsroot/scummvm/scummex/scummex.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- scummex.h	22 Sep 2003 15:43:24 -0000	1.8
+++ scummex.h	22 Sep 2003 18:25:16 -0000	1.9
@@ -63,6 +63,7 @@
 	void SmushFrameDraw();
 	void objectDraw();
 	void boxesDraw();
+	void boxesDrawOverlay();
 };
 
 #endif

Index: wxwindows.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummex/wxwindows.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- wxwindows.cpp	22 Sep 2003 15:23:57 -0000	1.12
+++ wxwindows.cpp	22 Sep 2003 18:25:16 -0000	1.13
@@ -212,13 +212,15 @@
 	}
 }
 
-void GUI_wxWindows::DisplayImage(char* title, int width, int height) {
-	imageFrame = new ImageWindow(title, wxPoint(-1,-1), wxSize(width, height));
+void GUI_wxWindows::DisplayImage(char* title, int width, int height, byte flags) {
+	imageFrame = new ImageWindow(title, wxPoint(-1,-1), wxSize(width, height), flags);
 
 	imageFrame->Connect( Viewer_Quit, wxEVT_COMMAND_MENU_SELECTED,
 		(wxObjectEventFunction) &ImageWindow::OnQuit );
 	imageFrame->Connect( ID_BMP, wxEVT_COMMAND_MENU_SELECTED,
 		(wxObjectEventFunction) &GUI_wxWindows::SaveImage );
+	imageFrame->Connect( ID_Boxes, wxEVT_COMMAND_MENU_SELECTED,
+		(wxObjectEventFunction) &ScummEX::boxesDrawOverlay );
 	imageFrame->Connect( ID_ImageWindow, wxEVT_CLOSE_WINDOW,
 		(wxObjectEventFunction) &ImageWindow::OnQuit );
 }
@@ -233,7 +235,7 @@
 	imageFrame->Refresh();
 }
 
-ImageWindow::ImageWindow(const wxString& title, const wxPoint& pos, const wxSize& size)
+ImageWindow::ImageWindow(const wxString& title, const wxPoint& pos, const wxSize& size, byte flags)
 	: wxFrame(frame,ID_ImageWindow,title,pos,size, wxDEFAULT_FRAME_STYLE & (wxMINIMIZE_BOX | wxSYSTEM_MENU | wxCAPTION))
 {
 	wxMenuBar *menuBar = new wxMenuBar;
@@ -247,6 +249,14 @@
 	menuFile->Append(Viewer_Quit,"Close");
 	
 	menuBar->Append(menuFile,"&File");
+
+	if (flags & IMAGE_BOXES) {
+		wxMenu *menuView = new wxMenu;
+		wxMenuItem *BoxesItem = new wxMenuItem(menuView, ID_Boxes, "Display Boxes", "Display Boxes", wxITEM_NORMAL, NULL );
+		menuView->Append(BoxesItem);
+		menuBar->Append(menuView,"View");
+	}
+	
 	SetMenuBar(menuBar);
 	SetClientSize(size.GetWidth(), size.GetHeight());
 	image = new wxImage(size.GetWidth(), size.GetHeight());

Index: wxwindows.h
===================================================================
RCS file: /cvsroot/scummvm/scummex/wxwindows.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- wxwindows.h	22 Sep 2003 15:23:57 -0000	1.4
+++ wxwindows.h	22 Sep 2003 18:25:16 -0000	1.5
@@ -39,6 +39,11 @@
 #include "blocks.h"
 #include "scummsys.h"
 
+enum {
+	FLAG_NONE = 1 << 0,
+	IMAGE_BOXES = 1 << 1
+};
+	
 class MainWindow : public wxFrame {
 private:
 	wxHtmlHelpController *HtmlHelp;
@@ -64,7 +69,7 @@
 
 	void DrawImage();
 	void OnQuit(wxCommandEvent& event);
-	ImageWindow(const wxString& title, const wxPoint& pos, const wxSize& size);
+	ImageWindow(const wxString& title, const wxPoint& pos, const wxSize& size, byte flags);
 };
 
 class ViewerWindow : public wxFrame {
@@ -92,7 +97,7 @@
 	void SaveImage();
 	void DisplayViewer(char *title, int width, int height, char *text);
 	void PutPixel(int x, int y, int red, int green, int blue);
-	void DisplayImage(char* title, int width, int height);
+	void DisplayImage(char* title, int width, int height, byte flags = FLAG_NONE);
 	void SetButton(int blocktype);
 	void DisplayDialog(char *message, char *title);
 	void updateLabel(char *label, char *title, uint32 text);
@@ -131,6 +136,7 @@
 	ID_ImageWindow,
 	ID_ViewerWindow,
 	ID_BMP,
+	ID_Boxes,
 	Tree
 };
 





More information about the Scummvm-git-logs mailing list