* Fix screwed up formatting.

This commit is contained in:
iProgramInCpp
2024-01-22 18:39:44 +02:00
parent 501a2a8dbd
commit 047fd3120f
6 changed files with 66 additions and 62 deletions

View File

@@ -152,10 +152,10 @@ void AppPlatform::showKeyboard()
void AppPlatform::showKeyboard(bool bShown)
{
if (bShown)
showKeyboard();
else
hideKeyboard();
if (bShown)
showKeyboard();
else
hideKeyboard();
}
void AppPlatform::hideKeyboard()
@@ -175,32 +175,32 @@ int AppPlatform::getKeyboardUpOffset()
void AppPlatform::_fireLowMemory()
{
}
void AppPlatform::_fireAppSuspended()
{
}
void AppPlatform::_fireAppResumed()
{
}
void AppPlatform::_fireAppFocusLost()
{
}
void AppPlatform::_fireAppFocusGained()
{
}
void AppPlatform::_fireAppTerminated()
{
}
bool AppPlatform::hasFileSystemAccess()
@@ -224,13 +224,13 @@ SoundSystem* const AppPlatform::getSoundSystem() const
std::string AppPlatform::getAssetPath(const std::string &path) const
{
std::string realPath = path;
if (realPath.size() && realPath[0] == '/')
{
// trim it off
realPath = realPath.substr(1);
}
realPath = "assets/" + realPath;
return realPath;
std::string realPath = path;
if (realPath.size() && realPath[0] == '/')
{
// trim it off
realPath = realPath.substr(1);
}
realPath = "assets/" + realPath;
return realPath;
}

View File

@@ -59,7 +59,7 @@ public:
virtual void updateFocused(bool focused);
// Also add this to allow proper text input within the game.
virtual bool shiftPressed();
// On-screen keyboard
// On-screen keyboard
virtual void showKeyboard(int x, int y, int w, int h);
virtual void showKeyboard();
virtual void showKeyboard(bool bShown); // @TODO: Why on earth is this here?
@@ -69,13 +69,13 @@ public:
#ifdef USE_NATIVE_ANDROID
virtual int getKeyboardUpOffset();
#endif
void _fireLowMemory();
void _fireAppSuspended();
void _fireAppResumed();
void _fireAppFocusLost();
void _fireAppFocusGained();
void _fireAppTerminated();
void _fireLowMemory();
void _fireAppSuspended();
void _fireAppResumed();
void _fireAppFocusLost();
void _fireAppFocusGained();
void _fireAppTerminated();
virtual bool hasFileSystemAccess();
// Also add this to allow dynamic patching.
@@ -85,7 +85,7 @@ public:
#endif
public:
virtual std::string getAssetPath(const std::string& path) const;
virtual std::string getAssetPath(const std::string& path) const;
private:
virtual void _tick();

View File

@@ -31,10 +31,10 @@
#include "client/renderer/GrassColor.hpp"
#include "client/renderer/FoliageColor.hpp"
// custom:
// custom:
#include "client/renderer/PatchManager.hpp"
int Minecraft::width = C_DEFAULT_SCREEN_WIDTH;
int Minecraft::width = C_DEFAULT_SCREEN_WIDTH;
int Minecraft::height = C_DEFAULT_SCREEN_HEIGHT;
float Minecraft::guiScaleMultiplier = 1.0f;
bool Minecraft::useAmbientOcclusion = false;
@@ -331,13 +331,13 @@ void Minecraft::handleBuildAction(BuildActionIntention* pAction)
{
switch (m_hitResult.m_hitSide)
{
case HitResult::NOHIT: break;
case HitResult::MINY: dy--; break;
case HitResult::MAXY: dy++; break;
case HitResult::MINZ: dz--; break;
case HitResult::MAXZ: dz++; break;
case HitResult::MINX: dx--; break;
case HitResult::MAXX: dx++; break;
case HitResult::NOHIT: break;
case HitResult::MINY: dy--; break;
case HitResult::MAXY: dy++; break;
case HitResult::MINZ: dz--; break;
case HitResult::MAXZ: dz++; break;
case HitResult::MINX: dx--; break;
case HitResult::MAXX: dx++; break;
}
}
else
@@ -538,10 +538,10 @@ void Minecraft::tickInput()
bool flag =
// If we are mouse operated, the LMB is held down and it's not in the GUI
((m_options->field_19 && Mouse::isButtonDown(BUTTON_LEFT) && !bIsInGUI) ||
// We are instead keyboard operated, so check for the KM_DESTROY key being held down
(!m_options->field_19 && Keyboard::isKeyDown(m_options->m_keyMappings[KM_DESTROY].value)) ||
// The build action intention is a remove one
(b && bai.isRemove()));
// We are instead keyboard operated, so check for the KM_DESTROY key being held down
(!m_options->field_19 && Keyboard::isKeyDown(m_options->m_keyMappings[KM_DESTROY].value)) ||
// The build action intention is a remove one
(b && bai.isRemove()));
if (flag && !m_pScreen && (field_DA8 - field_DAC) >= (m_timer.m_ticksPerSecond * 0.25f))
{
@@ -831,7 +831,7 @@ void Minecraft::init()
m_pGameMode = new CreativeMode(this);
#endif
// "Default.png" for the launch image overwrites "default.png" for the font during app packaging
// "Default.png" for the launch image overwrites "default.png" for the font during app packaging
m_pFont = new Font(m_options, "font/default8.png", m_pTextures);
if (GrassColor::isAvailable())
@@ -974,9 +974,13 @@ void Minecraft::sizeUpdate(int newWidth, int newHeight)
// re-calculate the GUI scale.
Gui::InvGuiScale = getBestScaleForThisScreenSize(newWidth, newHeight) / guiScaleMultiplier;
// the ceil prevents under-drawing
// The ceil gives an extra pixel to the screen's width and height, in case the GUI scale doesn't
// divide evenly into width or height, so that none of the game screen is uncovered.
if (m_pScreen)
m_pScreen->setSize(ceil(Minecraft::width * Gui::InvGuiScale), ceil(Minecraft::height * Gui::InvGuiScale));
m_pScreen->setSize(
int(ceilf(Minecraft::width * Gui::InvGuiScale)),
int(ceilf(Minecraft::height * Gui::InvGuiScale))
);
if (m_pInputHolder)
m_pInputHolder->setScreenSize(Minecraft::width, Minecraft::height);

View File

@@ -83,9 +83,9 @@ public:
Options* getOptions() const { return m_options; }
static void setGuiScaleMultiplier(float f);
private:
void _reloadInput();
void _reloadInput();
void _levelGenerated();
public: