-
Notifications
You must be signed in to change notification settings - Fork 121
feature(WorldBuilder): add all operation modes to single brush tool #1910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
b70665c
02ac220
a6110ad
14299cc
f5cae0f
dc80a61
f57f9bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,6 +73,12 @@ class CWorldBuilderView : public WbView | |
| CPoint m_scrollMin; ///< The minimum scrollbar positions. | ||
| CPoint m_scrollMax; ///< The maximum scroll bar positions. | ||
|
|
||
| // Brush mode hint flicker reduction | ||
|
||
| Int m_lastBrushMode; ///< Last brush mode drawn (for flicker reduction) | ||
| CRect m_lastHintRect; ///< Last hint rectangle drawn (for flicker reduction) | ||
| CPoint m_lastHintPos; ///< Last hint position (for flicker reduction) | ||
xezon marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Bool m_hintDrawnThisPaint; ///< Flag to prevent double-drawing in same paint cycle | ||
|
|
||
| protected: | ||
|
|
||
| /// Draw a texture bitmap in a rectangle in the dc. | ||
|
|
@@ -98,6 +104,9 @@ class CWorldBuilderView : public WbView | |
| /// Draw the object's icon in the dc at a given point. | ||
| void drawObjectInView(CDC *pDc, MapObject *pMapObj); | ||
|
|
||
| /// Draw brush mode hint on canvas | ||
| void drawBrushModeHint(CDC *pDc, CRgn *pUpdateRgn = NULL); | ||
|
|
||
| public: | ||
| /// Get the current draw size in pixels in the 2d window of one height map cell. | ||
| Int getCellSize(void) {return m_cellSize;} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,6 +93,7 @@ class WbView3d : public WbView, public DX8_CleanupHook | |
| afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); | ||
| afx_msg void OnPaint(); | ||
| afx_msg void OnSize(UINT nType, int cx, int cy); | ||
| afx_msg void OnMouseMove(UINT nFlags, CPoint point); | ||
| afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt); | ||
| afx_msg void OnTimer(UINT nIDEvent); | ||
| afx_msg void OnDestroy(); | ||
|
|
@@ -216,6 +217,12 @@ class WbView3d : public WbView, public DX8_CleanupHook | |
| Int m_pickPixels; | ||
| Int m_partialMapSize; | ||
|
|
||
| // Brush mode hint flicker reduction | ||
|
||
| Int m_lastBrushMode; ///< Last brush mode drawn (for flicker reduction) | ||
| RECT m_lastHintRect; ///< Last hint rectangle drawn (for flicker reduction) | ||
| CPoint m_lastHintPos; ///< Last hint position (for flicker reduction) | ||
| Bool m_hintDrawnThisFrame; ///< Flag to prevent double-drawing in same frame | ||
|
|
||
| protected: | ||
|
|
||
| UINT getLastDrawTime(); | ||
|
|
@@ -225,6 +232,7 @@ class WbView3d : public WbView, public DX8_CleanupHook | |
| void drawCircle( HDC hdc, const Coord3D & centerPoint, Real radius, COLORREF color ); | ||
| void drawLabels(HDC hdc); | ||
| void drawLabels(void); | ||
| void drawBrushModeHint(HDC hdc); | ||
| void shutdownWW3D(); | ||
| void killTheTimer(); | ||
| void render(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -494,7 +494,7 @@ BEGIN | |
| CONTROL "",ID_SLIDER,"Static",SS_BLACKFRAME,0,1,19,62 | ||
| END | ||
|
|
||
| IDD_BRUSH_OPTIONS DIALOG DISCARDABLE 0, 0, 118, 138 | ||
| IDD_BRUSH_OPTIONS DIALOG DISCARDABLE 0, 0, 118, 300 | ||
| STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | ||
| CAPTION "Height Brush Options" | ||
| FONT 8, "MS Sans Serif" | ||
|
|
@@ -504,16 +504,33 @@ BEGIN | |
| EDITTEXT IDC_FEATHER_EDIT,71,55,17,12,ES_AUTOHSCROLL | ||
| RTEXT "Size in cells:",IDC_STATIC,24,56,39,10 | ||
| PUSHBUTTON "1",IDC_SIZE_POPUP,93,11,8,12,BS_BITMAP | ||
| GROUPBOX "Brush Width:",IDC_STATIC,1,1,113,34 | ||
| GROUPBOX "Brush Feather Width:",IDC_STATIC,1,43,113,39 | ||
| GROUPBOX "Brush Width (Shift + Scroll Wheel):",IDC_STATIC,1,1,113,34 | ||
| GROUPBOX "Brush Feather Width (Ctrl + Scroll Wheel):",IDC_STATIC,1,43,113,39 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suspect there is no other way to tell about key mappings other than hard coding into strings? How do we know to update these strings when changing key mappings? |
||
| PUSHBUTTON "1",IDC_FEATHER_POPUP,93,55,8,12,BS_BITMAP | ||
| LTEXT "35 FT.",IDC_WIDTH_LABEL,71,24,43,8 | ||
| LTEXT "35 FT.",IDC_HEIGHT_LABEL,71,120,36,8 | ||
| GROUPBOX "Brush Height:",IDC_STATIC,1,90,113,45 | ||
| EDITTEXT IDC_HEIGHT_EDIT,71,105,17,12,ES_AUTOHSCROLL | ||
| RTEXT "Size in 1/8 cells:",IDC_STATIC,0,107,63,10 | ||
| PUSHBUTTON "1",IDC_HEIGHT_POPUP,93,106,8,12,BS_BITMAP | ||
| LTEXT "35 FT.",IDC_FEATHER_LABEL,71,68,41,8 | ||
| GROUPBOX "Raise / Lower Amount (LMB / Shift+LMB):",IDC_STATIC,1,90,113,34 | ||
| EDITTEXT IDC_RAISELOWER_EDIT,71,105,17,12,ES_AUTOHSCROLL | ||
| RTEXT "Amount:",IDC_STATIC,23,106,40,8 | ||
| PUSHBUTTON "1",IDC_RAISELOWER_POPUP,93,105,8,12,BS_BITMAP | ||
| LTEXT "0.0 FEET.",IDC_RAISELOWER_LABEL,71,118,43,8 | ||
| GROUPBOX "Set Height (Ctrl + LMB):",IDC_STATIC,1,132,113,34 | ||
| EDITTEXT IDC_HEIGHT_EDIT,71,147,17,12,ES_AUTOHSCROLL | ||
| RTEXT "Size in 1/8 cells:",IDC_STATIC,0,149,63,10 | ||
| PUSHBUTTON "1",IDC_HEIGHT_POPUP,93,148,8,12,BS_BITMAP | ||
| LTEXT "35 FT.",IDC_HEIGHT_LABEL,71,160,36,8 | ||
| GROUPBOX "Smooth (Ctrl + Shift + LMB):",IDC_STATIC,1,174,113,50 | ||
| EDITTEXT IDC_RADIUS_EDIT,71,189,17,12,ES_AUTOHSCROLL | ||
| RTEXT "Radius:",IDC_STATIC,23,190,40,8 | ||
| PUSHBUTTON "1",IDC_RADIUS_POPUP,93,189,8,12,BS_BITMAP | ||
| EDITTEXT IDC_RATE_EDIT,71,205,17,12,ES_AUTOHSCROLL | ||
| RTEXT "Rate:",IDC_STATIC,23,206,40,8 | ||
| PUSHBUTTON "1",IDC_RATE_POPUP,93,205,8,12,BS_BITMAP | ||
| GROUPBOX "Brush Modes:",IDC_STATIC,1,232,113,65 | ||
| LTEXT "LMB - Raise Height",IDC_STATIC,5,242,108,8 | ||
| LTEXT "Shift + LMB - Lower Height",IDC_STATIC,5,252,108,8 | ||
| LTEXT "Ctrl + LMB - Set Height",IDC_STATIC,5,262,108,8 | ||
| LTEXT "Ctrl + Shift + LMB - Smooth",IDC_STATIC,5,272,108,8 | ||
| END | ||
|
|
||
| IDD_TERRAIN_MATERIAL DIALOG DISCARDABLE 0, 0, 200, 286 | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.