Editor: Fix drop cursor drawing

directional-lights
Sven Eberhardt 2016-10-10 21:26:10 -04:00
parent eee79366d0
commit 4eae2b28d7
6 changed files with 19 additions and 24 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

@ -873,9 +873,11 @@ void C4EditCursor::Draw(C4TargetFacet &cgo)
X2 + cgo.X - cgo.TargetX, Y2 + cgo.Y - cgo.TargetY, 0xffffffff, line_width);
// Draw drop target
if (DropTarget)
::GraphicsResource.fctDropTarget.Draw(cgo.Surface,
DropTarget->GetX() + cgo.X - cgo.TargetX - ::GraphicsResource.fctDropTarget.Wdt / 2,
DropTarget->GetY() + DropTarget->Shape.y + cgo.Y - cgo.TargetY - ::GraphicsResource.fctDropTarget.Hgt);
::GraphicsResource.fctMouseCursor.DrawX(cgo.Surface,
DropTarget->GetX() + cgo.X - cgo.TargetX - ::GraphicsResource.fctMouseCursor.Wdt / 2 / cgo.Zoom,
DropTarget->GetY() + DropTarget->Shape.y + cgo.Y - cgo.TargetY - ::GraphicsResource.fctMouseCursor.Hgt / cgo.Zoom,
float(::GraphicsResource.fctMouseCursor.Wdt) / cgo.Zoom,
float(::GraphicsResource.fctMouseCursor.Hgt) / cgo.Zoom, C4MC_Cursor_DropInto);
// Draw paint circle
if (Mode == C4CNS_ModeDraw && has_mouse_hover && ::Console.ToolsDlg.Grade>0 && ::Console.ToolsDlg.IsGradedTool())
{

View File

@ -76,8 +76,6 @@ void C4GraphicsResource::Default()
fctFlagClr.Default();
fctPlayerClr.Default();
fctCursor.Default();
fctDropTarget.Default();
fctKeyboard.Default();
fctGamepad.Default();
fctCommand.Default();
@ -320,10 +318,6 @@ bool C4GraphicsResource::LoadCursorGfx()
szCursorFilename = "Cursor";
if (!LoadFile(fctMouseCursor, szCursorFilename, Files, C4FCT_Height, C4FCT_Full, false, 0))
return false;
// adjust dependant faces
int32_t iCursorSize = fctMouseCursor.Hgt;
fctCursor.Set(fctMouseCursor.Surface, 11*iCursorSize, 0, iCursorSize, iCursorSize);
fctDropTarget.Set(fctMouseCursor.Surface, 11*iCursorSize, 0, iCursorSize, iCursorSize);
return true;
}

View File

@ -68,8 +68,6 @@ public:
C4FacetID fctGamepad;
C4FacetID fctBuild;
C4Facet fctClonkSkin;
C4Facet fctCursor;
C4Facet fctDropTarget;
C4Facet fctKeyboard;
C4Facet fctMouse;
C4Facet fctCommand;

View File

@ -39,19 +39,6 @@ const int32_t C4MC_Drag_None = 0,
C4MC_Drag_Script = 6,
C4MC_Drag_Unhandled = 7;
const int32_t C4MC_Cursor_Select = 0, // click cursor to select/click stuff in the GUI
C4MC_Cursor_Crosshair = 1, // standard ingame cursor
C4MC_Cursor_DragDrop = 2, // cursor when drag&dropping
C4MC_Cursor_Up = 3, // cursors for scrolling the viewport ...
C4MC_Cursor_Down = 4, // ...
C4MC_Cursor_Left = 5,
C4MC_Cursor_Right = 6,
C4MC_Cursor_UpLeft = 7,
C4MC_Cursor_UpRight = 8,
C4MC_Cursor_DownLeft = 9,
C4MC_Cursor_DownRight = 10,
C4MC_Cursor_Passive = 11; // passive cursor in records and and fog of war and outside viewport
const int32_t C4MC_Tooltip_Delay = 20;
C4MouseControl::C4MouseControl()

View File

@ -47,6 +47,20 @@ const int32_t C4MC_MD_DragSource = 1,
C4MC_MD_DropTarget = 2,
C4MC_MD_NoClick = 4;
const int32_t C4MC_Cursor_Select = 0, // click cursor to select/click stuff in the GUI
C4MC_Cursor_Crosshair = 1, // standard ingame cursor
C4MC_Cursor_DragDrop = 2, // cursor when drag&dropping
C4MC_Cursor_Up = 3, // cursors for scrolling the viewport ...
C4MC_Cursor_Down = 4, // ...
C4MC_Cursor_Left = 5,
C4MC_Cursor_Right = 6,
C4MC_Cursor_UpLeft = 7,
C4MC_Cursor_UpRight = 8,
C4MC_Cursor_DownLeft = 9,
C4MC_Cursor_DownRight = 10,
C4MC_Cursor_Passive = 11, // passive cursor in records and and fog of war and outside viewport
C4MC_Cursor_DropInto = 12; // drop into contents
class C4MouseControl
{
friend class C4Viewport;