• R/O
  • SSH
  • HTTPS

marathon: コミット


コミットメタ情報

リビジョン336 (tree)
日時2007-06-18 20:04:50
作者hogepiyo

ログメッセージ

*** empty log message ***

変更サマリ

差分

--- marathon/trunk/MapEditorWX/src/MapEditorWX.cpp (revision 335)
+++ marathon/trunk/MapEditorWX/src/MapEditorWX.cpp (revision 336)
@@ -186,14 +186,32 @@
186186 //ポリゴンが正しいかどうかを検査します(高速版)
187187 bool MapEditorWX::isPolygonValidityStored(int polyIndex)
188188 {
189- //TODO
190- return true;
189+ if(polyIndex < 0){
190+ return false;
191+ }else if(polyIndex >= (int)this->polygonValidity.size()){
192+ //存在しないもの
193+ //更新
194+ updatePolygonValidityStored();
195+ if(polyIndex >= (int)this->polygonValidity.size()){
196+ //それでもやっぱりない→無視
197+ return false;
198+ }
199+ }
200+
201+ return this->polygonValidity[polyIndex];
191202 }
192203
193204 //ポリゴン整合性情報を更新します
194205 void MapEditorWX::updatePolygonValidityStored()
195206 {
196- //TODO
207+ this->polygonValidity.clear();
208+ for(int i = 0; i < (int)PolygonList.size(); i ++){
209+ bool isValid = hpl::aleph::map::isValidPolygon(i);
210+ this->polygonValidity.push_back(isValid);
211+ }
212+
213+ //ついでに高さ順をソートする
214+ //this->polygonDrawOrderByHeight.clear();
197215 }
198216
199217 hpl::aleph::view::HPLViewGridManager* MapEditorWX::getViewGridManager()
--- marathon/trunk/MapEditorWX/src/MapEditorMainFrame.cpp (revision 335)
+++ marathon/trunk/MapEditorWX/src/MapEditorMainFrame.cpp (revision 336)
@@ -256,6 +256,32 @@
256256 //ドローモードならオブジェクトも表示
257257 this->drawObjects(drawDC);
258258
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+
259285 //バッファから画面へコピー
260286 dc.Blit(wxPoint(0,0), size,
261287 drawDC,
@@ -353,6 +379,10 @@
353379 //選択モンスター
354380 this->selectedMonsterPen.SetColour(wxColor(0,255,0));
355381 this->selectedMonsterBrush.SetColour(wxColor(0,255,0));
382+
383+ //選択中
384+ int style = wxDOT;
385+ this->selectingPen = wxPen(wxColor(255,0,0), 1, style);
356386 }
357387
358388 /**
--- marathon/trunk/MapEditorWX/src/MapEditorWX.h (revision 335)
+++ marathon/trunk/MapEditorWX/src/MapEditorWX.h (revision 336)
@@ -220,6 +220,8 @@
220220 //ポリゴン整合性情報を更新します
221221 void updatePolygonValidityStored();
222222
223+ std::vector<bool> polygonValidity;
224+
223225 //イベントマネージャーを取得します
224226 hpl::aleph::HPLEventManager* getEventManager();
225227
--- marathon/trunk/MapEditorWX/src/MapEditorMainFrame.h (revision 335)
+++ marathon/trunk/MapEditorWX/src/MapEditorMainFrame.h (revision 336)
@@ -169,6 +169,9 @@
169169 wxBrush allyBrush;
170170 wxBrush selectedAllyBrush;
171171
172+ //範囲選択表示
173+ wxPen selectingPen;
174+
172175 public:
173176 MapEditorMainFrame(const wxString& title,
174177 const wxPoint& pos = wxDefaultPosition,
--- marathon/trunk/MapEditorWX/src/HeightDialog.cpp (revision 335)
+++ marathon/trunk/MapEditorWX/src/HeightDialog.cpp (revision 336)
@@ -67,20 +67,25 @@
6767 void HeightDialog::OnEditFloor(wxCommandEvent& ev)
6868 {
6969 //TODO
70+ //スライダーの位置を変更する
7071 }
7172 void HeightDialog::OnEditCeiling(wxCommandEvent& ev)
7273 {
7374 //TODO
75+ //同上
7476 }
7577 void HeightDialog::OnSliderFloor(wxCommandEvent& ev)
7678 {
7779 //TODO
80+ //テキストボックスの値を変更する
7881 }
7982 void HeightDialog::OnSliderCeiling(wxCommandEvent& ev)
8083 {
8184 //TODO
85+ //同上
8286 }
8387 void HeightDialog::OnDrawCheck(wxCommandEvent& ev)
8488 {
8589 //TODO
90+ //シングルトンさんのisDrawHiddenLinesを操作する
8691 }
--- marathon/trunk/HPLLib/HPLMapTool.cpp (revision 335)
+++ marathon/trunk/HPLLib/HPLMapTool.cpp (revision 336)
@@ -841,6 +841,86 @@
841841 return index;
842842 }
843843
844+line_data hpl::aleph::map::createLine(int beginPointIndex, int endPointIndex)
845+{
846+ endpoint_data* begin = get_endpoint_data(beginPointIndex);
847+ endpoint_data* end = get_endpoint_data(endPointIndex);
848+ if(begin == NULL || end == NULL){
849+ return NONE;
850+ }
851+ line_data line;
852+ line.clockwise_polygon_owner = NONE;
853+ line.clockwise_polygon_side_index = NONE;
854+ line.counterclockwise_polygon_owner = NONE;
855+ line.counterclockwise_polygon_side_index = NONE;
856+ line.endpoint_indexes[0] = beginPointIndex;
857+ line.endpoint_indexes[1] = endPointIndex;
858+ line.flags = 0;
859+ //TODO 点のうち高い方のフロア高度
860+ line.highest_adjacent_floor = 0;
861+ return line;
862+}
863+polygon_data hpl::aleph::map::createPolygon(int pointIndexes[], int n)
864+{
865+ endpoint_data* ep[MAXIMUM_VERTICES_PER_POLYGON];
866+ polygon_data poly;
867+ for(int i = 0; i < n; i ++){
868+ ep[i] = get_endpoint_data(pointIndexes[i]);
869+ if(ep[i] == NULL){
870+ return NONE;
871+ }
872+ poly.endpoint_indexes[i] = pointIndexes[i];
873+ }
874+ for(int i = 0; i < n; i ++){
875+ int next = i + 1;
876+ if(i == n - 1){
877+ next = 0;
878+ }
879+ int lIndex = hpl::aleph::map::getLineIndexFromTwoLPoints(pointIndexes[i], pointIndexes[next]);
880+ if(lIndex == NONE){
881+ return NONE;
882+ }
883+ poly.line_indexes[i] = lIndex;
884+ }
885+ poly.adjacent_polygon_indexes = NONE;
886+ poly.ambient_sound_image_index = NONE;
887+ //TODO area?
888+ poly.area = 0;
889+ //TODO 点のうち一番高い高度
890+ poly.ceiling_height = WORLD_ONE;
891+ poly.ceiling_lightsource_index = NONE;
892+ //TODO ?
893+ poly.ceiling_origin.x = 0;
894+ poly.ceiling_origin.y = 0;
895+ poly.ceiling_texture = NONE;
896+ //TODO ?
897+ poly.ceiling_transfer_mode = 0;
898+ //TODO center?
899+ poly.center.x = 0;
900+ poly.center.y = 0;
901+ //TODO ZONE?
902+ poly.first_exclusion_zone_index = NONE;
903+ poly.line_exclusion_zone_count = 0;
904+ poly.point_exclusion_zone_count = 0;
905+ //TODO ?
906+ poly.first_neighbor_index = NONE;
907+ poly.first_object = NONE;
908+ //TODO flags?
909+ poly.flags = 0;
910+ poly.media_index = NONE;
911+ poly.media_lightsource_index = NONE;
912+ //TODO count 線の反対側の
913+ poly.neighbor_count = 0;
914+ //TODO ?
915+ poly.permutation = 0;
916+ poly.random_sound_image_index = NONE;
917+ //poly.side_indexes[0] = NONE;
918+ //poly.sound_source_indexes;
919+ poly.type = _polygon_is_normal;
920+ poly.vertex_count = n;
921+ return poly;
922+}
923+
844924 /**
845925 一部を飛ばした新しいインデックス表を作ります
846926 */
--- marathon/trunk/HPLLib/HPLMapTool.h (revision 335)
+++ marathon/trunk/HPLLib/HPLMapTool.h (revision 336)
@@ -306,6 +306,13 @@
306306 int addMapSavedObject(map_object object);
307307 int addAnnotation(map_annotation annotation);
308308
309+ /**
310+ 既存の点を用いて線やポリゴンを作成します
311+ <en> create new line and polygon with points already exist
312+ */
313+ line_data createLine(int beginPointIndex, int endPointIndex);
314+ polygon_data createPolygon(int pointIndexes[], int n);
315+
309316 /**
310317 点情報を削除します
311318 @param index 削除対象のインデックス
旧リポジトリブラウザで表示