update cursors

GuiCursor needs to be changed to use bitmapAsset
guiTypes.GuiCursor safety around rendering getBitmap()
This commit is contained in:
marauder2k7 2025-06-18 09:27:47 +01:00
parent 794a8c900d
commit 51b1e3b07e
3 changed files with 18 additions and 14 deletions

View file

@ -116,6 +116,10 @@ void GuiCursor::render(const Point2I &pos)
{ {
mExtent.set(getBitmap()->getWidth(), getBitmap()->getHeight()); mExtent.set(getBitmap()->getWidth(), getBitmap()->getHeight());
} }
else
{
return;
}
// Render the cursor centered according to dimensions of texture // Render the cursor centered according to dimensions of texture
S32 texWidth = getBitmap()->getWidth(); S32 texWidth = getBitmap()->getWidth();

View file

@ -24,40 +24,40 @@ new GuiCursor(LeftRightCursor)
{ {
hotSpot = "0.5 0"; hotSpot = "0.5 0";
renderOffset = "0.5 0"; renderOffset = "0.5 0";
bitmapName = "./Images/leftRight"; bitmapAsset = "ToolsModule:leftRight_image";
}; };
new GuiCursor(UpDownCursor) new GuiCursor(UpDownCursor)
{ {
hotSpot = "1 1"; hotSpot = "1 1";
renderOffset = "0 1"; renderOffset = "0 1";
bitmapName = "./Images/upDown"; bitmapAsset = "ToolsModule:upDown_image";
}; };
new GuiCursor(NWSECursor) new GuiCursor(NWSECursor)
{ {
hotSpot = "1 1"; hotSpot = "1 1";
renderOffset = "0.5 0.5"; renderOffset = "0.5 0.5";
bitmapName = "./Images/NWSE"; bitmapAsset = "ToolsModule:NWSE_image";
}; };
new GuiCursor(NESWCursor) new GuiCursor(NESWCursor)
{ {
hotSpot = "1 1"; hotSpot = "1 1";
renderOffset = "0.5 0.5"; renderOffset = "0.5 0.5";
bitmapName = "./Images/NESW"; bitmapAsset = "ToolsModule:NESW_image";
}; };
new GuiCursor(MoveCursor) new GuiCursor(MoveCursor)
{ {
hotSpot = "1 1"; hotSpot = "1 1";
renderOffset = "0.5 0.5"; renderOffset = "0.5 0.5";
bitmapName = "./Images/move"; bitmapAsset = "ToolsModule:move_image";
}; };
new GuiCursor(TextEditCursor) new GuiCursor(TextEditCursor)
{ {
hotSpot = "1 1"; hotSpot = "1 1";
renderOffset = "0.5 0.5"; renderOffset = "0.5 0.5";
bitmapName = "./Images/textEdit"; bitmapAsset = "ToolsModule:textEdit_image";
}; };

View file

@ -27,48 +27,48 @@
new GuiCursor(EditorHandCursor) new GuiCursor(EditorHandCursor)
{ {
hotSpot = "7 0"; hotSpot = "7 0";
bitmapName = "~/worldEditor/images/CUR_hand.png"; bitmapAsset = "ToolsModule:CUR_hand_image";
}; };
new GuiCursor(EditorRotateCursor) new GuiCursor(EditorRotateCursor)
{ {
hotSpot = "11 18"; hotSpot = "11 18";
bitmapName = "~/worldEditor/images/CUR_rotate.png"; bitmapAsset = "ToolsModule:CUR_rotate_image";
}; };
new GuiCursor(EditorMoveCursor) new GuiCursor(EditorMoveCursor)
{ {
hotSpot = "9 13"; hotSpot = "9 13";
bitmapName = "~/worldEditor/images/CUR_grab.png"; bitmapAsset = "ToolsModule:CUR_grab_image";
}; };
new GuiCursor(EditorArrowCursor) new GuiCursor(EditorArrowCursor)
{ {
hotSpot = "0 0"; hotSpot = "0 0";
bitmapName = "~/worldEditor/images/CUR_3darrow.png"; bitmapAsset = "ToolsModule:CUR_3darrow_image";
}; };
new GuiCursor(EditorUpDownCursor) new GuiCursor(EditorUpDownCursor)
{ {
hotSpot = "5 10"; hotSpot = "5 10";
bitmapName = "~/worldEditor/images/CUR_3dupdown"; bitmapAsset = "ToolsModule:CUR_3dupdown_image";
}; };
new GuiCursor(EditorLeftRightCursor) new GuiCursor(EditorLeftRightCursor)
{ {
hotSpot = "9 5"; hotSpot = "9 5";
bitmapName = "~/worldEditor/images/CUR_3dleftright"; bitmapAsset = "ToolsModule:CUR_3dleftright_image";
}; };
new GuiCursor(EditorDiagRightCursor) new GuiCursor(EditorDiagRightCursor)
{ {
hotSpot = "8 8"; hotSpot = "8 8";
bitmapName = "~/worldEditor/images/CUR_3ddiagright"; bitmapAsset = "ToolsModule:CUR_3ddiagright_image";
}; };
new GuiCursor(EditorDiagLeftCursor) new GuiCursor(EditorDiagLeftCursor)
{ {
hotSpot = "8 8"; hotSpot = "8 8";
bitmapName = "~/worldEditor/images/CUR_3ddiagleft"; bitmapAsset = "ToolsModule:CUR_3ddiagleft_image";
}; };
new GuiControl(EmptyControl) new GuiControl(EmptyControl)