• R/O
  • SSH
  • HTTPS

marathon: コミット


コミットメタ情報

リビジョン339 (tree)
日時2007-06-20 20:17:31
作者hogepiyo

ログメッセージ

*** empty log message ***

変更サマリ

差分

--- marathon/trunk/MapEditorWX/src/HeightPalletDialog.cpp (revision 338)
+++ marathon/trunk/MapEditorWX/src/HeightPalletDialog.cpp (nonexistent)
@@ -1,16 +0,0 @@
1-#include "HeightPalletDialog.h"
2-#include "MapEditorWX.h"
3-BEGIN_EVENT_TABLE(HeightPalletDialog, wxDialog)
4-END_EVENT_TABLE()
5-HeightPalletDialog::HeightPalletDialog()
6-{
7-}
8-HeightPalletDialog::~HeightPalletDialog()
9-{
10-}
11-bool HeightPalletDialog::Create(wxWindow* parent, wxWindowID id)
12-{
13- bool result = wxDialog::Create(parent, id, _T("Height Pallet"));
14-
15- return result;
16-}
--- marathon/trunk/MapEditorWX/src/HeightPalletDialog.h (revision 338)
+++ marathon/trunk/MapEditorWX/src/HeightPalletDialog.h (nonexistent)
@@ -1,15 +0,0 @@
1-#ifndef _HEIGHT_PALLET_DIALOG_
2-#define _HEIGHT_PALLET_DIALOG_
3-
4-#include "DlgCommon.h"
5-
6-class HeightPalletDialog: public wxDialog{
7-public:
8- HeightPalletDialog();
9- bool Create(wxWindow* parent, wxWindowID id);
10- virtual ~HeightPalletDialog();
11- //イベントテーブル作成<en>declare
12- DECLARE_EVENT_TABLE()
13-};
14-
15-#endif
--- marathon/trunk/MapEditorWX/src/MapEditorMainFrame.cpp (revision 338)
+++ marathon/trunk/MapEditorWX/src/MapEditorMainFrame.cpp (revision 339)
@@ -96,9 +96,6 @@
9696 wxCommandEvent dummy;
9797 OnDrawPolygonMode(dummy);
9898
99- //高さ制限ダイアログの表示
100- this->heightDialog.Create(this, wxID_ANY);
101-
10299 //TODO
103100 //テスト
104101 //プラットフォームダイアログ
@@ -213,82 +210,8 @@
213210 _T("about this..."), wxOK | wxICON_INFORMATION, this);
214211 }
215212
216-/**
217- 描画
218-*/
219-void MapEditorMainFrame::OnPaint(wxPaintEvent& WXUNUSED(event))
220-{
221- wxSize size = wxFrame::GetSize();
222- if(!wxWindow::IsExposed(0,0,size.GetWidth(), size.GetHeight())){
223- return;
224- }
225- wxBufferedPaintDC dc(this, this->doubleBufferingBitmap);
226- PrepareDC(dc);
227- //dc.Clear();
228-// wxRegionIerator region(GetUpdateRegion());
229-// while(
230- //dc.DrawLine(10,10,100,20);
231-
232- wxDC* drawDC = &dc;//&this->doubleBufferingDC;
233213
234- hpl::aleph::view::HPLViewGridManager* mgr = wxGetApp().getViewGridManager();
235- int DIV = mgr->getZoomDivision();
236- int voffset[2];
237- mgr->getOffset(voffset);
238- int OFFSET_X_VIEW = voffset[0];
239- int OFFSET_Y_VIEW = voffset[1];
240214
241- //背景描画
242- this->drawBackground(drawDC);
243-
244- //ポリゴン
245- this->drawPolygons(drawDC);
246-
247- //ライン
248- this->drawLines(drawDC);
249-
250- //ポイント
251- this->drawPoints(drawDC);
252-
253- //アノテーション
254- this->drawAnnotations(drawDC);
255-
256- //ドローモードならオブジェクトも表示
257- this->drawObjects(drawDC);
258-
259- if(wxGetApp().getEventManager()->isSelectingGroup()){
260- //範囲指定中なら範囲を示す矩形を表示
261- int vpoint[2];
262- wxGetApp().getEventManager()->getSelectGroupStartPoint(vpoint);
263- int mpoint[2];
264- wxGetApp().getViewGridManager()->getNewMousePoint(mpoint);
265-
266- //x,y,w,hを計算
267- int x = vpoint[0];
268- int y = vpoint[1];
269- int w = mpoint[0] - x;
270- itn h = mpoint[1] - y;
271- if(mpoint[0] < x){
272- x = mpoint[0];
273- w = vpoint[0] - x;
274- }
275- if(mpoint[1] < y){
276- y = mpoint[1];
277- h = vpoint[1] - y;
278- }
279- drawDC->SetPen(this->selectingPen);
280- drawDC->SetPen(wxNullBrush);
281- drawDC->DrawRectangle(x,y,w,h);
282-
283- }
284-
285- //バッファから画面へコピー
286- dc.Blit(wxPoint(0,0), size,
287- drawDC,
288- wxPoint(0,0));
289-}
290-
291-
292215 //サイズ変更
293216 void MapEditorMainFrame::OnSize(wxSizeEvent& ev)
294217 {
--- marathon/trunk/MapEditorWX/src/MainFrameDraw.cpp (revision 338)
+++ marathon/trunk/MapEditorWX/src/MainFrameDraw.cpp (revision 339)
@@ -6,10 +6,108 @@
66 const double OBJECT_TRIANGLE_LENGTH = 10.0;
77 const double WING_DEG = 120.0;
88
9+
910 /**
1011 マップデータの表示
1112 */
1213 /**
14+ 描画
15+*/
16+void MapEditorMainFrame::OnPaint(wxPaintEvent& WXUNUSED(event))
17+{
18+ wxSize size = wxFrame::GetSize();
19+ if(!wxWindow::IsExposed(0,0,size.GetWidth(), size.GetHeight())){
20+ return;
21+ }
22+ wxBufferedPaintDC dc(this, this->doubleBufferingBitmap);
23+ PrepareDC(dc);
24+ //dc.Clear();
25+// wxRegionIerator region(GetUpdateRegion());
26+// while(
27+ //dc.DrawLine(10,10,100,20);
28+
29+ wxDC* drawDC = &dc;//&this->doubleBufferingDC;
30+
31+ hpl::aleph::view::HPLViewGridManager* mgr = wxGetApp().getViewGridManager();
32+ int DIV = mgr->getZoomDivision();
33+ int voffset[2];
34+ mgr->getOffset(voffset);
35+ int OFFSET_X_VIEW = voffset[0];
36+ int OFFSET_Y_VIEW = voffset[1];
37+
38+ //背景描画
39+ this->drawBackground(drawDC);
40+
41+ //ポリゴン
42+ this->drawPolygons(drawDC);
43+
44+ //ライン
45+ this->drawLines(drawDC);
46+
47+ //ポイント
48+ this->drawPoints(drawDC);
49+
50+ //アノテーション
51+ this->drawAnnotations(drawDC);
52+
53+ //ドローモードならオブジェクトも表示
54+ this->drawObjects(drawDC);
55+
56+ hpl::aleph::HPLEventManager* emgr = wxGetApp().getEventManager();
57+
58+ if(emgr->isSelectingGroup()){
59+ //範囲指定中なら範囲を示す矩形を表示
60+ int vpoint[2];
61+ emgr->getSelectGroupStartPoint(vpoint);
62+ int mpoint[2];
63+ wxGetApp().getViewGridManager()->getNewMousePoint(mpoint);
64+
65+ //x,y,w,hを計算
66+ int x = vpoint[0];
67+ int y = vpoint[1];
68+ int w = mpoint[0] - x;
69+ int h = mpoint[1] - y;
70+ if(mpoint[0] < x){
71+ x = mpoint[0];
72+ w = vpoint[0] - x;
73+ }
74+ if(mpoint[1] < y){
75+ y = mpoint[1];
76+ h = vpoint[1] - y;
77+ }
78+ drawDC->SetPen(this->selectingPen);
79+ drawDC->SetBrush(*wxTRANSPARENT_BRUSH);
80+ drawDC->DrawRectangle(x,y,w,h);
81+
82+ if(emgr->getEditModeType() == EditModeType::EM_DRAW &&
83+ emgr->getToolType() == ToolType::TI_POLYGON)
84+ {
85+ int mx = mpoint[0];
86+ int my = mpoint[1];
87+ int selStartPoint[2];
88+ emgr->getSelectingGroupStartPoint(selStartPoint);
89+ //ポリゴン追加モード
90+ //追加予定ポリゴンを表示
91+ double polygonPoints[MAXIMUM_VERTICES_PER_POLYGON][2];
92+ int n = wxGetApp().presetPolygonVertexCount;
93+ hpl::math::getRectangleScaledPreparedPolygon(mx, my,
94+ selStartPoint[0], selStartPoint[1], n, polygonPoints);
95+ wxPoint points[MAXIMUM_VERTICES_PER_POLYGON];
96+ for(int i = 0; i < n; i ++){
97+ points[i].x = (int)polygonPoints[i][0];
98+ points[i].y = (int)polygonPoints[i][1];
99+ }
100+ drawDC->DrawPolygon(points, n);
101+ }
102+ }
103+
104+ //バッファから画面へコピー
105+ dc.Blit(wxPoint(0,0), size,
106+ drawDC,
107+ wxPoint(0,0));
108+}
109+
110+/**
13111 背景の描画 <en> draw background
14112 */
15113 void MapEditorMainFrame::drawBackground(wxDC* dc)
@@ -31,7 +129,7 @@
31129
32130 //枠描画
33131 dc->SetPen(this->gridLargePen);
34- dc->SetBrush(wxNullBrush);
132+ dc->SetBrush(*wxTRANSPARENT_BRUSH);
35133 left = voffset[0];
36134 top = voffset[1];
37135 width = OFFSET_X_WORLD * 2 / DIV;
@@ -246,7 +344,7 @@
246344 wxGetApp().selectData.containsPoint(i))
247345 {
248346 dc->SetPen(this->selectedLinePen);
249- dc->SetBrush(wxNullBrush);
347+ dc->SetBrush(*wxTRANSPARENT_BRUSH);
250348 int SIZE = 5;
251349 dc->DrawRectangle(vpoint[0] - SIZE / 2, vpoint[1] - SIZE / 2,
252350 SIZE, SIZE);
--- marathon/trunk/MapEditorWX/src/PolygonNumDialog.cpp (revision 338)
+++ marathon/trunk/MapEditorWX/src/PolygonNumDialog.cpp (revision 339)
@@ -1,6 +1,12 @@
11 #include "PolygonNumDialog.h"
22 #include "MapEditorWX.h"
33 BEGIN_EVENT_TABLE(PolygonNumDialog, wxDialog)
4+ EVT_BUTTON(wxID_ANY, PolygonNumDialog::OnPoly3)
5+ EVT_BUTTON(wxID_ANY, PolygonNumDialog::OnPoly4)
6+ EVT_BUTTON(wxID_ANY, PolygonNumDialog::OnPoly5)
7+ EVT_BUTTON(wxID_ANY, PolygonNumDialog::OnPoly6)
8+ EVT_BUTTON(wxID_ANY, PolygonNumDialog::OnPoly7)
9+ EVT_BUTTON(wxID_ANY, PolygonNumDialog::OnPoly8)
410 END_EVENT_TABLE()
511 PolygonNumDialog::PolygonNumDialog()
612 {
@@ -11,6 +17,78 @@
1117 bool PolygonNumDialog::Create(wxWindow* parent, wxWindowID id)
1218 {
1319 bool result = wxDialog::Create(parent, id, _T("Polygon Num"));
20+ wxBitmap bmp;
21+ bmp.LoadFile(_T("data/img/poly3.bmp"));
22+ bitmap_button_1 = new wxBitmapButton(this, wxID_ANY, bmp);
23+ bmp.LoadFile(_T("data/img/poly4.bmp"));
24+ bitmap_button_2 = new wxBitmapButton(this, wxID_ANY, bmp);
25+ bmp.LoadFile(_T("data/img/poly5.bmp"));
26+ bitmap_button_3 = new wxBitmapButton(this, wxID_ANY, bmp);
27+ bmp.LoadFile(_T("data/img/poly6.bmp"));
28+ bitmap_button_4 = new wxBitmapButton(this, wxID_ANY, bmp);
29+ bmp.LoadFile(_T("data/img/poly7.bmp"));
30+ bitmap_button_5 = new wxBitmapButton(this, wxID_ANY, bmp);
31+ bmp.LoadFile(_T("data/img/poly8.bmp"));
32+ bitmap_button_6 = new wxBitmapButton(this, wxID_ANY, bmp);
1433
34+ //
35+ bitmap_button_1->SetSize(bitmap_button_1->GetBestSize());
36+ bitmap_button_2->SetSize(bitmap_button_2->GetBestSize());
37+ bitmap_button_3->SetSize(bitmap_button_3->GetBestSize());
38+ bitmap_button_4->SetSize(bitmap_button_4->GetBestSize());
39+ bitmap_button_5->SetSize(bitmap_button_5->GetBestSize());
40+ bitmap_button_6->SetSize(bitmap_button_6->GetBestSize());
41+
42+ wxFlexGridSizer* grid_sizer_14 = new wxFlexGridSizer(1, 6, 0, 0);
43+ grid_sizer_14->Add(bitmap_button_1, 0, 0, 0);
44+ grid_sizer_14->Add(bitmap_button_2, 0, 0, 0);
45+ grid_sizer_14->Add(bitmap_button_3, 0, 0, 0);
46+ grid_sizer_14->Add(bitmap_button_4, 0, 0, 0);
47+ grid_sizer_14->Add(bitmap_button_5, 0, 0, 0);
48+ grid_sizer_14->Add(bitmap_button_6, 0, 0, 0);
49+ SetSizer(grid_sizer_14);
50+ grid_sizer_14->Fit(this);
51+ Layout();
52+
1553 return result;
1654 }
55+void PolygonNumDialog::OnPoly3(wxCommandEvent &event)
56+{
57+ SetReturnCode(3);
58+ Destroy();
59+}
60+
61+
62+void PolygonNumDialog::OnPoly4(wxCommandEvent &event)
63+{
64+ SetReturnCode(4);
65+ Destroy();
66+}
67+
68+
69+void PolygonNumDialog::OnPoly5(wxCommandEvent &event)
70+{
71+ SetReturnCode(5);
72+ Destroy();
73+}
74+
75+
76+void PolygonNumDialog::OnPoly6(wxCommandEvent &event)
77+{
78+ SetReturnCode(6);
79+ Destroy();
80+}
81+
82+
83+void PolygonNumDialog::OnPoly7(wxCommandEvent &event)
84+{
85+ SetReturnCode(7);
86+ Destroy();
87+}
88+
89+
90+void PolygonNumDialog::OnPoly8(wxCommandEvent &event)
91+{
92+ SetReturnCode(8);
93+ Destroy();
94+}
--- marathon/trunk/MapEditorWX/src/ColorCustomizeDialog.cpp (revision 338)
+++ marathon/trunk/MapEditorWX/src/ColorCustomizeDialog.cpp (revision 339)
@@ -93,53 +93,53 @@
9393
9494 return result;
9595 }
96-void ColorCustomize::OnOk(wxCommandEvent& ev)
96+void ColorCustomizeDialog::OnOk(wxCommandEvent& ev)
9797 {
9898 SetReturnCode(wxID_OK);
9999 Destroy();
100100 }
101-void ColorCustomize::OnCancel(wxCommandEvent &ev)
101+void ColorCustomizeDialog::OnCancel(wxCommandEvent &ev)
102102 {
103103 SetReturnCode(wxID_OK);
104104 Destroy();
105105 }
106-void ColorCustomize::OnBackground(wxCommandEvent &event)
106+void ColorCustomizeDialog::OnBackground(wxCommandEvent &event)
107107 {
108108 event.Skip();
109- std::cout<<"Event handler (ColorCustomize::OnBackground) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
109+ std::cout<<"Event handler (ColorCustomizeDialog::OnBackground) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
110110 }
111111
112112
113-void ColorCustomize::OnGrid(wxCommandEvent &event)
113+void ColorCustomizeDialog::OnGrid(wxCommandEvent &event)
114114 {
115115 event.Skip();
116- std::cout<<"Event handler (ColorCustomize::OnGrid) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
116+ std::cout<<"Event handler (ColorCustomizeDialog::OnGrid) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
117117 }
118118
119119
120-void ColorCustomize::OnLines(wxCommandEvent &event)
120+void ColorCustomizeDialog::OnLines(wxCommandEvent &event)
121121 {
122122 event.Skip();
123- std::cout<<"Event handler (ColorCustomize::OnLines) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
123+ std::cout<<"Event handler (ColorCustomizeDialog::OnLines) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
124124 }
125125
126126
127-void ColorCustomize::OnPolygons(wxCommandEvent &event)
127+void ColorCustomizeDialog::OnPolygons(wxCommandEvent &event)
128128 {
129129 event.Skip();
130- std::cout<<"Event handler (ColorCustomize::OnPolygons) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
130+ std::cout<<"Event handler (ColorCustomizeDialog::OnPolygons) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
131131 }
132132
133133
134-void ColorCustomize::OnStrings(wxCommandEvent &event)
134+void ColorCustomizeDialog::OnStrings(wxCommandEvent &event)
135135 {
136136 event.Skip();
137- std::cout<<"Event handler (ColorCustomize::OnStrings) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
137+ std::cout<<"Event handler (ColorCustomizeDialog::OnStrings) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
138138 }
139139
140140
141-void ColorCustomize::OnPoints(wxCommandEvent &event)
141+void ColorCustomizeDialog::OnPoints(wxCommandEvent &event)
142142 {
143143 event.Skip();
144- std::cout<<"Event handler (ColorCustomize::OnPoints) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
144+ std::cout<<"Event handler (ColorCustomizeDialog::OnPoints) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
145145 }
--- marathon/trunk/MapEditorWX/src/MainFrameEvent.cpp (revision 338)
+++ marathon/trunk/MapEditorWX/src/MainFrameEvent.cpp (revision 339)
@@ -406,13 +406,16 @@
406406
407407 hpl::aleph::HPLEventManager* emgr = wxGetApp().getEventManager();
408408
409-
409+ int voffset[2];
410+ wxGetApp().getViewGridManager()->getOffset(voffset);
411+ int div = wxGetApp().getViewGridManager()->getZoomDivision();
412+
410413 //重なる点があるかどうかチェック
411414 int pointIndex = NONE;
412415 for(int i = 0; i < (int)EndpointList.size(); i ++){
413416 endpoint_data* ep = get_endpoint_data(i);
414417 if(hpl::aleph::map::isSelectPoint(mx, my, ep->vertex.x, ep->vertex.y,
415- voffset[0], voffset[1], OFFSET_X_WORLD, OFFSET_Y_WORLD, div))
418+ voffset[0], voffset[1], OFFSET_X_WORLD, OFFSET_Y_WORLD, div, POINT_DISTANCE_EPSILON))
416419 {
417420 pointIndex = i;
418421 break;
@@ -437,7 +440,7 @@
437440 if(isFirst){
438441 //最初のクリック
439442 //始点とする
440- wxGetApp().prevPointIndex =
443+ //wxGetApp().prevPointIndex =
441444 }else{
442445 //2回目以降のクリック
443446 //同じ点をクリックしていたら何もしない
@@ -596,8 +599,185 @@
596599 wxGetApp().setCursor();
597600 //マウス座標記録
598601 wxGetApp().getViewGridManager()->setNewMousePoint(ev.m_x, ev.m_y);
602+
603+ //イベントマネージャー
604+ hpl::aleph::HPLEventManager* emgr = wxGetApp().getEventManager();
605+
606+ int editMode = emgr->getEditModeType();
607+ int toolType = emgr->getToolType();
608+ if(editMode == EditModeType::EM_DRAW){
609+ if(toolType == ToolType::TI_ARROW){
610+ this->doLUpOnArrowTool(ev);
611+ }else if(toolType == ToolType::TI_POLYGON){
612+ this->doLUpOnPolygonTool(ev);
613+ }
614+ }
615+ emgr->setSelectingGroup(false);
616+
617+ //ポリゴン状態を更新します
618+ wxGetApp().updatePolygonValidityStored();
619+ Refresh();
599620 }
600621
622+void MapEditorMainFrame::doLUpOnArrowTool(wxMouseEvent& ev)
623+{
624+ //選択データ
625+ hpl::aleph::map::HPLSelectData* sel = &wxGetApp().selectData;
626+
627+ //グリッドマネージャー
628+ hpl::aleph::view::HPLViewGridManager* vmgr = wxGetApp().getViewGridManager();
629+ hpl::aleph::HPLEventManager* emgr = wxGetApp().getEventManager();
630+
631+ if(sel->isSelectOneObject){
632+ //オブジェクトを選択していたら
633+ //オブジェクト情報ダイアログ表示
634+ //TODO
635+ this->objPropDialog.Show(true);
636+ }else if(sel->isSelectOnePolygon){
637+ //ポリゴン情報ダイアログ表示
638+ }
639+ //TODO
640+ //点、線、Sideは右クリックメニューでプロパティを選択した時のみ表示する
641+
642+ int mx = ev.m_x;
643+ int my = ev.m_y;
644+
645+ if(emgr->isSelectingGroup()){
646+ //範囲選択中だった。矩形内のアイテムを選択とする
647+ //選択開始位置
648+ int selStartPoint[2];
649+ emgr->getSelectGroupStartPoint(selStartPoint);
650+
651+ //選択情報初期化
652+ sel->clear();
653+
654+ //点 <en> points
655+ for(int i = 0; i < (int)EndpointList.size(); i ++){
656+ endpoint_data* ep = get_endpoint_data(i);
657+ //高さチェック
658+ if(!vmgr->isValidHeight(ep->highest_adjacent_floor_height,
659+ ep->lowest_adjacent_ceiling_height))
660+ {
661+ continue;
662+ }
663+ int vpoint[2];
664+ wxGetApp().getViewPointFromWorldPoint(ep->vertex, vpoint);
665+ if(hpl::math::isPointInRect<int>(vpoint[0], vpoint[1],
666+ mx, my, selStartPoint[0], selStartPoint[1]))
667+ {
668+ //追加
669+ int offset[2] = {0,0};
670+ sel->addSelPoint(i, offset);
671+ }
672+ }
673+
674+ //線 <en> lines
675+ for(int i = 0; i < (int)LineList.size(); i ++){
676+ line_data* line = get_line_data(i);
677+ endpoint_data* begin = get_endpoint_data(line->endpoint_indexes[0]);
678+ endpoint_data* end = get_endpoint_data(line->endpoint_indexes[1]);
679+ int beginVPoint[2];
680+ int endVPoint[2];
681+ wxGetApp().getViewPointFromWorldPoint(begin->vertex, beginVPoint);
682+ wxGetApp().getViewPointFromWorldPoint(end->vertex, endVPoint);
683+
684+ //高さチェック
685+ if(!vmgr->isValidHeight(line->highest_adjacent_floor,
686+ line->lowest_adjacent_ceiling))
687+ {
688+ continue;
689+ }
690+ if(hpl::math::isLineInRect(beginVPoint[0], beginVPoint[1],
691+ endVPoint[0], endVPoint[1],
692+ mx, my, selStartPoint[0], selStartPoint[1]))
693+ {
694+ //追加
695+ int offset[2][2] = {{0,0},{0,0}};
696+ sel->addSelLine(i, offset);
697+ }
698+ }
699+
700+ //ポリゴン
701+ for(int i = 0; i < (int)PolygonList.size(); i ++){
702+ polygon_data* poly = get_polygon_data(i);
703+ int n = poly->vertex_count;
704+ if(n < 1 || n >= MAXIMUM_VERTICES_PER_POLYGON){
705+ continue;
706+ }
707+ //高さチェック
708+ if(!vmgr->isValidHeight(poly->floor_height,
709+ poly->ceiling_height))
710+ {
711+ continue;
712+ }
713+ //全ての点が矩形内ならポリゴンを選択
714+ bool inner = true;
715+ for(int j = 0; j < n; j ++){
716+ endpoint_data* ep = get_endpoint_data(poly->endpoint_indexes[j]);
717+ int vpoint[2];
718+ wxGetApp().getViewPointFromWorldPoint(ep->vertex, vpoint);
719+ if(!hpl::math::isPointInRect<int>(vpoint[0], vpoint[1],
720+ mx, my, selStartPoint[0], selStartPoint[1]))
721+ {
722+ inner = false;
723+ break;
724+ }
725+ }
726+ if(inner){
727+ //登録
728+ int offset[MAXIMUM_VERTICES_PER_POLYGON][2];
729+ memset(offset, 0, sizeof(int) * MAXIMUM_VERTICES_PER_POLYGON * 2);
730+ sel->addSelPolygon(i, offset, n);
731+ }
732+ }
733+
734+
735+ //オブジェクト
736+ for(int i = 0; i < (int)SavedObjectList.size(); i ++){
737+ map_object* obj = &(SavedObjectList[i]);
738+ //高さチェック
739+ if(!vmgr->isValidHeight(obj->location.z,
740+ obj->location.z))
741+ {
742+ continue;
743+ }
744+ int vpoint[2];
745+ wxGetApp().getViewPointFromWorldPoint(obj->location.x,
746+ obj->location.y, vpoint);
747+ if(hpl::math::isPointInRect<int>(vpoint[0], vpoint[1],
748+ mx, my, selStartPoint[0], selStartPoint[1]))
749+ {
750+ //追加
751+ int offset[2] = {0,0};
752+ sel->addSelObject(i, offset);
753+ }
754+ }
755+
756+ }
757+}
758+void MapEditorMainFrame::doLUpOnPolygonTool(wxMouseEvent& ev)
759+{
760+ int selStartPoint[2];
761+ wxGetApp().getEventManager()->getSelectGroupStartPoint(selStartPoint);
762+ hpl::aleph::HPLEventManager* emgr = wxGetApp().getEventManager();
763+ if(emgr->isSelectingGroup()){
764+ //n角形の座標を計算
765+ double polyPointsView[MAXIMUM_VERTICES_PER_POLYGON][2];
766+ int n = wxGetApp().presetPolygonVertexCount;
767+ hpl::math::getRectangleScaledPreparedPolygon(ev.m_x, ev.m_y,
768+ selStartPoint[0], selStartPoint[1], n,
769+ polyPointsView);
770+ //ワールド座標形に変換
771+ world_point2d polyPointsWorld[MAXIMUM_VERTICES_PER_POLYGON];
772+ for(int i = 0; i < n; i ++){
773+ polyPointsWorld[i] = wxGetApp().getWorldPointFromViewPoint(
774+ (int)polyPointsView[i][0], (int)polyPointsView[i][1]);
775+ }
776+ //ポリゴン生成
777+ hpl::aleph::map::addNewPolygon(polyPointsWorld, n);
778+ }
779+}
780+
601781 /////////////////////////////////////////////////////
602782 /////////////////////////////////////////////////////
603783 /**
@@ -646,12 +826,35 @@
646826 this->moveMapOffset(ev.m_x, ev.m_y);
647827 }else{
648828 //Ctrl押さない
649- if(editModeType == EditModeType::EM_DRAW){
650- //ドローモード
651- if(toolType == ToolType::TI_ARROW){
652- //矢印ツールでD&D
653829
654- }
830+ switch(editModeType){
831+ case EditModeType::EM_DRAW:
832+ doMouseMotionOnDrawMode(ev);
833+ break;
834+ case EditModeType::EM_POLYGON_TYPE:
835+ doMouseMotionOnPolygonMode(ev);
836+ break;
837+ case EditModeType::EM_FLOOR_HEIGHT:
838+ doMouseMotionOnFloorHeightMode(ev);
839+ break;
840+ case EditModeType::EM_CEILING_HEIGHT:
841+ doMouseMotionOnCeilingHeightMode(ev);
842+ break;
843+ case EditModeType::EM_FLOOR_LIGHT:
844+ doMouseMotionOnFloorLightMode(ev);
845+ break;
846+ case EditModeType::EM_CEILING_LIGHT:
847+ doMouseMotionOnCeilingLightMode(ev);
848+ break;
849+ case EditModeType::EM_MEDIA:
850+ doMouseMotionOnMediaMode(ev);
851+ break;
852+ case EditModeType::EM_FLOOR_TEXTURE:
853+ doMouseMotionOnFloorTextureMode(ev);
854+ break;
855+ case EditModeType::EM_CEILING_TEXTURE:
856+ doMouseMotionOnCeilingTextureMode(ev);
857+ break;
655858 }
656859 }
657860
@@ -666,9 +869,41 @@
666869 }
667870 void MapEditorMainFrame::doMouseMotionOnDrawMode(wxMouseEvent& ev)
668871 {
872+ switch(wxGetApp().getEventManager()->getToolType()){
873+ case ToolType::TI_ARROW:
874+ doMouseMotionOnArrowTool(ev);
875+ break;
876+ case ToolType::TI_FILL:
877+ doMouseMotionOnFillTool(ev);
878+ break;
879+ case ToolType::TI_HAND:
880+ doMouseMotionOnHandTool(ev);
881+ break;
882+ case ToolType::TI_LINE:
883+ doMouseMotionOnLineTool(ev);
884+ break;
885+ case ToolType::TI_MAGNIFY:
886+ doMouseMotionOnMagnifyTool(ev);
887+ break;
888+ case ToolType::TI_SKULL:
889+ doMouseMotionOnSkullTool(ev);
890+ break;
891+ case ToolType::TI_TEXT:
892+ doMouseMotionOnTextTool(ev);
893+ break;
894+ case ToolType::TI_POLYGON:
895+ doMouseMotionOnPolygonTool(ev);
896+ break;
897+ default:
898+ hpl::error::halt("Invalid tool type");
899+ }
669900 }
670901 void MapEditorMainFrame::doMouseMotionOnArrowTool(wxMouseEvent& ev)
671902 {
903+ //もし範囲選択中なら?
904+ //ここですることはない
905+
906+ //もし選択中のマップアイテムがあれば、それらを移動させる
672907 }
673908 void MapEditorMainFrame::doMouseMotionOnFillTool(wxMouseEvent& ev)
674909 {
--- marathon/trunk/MapEditorWX/src/MapEditorWX.h (revision 338)
+++ marathon/trunk/MapEditorWX/src/MapEditorWX.h (revision 339)
@@ -172,6 +172,15 @@
172172
173173 //高さが範囲外の線を表示するかどうか(デフォルト:false)
174174 bool isRevealHiddenLines;
175+
176+ //マップが変更されたか
177+ bool isChanged;
178+ //ファイルパス
179+ wxString filePath;
180+
181+ //プリセットで追加するポリゴンの頂点数
182+ int presetPolygonVertexCount;
183+
175184 private:
176185
177186 ///////////////////////
@@ -179,10 +188,6 @@
179188 /** ビュー&グリッドマネージャー */
180189 hpl::aleph::view::HPLViewGridManager viewGridManager;
181190
182- //マップが変更されたか
183- bool isChanged;
184- //ファイルパス
185- wxString filePath;
186191
187192 //イベント管理
188193 hpl::aleph::HPLEventManager eventManager;
--- marathon/trunk/MapEditorWX/src/res/Dialogues.h (revision 338)
+++ marathon/trunk/MapEditorWX/src/res/Dialogues.h (revision 339)
@@ -1,4 +1,4 @@
1-// -*- C++ -*- generated by wxGlade 0.5 on Sat Jun 16 18:59:18 2007 from C:\Documents and Settings\koji\My Documents\saved_\repository_\marathon\MapEditorWX\src\res\MapEditorWX.wxg
1+// -*- C++ -*- generated by wxGlade 0.5 on Wed Jun 20 19:53:28 2007 from C:\0save\marathon\MapEditorWX\src\res\MapEditorWX.wxg
22
33 #include <wx/wx.h>
44 #include <wx/image.h>
@@ -358,6 +358,9 @@
358358 DECLARE_EVENT_TABLE();
359359
360360 public:
361+ void OnSlidBtn(wxCommandEvent &event); // wxGlade: <event_handler>
362+ void OnTransBtn(wxCommandEvent &event); // wxGlade: <event_handler>
363+ void OnElevationBtn(wxCommandEvent &event); // wxGlade: <event_handler>
361364 void OnEditFloor(wxCommandEvent &event); // wxGlade: <event_handler>
362365 void OnEditCeiling(wxCommandEvent &event); // wxGlade: <event_handler>
363366 void OnEdit(wxCommandEvent &event); // wxGlade: <event_handler>
@@ -436,6 +439,31 @@
436439 wxPanel* panel_11;
437440 wxPanel* panel_12;
438441 // end wxGlade
442+
443+ DECLARE_EVENT_TABLE();
444+
445+public:
446+ void OnIDEdit(wxCommandEvent &event); // wxGlade: <event_handler>
447+ void OnFirstNeighborEdit(wxCommandEvent &event); // wxGlade: <event_handler>
448+ void OnTypeChoice(wxCommandEvent &event); // wxGlade: <event_handler>
449+ void OnNearCountEdit(wxCommandEvent &event); // wxGlade: <event_handler>
450+ void OnPermuEdit(wxCommandEvent &event); // wxGlade: <event_handler>
451+ void OnCenterXEdit(wxCommandEvent &event); // wxGlade: <event_handler>
452+ void OnFloorLightEdit(wxCommandEvent &event); // wxGlade: <event_handler>
453+ void OnCenterYEdit(wxCommandEvent &event); // wxGlade: <event_handler>
454+ void OnCeilingLightEdit(wxCommandEvent &event); // wxGlade: <event_handler>
455+ void OnAreaEdit(wxCommandEvent &event); // wxGlade: <event_handler>
456+ void OnFirstObjChoice(wxCommandEvent &event); // wxGlade: <event_handler>
457+ void OnMediaChoice(wxCommandEvent &event); // wxGlade: <event_handler>
458+ void OnFirstExZoneEdit(wxCommandEvent &event); // wxGlade: <event_handler>
459+ void OnMediaLightChoice(wxCommandEvent &event); // wxGlade: <event_handler>
460+ void OnLineExZoneEdit(wxCommandEvent &event); // wxGlade: <event_handler>
461+ void OnSndSrcIndexChoice(wxCommandEvent &event); // wxGlade: <event_handler>
462+ void OnFloorTransEdit(wxCommandEvent &event); // wxGlade: <event_handler>
463+ void OnAmbSndChoice(wxCommandEvent &event); // wxGlade: <event_handler>
464+ void OnCeilingTransEdit(wxCommandEvent &event); // wxGlade: <event_handler>
465+ void OnRndSndChoice(wxCommandEvent &event); // wxGlade: <event_handler>
466+ void OnPlatformBtn(wxCommandEvent &event); // wxGlade: <event_handler>
439467 }; // wxGlade: end class
440468
441469
--- marathon/trunk/MapEditorWX/src/res/Dialogues.cpp (revision 338)
+++ marathon/trunk/MapEditorWX/src/res/Dialogues.cpp (revision 339)
@@ -1,4 +1,4 @@
1-// -*- C++ -*- generated by wxGlade 0.5 on Sat Jun 16 18:59:18 2007 from C:\Documents and Settings\koji\My Documents\saved_\repository_\marathon\MapEditorWX\src\res\MapEditorWX.wxg
1+// -*- C++ -*- generated by wxGlade 0.5 on Wed Jun 20 19:53:28 2007 from C:\0save\marathon\MapEditorWX\src\res\MapEditorWX.wxg
22
33 #include "Dialogues.h"
44
@@ -895,6 +895,9 @@
895895
896896 BEGIN_EVENT_TABLE(PointPropDialog, wxDialog)
897897 // begin wxGlade: PointPropDialog::event_table
898+ EVT_RADIOBUTTON(wxID_ANY, PointPropDialog::OnSlidBtn)
899+ EVT_RADIOBUTTON(wxID_ANY, PointPropDialog::OnTransBtn)
900+ EVT_CHECKBOX(wxID_ANY, PointPropDialog::OnElevationBtn)
898901 EVT_TEXT(wxID_ANY, PointPropDialog::OnEditFloor)
899902 EVT_TEXT(wxID_ANY, PointPropDialog::OnEditCeiling)
900903 EVT_TEXT(wxID_ANY, PointPropDialog::OnEdit)
@@ -906,6 +909,27 @@
906909 END_EVENT_TABLE();
907910
908911
912+void PointPropDialog::OnSlidBtn(wxCommandEvent &event)
913+{
914+ event.Skip();
915+ std::cout<<"Event handler (PointPropDialog::OnSlidBtn) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
916+}
917+
918+
919+void PointPropDialog::OnTransBtn(wxCommandEvent &event)
920+{
921+ event.Skip();
922+ std::cout<<"Event handler (PointPropDialog::OnTransBtn) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
923+}
924+
925+
926+void PointPropDialog::OnElevationBtn(wxCommandEvent &event)
927+{
928+ event.Skip();
929+ std::cout<<"Event handler (PointPropDialog::OnElevationBtn) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
930+}
931+
932+
909933 void PointPropDialog::OnEditFloor(wxCommandEvent &event)
910934 {
911935 event.Skip();
@@ -1079,7 +1103,7 @@
10791103
10801104 };
10811105 choice_18 = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, choice_18_choices, 0);
1082- button_21 = new wxButton(this, wxID_ANY, wxT("button_21"));
1106+ button_21 = new wxButton(this, wxID_ANY, wxT("Platform settings"));
10831107 panel_10 = new wxPanel(this, wxID_ANY);
10841108 panel_11 = new wxPanel(this, wxID_ANY);
10851109 panel_12 = new wxPanel(this, wxID_ANY);
@@ -1090,6 +1114,183 @@
10901114 }
10911115
10921116
1117+BEGIN_EVENT_TABLE(PolygonPropDialog, wxDialog)
1118+ // begin wxGlade: PolygonPropDialog::event_table
1119+ EVT_TEXT(wxID_ANY, PolygonPropDialog::OnIDEdit)
1120+ EVT_TEXT(wxID_ANY, PolygonPropDialog::OnFirstNeighborEdit)
1121+ EVT_CHOICE(wxID_ANY, PolygonPropDialog::OnTypeChoice)
1122+ EVT_TEXT(wxID_ANY, PolygonPropDialog::OnNearCountEdit)
1123+ EVT_TEXT(wxID_ANY, PolygonPropDialog::OnPermuEdit)
1124+ EVT_TEXT(wxID_ANY, PolygonPropDialog::OnCenterXEdit)
1125+ EVT_CHOICE(wxID_ANY, PolygonPropDialog::OnFloorLightEdit)
1126+ EVT_TEXT(wxID_ANY, PolygonPropDialog::OnCenterYEdit)
1127+ EVT_CHOICE(wxID_ANY, PolygonPropDialog::OnCeilingLightEdit)
1128+ EVT_TEXT(wxID_ANY, PolygonPropDialog::OnAreaEdit)
1129+ EVT_CHOICE(wxID_ANY, PolygonPropDialog::OnFirstObjChoice)
1130+ EVT_CHOICE(wxID_ANY, PolygonPropDialog::OnMediaChoice)
1131+ EVT_TEXT(wxID_ANY, PolygonPropDialog::OnFirstExZoneEdit)
1132+ EVT_CHOICE(wxID_ANY, PolygonPropDialog::OnMediaLightChoice)
1133+ EVT_TEXT(wxID_ANY, PolygonPropDialog::OnLineExZoneEdit)
1134+ EVT_CHOICE(wxID_ANY, PolygonPropDialog::OnSndSrcIndexChoice)
1135+ EVT_TEXT(wxID_ANY, PolygonPropDialog::OnFloorTransEdit)
1136+ EVT_CHOICE(wxID_ANY, PolygonPropDialog::OnAmbSndChoice)
1137+ EVT_TEXT(wxID_ANY, PolygonPropDialog::OnCeilingTransEdit)
1138+ EVT_CHOICE(wxID_ANY, PolygonPropDialog::OnRndSndChoice)
1139+ EVT_BUTTON(wxID_ANY, PolygonPropDialog::OnPlatformBtn)
1140+ // end wxGlade
1141+END_EVENT_TABLE();
1142+
1143+
1144+void PolygonPropDialog::OnIDEdit(wxCommandEvent &event)
1145+{
1146+ event.Skip();
1147+ std::cout<<"Event handler (PolygonPropDialog::OnIDEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1148+}
1149+
1150+
1151+void PolygonPropDialog::OnFirstNeighborEdit(wxCommandEvent &event)
1152+{
1153+ event.Skip();
1154+ std::cout<<"Event handler (PolygonPropDialog::OnFirstNeighborEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1155+}
1156+
1157+
1158+void PolygonPropDialog::OnTypeChoice(wxCommandEvent &event)
1159+{
1160+ event.Skip();
1161+ std::cout<<"Event handler (PolygonPropDialog::OnTypeChoice) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1162+}
1163+
1164+
1165+void PolygonPropDialog::OnNearCountEdit(wxCommandEvent &event)
1166+{
1167+ event.Skip();
1168+ std::cout<<"Event handler (PolygonPropDialog::OnNearCountEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1169+}
1170+
1171+
1172+void PolygonPropDialog::OnPermuEdit(wxCommandEvent &event)
1173+{
1174+ event.Skip();
1175+ std::cout<<"Event handler (PolygonPropDialog::OnPermuEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1176+}
1177+
1178+
1179+void PolygonPropDialog::OnCenterXEdit(wxCommandEvent &event)
1180+{
1181+ event.Skip();
1182+ std::cout<<"Event handler (PolygonPropDialog::OnCenterXEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1183+}
1184+
1185+
1186+void PolygonPropDialog::OnFloorLightEdit(wxCommandEvent &event)
1187+{
1188+ event.Skip();
1189+ std::cout<<"Event handler (PolygonPropDialog::OnFloorLightEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1190+}
1191+
1192+
1193+void PolygonPropDialog::OnCenterYEdit(wxCommandEvent &event)
1194+{
1195+ event.Skip();
1196+ std::cout<<"Event handler (PolygonPropDialog::OnCenterYEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1197+}
1198+
1199+
1200+void PolygonPropDialog::OnCeilingLightEdit(wxCommandEvent &event)
1201+{
1202+ event.Skip();
1203+ std::cout<<"Event handler (PolygonPropDialog::OnCeilingLightEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1204+}
1205+
1206+
1207+void PolygonPropDialog::OnAreaEdit(wxCommandEvent &event)
1208+{
1209+ event.Skip();
1210+ std::cout<<"Event handler (PolygonPropDialog::OnAreaEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1211+}
1212+
1213+
1214+void PolygonPropDialog::OnFirstObjChoice(wxCommandEvent &event)
1215+{
1216+ event.Skip();
1217+ std::cout<<"Event handler (PolygonPropDialog::OnFirstObjChoice) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1218+}
1219+
1220+
1221+void PolygonPropDialog::OnMediaChoice(wxCommandEvent &event)
1222+{
1223+ event.Skip();
1224+ std::cout<<"Event handler (PolygonPropDialog::OnMediaChoice) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1225+}
1226+
1227+
1228+void PolygonPropDialog::OnFirstExZoneEdit(wxCommandEvent &event)
1229+{
1230+ event.Skip();
1231+ std::cout<<"Event handler (PolygonPropDialog::OnFirstExZoneEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1232+}
1233+
1234+
1235+void PolygonPropDialog::OnMediaLightChoice(wxCommandEvent &event)
1236+{
1237+ event.Skip();
1238+ std::cout<<"Event handler (PolygonPropDialog::OnMediaLightChoice) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1239+}
1240+
1241+
1242+void PolygonPropDialog::OnLineExZoneEdit(wxCommandEvent &event)
1243+{
1244+ event.Skip();
1245+ std::cout<<"Event handler (PolygonPropDialog::OnLineExZoneEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1246+}
1247+
1248+
1249+void PolygonPropDialog::OnSndSrcIndexChoice(wxCommandEvent &event)
1250+{
1251+ event.Skip();
1252+ std::cout<<"Event handler (PolygonPropDialog::OnSndSrcIndexChoice) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1253+}
1254+
1255+
1256+void PolygonPropDialog::OnFloorTransEdit(wxCommandEvent &event)
1257+{
1258+ event.Skip();
1259+ std::cout<<"Event handler (PolygonPropDialog::OnFloorTransEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1260+}
1261+
1262+
1263+void PolygonPropDialog::OnAmbSndChoice(wxCommandEvent &event)
1264+{
1265+ event.Skip();
1266+ std::cout<<"Event handler (PolygonPropDialog::OnAmbSndChoice) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1267+}
1268+
1269+
1270+void PolygonPropDialog::OnCeilingTransEdit(wxCommandEvent &event)
1271+{
1272+ event.Skip();
1273+ std::cout<<"Event handler (PolygonPropDialog::OnCeilingTransEdit) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1274+}
1275+
1276+
1277+void PolygonPropDialog::OnRndSndChoice(wxCommandEvent &event)
1278+{
1279+ event.Skip();
1280+ std::cout<<"Event handler (PolygonPropDialog::OnRndSndChoice) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1281+}
1282+
1283+
1284+void PolygonPropDialog::OnPlatformBtn(wxCommandEvent &event)
1285+{
1286+ event.Skip();
1287+ std::cout<<"Event handler (PolygonPropDialog::OnPlatformBtn) not implemented yet"<<std::endl; //notify the user that he hasn't implemented the event handler yet
1288+}
1289+
1290+
1291+// wxGlade: add PolygonPropDialog event handlers
1292+
1293+
10931294 void PolygonPropDialog::set_properties()
10941295 {
10951296 // begin wxGlade: PolygonPropDialog::set_properties
--- marathon/trunk/MapEditorWX/src/MapEditorMainFrame.h (revision 338)
+++ marathon/trunk/MapEditorWX/src/MapEditorMainFrame.h (revision 339)
@@ -300,6 +300,12 @@
300300 void doLButtonOnFloorTextureMode(wxMouseEvent& ev);
301301 void doLButtonOnCeilingTextureMode(wxMouseEvent& ev);
302302
303+ /**
304+ マウス左ボタンをあげたとき
305+ */
306+ void doLUpOnArrowTool(wxMouseEvent& ev);
307+ void doLUpOnPolygonTool(wxMouseEvent& ev);
308+
303309 // オフセットを指定したマウスポイントによって移動させます
304310 void moveMapOffset(int x, int y);
305311
--- marathon/trunk/MapEditorWX/src/DlgCommon.h (revision 338)
+++ marathon/trunk/MapEditorWX/src/DlgCommon.h (revision 339)
@@ -14,6 +14,7 @@
1414 #include <wx/radiobut.h>
1515 #include <wx/listctrl.h>
1616 #include <wx/listbox.h>
17+#include <wx/bmpbuttn.h>
1718
1819 #include "HPLLib/HPLEventManager.h"
1920 #include <string>
--- marathon/trunk/MapEditorWX/src/MainFrameMenuEvent.cpp (revision 338)
+++ marathon/trunk/MapEditorWX/src/MainFrameMenuEvent.cpp (revision 339)
@@ -23,7 +23,7 @@
2323 return;
2424 }
2525 }
26- initialize_map_for_new_game();
26+ initialize_map_for_new_level();
2727 //レベル一覧削除
2828 wxGetApp().levelNameList.clear();
2929
@@ -111,7 +111,7 @@
111111 //現在のファイル名で保存
112112 if(save_level(wxGetApp().filePath.mb_str())){
113113 wxGetApp().isChanged = false;
114- wxGetApp().filePath = fname;
114+// wxGetApp().filePath = fname;
115115 }else{
116116 hpl::error::caution("save failure");
117117 }
@@ -131,7 +131,7 @@
131131
132132 if(save_level(fname.mb_str())){
133133 wxGetApp().isChanged = false;
134- filePath = fname;
134+ wxGetApp().filePath = fname;
135135 }else{
136136 hpl::error::caution("save failure");
137137 }
--- marathon/trunk/MapEditorWX/src/TerminalDialog.cpp (revision 338)
+++ marathon/trunk/MapEditorWX/src/TerminalDialog.cpp (revision 339)
@@ -56,7 +56,7 @@
5656 Layout();
5757 return result;
5858 }
59-void PlacementDialog::OnOk(wxCommandEvent& ev)
59+void TerminalDialog::OnOk(wxCommandEvent& ev)
6060 {
6161 SetReturnCode(wxID_OK);
6262 Destroy();
--- marathon/trunk/MapEditorWX/src/PolygonNumDialog.h (revision 338)
+++ marathon/trunk/MapEditorWX/src/PolygonNumDialog.h (revision 339)
@@ -10,5 +10,21 @@
1010 virtual ~PolygonNumDialog();
1111 //イベントテーブル作成<en>declare
1212 DECLARE_EVENT_TABLE()
13+private:
14+
15+ wxBitmapButton* bitmap_button_1;
16+ wxBitmapButton* bitmap_button_2;
17+ wxBitmapButton* bitmap_button_3;
18+ wxBitmapButton* bitmap_button_4;
19+ wxBitmapButton* bitmap_button_5;
20+ wxBitmapButton* bitmap_button_6;
21+public:
22+ void OnPoly3(wxCommandEvent &event); // wxGlade: <event_handler>
23+ void OnPoly4(wxCommandEvent &event); // wxGlade: <event_handler>
24+ void OnPoly5(wxCommandEvent &event); // wxGlade: <event_handler>
25+ void OnPoly6(wxCommandEvent &event); // wxGlade: <event_handler>
26+ void OnPoly7(wxCommandEvent &event); // wxGlade: <event_handler>
27+ void OnPoly8(wxCommandEvent &event); // wxGlade: <event_handler>
28+
1329 };
1430 #endif
--- marathon/trunk/MapEditorWX/src/ToolDialog.cpp (revision 338)
+++ marathon/trunk/MapEditorWX/src/ToolDialog.cpp (revision 339)
@@ -83,6 +83,8 @@
8383
8484 void ToolDialog::OnLeftDown(wxMouseEvent& ev)
8585 {
86+ hpl::aleph::HPLEventManager* emgr = wxGetApp().getEventManager();
87+ int oldIndex = emgr->getToolType();
8688 //選択したツールに設定する
8789 for(int i = 0; i < ToolType::NUMBER_OF_TOOLS; i ++){
8890 int left = (i % 2) * TOOL_WIDTH;
@@ -94,7 +96,7 @@
9496 left, top, right, bottom))
9597 {
9698 //変化
97- wxGetApp().getEventManager()->setToolType(i);
99+ emgr->setToolType(i);
98100
99101 if(i == ToolType::TI_SKULL){
100102 //オブジェクトツール
@@ -106,8 +108,21 @@
106108 //規定のポリゴン追加ツール
107109 //TODO Preset polygons
108110 PolygonNumDialog polyNumDialog;
111+ polyNumDialog.Create(this, wxID_ANY);
112+ int num = polyNumDialog.ShowModal();
113+ if(num >= 3 && num <= 8){
114+ //値を設定
115+ wxGetApp().presetPolygonVertexCount = num;
116+ }
109117
110118 }
119+ if(i != oldIndex){
120+ //TODO
121+ //範囲選択モードを解除
122+ emgr->setSelectingGroup(false);
123+ //選択情報を解除
124+ //wxGetApp().selectData.clear();
125+ }
111126 Refresh();
112127 //カーソル変化
113128 //TODO cursor
--- marathon/trunk/MapEditorWX/WXTODOリスト.txt (revision 338)
+++ marathon/trunk/MapEditorWX/WXTODOリスト.txt (revision 339)
@@ -119,3 +119,4 @@
119119 ?_?̒lj?
120120 ?u?O??N???b?N?_?v?̍X?V
121121
122+TODO ??ɏ????????̒lj????????쐬
--- marathon/trunk/HPLLib/HPLViewGridManager.cpp (revision 338)
+++ marathon/trunk/HPLLib/HPLViewGridManager.cpp (revision 339)
@@ -170,3 +170,13 @@
170170 }
171171 this->gridIndex = index;
172172 }
173+//高さチェック
174+bool hpl::aleph::view::HPLViewGridManager::isValidHeight(int zMin, int zMax)
175+{
176+ if(zMin > this->getViewHeightMax() ||
177+ zMax < this->getViewHeightMin())
178+ {
179+ return false;
180+ }
181+ return true;
182+}
--- marathon/trunk/HPLLib/HPLViewGridManager.h (revision 338)
+++ marathon/trunk/HPLLib/HPLViewGridManager.h (revision 339)
@@ -114,6 +114,9 @@
114114 bool isRevealHiddenLines();
115115 int getGridInterval();
116116 void setGridIntervalIndex(int index);
117+
118+ //高さチェック
119+ bool isValidHeight(int zMin, int zMax);
117120 private:
118121 /**
119122 ズーム調整
旧リポジトリブラウザで表示