• R/O
  • SSH
  • HTTPS

marathon: コミット


コミットメタ情報

リビジョン157 (tree)
日時2006-11-16 00:33:54
作者hogepiyo

ログメッセージ

adding dialog items for sequence datas

変更サマリ

差分

--- marathon/trunk/ShapesEditorOne/src/ShapesEditorOne.h (revision 156)
+++ marathon/trunk/ShapesEditorOne/src/ShapesEditorOne.h (revision 157)
@@ -31,6 +31,8 @@
3131 // See ShapesEditorOne.cpp for the implementation of this class
3232 //
3333
34+const int NUMBER_OF_COLLECTION_TYPES = _scenery_collection + 1;
35+
3436 class CShapesEditorOneApp : public CWinApp
3537 {
3638 public:
@@ -40,6 +42,8 @@
4042 public:
4143 virtual BOOL InitInstance();
4244
45+ int collection;
46+
4347 // Implementation
4448
4549 DECLARE_MESSAGE_MAP()
@@ -47,6 +51,7 @@
4751 public:
4852 Information showTypeInformations[NUMBER_OF_BITMAPS_DIALOG_SHOW_TYPES];
4953 Information collectionInformations[NUMBER_OF_COLLECTIONS];
54+ Information collectionTypeInformations[NUMBER_OF_COLLECTION_TYPES];
5055 bool isShapesLoaded;
5156 };
5257
--- marathon/trunk/ShapesEditorOne/src/AlephOne/shapes_sdl.h (revision 156)
+++ marathon/trunk/ShapesEditorOne/src/AlephOne/shapes_sdl.h (revision 157)
@@ -51,6 +51,8 @@
5151 extern SDL_Surface *screenSurface;
5252 struct collection_header *get_collection_header(short collection_index);
5353 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);
5456
5557 /*
5658 * Initialize shapes handling
--- marathon/trunk/ShapesEditorOne/src/AlephOne/shapes.cpp (revision 156)
+++ marathon/trunk/ShapesEditorOne/src/AlephOne/shapes.cpp (revision 157)
@@ -221,8 +221,6 @@
221221 static void *get_collection_tint_tables(short collection_index, short tint_index);
222222 static void *collection_offset(struct collection_definition *definition, long offset);
223223 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);
226224
227225 /* ---------- machine-specific code */
228226
@@ -1949,7 +1947,7 @@
19491947 return (struct rgb_color_value *) collection_offset(definition, definition->color_table_offset+clut_number*sizeof(struct rgb_color_value)*definition->color_count);
19501948 }
19511949
1952-static struct high_level_shape_definition *get_high_level_shape_definition(
1950+struct high_level_shape_definition *get_high_level_shape_definition(
19531951 short collection_index,
19541952 short high_level_shape_index)
19551953 {
@@ -1986,7 +1984,7 @@
19861984 else return NULL;
19871985 }
19881986
1989-static struct bitmap_definition *get_bitmap_definition(
1987+struct bitmap_definition *get_bitmap_definition(
19901988 short collection_index,
19911989 short bitmap_index)
19921990 {
--- marathon/trunk/ShapesEditorOne/src/SequencesDialog.cpp (revision 156)
+++ marathon/trunk/ShapesEditorOne/src/SequencesDialog.cpp (revision 157)
@@ -20,12 +20,29 @@
2020
2121 void CSequencesDialog::DoDataExchange(CDataExchange* pDX)
2222 {
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);
2440 }
2541
2642
2743 BEGIN_MESSAGE_MAP(CSequencesDialog, CDialog)
2844 ON_WM_PAINT()
45+ ON_CBN_SELCHANGE(IDC_COMBO1, &CSequencesDialog::OnCbnSelchangeCombo1)
2946 END_MESSAGE_MAP()
3047
3148
@@ -43,7 +60,14 @@
4360 CDialog::OnInitDialog();
4461
4562 // 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();
4771 return TRUE; // return TRUE unless you set the focus to a control
4872 // 例外 : OCX プロパティ ページは必ず FALSE を返します。
4973 }
@@ -50,7 +74,56 @@
5074
5175 void CSequencesDialog::setupDialog()
5276 {
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);
53115
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+ }*/
54127 UpdateData();
55128
56129 }
@@ -61,6 +134,18 @@
61134 // TODO: ここにメッセージ ハンドラ コードを追加します。
62135 // 描画メッセージで CDialog::OnPaint() を呼び出さないでください。
63136 if(theApp.isShapesLoaded){
64- int collectionIndex = ((CBitmapsDialog*)parent)->collection;
137+ int collectionIndex = theApp.collection;
65138 }
66139 }
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+}
--- marathon/trunk/ShapesEditorOne/src/BitmapsDialog.cpp (revision 156)
+++ marathon/trunk/ShapesEditorOne/src/BitmapsDialog.cpp (revision 157)
@@ -90,7 +90,6 @@
9090 }
9191 showTypeCmb.SetCurSel(0);
9292 collectionCmb.SetCurSel(0);
93- collection = 0;
9493 showMode = 0;
9594 setupDialog();
9695 return TRUE; // return TRUE unless you set the focus to a control
@@ -109,7 +108,7 @@
109108 void CBitmapsDialog::OnCbnSelchangeCombo2()
110109 {
111110 // TODO: ここにコントロール通知ハンドラ コードを追加します。
112- collection = collectionCmb.GetCurSel();
111+ theApp.collection = collectionCmb.GetCurSel();
113112 setupDialog();
114113 //フォーカスをshow typeへ。
115114 GetDlgItem(IDC_DUMMY_)->SetFocus();
--- marathon/trunk/ShapesEditorOne/src/SequencesDialog.h (revision 156)
+++ marathon/trunk/ShapesEditorOne/src/SequencesDialog.h (revision 157)
@@ -1,6 +1,7 @@
11 #pragma once
22
33 #include "SDLToWin32/SDLToWin32.h"
4+#include "afxwin.h"
45
56 // CSequencesDialog ダイアログ
67
@@ -28,4 +29,38 @@
2829 virtual BOOL OnInitDialog();
2930 public:
3031 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();
3166 };
--- marathon/trunk/ShapesEditorOne/src/BitmapImagesDialog.cpp (revision 156)
+++ marathon/trunk/ShapesEditorOne/src/BitmapImagesDialog.cpp (revision 157)
@@ -119,7 +119,7 @@
119119
120120 void CBitmapImagesDialog::setupDialog()
121121 {
122- int collectionIndex = ((CBitmapsDialog*)parent)->collection;
122+ int collectionIndex = theApp.collection;
123123 selectBitmapIndex = NONE;
124124 if(theApp.isShapesLoaded){
125125 if(isFirstOfSetup){
@@ -198,7 +198,7 @@
198198
199199 freeBitmaps();
200200 if(theApp.isShapesLoaded){
201- int collectionIndex = ((CBitmapsDialog*)parent)->collection;
201+ int collectionIndex = theApp.collection;
202202
203203 int clut = clutCmb.GetCurSel();
204204
@@ -273,7 +273,7 @@
273273
274274 //draw panels
275275 if(theApp.isShapesLoaded){
276- int collectionIndex = ((CBitmapsDialog*)parent)->collection;
276+ int collectionIndex = theApp.collection;
277277
278278 int clut = clutCmb.GetCurSel();
279279
@@ -370,7 +370,7 @@
370370 CRect imageRect;
371371 getImageRect(&imageRect);
372372
373- int collectionIndex = ((CBitmapsDialog*)parent)->collection;
373+ int collectionIndex = theApp.collection;
374374
375375 int clut = clutCmb.GetCurSel();
376376
@@ -419,7 +419,7 @@
419419 {
420420 selectBitmapIndex = getIndexPointIn(point.x, point.y);
421421 if(selectBitmapIndex != NONE){
422- int collectionIndex = ((CBitmapsDialog*)parent)->collection;
422+ int collectionIndex = theApp.collection;
423423
424424 int clut = clutCmb.GetCurSel();
425425
--- marathon/trunk/ShapesEditorOne/src/BitmapsDialog.h (revision 156)
+++ marathon/trunk/ShapesEditorOne/src/BitmapsDialog.h (revision 157)
@@ -34,7 +34,6 @@
3434
3535 //selecting show type
3636 //selecting collection
37- int collection;
3837 void resize();
3938
4039 protected:
--- marathon/trunk/ShapesEditorOne/src/BitmapCLUTDialog.cpp (revision 156)
+++ marathon/trunk/ShapesEditorOne/src/BitmapCLUTDialog.cpp (revision 157)
@@ -70,7 +70,7 @@
7070 dc.SelectObject(GetStockObject(LTGRAY_BRUSH));
7171 dc.Rectangle(&frameRect);
7272 if(theApp.isShapesLoaded){
73- int collectionIndex = ((CBitmapsDialog*)parent)->collection;
73+ int collectionIndex = theApp.collection;
7474 struct collection_header* header = get_collection_header(collectionIndex);
7575 int clutNum = header->collection->clut_count;
7676 vector<int> colorCount;
@@ -119,7 +119,7 @@
119119 scrollSlider.SetRangeMin(0);
120120
121121 if(theApp.isShapesLoaded){
122- int collectionIndex = ((CBitmapsDialog*)parent)->collection;
122+ int collectionIndex = theApp.collection;
123123 struct collection_header* header = get_collection_header(collectionIndex);
124124 int clutNum = header->collection->clut_count;
125125 //max
--- marathon/trunk/ShapesEditorOne/src/ShapesEditorOne.cpp (revision 156)
+++ marathon/trunk/ShapesEditorOne/src/ShapesEditorOne.cpp (revision 157)
@@ -19,6 +19,7 @@
1919
2020 static char* SHOW_TYPE_INFO_FILE_NAME = "data/ShowTypeInfo.txt";
2121 static char* COLLECTION_INFO_FILE_NAME = "data/Collections.txt";
22+static char* COLLECTION_TYPE_INFO_FILE_NAME = "data/CollectionTypes.txt";
2223
2324 // CShapesEditorOneApp construction
2425
@@ -56,7 +57,10 @@
5657 showTypeInformations);
5758 loadInformations(COLLECTION_INFO_FILE_NAME, NUMBER_OF_COLLECTIONS,
5859 collectionInformations);
60+ loadInformations(COLLECTION_TYPE_INFO_FILE_NAME, NUMBER_OF_COLLECTION_TYPES,
61+ collectionTypeInformations);
5962 isShapesLoaded = false;
63+ collection = 0;
6064
6165 // Standard initialization
6266 // If you are not using these features and wish to reduce the size
--- marathon/trunk/ShapesEditorOne/src/resource.h (revision 156)
+++ marathon/trunk/ShapesEditorOne/src/resource.h (revision 157)
@@ -34,6 +34,20 @@
3434 #define IDC_EDIT8 1017
3535 #define IDC_EDIT9 1018
3636 #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
3751 #define ID_FILE_NEW32771 32771
3852 #define ID_FILE_OPEN32772 32772
3953 #define ID_FILE_CLOSE32773 32773
@@ -45,7 +59,7 @@
4559 #ifndef APSTUDIO_READONLY_SYMBOLS
4660 #define _APS_NEXT_RESOURCE_VALUE 135
4761 #define _APS_NEXT_COMMAND_VALUE 32775
48-#define _APS_NEXT_CONTROL_VALUE 1013
62+#define _APS_NEXT_CONTROL_VALUE 1034
4963 #define _APS_NEXT_SYMED_VALUE 101
5064 #endif
5165 #endif
--- marathon/trunk/ShapesEditorOne/data/CollectionTypes.txt (nonexistent)
+++ marathon/trunk/ShapesEditorOne/data/CollectionTypes.txt (revision 157)
@@ -0,0 +1,5 @@
1+unused
2+wall
3+object
4+interface
5+scenery
旧リポジトリブラウザで表示