• R/O
  • SSH
  • HTTPS

marathon: コミット


コミットメタ情報

リビジョン324 (tree)
日時2007-06-10 23:36:21
作者hogepiyo

ログメッセージ

*** empty log message ***

変更サマリ

差分

--- marathon/trunk/MapEditorWX/src/MapEditorWX.cpp (revision 323)
+++ marathon/trunk/MapEditorWX/src/MapEditorWX.cpp (revision 324)
@@ -21,7 +21,7 @@
2121 }
2222
2323 //ウインドウフレームを生成します
24- MapEditorMainFrame *frame = new MapEditorMainFrame(
24+ frame = new MapEditorMainFrame(
2525 TITLE_TEXT_BASE,
2626 wxPoint(WINDOW_DEFAULT_X, WINDOW_DEFAULT_Y), wxSize(WINDOW_DEFAULT_WIDTH, WINDOW_DEFAULT_HEIGHT));
2727 frame->Show(true);
@@ -133,6 +133,51 @@
133133
134134 //TODO textureBitmaps
135135
136+ /*
137+ TI_ARROW = 0,
138+ TI_FILL,
139+ TI_HAND,
140+ TI_LINE,
141+ TI_MAGNIFY,
142+ TI_SKULL,
143+ TI_TEXT,
144+ TI_POLYGON,
145+ */
146+ char CURSOR_BASE_DIR[] = "data/img/";
147+ char *cursorSkull = "cursor2.cur";
148+ char *cursorPolygon = "cur00004.cur";
149+ int cursorId[] ={
150+ wxCURSOR_ARROW,
151+ wxCURSOR_PAINT_BRUSH,
152+ wxCURSOR_HAND,
153+ wxCURSOR_PENCIL,
154+ wxCURSOR_MAGNIFIER,
155+ -1,
156+ wxCURSOR_IBEAM,
157+ -1
158+ };
159+ //カーソルデータ読み込み
160+ for(int i = 0; i < ToolType::NUMBER_OF_TOOLS; i ++){
161+ if(cursorId[i] != -1){
162+ cursors[i] = wxCursor(cursorId[i]);
163+ }else{
164+ //ファイルパス
165+ char* fname;
166+ if(i == ToolType::TI_SKULL){
167+ fname = cursorSkull;
168+ }else if(i == ToolType::TI_POLYGON){
169+ fname = cursorPolygon;
170+ }
171+ wxString path = wxConvCurrent->cMB2WX(CURSOR_BASE_DIR);
172+ wxString pathF = wxConvCurrent->cMB2WX(fname);
173+ path.Append(pathF);
174+ //読み込み
175+ wxImage bmp;
176+ bmp.LoadFile(path, wxBITMAP_TYPE_CUR);
177+ //カーソル設定
178+ cursors[i] = wxCursor(bmp);
179+ }
180+ }
136181 return true;
137182 }
138183
@@ -235,5 +280,11 @@
235280 */
236281 void MapEditorWX::setCursor()
237282 {
238- //TODO カーソル
283+ int editMode = this->getEventManager()->getEditModeType();
284+ if(editMode == EditModeType::EM_DRAW){
285+ int toolType = this->getEventManager()->getToolType();
286+ //TODO カーソル
287+ ::wxSetCursor(cursors[toolType]);
288+ }else{
289+ }
239290 }
--- marathon/trunk/MapEditorWX/src/MapEditorWX.h (revision 323)
+++ marathon/trunk/MapEditorWX/src/MapEditorWX.h (revision 324)
@@ -24,6 +24,7 @@
2424 #include <wx/dcbuffer.h>
2525 #include <wx/bmpbuttn.h>
2626 #include <wx/sizer.h>
27+#include <wx/cursor.h>
2728
2829 #ifdef __BORLANDC__
2930 #pragma hdrstop
@@ -48,6 +49,8 @@
4849
4950 static wxString TITLE_TEXT_BASE = wxString(_T("Map Editor One"));
5051
52+class MapEditorMainFrame;
53+
5154 //選択したものの種類
5255 enum{
5356 _no_selected,
@@ -179,6 +182,12 @@
179182 //ポリゴンを高さ順に表示する際の順番
180183 //TODO poly height order
181184 std::vector<int> polygonDrawOrderByHeight;
185+
186+ //ツールごとのカーソル
187+ wxCursor cursors[ToolType::NUMBER_OF_TOOLS];
188+
189+ //ウインドウフレーム
190+ MapEditorMainFrame *frame;
182191 public:
183192 ///////////////////////////////////
184193 ///////////////////////////////////
--- marathon/trunk/MapEditorWX/src/ToolDialog.cpp (revision 323)
+++ marathon/trunk/MapEditorWX/src/ToolDialog.cpp (revision 324)
@@ -35,10 +35,6 @@
3535 }
3636 }
3737
38- wxBitmapButton *bmpBtn = new wxBitmapButton(this, -1, toolBitmaps[0]);
39- wxGridSizer *boxSizer = new wxGridSizer(2);
40- this->SetSizer(boxSizer);
41- boxSizer->Add(bmpBtn);
4238 }
4339 ToolDialog::~ToolDialog()
4440 {
@@ -48,18 +44,23 @@
4844 {
4945 //wxTHICK_FRAME wxSTAY_ON_TOP
5046 long style = wxCAPTION;
51- return wxDialog::Create(parent, id, title, wxDefaultPosition,
52- wxSize(TOOL_DIALOG_W, TOOL_DIALOG_H), style);
47+ bool result = wxDialog::Create(parent, id, title, wxDefaultPosition//);
48+ , wxSize(TOOL_DIALOG_W, TOOL_DIALOG_H), style);
49+/* wxBitmapButton *bmpBtn = new wxBitmapButton(this, -1, toolBitmaps[0]);
50+ wxGridSizer *boxSizer = new wxGridSizer(2);
51+ this->SetSizer(boxSizer);
52+ boxSizer->Add(bmpBtn);
53+*/
54+ return result;
5355 }
5456
5557 //paint
5658 void ToolDialog::OnPaint(wxPaintEvent& ev)
5759 {
58-
5960 //ツールアイコン表示
6061 wxPaintDC dc(this);
6162 PrepareDC(dc);
62-return ;
63+
6364 for(int i = 0; i < ToolType::NUMBER_OF_TOOLS; i ++){
6465 #ifdef MAP_VIEWER
6566 //マップビューアー仕様
--- marathon/trunk/PhysicsEditorWX/build/DialogBlocks/physicseditoronewx.h (nonexistent)
+++ marathon/trunk/PhysicsEditorWX/build/DialogBlocks/physicseditoronewx.h (revision 324)
@@ -0,0 +1,94 @@
1+/////////////////////////////////////////////////////////////////////////////
2+// Name: physicseditoronewx.h
3+// Purpose:
4+// Author: koji
5+// Modified by:
6+// Created: 10/06/2007 20:04:30
7+// RCS-ID:
8+// Copyright:
9+// Licence:
10+/////////////////////////////////////////////////////////////////////////////
11+
12+// Generated by DialogBlocks (unregistered), 10/06/2007 20:04:30
13+
14+#ifndef _PHYSICSEDITORONEWX_H_
15+#define _PHYSICSEDITORONEWX_H_
16+
17+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
18+#pragma interface "physicseditoronewx.h"
19+#endif
20+
21+/*!
22+ * Includes
23+ */
24+
25+////@begin includes
26+#include "wx/frame.h"
27+////@end includes
28+
29+/*!
30+ * Forward declarations
31+ */
32+
33+////@begin forward declarations
34+////@end forward declarations
35+
36+/*!
37+ * Control identifiers
38+ */
39+
40+////@begin control identifiers
41+#define ID_PHYSICSEDITORONEWX 10000
42+#define SYMBOL_PHYSICSEDITORONEWX_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX
43+#define SYMBOL_PHYSICSEDITORONEWX_TITLE _("PhysicsEditorOneWX")
44+#define SYMBOL_PHYSICSEDITORONEWX_IDNAME ID_PHYSICSEDITORONEWX
45+#define SYMBOL_PHYSICSEDITORONEWX_SIZE wxSize(400, 300)
46+#define SYMBOL_PHYSICSEDITORONEWX_POSITION wxDefaultPosition
47+////@end control identifiers
48+
49+
50+/*!
51+ * PhysicsEditorOneWX class declaration
52+ */
53+
54+class PhysicsEditorOneWX: public wxFrame
55+{
56+ DECLARE_CLASS( PhysicsEditorOneWX )
57+ DECLARE_EVENT_TABLE()
58+
59+public:
60+ /// Constructors
61+ PhysicsEditorOneWX();
62+ PhysicsEditorOneWX( wxWindow* parent, wxWindowID id = SYMBOL_PHYSICSEDITORONEWX_IDNAME, const wxString& caption = SYMBOL_PHYSICSEDITORONEWX_TITLE, const wxPoint& pos = SYMBOL_PHYSICSEDITORONEWX_POSITION, const wxSize& size = SYMBOL_PHYSICSEDITORONEWX_SIZE, long style = SYMBOL_PHYSICSEDITORONEWX_STYLE );
63+
64+ bool Create( wxWindow* parent, wxWindowID id = SYMBOL_PHYSICSEDITORONEWX_IDNAME, const wxString& caption = SYMBOL_PHYSICSEDITORONEWX_TITLE, const wxPoint& pos = SYMBOL_PHYSICSEDITORONEWX_POSITION, const wxSize& size = SYMBOL_PHYSICSEDITORONEWX_SIZE, long style = SYMBOL_PHYSICSEDITORONEWX_STYLE );
65+
66+ /// Destructor
67+ ~PhysicsEditorOneWX();
68+
69+ /// Initialises member variables
70+ void Init();
71+
72+ /// Creates the controls and sizers
73+ void CreateControls();
74+
75+////@begin PhysicsEditorOneWX event handler declarations
76+////@end PhysicsEditorOneWX event handler declarations
77+
78+////@begin PhysicsEditorOneWX member function declarations
79+ /// Retrieves bitmap resources
80+ wxBitmap GetBitmapResource( const wxString& name );
81+
82+ /// Retrieves icon resources
83+ wxIcon GetIconResource( const wxString& name );
84+////@end PhysicsEditorOneWX member function declarations
85+
86+ /// Should we show tooltips?
87+ static bool ShowToolTips();
88+
89+////@begin PhysicsEditorOneWX member variables
90+////@end PhysicsEditorOneWX member variables
91+};
92+
93+#endif
94+ // _PHYSICSEDITORONEWX_H_
--- marathon/trunk/PhysicsEditorWX/build/DialogBlocks/physicseditorwx.cpp (nonexistent)
+++ marathon/trunk/PhysicsEditorWX/build/DialogBlocks/physicseditorwx.cpp (revision 324)
@@ -0,0 +1,124 @@
1+/////////////////////////////////////////////////////////////////////////////
2+// Name: physicseditorwx.cpp
3+// Purpose:
4+// Author: koji
5+// Modified by:
6+// Created: 09/06/2007 23:14:05
7+// RCS-ID:
8+// Copyright:
9+// Licence:
10+/////////////////////////////////////////////////////////////////////////////
11+
12+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
13+#pragma implementation "physicseditorwx.h"
14+#endif
15+
16+// For compilers that support precompilation, includes "wx/wx.h".
17+#include "wx/wxprec.h"
18+
19+#ifdef __BORLANDC__
20+#pragma hdrstop
21+#endif
22+
23+#ifndef WX_PRECOMP
24+#include "wx/wx.h"
25+#endif
26+
27+////@begin includes
28+////@end includes
29+
30+#include "physicseditorwx.h"
31+
32+////@begin XPM images
33+////@end XPM images
34+
35+
36+/*!
37+ * Application instance implementation
38+ */
39+
40+////@begin implement app
41+IMPLEMENT_APP( PhysicsEditorWXApp )
42+////@end implement app
43+
44+
45+/*!
46+ * PhysicsEditorWXApp type definition
47+ */
48+
49+IMPLEMENT_CLASS( PhysicsEditorWXApp, wxApp )
50+
51+
52+/*!
53+ * PhysicsEditorWXApp event table definition
54+ */
55+
56+BEGIN_EVENT_TABLE( PhysicsEditorWXApp, wxApp )
57+
58+////@begin PhysicsEditorWXApp event table entries
59+////@end PhysicsEditorWXApp event table entries
60+
61+END_EVENT_TABLE()
62+
63+
64+/*!
65+ * Constructor for PhysicsEditorWXApp
66+ */
67+
68+PhysicsEditorWXApp::PhysicsEditorWXApp()
69+{
70+ Init();
71+}
72+
73+
74+/*!
75+ * Member initialisation
76+ */
77+
78+void PhysicsEditorWXApp::Init()
79+{
80+////@begin PhysicsEditorWXApp member initialisation
81+////@end PhysicsEditorWXApp member initialisation
82+}
83+
84+/*!
85+ * Initialisation for PhysicsEditorWXApp
86+ */
87+
88+bool PhysicsEditorWXApp::OnInit()
89+{
90+////@begin PhysicsEditorWXApp initialisation
91+ // Remove the comment markers above and below this block
92+ // to make permanent changes to the code.
93+
94+#if wxUSE_XPM
95+ wxImage::AddHandler(new wxXPMHandler);
96+#endif
97+#if wxUSE_LIBPNG
98+ wxImage::AddHandler(new wxPNGHandler);
99+#endif
100+#if wxUSE_LIBJPEG
101+ wxImage::AddHandler(new wxJPEGHandler);
102+#endif
103+#if wxUSE_GIF
104+ wxImage::AddHandler(new wxGIFHandler);
105+#endif
106+ PhysicsEditorOneWX* mainWindow = new PhysicsEditorOneWX( NULL, ID_PHYSICSEDITORONEWX );
107+ mainWindow->Show(true);
108+////@end PhysicsEditorWXApp initialisation
109+
110+ return true;
111+}
112+
113+
114+/*!
115+ * Cleanup for PhysicsEditorWXApp
116+ */
117+
118+int PhysicsEditorWXApp::OnExit()
119+{
120+////@begin PhysicsEditorWXApp cleanup
121+ return wxApp::OnExit();
122+////@end PhysicsEditorWXApp cleanup
123+}
124+
--- marathon/trunk/PhysicsEditorWX/build/DialogBlocks/physicseditoronewx.cpp (nonexistent)
+++ marathon/trunk/PhysicsEditorWX/build/DialogBlocks/physicseditoronewx.cpp (revision 324)
@@ -0,0 +1,160 @@
1+/////////////////////////////////////////////////////////////////////////////
2+// Name: physicseditoronewx.cpp
3+// Purpose:
4+// Author: koji
5+// Modified by:
6+// Created: 10/06/2007 20:04:30
7+// RCS-ID:
8+// Copyright:
9+// Licence:
10+/////////////////////////////////////////////////////////////////////////////
11+
12+// Generated by DialogBlocks (unregistered), 10/06/2007 20:04:30
13+
14+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
15+#pragma implementation "physicseditoronewx.h"
16+#endif
17+
18+// For compilers that support precompilation, includes "wx/wx.h".
19+#include "wx/wxprec.h"
20+
21+#ifdef __BORLANDC__
22+#pragma hdrstop
23+#endif
24+
25+#ifndef WX_PRECOMP
26+#include "wx/wx.h"
27+#endif
28+
29+////@begin includes
30+////@end includes
31+
32+#include "physicseditoronewx.h"
33+
34+////@begin XPM images
35+
36+////@end XPM images
37+
38+
39+/*!
40+ * PhysicsEditorOneWX type definition
41+ */
42+
43+IMPLEMENT_CLASS( PhysicsEditorOneWX, wxFrame )
44+
45+
46+/*!
47+ * PhysicsEditorOneWX event table definition
48+ */
49+
50+BEGIN_EVENT_TABLE( PhysicsEditorOneWX, wxFrame )
51+
52+////@begin PhysicsEditorOneWX event table entries
53+////@end PhysicsEditorOneWX event table entries
54+
55+END_EVENT_TABLE()
56+
57+
58+/*!
59+ * PhysicsEditorOneWX constructors
60+ */
61+
62+PhysicsEditorOneWX::PhysicsEditorOneWX()
63+{
64+ Init();
65+}
66+
67+PhysicsEditorOneWX::PhysicsEditorOneWX( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
68+{
69+ Init();
70+ Create( parent, id, caption, pos, size, style );
71+}
72+
73+
74+/*!
75+ * PhysicsEditorOneWX creator
76+ */
77+
78+bool PhysicsEditorOneWX::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
79+{
80+////@begin PhysicsEditorOneWX creation
81+ wxFrame::Create( parent, id, caption, pos, size, style );
82+
83+ CreateControls();
84+ Centre();
85+////@end PhysicsEditorOneWX creation
86+ return true;
87+}
88+
89+
90+/*!
91+ * PhysicsEditorOneWX destructor
92+ */
93+
94+PhysicsEditorOneWX::~PhysicsEditorOneWX()
95+{
96+////@begin PhysicsEditorOneWX destruction
97+////@end PhysicsEditorOneWX destruction
98+}
99+
100+
101+/*!
102+ * Member initialisation
103+ */
104+
105+void PhysicsEditorOneWX::Init()
106+{
107+////@begin PhysicsEditorOneWX member initialisation
108+////@end PhysicsEditorOneWX member initialisation
109+}
110+
111+
112+/*!
113+ * Control creation for PhysicsEditorOneWX
114+ */
115+
116+void PhysicsEditorOneWX::CreateControls()
117+{
118+////@begin PhysicsEditorOneWX content construction
119+ // Generated by DialogBlocks, 10/06/2007 20:04:30 (unregistered)
120+
121+ PhysicsEditorOneWX* itemFrame1 = this;
122+
123+////@end PhysicsEditorOneWX content construction
124+}
125+
126+
127+/*!
128+ * Should we show tooltips?
129+ */
130+
131+bool PhysicsEditorOneWX::ShowToolTips()
132+{
133+ return true;
134+}
135+
136+/*!
137+ * Get bitmap resources
138+ */
139+
140+wxBitmap PhysicsEditorOneWX::GetBitmapResource( const wxString& name )
141+{
142+ // Bitmap retrieval
143+////@begin PhysicsEditorOneWX bitmap retrieval
144+ wxUnusedVar(name);
145+ return wxNullBitmap;
146+////@end PhysicsEditorOneWX bitmap retrieval
147+}
148+
149+/*!
150+ * Get icon resources
151+ */
152+
153+wxIcon PhysicsEditorOneWX::GetIconResource( const wxString& name )
154+{
155+ // Icon retrieval
156+////@begin PhysicsEditorOneWX icon retrieval
157+ wxUnusedVar(name);
158+ return wxNullIcon;
159+////@end PhysicsEditorOneWX icon retrieval
160+}
--- marathon/trunk/PhysicsEditorWX/build/DialogBlocks/physicseditorwx.h (nonexistent)
+++ marathon/trunk/PhysicsEditorWX/build/DialogBlocks/physicseditorwx.h (revision 324)
@@ -0,0 +1,96 @@
1+/////////////////////////////////////////////////////////////////////////////
2+// Name: physicseditorwx.h
3+// Purpose:
4+// Author: koji
5+// Modified by:
6+// Created: 09/06/2007 23:14:05
7+// RCS-ID:
8+// Copyright:
9+// Licence:
10+/////////////////////////////////////////////////////////////////////////////
11+
12+#ifndef _PHYSICSEDITORWX_H_
13+#define _PHYSICSEDITORWX_H_
14+
15+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16+#pragma interface "physicseditorwx.h"
17+#endif
18+
19+/*!
20+ * Includes
21+ */
22+#include "header.h"
23+#include "extensions.h"
24+#include "FileHandler.h"
25+#include "map.h"
26+#include "game_wad.h"
27+#include "weapons.h"
28+#include "items.h"
29+#include "monsters.h"
30+#include "scenery_definitions.h"
31+#include "mysound.h"
32+#include "computer_interface.h"
33+#include "editor.h"
34+
35+////@begin includes
36+#include "wx/image.h"
37+#include "physicseditoronewx.h"
38+////@end includes
39+
40+/*!
41+ * Forward declarations
42+ */
43+
44+////@begin forward declarations
45+////@end forward declarations
46+
47+/*!
48+ * Control identifiers
49+ */
50+
51+////@begin control identifiers
52+////@end control identifiers
53+
54+/*!
55+ * PhysicsEditorWXApp class declaration
56+ */
57+
58+class PhysicsEditorWXApp: public wxApp
59+{
60+ DECLARE_CLASS( PhysicsEditorWXApp )
61+ DECLARE_EVENT_TABLE()
62+
63+public:
64+ /// Constructor
65+ PhysicsEditorWXApp();
66+
67+ void Init();
68+
69+ /// Initialises the application
70+ virtual bool OnInit();
71+
72+ /// Called on exit
73+ virtual int OnExit();
74+
75+////@begin PhysicsEditorWXApp event handler declarations
76+
77+////@end PhysicsEditorWXApp event handler declarations
78+
79+////@begin PhysicsEditorWXApp member function declarations
80+
81+////@end PhysicsEditorWXApp member function declarations
82+
83+////@begin PhysicsEditorWXApp member variables
84+////@end PhysicsEditorWXApp member variables
85+};
86+
87+/*!
88+ * Application instance declaration
89+ */
90+
91+////@begin declare app
92+DECLARE_APP(PhysicsEditorWXApp)
93+////@end declare app
94+
95+#endif
96+ // _PHYSICSEDITORWX_H_
旧リポジトリブラウザで表示