Author Topic: Centering X-hairs on the minimap  (Read 5115 times)

Offline kevL

  • Colonel
  • ****
  • Posts: 466
  • pitchforks and torches
    • View Profile
Centering X-hairs on the minimap
« on: August 03, 2013, 07:47:25 am »
the 1x1px offset was really bothering me, so I tracked down the code and this works:

Battlescape/MiniMapView.cpp, ~line 150+

Code: [Select]
drawLine(centerX - CELL_WIDTH -1, centerY - CELL_HEIGHT -1,
centerX - xOffset -1, centerY - yOffset -1,
color); https:// top left
drawLine(centerX + xOffset -1, centerY - yOffset -1,
centerX + CELL_WIDTH -1, centerY - CELL_HEIGHT -1,
color); https:// top right
drawLine(centerX - CELL_WIDTH -1, centerY + CELL_HEIGHT -1,
centerX - xOffset -1, centerY + yOffset -1,
color); https:// bottom left
drawLine(centerX + CELL_WIDTH -1, centerY + CELL_HEIGHT -1,
centerX + xOffset -1, centerY + yOffset -1,
color); https:// bottom right

If someone with git-fu would like to toss it into a nightly build Pls do. All those "-1"s are yours truly,

Offline 54x

  • Colonel
  • ****
  • Posts: 208
    • View Profile
Re: Centering X-hairs on the minimap
« Reply #1 on: August 03, 2013, 10:31:10 am »
Pull request made.

Offline kevL

  • Colonel
  • ****
  • Posts: 466
  • pitchforks and torches
    • View Profile
Re: Centering X-hairs on the minimap
« Reply #2 on: August 04, 2013, 01:14:52 am »
thanks but, whoever altered the code mucked things up. It *should* look like this:

Offline kevL

  • Colonel
  • ****
  • Posts: 466
  • pitchforks and torches
    • View Profile
Re: Centering X-hairs on the minimap
« Reply #3 on: August 05, 2013, 01:58:20 am »
here's how to get soldiers properly centered on the main battle map also:

in Battlescape/Camera.cpp, Camera::centerOnPosition()
change

Code: [Select]
_mapOffset.x = -(screenPos.x - (_screenWidth / 2));
_mapOffset.y = -(screenPos.y - (_visibleMapHeight / 2));

to
Code: [Select]
_mapOffset.x = -(screenPos.x - (_screenWidth / 2) +16);
_mapOffset.y = -(screenPos.y - (_visibleMapHeight / 2) +16);


great game. It's really shaping up!!!

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Centering X-hairs on the minimap
« Reply #4 on: August 05, 2013, 03:36:07 am »
fixt

Offline kevL

  • Colonel
  • ****
  • Posts: 466
  • pitchforks and torches
    • View Profile
Re: Centering X-hairs on the minimap
« Reply #5 on: August 05, 2013, 10:10:44 am »
et tu, brutus




jk

Offline 54x

  • Colonel
  • ****
  • Posts: 208
    • View Profile
Re: Centering X-hairs on the minimap
« Reply #6 on: August 05, 2013, 12:12:21 pm »
ah, apologies that I effed it up. :) Cheers for cleaning it, Warboy.