mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
added zoom with F
This commit is contained in:
parent
5a59f5d146
commit
3bb147aad6
|
|
@ -578,17 +578,21 @@ void GameRenderer::moveCameraToPlayer(float a)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// fixed - retucio
|
||||||
|
void GameRenderer::zoomRegion(double zoom, double xa, double ya) {
|
||||||
|
// clamp zoom to reasonable range to avoid degenerate matrices
|
||||||
|
if (zoom < 0.1) zoom = 0.1;
|
||||||
|
if (zoom > 10.0) zoom = 10.0;
|
||||||
|
|
||||||
void GameRenderer::zoomRegion(double zoom, double xa, double ya)
|
this->zoom = zoom;
|
||||||
{
|
this->zoom_x = xa;
|
||||||
zoom = zoom;
|
this->zoom_y = ya;
|
||||||
zoom_x = xa;
|
|
||||||
zoom_y = ya;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameRenderer::unZoomRegion()
|
void GameRenderer::unZoomRegion() {
|
||||||
{
|
this->zoom = 1.0;
|
||||||
zoom = 1;
|
this->zoom_x = 0.0;
|
||||||
|
this->zoom_y = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4J added as we have more complex adjustments to make for fov & aspect on account of viewports
|
// 4J added as we have more complex adjustments to make for fov & aspect on account of viewports
|
||||||
|
|
@ -2249,4 +2253,4 @@ int GameRenderer::getFpsCap(int option)
|
||||||
void GameRenderer::updateAllChunks()
|
void GameRenderer::updateAllChunks()
|
||||||
{
|
{
|
||||||
// mc->levelRenderer->updateDirtyChunks(mc->cameraTargetPlayer, true);
|
// mc->levelRenderer->updateDirtyChunks(mc->cameraTargetPlayer, true);
|
||||||
}
|
}
|
||||||
|
|
@ -26,6 +26,7 @@ public:
|
||||||
static const int KEY_CRAFTING = 'C';
|
static const int KEY_CRAFTING = 'C';
|
||||||
static const int KEY_CRAFTING_ALT = 'R';
|
static const int KEY_CRAFTING_ALT = 'R';
|
||||||
static const int KEY_CHAT = 'T';
|
static const int KEY_CHAT = 'T';
|
||||||
|
static const int KEY_ZOOM = 'F';
|
||||||
static const int KEY_CONFIRM = VK_RETURN;
|
static const int KEY_CONFIRM = VK_RETURN;
|
||||||
static const int KEY_CANCEL = VK_ESCAPE;
|
static const int KEY_CANCEL = VK_ESCAPE;
|
||||||
static const int KEY_PAUSE = VK_ESCAPE;
|
static const int KEY_PAUSE = VK_ESCAPE;
|
||||||
|
|
|
||||||
|
|
@ -562,6 +562,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
vk = (lParam & (1 << 24)) ? VK_RCONTROL : VK_LCONTROL;
|
vk = (lParam & (1 << 24)) ? VK_RCONTROL : VK_LCONTROL;
|
||||||
else if (vk == VK_MENU)
|
else if (vk == VK_MENU)
|
||||||
vk = (lParam & (1 << 24)) ? VK_RMENU : VK_LMENU;
|
vk = (lParam & (1 << 24)) ? VK_RMENU : VK_LMENU;
|
||||||
|
|
||||||
g_KBMInput.OnKeyDown(vk);
|
g_KBMInput.OnKeyDown(vk);
|
||||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
@ -1821,6 +1822,19 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
||||||
SetFocus(g_hWnd);
|
SetFocus(g_hWnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// zoom with F - retucio
|
||||||
|
if (!ui.GetMenuDisplayed(0) && pMinecraft->screen == NULL) {
|
||||||
|
Minecraft* mc = Minecraft::GetInstance();
|
||||||
|
if (mc && mc->gameRenderer) {
|
||||||
|
if (g_KBMInput.IsKeyDown(KeyboardMouseInput::KEY_ZOOM)) {
|
||||||
|
mc->gameRenderer->zoomRegion(5.0, 0.0, 0.0);
|
||||||
|
} else {
|
||||||
|
mc->gameRenderer->unZoomRegion();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// has the game defined profile data been changed (by a profile load)
|
// has the game defined profile data been changed (by a profile load)
|
||||||
if(app.uiGameDefinedDataChangedBitmask!=0)
|
if(app.uiGameDefinedDataChangedBitmask!=0)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue