home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / CMCD0704.ISO / Software / Freeware / Utilitare / VisualBoyAdvance-1.7.2 / src / win32 / TileView.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-05-13  |  3.2 KB  |  110 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_TILEVIEW_H__055751EC_2DF3_495B_B643_29025465CD2E__INCLUDED_)
  21. #define AFX_TILEVIEW_H__055751EC_2DF3_495B_B643_29025465CD2E__INCLUDED_
  22.  
  23. #if _MSC_VER > 1000
  24. #pragma once
  25. #endif // _MSC_VER > 1000
  26. // TileView.h : header file
  27. //
  28.  
  29. #include "BitmapControl.h"
  30. #include "ColorControl.h"
  31. #include "IUpdate.h"
  32. #include "ResizeDlg.h"
  33. #include "ZoomControl.h"
  34.  
  35. /////////////////////////////////////////////////////////////////////////////
  36. // TileView dialog
  37.  
  38. class TileView : public ResizeDlg, IUpdateListener
  39. {
  40.   int charBase;
  41.   int is256Colors;
  42.   int palette;
  43.   BitmapControl tileView;
  44.   BITMAPINFO bmpInfo;
  45.   u8 *data;
  46.   ZoomControl zoom;
  47.   ColorControl color;
  48.   int w;
  49.   int h;
  50.   bool autoUpdate;
  51.   // Construction
  52.  public:
  53.   void paint();
  54.   void render();
  55.   void renderTile16(int tile, int x, int y, u8 *charBase, u16 *palette);
  56.   void renderTile256(int tile, int x, int y, u8 *charBase, u16 *palette);
  57.   void savePNG(const char *name);
  58.   void saveBMP(const char *name);
  59.   TileView(CWnd* pParent = NULL);   // standard constructor
  60.   virtual ~TileView();
  61.  
  62.   virtual void update();
  63.  
  64.   // Dialog Data
  65.   //{{AFX_DATA(TileView)
  66.   enum { IDD = IDD_TILE_VIEWER };
  67.   CSliderCtrl  m_slider;
  68.   int    m_colors;
  69.   int    m_charBase;
  70.   BOOL  m_stretch;
  71.   //}}AFX_DATA
  72.  
  73.  
  74.   // Overrides
  75.   // ClassWizard generated virtual function overrides
  76.   //{{AFX_VIRTUAL(TileView)
  77.  protected:
  78.   virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  79.   virtual void PostNcDestroy();
  80.   //}}AFX_VIRTUAL
  81.  
  82.   // Implementation
  83.  protected:
  84.   virtual afx_msg LRESULT OnMapInfo(WPARAM wParam, LPARAM lParam);
  85.   virtual afx_msg LRESULT OnColInfo(WPARAM wParam, LPARAM lParam);
  86.  
  87.   // Generated message map functions
  88.   //{{AFX_MSG(TileView)
  89.   afx_msg void OnSave();
  90.   virtual BOOL OnInitDialog();
  91.   afx_msg void OnClose();
  92.   afx_msg void OnAutoUpdate();
  93.   afx_msg void On16Colors();
  94.   afx_msg void On256Colors();
  95.   afx_msg void OnCharbase0();
  96.   afx_msg void OnCharbase1();
  97.   afx_msg void OnCharbase2();
  98.   afx_msg void OnCharbase3();
  99.   afx_msg void OnCharbase4();
  100.   afx_msg void OnStretch();
  101.   afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
  102.   //}}AFX_MSG
  103.   DECLARE_MESSAGE_MAP()
  104.     };
  105.  
  106.     //{{AFX_INSERT_LOCATION}}
  107.     // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  108.  
  109. #endif // !defined(AFX_TILEVIEW_H__055751EC_2DF3_495B_B643_29025465CD2E__INCLUDED_)
  110.