home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / CMCD0704.ISO / Software / Freeware / Utilitare / VisualBoyAdvance-1.7.2 / src / win32 / GBTileView.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-05-13  |  3.1 KB  |  105 lines

  1. // -*- C++ -*-
  2. // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
  3. // Copyright (C) 1999-2003 Forgotten
  4. // Copyright (C) 2004 Forgotten and the VBA development team
  5.  
  6. // This program is free software; you can redistribute it and/or modify
  7. // it under the terms of the GNU General Public License as published by
  8. // the Free Software Foundation; either version 2, or(at your option)
  9. // any later version.
  10. //
  11. // This program is distributed in the hope that it will be useful,
  12. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. // GNU General Public License for more details.
  15. //
  16. // You should have received a copy of the GNU General Public License
  17. // along with this program; if not, write to the Free Software Foundation,
  18. // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19.  
  20. #if !defined(AFX_GBTILEVIEW_H__C8C8DEBB_17ED_4C5C_9DBE_D730A49B312C__INCLUDED_)
  21. #define AFX_GBTILEVIEW_H__C8C8DEBB_17ED_4C5C_9DBE_D730A49B312C__INCLUDED_
  22.  
  23. #if _MSC_VER > 1000
  24. #pragma once
  25. #endif // _MSC_VER > 1000
  26. // GBTileView.h : header file
  27. //
  28. #include "BitmapControl.h"
  29. #include "ColorControl.h"
  30. #include "IUpdate.h"
  31. #include "ResizeDlg.h"
  32. #include "ZoomControl.h"
  33.  
  34. /////////////////////////////////////////////////////////////////////////////
  35. // GBTileView dialog
  36.  
  37. class GBTileView : public ResizeDlg, IUpdateListener
  38. {
  39.   int charBase;
  40.   int palette;
  41.   int bank;
  42.   BitmapControl tileView;
  43.   BITMAPINFO bmpInfo;
  44.   u8 *data;
  45.   ZoomControl zoom;
  46.   ColorControl color;
  47.   int w;
  48.   int h;
  49.   bool autoUpdate;
  50.   // Construction
  51.  public:
  52.   void paint();
  53.   void render();
  54.   void renderTile(int tile, int x, int y, u8 *charBase);
  55.   void savePNG(const char *name);
  56.   void saveBMP(const char *name);
  57.   GBTileView(CWnd* pParent = NULL);   // standard constructor
  58.   virtual ~GBTileView();
  59.  
  60.   virtual void update();
  61.  
  62.   // Dialog Data
  63.   //{{AFX_DATA(GBTileView)
  64.   enum { IDD = IDD_GB_TILE_VIEWER };
  65.   CSliderCtrl  m_slider;
  66.   int    m_charBase;
  67.   int    m_bank;
  68.   BOOL  m_stretch;
  69.   //}}AFX_DATA
  70.  
  71.  
  72.   // Overrides
  73.   // ClassWizard generated virtual function overrides
  74.   //{{AFX_VIRTUAL(GBTileView)
  75.  protected:
  76.   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  77.   virtual void PostNcDestroy();
  78.   //}}AFX_VIRTUAL
  79.  
  80.   // Implementation
  81.  protected:
  82.   virtual afx_msg LRESULT OnMapInfo(WPARAM wParam, LPARAM lParam);
  83.   virtual afx_msg LRESULT OnColInfo(WPARAM wParam, LPARAM lParam);
  84.  
  85.   // Generated message map functions
  86.   //{{AFX_MSG(GBTileView)
  87.   afx_msg void OnSave();
  88.   virtual BOOL OnInitDialog();
  89.   afx_msg void OnClose();
  90.   afx_msg void OnAutoUpdate();
  91.   afx_msg void OnCharbase0();
  92.   afx_msg void OnCharbase1();
  93.   afx_msg void OnBank0();
  94.   afx_msg void OnBank1();
  95.   afx_msg void OnStretch();
  96.   afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
  97.   //}}AFX_MSG
  98.   DECLARE_MESSAGE_MAP()
  99.     };
  100.  
  101.     //{{AFX_INSERT_LOCATION}}
  102.     // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  103.  
  104. #endif // !defined(AFX_GBTILEVIEW_H__C8C8DEBB_17ED_4C5C_9DBE_D730A49B312C__INCLUDED_)
  105.