adding dialog items for sequence datas
@@ -31,6 +31,8 @@ | ||
31 | 31 | // See ShapesEditorOne.cpp for the implementation of this class |
32 | 32 | // |
33 | 33 | |
34 | +const int NUMBER_OF_COLLECTION_TYPES = _scenery_collection + 1; | |
35 | + | |
34 | 36 | class CShapesEditorOneApp : public CWinApp |
35 | 37 | { |
36 | 38 | public: |
@@ -40,6 +42,8 @@ | ||
40 | 42 | public: |
41 | 43 | virtual BOOL InitInstance(); |
42 | 44 | |
45 | + int collection; | |
46 | + | |
43 | 47 | // Implementation |
44 | 48 | |
45 | 49 | DECLARE_MESSAGE_MAP() |
@@ -47,6 +51,7 @@ | ||
47 | 51 | public: |
48 | 52 | Information showTypeInformations[NUMBER_OF_BITMAPS_DIALOG_SHOW_TYPES]; |
49 | 53 | Information collectionInformations[NUMBER_OF_COLLECTIONS]; |
54 | + Information collectionTypeInformations[NUMBER_OF_COLLECTION_TYPES]; | |
50 | 55 | bool isShapesLoaded; |
51 | 56 | }; |
52 | 57 |
@@ -51,6 +51,8 @@ | ||
51 | 51 | extern SDL_Surface *screenSurface; |
52 | 52 | struct collection_header *get_collection_header(short collection_index); |
53 | 53 | struct collection_definition *get_collection_definition(short collection_index); |
54 | +struct high_level_shape_definition *get_high_level_shape_definition(short collection_index, short high_level_shape_index); | |
55 | +struct bitmap_definition *get_bitmap_definition(short collection_index, short bitmap_index); | |
54 | 56 | |
55 | 57 | /* |
56 | 58 | * Initialize shapes handling |
@@ -221,8 +221,6 @@ | ||
221 | 221 | static void *get_collection_tint_tables(short collection_index, short tint_index); |
222 | 222 | static void *collection_offset(struct collection_definition *definition, long offset); |
223 | 223 | static struct rgb_color_value *get_collection_colors(short collection_index, short clut_number); |
224 | -static struct high_level_shape_definition *get_high_level_shape_definition(short collection_index, short high_level_shape_index); | |
225 | -static struct bitmap_definition *get_bitmap_definition(short collection_index, short bitmap_index); | |
226 | 224 | |
227 | 225 | /* ---------- machine-specific code */ |
228 | 226 |
@@ -1949,7 +1947,7 @@ | ||
1949 | 1947 | return (struct rgb_color_value *) collection_offset(definition, definition->color_table_offset+clut_number*sizeof(struct rgb_color_value)*definition->color_count); |
1950 | 1948 | } |
1951 | 1949 | |
1952 | -static struct high_level_shape_definition *get_high_level_shape_definition( | |
1950 | +struct high_level_shape_definition *get_high_level_shape_definition( | |
1953 | 1951 | short collection_index, |
1954 | 1952 | short high_level_shape_index) |
1955 | 1953 | { |
@@ -1986,7 +1984,7 @@ | ||
1986 | 1984 | else return NULL; |
1987 | 1985 | } |
1988 | 1986 | |
1989 | -static struct bitmap_definition *get_bitmap_definition( | |
1987 | +struct bitmap_definition *get_bitmap_definition( | |
1990 | 1988 | short collection_index, |
1991 | 1989 | short bitmap_index) |
1992 | 1990 | { |
@@ -20,12 +20,29 @@ | ||
20 | 20 | |
21 | 21 | void CSequencesDialog::DoDataExchange(CDataExchange* pDX) |
22 | 22 | { |
23 | - CDialog::DoDataExchange(pDX); | |
23 | + CDialog::DoDataExchange(pDX); | |
24 | + DDX_Control(pDX, IDC_COMBO1, collectionCmb); | |
25 | + DDX_Control(pDX, IDC_EDIT2, versionNum); | |
26 | + DDX_Control(pDX, IDC_COMBO2, typeCmb); | |
27 | + DDX_Control(pDX, IDC_EDIT3, flagNum); | |
28 | + DDX_Control(pDX, IDC_EDIT4, colorCountNum); | |
29 | + DDX_Control(pDX, IDC_EDIT5, CLUTCountNum); | |
30 | + DDX_Control(pDX, IDC_EDIT6, colorTableOffsetNum); | |
31 | + DDX_Control(pDX, IDC_EDIT7, highLevelShapeCountNum); | |
32 | + DDX_Control(pDX, IDC_EDIT8, highLevelShapeOffsetTableOffsetNum); | |
33 | + DDX_Control(pDX, IDC_EDIT9, lowLevelShapeCountNum); | |
34 | + DDX_Control(pDX, IDC_EDIT10, lowLevelShapeOffsetTableOffsetNum); | |
35 | + DDX_Control(pDX, IDC_EDIT11, bitmapCountNum); | |
36 | + DDX_Control(pDX, IDC_EDIT12, bitmapOffsetTableOffset); | |
37 | + DDX_Control(pDX, IDC_EDIT13, pixelsToWorldNum); | |
38 | + DDX_Control(pDX, IDC_EDIT14, sizeNum); | |
39 | + DDX_Control(pDX, IDC_COMBO3, highLevelShapeIndexCmb); | |
24 | 40 | } |
25 | 41 | |
26 | 42 | |
27 | 43 | BEGIN_MESSAGE_MAP(CSequencesDialog, CDialog) |
28 | 44 | ON_WM_PAINT() |
45 | + ON_CBN_SELCHANGE(IDC_COMBO1, &CSequencesDialog::OnCbnSelchangeCombo1) | |
29 | 46 | END_MESSAGE_MAP() |
30 | 47 | |
31 | 48 |
@@ -43,7 +60,14 @@ | ||
43 | 60 | CDialog::OnInitDialog(); |
44 | 61 | |
45 | 62 | // TODO: ここに初期化を追加してください |
46 | - setupDialog(); | |
63 | + //store collections | |
64 | + for(int i = 0; i < NUMBER_OF_COLLECTIONS; i ++){ | |
65 | + collectionCmb.InsertString(i, theApp.collectionInformations[i].jname); | |
66 | + } | |
67 | + for(int i = 0; i < NUMBER_OF_COLLECTION_TYPES; i ++){ | |
68 | + typeCmb.InsertString(i, theApp.collectionTypeInformations[i].jname); | |
69 | + } | |
70 | + //setupDialog(); | |
47 | 71 | return TRUE; // return TRUE unless you set the focus to a control |
48 | 72 | // 例外 : OCX プロパティ ページは必ず FALSE を返します。 |
49 | 73 | } |
@@ -50,7 +74,56 @@ | ||
50 | 74 | |
51 | 75 | void CSequencesDialog::setupDialog() |
52 | 76 | { |
77 | + if(!theApp.isShapesLoaded){ | |
78 | + return; | |
79 | + } | |
80 | + // | |
81 | + int col = theApp.collection; | |
82 | + collectionCmb.SetCurSel(col); | |
83 | + | |
84 | + //collection_definition | |
85 | + struct collection_definition* colDef = get_collection_definition(col); | |
86 | + | |
87 | + //version | |
88 | + setIntegerNum(colDef->version, &versionNum); | |
89 | + | |
90 | + //type | |
91 | + typeCmb.SetCurSel(colDef->type); | |
92 | + | |
93 | + //flags | |
94 | + setIntegerNum(colDef->flags, &flagNum); | |
95 | + | |
96 | + //color | |
97 | + setIntegerNum(colDef->color_count, &colorCountNum); | |
98 | + setIntegerNum(colDef->clut_count, &CLUTCountNum); | |
99 | + setIntegerNum(colDef->color_table_offset, &colorTableOffsetNum); | |
100 | + | |
101 | + //high level shapes | |
102 | + setIntegerNum(colDef->high_level_shape_count, &highLevelShapeCountNum); | |
103 | + setIntegerNum(colDef->high_level_shape_offset_table_offset, &highLevelShapeOffsetTableOffsetNum); | |
104 | + | |
105 | + //low level shapes | |
106 | + setIntegerNum(colDef->low_level_shape_count, &lowLevelShapeCountNum); | |
107 | + setIntegerNum(colDef->low_level_shape_offset_table_offset, &lowLevelShapeOffsetTableOffsetNum); | |
108 | + | |
109 | + //bitmaps | |
110 | + setIntegerNum(colDef->bitmap_count, &bitmapCountNum); | |
111 | + setIntegerNum(colDef->bitmap_offset_table_offset, &bitmapOffsetTableOffset); | |
112 | + | |
113 | + //pixels | |
114 | + setIntegerNum(colDef->pixels_to_world, &pixelsToWorldNum); | |
53 | 115 | |
116 | + //size | |
117 | + setIntegerNum(colDef->size, &sizeNum); | |
118 | + | |
119 | + //********************************* high level shape info *** | |
120 | + //clear combo | |
121 | + highLevelShapeIndexCmb.ResetContent(); | |
122 | + //store them | |
123 | + /*for(int i = 0; i < colDef->high_level_shape_count; i ++){ | |
124 | + high_level_shape_definition* highDef = | |
125 | + get_high_level_shape_definition( | |
126 | + }*/ | |
54 | 127 | UpdateData(); |
55 | 128 | |
56 | 129 | } |
@@ -61,6 +134,18 @@ | ||
61 | 134 | // TODO: ここにメッセージ ハンドラ コードを追加します。 |
62 | 135 | // 描画メッセージで CDialog::OnPaint() を呼び出さないでください。 |
63 | 136 | if(theApp.isShapesLoaded){ |
64 | - int collectionIndex = ((CBitmapsDialog*)parent)->collection; | |
137 | + int collectionIndex = theApp.collection; | |
65 | 138 | } |
66 | 139 | } |
140 | + | |
141 | +//change selection of collection combo box | |
142 | +void CSequencesDialog::OnCbnSelchangeCombo1() | |
143 | +{ | |
144 | + // TODO: ここにコントロール通知ハンドラ コードを追加します。 | |
145 | + int sel = collectionCmb.GetCurSel(); | |
146 | + theApp.collection = sel; | |
147 | + //update dialog's datas | |
148 | + if(theApp.isShapesLoaded){ | |
149 | + setupDialog(); | |
150 | + } | |
151 | +} |
@@ -90,7 +90,6 @@ | ||
90 | 90 | } |
91 | 91 | showTypeCmb.SetCurSel(0); |
92 | 92 | collectionCmb.SetCurSel(0); |
93 | - collection = 0; | |
94 | 93 | showMode = 0; |
95 | 94 | setupDialog(); |
96 | 95 | return TRUE; // return TRUE unless you set the focus to a control |
@@ -109,7 +108,7 @@ | ||
109 | 108 | void CBitmapsDialog::OnCbnSelchangeCombo2() |
110 | 109 | { |
111 | 110 | // TODO: ここにコントロール通知ハンドラ コードを追加します。 |
112 | - collection = collectionCmb.GetCurSel(); | |
111 | + theApp.collection = collectionCmb.GetCurSel(); | |
113 | 112 | setupDialog(); |
114 | 113 | //フォーカスをshow typeへ。 |
115 | 114 | GetDlgItem(IDC_DUMMY_)->SetFocus(); |
@@ -1,6 +1,7 @@ | ||
1 | 1 | #pragma once |
2 | 2 | |
3 | 3 | #include "SDLToWin32/SDLToWin32.h" |
4 | +#include "afxwin.h" | |
4 | 5 | |
5 | 6 | // CSequencesDialog ダイアログ |
6 | 7 |
@@ -28,4 +29,38 @@ | ||
28 | 29 | virtual BOOL OnInitDialog(); |
29 | 30 | public: |
30 | 31 | afx_msg void OnPaint(); |
32 | +public: | |
33 | + CComboBox collectionCmb; | |
34 | +public: | |
35 | + CEdit versionNum; | |
36 | +public: | |
37 | + CComboBox typeCmb; | |
38 | +public: | |
39 | + CEdit flagNum; | |
40 | +public: | |
41 | + CEdit colorCountNum; | |
42 | +public: | |
43 | + CEdit CLUTCountNum; | |
44 | +public: | |
45 | + CEdit colorTableOffsetNum; | |
46 | +public: | |
47 | + CEdit highLevelShapeCountNum; | |
48 | +public: | |
49 | + CEdit highLevelShapeOffsetTableOffsetNum; | |
50 | +public: | |
51 | + CEdit lowLevelShapeCountNum; | |
52 | +public: | |
53 | + CEdit lowLevelShapeOffsetTableOffsetNum; | |
54 | +public: | |
55 | + CEdit bitmapCountNum; | |
56 | +public: | |
57 | + CEdit bitmapOffsetTableOffset; | |
58 | +public: | |
59 | + CEdit pixelsToWorldNum; | |
60 | +public: | |
61 | + CEdit sizeNum; | |
62 | +public: | |
63 | + CComboBox highLevelShapeIndexCmb; | |
64 | +public: | |
65 | + afx_msg void OnCbnSelchangeCombo1(); | |
31 | 66 | }; |
@@ -119,7 +119,7 @@ | ||
119 | 119 | |
120 | 120 | void CBitmapImagesDialog::setupDialog() |
121 | 121 | { |
122 | - int collectionIndex = ((CBitmapsDialog*)parent)->collection; | |
122 | + int collectionIndex = theApp.collection; | |
123 | 123 | selectBitmapIndex = NONE; |
124 | 124 | if(theApp.isShapesLoaded){ |
125 | 125 | if(isFirstOfSetup){ |
@@ -198,7 +198,7 @@ | ||
198 | 198 | |
199 | 199 | freeBitmaps(); |
200 | 200 | if(theApp.isShapesLoaded){ |
201 | - int collectionIndex = ((CBitmapsDialog*)parent)->collection; | |
201 | + int collectionIndex = theApp.collection; | |
202 | 202 | |
203 | 203 | int clut = clutCmb.GetCurSel(); |
204 | 204 |
@@ -273,7 +273,7 @@ | ||
273 | 273 | |
274 | 274 | //draw panels |
275 | 275 | if(theApp.isShapesLoaded){ |
276 | - int collectionIndex = ((CBitmapsDialog*)parent)->collection; | |
276 | + int collectionIndex = theApp.collection; | |
277 | 277 | |
278 | 278 | int clut = clutCmb.GetCurSel(); |
279 | 279 |
@@ -370,7 +370,7 @@ | ||
370 | 370 | CRect imageRect; |
371 | 371 | getImageRect(&imageRect); |
372 | 372 | |
373 | - int collectionIndex = ((CBitmapsDialog*)parent)->collection; | |
373 | + int collectionIndex = theApp.collection; | |
374 | 374 | |
375 | 375 | int clut = clutCmb.GetCurSel(); |
376 | 376 |
@@ -419,7 +419,7 @@ | ||
419 | 419 | { |
420 | 420 | selectBitmapIndex = getIndexPointIn(point.x, point.y); |
421 | 421 | if(selectBitmapIndex != NONE){ |
422 | - int collectionIndex = ((CBitmapsDialog*)parent)->collection; | |
422 | + int collectionIndex = theApp.collection; | |
423 | 423 | |
424 | 424 | int clut = clutCmb.GetCurSel(); |
425 | 425 |
@@ -34,7 +34,6 @@ | ||
34 | 34 | |
35 | 35 | //selecting show type |
36 | 36 | //selecting collection |
37 | - int collection; | |
38 | 37 | void resize(); |
39 | 38 | |
40 | 39 | protected: |
@@ -70,7 +70,7 @@ | ||
70 | 70 | dc.SelectObject(GetStockObject(LTGRAY_BRUSH)); |
71 | 71 | dc.Rectangle(&frameRect); |
72 | 72 | if(theApp.isShapesLoaded){ |
73 | - int collectionIndex = ((CBitmapsDialog*)parent)->collection; | |
73 | + int collectionIndex = theApp.collection; | |
74 | 74 | struct collection_header* header = get_collection_header(collectionIndex); |
75 | 75 | int clutNum = header->collection->clut_count; |
76 | 76 | vector<int> colorCount; |
@@ -119,7 +119,7 @@ | ||
119 | 119 | scrollSlider.SetRangeMin(0); |
120 | 120 | |
121 | 121 | if(theApp.isShapesLoaded){ |
122 | - int collectionIndex = ((CBitmapsDialog*)parent)->collection; | |
122 | + int collectionIndex = theApp.collection; | |
123 | 123 | struct collection_header* header = get_collection_header(collectionIndex); |
124 | 124 | int clutNum = header->collection->clut_count; |
125 | 125 | //max |
@@ -19,6 +19,7 @@ | ||
19 | 19 | |
20 | 20 | static char* SHOW_TYPE_INFO_FILE_NAME = "data/ShowTypeInfo.txt"; |
21 | 21 | static char* COLLECTION_INFO_FILE_NAME = "data/Collections.txt"; |
22 | +static char* COLLECTION_TYPE_INFO_FILE_NAME = "data/CollectionTypes.txt"; | |
22 | 23 | |
23 | 24 | // CShapesEditorOneApp construction |
24 | 25 |
@@ -56,7 +57,10 @@ | ||
56 | 57 | showTypeInformations); |
57 | 58 | loadInformations(COLLECTION_INFO_FILE_NAME, NUMBER_OF_COLLECTIONS, |
58 | 59 | collectionInformations); |
60 | + loadInformations(COLLECTION_TYPE_INFO_FILE_NAME, NUMBER_OF_COLLECTION_TYPES, | |
61 | + collectionTypeInformations); | |
59 | 62 | isShapesLoaded = false; |
63 | + collection = 0; | |
60 | 64 | |
61 | 65 | // Standard initialization |
62 | 66 | // If you are not using these features and wish to reduce the size |
@@ -34,6 +34,20 @@ | ||
34 | 34 | #define IDC_EDIT8 1017 |
35 | 35 | #define IDC_EDIT9 1018 |
36 | 36 | #define IDC_EDIT10 1019 |
37 | +#define IDC_EDIT11 1020 | |
38 | +#define IDC_EDIT12 1021 | |
39 | +#define IDC_EDIT13 1022 | |
40 | +#define IDC_EDIT14 1023 | |
41 | +#define IDC_COMBO3 1024 | |
42 | +#define IDC_EDIT15 1025 | |
43 | +#define IDC_EDIT16 1026 | |
44 | +#define IDC_EDIT17 1027 | |
45 | +#define IDC_EDIT18 1028 | |
46 | +#define IDC_EDIT19 1029 | |
47 | +#define IDC_EDIT20 1030 | |
48 | +#define IDC_EDIT21 1031 | |
49 | +#define IDC_EDIT22 1032 | |
50 | +#define IDC_COMBO4 1033 | |
37 | 51 | #define ID_FILE_NEW32771 32771 |
38 | 52 | #define ID_FILE_OPEN32772 32772 |
39 | 53 | #define ID_FILE_CLOSE32773 32773 |
@@ -45,7 +59,7 @@ | ||
45 | 59 | #ifndef APSTUDIO_READONLY_SYMBOLS |
46 | 60 | #define _APS_NEXT_RESOURCE_VALUE 135 |
47 | 61 | #define _APS_NEXT_COMMAND_VALUE 32775 |
48 | -#define _APS_NEXT_CONTROL_VALUE 1013 | |
62 | +#define _APS_NEXT_CONTROL_VALUE 1034 | |
49 | 63 | #define _APS_NEXT_SYMED_VALUE 101 |
50 | 64 | #endif |
51 | 65 | #endif |
@@ -0,0 +1,5 @@ | ||
1 | +unused | |
2 | +wall | |
3 | +object | |
4 | +interface | |
5 | +scenery |