diff src/win32/TileView.h @ 1:f9f4f1b99eed

importing src directory
author Robert McIntyre <rlm@mit.edu>
date Sat, 03 Mar 2012 10:31:27 -0600
parents
children
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/win32/TileView.h	Sat Mar 03 10:31:27 2012 -0600
     1.3 @@ -0,0 +1,90 @@
     1.4 +#if !defined(AFX_TILEVIEW_H__055751EC_2DF3_495B_B643_29025465CD2E__INCLUDED_)
     1.5 +#define AFX_TILEVIEW_H__055751EC_2DF3_495B_B643_29025465CD2E__INCLUDED_
     1.6 +
     1.7 +#if _MSC_VER > 1000
     1.8 +#pragma once
     1.9 +#endif // _MSC_VER > 1000
    1.10 +// TileView.h : header file
    1.11 +//
    1.12 +
    1.13 +#include "BitmapControl.h"
    1.14 +#include "ColorControl.h"
    1.15 +#include "IUpdate.h"
    1.16 +#include "ResizeDlg.h"
    1.17 +#include "ZoomControl.h"
    1.18 +
    1.19 +/////////////////////////////////////////////////////////////////////////////
    1.20 +// TileView dialog
    1.21 +
    1.22 +class TileView : public ResizeDlg, IUpdateListener
    1.23 +{
    1.24 +  int charBase;
    1.25 +  int is256Colors;
    1.26 +  int palette;
    1.27 +  BitmapControl tileView;
    1.28 +  BITMAPINFO bmpInfo;
    1.29 +  u8 *data;
    1.30 +  ZoomControl zoom;
    1.31 +  ColorControl color;
    1.32 +  int w;
    1.33 +  int h;
    1.34 +  bool autoUpdate;
    1.35 +  // Construction
    1.36 + public:
    1.37 +  void paint();
    1.38 +  void render();
    1.39 +  void renderTile16(int tile, int x, int y, u8 *charBase, u16 *palette);
    1.40 +  void renderTile256(int tile, int x, int y, u8 *charBase, u16 *palette);
    1.41 +  void savePNG(const char *name);
    1.42 +  void saveBMP(const char *name);
    1.43 +  TileView(CWnd* pParent = NULL);   // standard constructor
    1.44 +  virtual ~TileView();
    1.45 +
    1.46 +  virtual void update();
    1.47 +
    1.48 +  // Dialog Data
    1.49 +  //{{AFX_DATA(TileView)
    1.50 +  enum { IDD = IDD_TILE_VIEWER };
    1.51 +  CSliderCtrl  m_slider;
    1.52 +  int    m_colors;
    1.53 +  int    m_charBase;
    1.54 +  BOOL  m_stretch;
    1.55 +  //}}AFX_DATA
    1.56 +
    1.57 +
    1.58 +  // Overrides
    1.59 +  // ClassWizard generated virtual function overrides
    1.60 +  //{{AFX_VIRTUAL(TileView)
    1.61 + protected:
    1.62 +  virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
    1.63 +  virtual void PostNcDestroy();
    1.64 +  //}}AFX_VIRTUAL
    1.65 +
    1.66 +  // Implementation
    1.67 + protected:
    1.68 +  virtual afx_msg LRESULT OnMapInfo(WPARAM wParam, LPARAM lParam);
    1.69 +  virtual afx_msg LRESULT OnColInfo(WPARAM wParam, LPARAM lParam);
    1.70 +
    1.71 +  // Generated message map functions
    1.72 +  //{{AFX_MSG(TileView)
    1.73 +  afx_msg void OnSave();
    1.74 +  virtual BOOL OnInitDialog();
    1.75 +  afx_msg void OnClose();
    1.76 +  afx_msg void OnAutoUpdate();
    1.77 +  afx_msg void On16Colors();
    1.78 +  afx_msg void On256Colors();
    1.79 +  afx_msg void OnCharbase0();
    1.80 +  afx_msg void OnCharbase1();
    1.81 +  afx_msg void OnCharbase2();
    1.82 +  afx_msg void OnCharbase3();
    1.83 +  afx_msg void OnCharbase4();
    1.84 +  afx_msg void OnStretch();
    1.85 +  afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
    1.86 +  //}}AFX_MSG
    1.87 +  DECLARE_MESSAGE_MAP()
    1.88 +    };
    1.89 +
    1.90 +    //{{AFX_INSERT_LOCATION}}
    1.91 +    // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
    1.92 +
    1.93 +#endif // !defined(AFX_TILEVIEW_H__055751EC_2DF3_495B_B643_29025465CD2E__INCLUDED_)