rlm@1
|
1 #if !defined(AFX_TILEVIEW_H__055751EC_2DF3_495B_B643_29025465CD2E__INCLUDED_)
|
rlm@1
|
2 #define AFX_TILEVIEW_H__055751EC_2DF3_495B_B643_29025465CD2E__INCLUDED_
|
rlm@1
|
3
|
rlm@1
|
4 #if _MSC_VER > 1000
|
rlm@1
|
5 #pragma once
|
rlm@1
|
6 #endif // _MSC_VER > 1000
|
rlm@1
|
7 // TileView.h : header file
|
rlm@1
|
8 //
|
rlm@1
|
9
|
rlm@1
|
10 #include "BitmapControl.h"
|
rlm@1
|
11 #include "ColorControl.h"
|
rlm@1
|
12 #include "IUpdate.h"
|
rlm@1
|
13 #include "ResizeDlg.h"
|
rlm@1
|
14 #include "ZoomControl.h"
|
rlm@1
|
15
|
rlm@1
|
16 /////////////////////////////////////////////////////////////////////////////
|
rlm@1
|
17 // TileView dialog
|
rlm@1
|
18
|
rlm@1
|
19 class TileView : public ResizeDlg, IUpdateListener
|
rlm@1
|
20 {
|
rlm@1
|
21 int charBase;
|
rlm@1
|
22 int is256Colors;
|
rlm@1
|
23 int palette;
|
rlm@1
|
24 BitmapControl tileView;
|
rlm@1
|
25 BITMAPINFO bmpInfo;
|
rlm@1
|
26 u8 *data;
|
rlm@1
|
27 ZoomControl zoom;
|
rlm@1
|
28 ColorControl color;
|
rlm@1
|
29 int w;
|
rlm@1
|
30 int h;
|
rlm@1
|
31 bool autoUpdate;
|
rlm@1
|
32 // Construction
|
rlm@1
|
33 public:
|
rlm@1
|
34 void paint();
|
rlm@1
|
35 void render();
|
rlm@1
|
36 void renderTile16(int tile, int x, int y, u8 *charBase, u16 *palette);
|
rlm@1
|
37 void renderTile256(int tile, int x, int y, u8 *charBase, u16 *palette);
|
rlm@1
|
38 void savePNG(const char *name);
|
rlm@1
|
39 void saveBMP(const char *name);
|
rlm@1
|
40 TileView(CWnd* pParent = NULL); // standard constructor
|
rlm@1
|
41 virtual ~TileView();
|
rlm@1
|
42
|
rlm@1
|
43 virtual void update();
|
rlm@1
|
44
|
rlm@1
|
45 // Dialog Data
|
rlm@1
|
46 //{{AFX_DATA(TileView)
|
rlm@1
|
47 enum { IDD = IDD_TILE_VIEWER };
|
rlm@1
|
48 CSliderCtrl m_slider;
|
rlm@1
|
49 int m_colors;
|
rlm@1
|
50 int m_charBase;
|
rlm@1
|
51 BOOL m_stretch;
|
rlm@1
|
52 //}}AFX_DATA
|
rlm@1
|
53
|
rlm@1
|
54
|
rlm@1
|
55 // Overrides
|
rlm@1
|
56 // ClassWizard generated virtual function overrides
|
rlm@1
|
57 //{{AFX_VIRTUAL(TileView)
|
rlm@1
|
58 protected:
|
rlm@1
|
59 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
rlm@1
|
60 virtual void PostNcDestroy();
|
rlm@1
|
61 //}}AFX_VIRTUAL
|
rlm@1
|
62
|
rlm@1
|
63 // Implementation
|
rlm@1
|
64 protected:
|
rlm@1
|
65 virtual afx_msg LRESULT OnMapInfo(WPARAM wParam, LPARAM lParam);
|
rlm@1
|
66 virtual afx_msg LRESULT OnColInfo(WPARAM wParam, LPARAM lParam);
|
rlm@1
|
67
|
rlm@1
|
68 // Generated message map functions
|
rlm@1
|
69 //{{AFX_MSG(TileView)
|
rlm@1
|
70 afx_msg void OnSave();
|
rlm@1
|
71 virtual BOOL OnInitDialog();
|
rlm@1
|
72 afx_msg void OnClose();
|
rlm@1
|
73 afx_msg void OnAutoUpdate();
|
rlm@1
|
74 afx_msg void On16Colors();
|
rlm@1
|
75 afx_msg void On256Colors();
|
rlm@1
|
76 afx_msg void OnCharbase0();
|
rlm@1
|
77 afx_msg void OnCharbase1();
|
rlm@1
|
78 afx_msg void OnCharbase2();
|
rlm@1
|
79 afx_msg void OnCharbase3();
|
rlm@1
|
80 afx_msg void OnCharbase4();
|
rlm@1
|
81 afx_msg void OnStretch();
|
rlm@1
|
82 afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
rlm@1
|
83 //}}AFX_MSG
|
rlm@1
|
84 DECLARE_MESSAGE_MAP()
|
rlm@1
|
85 };
|
rlm@1
|
86
|
rlm@1
|
87 //{{AFX_INSERT_LOCATION}}
|
rlm@1
|
88 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
rlm@1
|
89
|
rlm@1
|
90 #endif // !defined(AFX_TILEVIEW_H__055751EC_2DF3_495B_B643_29025465CD2E__INCLUDED_)
|