@ -50,6 +50,20 @@ void mouseInput(Game *game){
inputHandler - > cursorPos . x = GetMousePosition ( ) . x ;
inputHandler - > cursorPos . y = GetMousePosition ( ) . y ;
// bissl Kamera Zoom
float maxZoom = 5.0f ;
float minZoom = 0.2f ;
if ( IsKeyPressed ( KEY_I ) ) {
if ( camera - > zoom < maxZoom ) {
camera - > zoom + = 0.2f ;
}
}
if ( IsKeyPressed ( KEY_K ) ) {
if ( camera - > zoom > minZoom ) {
camera - > zoom - = 0.2f ;
}
}
// resetting last selected Tile to grass texture
if ( inputHandler - > selectedLayer ! = - 1 ) {
IsometricMapChangeTextureIdOfTile ( layers , ( int ) inputHandler - > cursorWorldTile . x , ( int ) inputHandler - > cursorWorldTile . y , inputHandler - > selectedLayer , 0 ) ;
@ -64,7 +78,11 @@ void mouseInput(Game *game){
int mouseAdjustmentX = - tileWidthHalf ;
int mouseAdjustmentY = - tileHeightQuarter + ( tileHeightQuarter * layers [ n ] - > layer ) ;
IsometricMapProject ( layers [ n ] , camera , inputHandler - > cursorPos . x + mouseAdjustmentX , inputHandler - > cursorPos . y + mouseAdjustmentY , & inputHandler - > cursorWorldPos ) ;
// Updating inputHandler->cursorWorldPos Vector2D
IsometricMapProject ( layers [ n ] , camera ,
( inputHandler - > cursorPos . x / camera - > zoom ) + mouseAdjustmentX ,
( inputHandler - > cursorPos . y / camera - > zoom ) + mouseAdjustmentY ,
& inputHandler - > cursorWorldPos ) ;
/*N I C E*/ Tile * selectedTile = IsometricMapGetTileFromWorldCoordinates ( layers , inputHandler - > cursorWorldPos . x , inputHandler - > cursorWorldPos . y , n ) ;