diff --git a/image.cpp b/image.cpp index 38d331d..67991df 100644 --- a/image.cpp +++ b/image.cpp @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Header: /Users/sev/projects/sc/s/scummvm/scummex/image.cpp,v 1.7 2003/09/22 15:23:56 yoshizf Exp $ + * $Header: /Users/sev/projects/sc/s/scummvm/scummex/image.cpp,v 1.8 2003/09/22 18:25:16 yoshizf Exp $ * */ @@ -112,6 +112,9 @@ int Image::drawBoxes(BlockTable *_blockTable, int id, File& _input, int newWindo 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 @@ int Image::drawSmushFrame(BlockTable *_blockTable, int id, File& _input) { 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 @@ int Image::drawBG(File& _input, BlockTable *_blockTable, int id, char* filename) _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"); diff --git a/image.h b/image.h index 8758649..4b3e2f1 100644 --- a/image.h +++ b/image.h @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Header: /Users/sev/projects/sc/s/scummvm/scummex/image.h,v 1.6 2003/09/22 15:23:56 yoshizf Exp $ + * $Header: /Users/sev/projects/sc/s/scummvm/scummex/image.h,v 1.7 2003/09/22 18:25:16 yoshizf Exp $ * */ @@ -59,7 +59,7 @@ public: 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); diff --git a/scummex.cpp b/scummex.cpp index dd47035..b822d7d 100644 --- a/scummex.cpp +++ b/scummex.cpp @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Header: /Users/sev/projects/sc/s/scummvm/scummex/scummex.cpp,v 1.15 2003/09/22 15:43:24 yoshizf Exp $ + * $Header: /Users/sev/projects/sc/s/scummvm/scummex/scummex.cpp,v 1.16 2003/09/22 18:25:16 yoshizf Exp $ * */ @@ -274,7 +274,7 @@ void ScummEX::paletteDraw() void ScummEX::bgDraw() { _image = new Image(); - _image->drawBG(_input, _blockTable, _blockId, ""); + _image->drawBG(_input, _blockTable, _blockId); } void ScummEX::SmushFrameDraw() @@ -295,6 +295,12 @@ void ScummEX::boxesDraw() _image->drawBoxes(_blockTable, _blockId, _input); } +void ScummEX::boxesDrawOverlay() +{ + _image = new Image(); + _image->drawBoxes(_blockTable, _blockId, _input, 0); +} + void ScummEX::FileInfo() { int fsize; fsize = _input.size(); diff --git a/scummex.h b/scummex.h index 0f63d7a..fae3224 100644 --- a/scummex.h +++ b/scummex.h @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Header: /Users/sev/projects/sc/s/scummvm/scummex/scummex.h,v 1.8 2003/09/22 15:43:24 yoshizf Exp $ + * $Header: /Users/sev/projects/sc/s/scummvm/scummex/scummex.h,v 1.9 2003/09/22 18:25:16 yoshizf Exp $ * */ @@ -63,6 +63,7 @@ public: void SmushFrameDraw(); void objectDraw(); void boxesDraw(); + void boxesDrawOverlay(); }; #endif diff --git a/wxwindows.cpp b/wxwindows.cpp index c67bacd..9aa1545 100644 --- a/wxwindows.cpp +++ b/wxwindows.cpp @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Header: /Users/sev/projects/sc/s/scummvm/scummex/wxwindows.cpp,v 1.12 2003/09/22 15:23:57 yoshizf Exp $ + * $Header: /Users/sev/projects/sc/s/scummvm/scummex/wxwindows.cpp,v 1.13 2003/09/22 18:25:16 yoshizf Exp $ * */ @@ -212,13 +212,15 @@ void GUI_wxWindows::SaveImage() { } } -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 @@ void GUI_wxWindows::UpdateImage() { 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 @@ ImageWindow::ImageWindow(const wxString& title, const wxPoint& pos, const wxSize 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()); diff --git a/wxwindows.h b/wxwindows.h index 9c8fab1..e218da5 100644 --- a/wxwindows.h +++ b/wxwindows.h @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Header: /Users/sev/projects/sc/s/scummvm/scummex/wxwindows.h,v 1.4 2003/09/22 15:23:57 yoshizf Exp $ + * $Header: /Users/sev/projects/sc/s/scummvm/scummex/wxwindows.h,v 1.5 2003/09/22 18:25:16 yoshizf Exp $ * */ @@ -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 @@ public: 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 @@ public: 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 @@ enum ID_ImageWindow, ID_ViewerWindow, ID_BMP, + ID_Boxes, Tree };