Skip to content

Commit

Permalink
Default pointer pos to center of the screen with touch_use_crosshair=…
Browse files Browse the repository at this point in the history
…false too
  • Loading branch information
grorp committed Dec 20, 2024
1 parent 58111a8 commit fd7c2b3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/gui/touchcontrols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ TouchControls::TouchControls(IrrlichtDevice *device, ISimpleTextureSource *tsrc)
m_screensize = m_device->getVideoDriver()->getScreenSize();
m_button_size = ButtonLayout::getButtonSize(m_screensize);
applyLayout(ButtonLayout::loadFromSettings());
// This means the shootline starts out in the middle of the screen instead
// of the upper left corner with m_draw_crosshair == false.
// It's not strictly necessary, but it's nicer.
m_move_pos = v2s32(m_screensize.X / 2, m_screensize.Y / 2);
}

void TouchControls::applyLayout(const ButtonLayout &layout)
Expand Down

0 comments on commit fd7c2b3

Please sign in to comment.