mirror of
https://github.com/ApfelTeeSaft/PlanetFleet.git
synced 2026-08-26 19:33:38 +00:00
corrected minimap coordinate placement
This commit is contained in:
+1
-1
@@ -80,7 +80,7 @@ namespace battleship{
|
|||||||
|
|
||||||
Camera *cam = Root::getSingleton()->getCamera();
|
Camera *cam = Root::getSingleton()->getCamera();
|
||||||
cam->setPosition(Map::getSingleton()->getSpawnPoint(playerId - 1) + Vector3(1, 1, 1) * configData::CAMERA_DISTANCE);
|
cam->setPosition(Map::getSingleton()->getSpawnPoint(playerId - 1) + Vector3(1, 1, 1) * configData::CAMERA_DISTANCE);
|
||||||
cam->lookAt(Vector3(0, -1, 1).norm(), Vector3(0, 1, 1).norm());
|
cam->lookAt(Vector3(0, -1, -1).norm(), Vector3(0, 1, -1).norm());
|
||||||
|
|
||||||
mainPlayer = Game::getSingleton()->getPlayer(playerId);
|
mainPlayer = Game::getSingleton()->getPlayer(playerId);
|
||||||
|
|
||||||
|
|||||||
@@ -123,8 +123,8 @@ namespace battleship{
|
|||||||
|
|
||||||
for(u8 *p = asset->image; p != asset->image + size; p += numChannels, pxId += numChannels, numIter++){
|
for(u8 *p = asset->image; p != asset->image + size; p += numChannels, pxId += numChannels, numIter++){
|
||||||
Vector2 coords = Vector2(
|
Vector2 coords = Vector2(
|
||||||
-(numIter % asset->width - .5 * asset->width),
|
numIter % asset->width - .5 * asset->width,
|
||||||
numIter / asset->width - .5 * asset->height
|
-(numIter / asset->width - .5 * asset->height)
|
||||||
);
|
);
|
||||||
float losFactor = .6, pxCol[3]{
|
float losFactor = .6, pxCol[3]{
|
||||||
losFactor * oldImageData[pxId + 0],
|
losFactor * oldImageData[pxId + 0],
|
||||||
|
|||||||
+2
-2
@@ -20,8 +20,8 @@ namespace battleship{
|
|||||||
|
|
||||||
void MinimapButton::onClick(){
|
void MinimapButton::onClick(){
|
||||||
Vector2 clickPos = getCursorPos();
|
Vector2 clickPos = getCursorPos();
|
||||||
float posXRatio = 1. - (clickPos.x - pos.x) / size.x;
|
float posXRatio = (clickPos.x - pos.x) / size.x;
|
||||||
float posYRatio = 1. - (clickPos.y - pos.y) / size.y;
|
float posYRatio = (clickPos.y - pos.y) / size.y;
|
||||||
|
|
||||||
Camera *cam = Root::getSingleton()->getCamera();
|
Camera *cam = Root::getSingleton()->getCamera();
|
||||||
Vector3 mapSize = Map::getSingleton()->getMapSize();
|
Vector3 mapSize = Map::getSingleton()->getMapSize();
|
||||||
|
|||||||
Reference in New Issue
Block a user