mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-17 20:10:23 +03:00
Cleared up some fields (#41)
* Cleared up some fields Renamed some fields Made some statements involving those fields make more sense for their type Renamed the parameters of SoundEngine::PlayAt to have more readable names * Renamed master volume field m_flMasterVolume -> m_fMasterVolume * Made m_iPerspective -> m_bThirdPerson
This commit is contained in:
@@ -452,7 +452,7 @@ void Minecraft::tickInput()
|
||||
}
|
||||
else if (keyCode == AKEYCODE_SEARCH)
|
||||
{
|
||||
m_options.field_23D ^= 1;
|
||||
m_options.m_bThirdPerson = !m_options.m_bThirdPerson;
|
||||
}
|
||||
else if (keyCode == AKEYCODE_MENU)
|
||||
{
|
||||
@@ -471,8 +471,8 @@ void Minecraft::tickInput()
|
||||
else if (keyCode == AKEYCODE_F4)
|
||||
{
|
||||
// Toggle ambient occlusion.
|
||||
m_options.field_18 ^= 1;
|
||||
Minecraft::useAmbientOcclusion = m_options.field_18;
|
||||
m_options.m_bAmbientOcclusion = !m_options.m_bAmbientOcclusion;
|
||||
Minecraft::useAmbientOcclusion = m_options.m_bAmbientOcclusion;
|
||||
m_pLevelRenderer->allChanged();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -31,10 +31,10 @@ void Options::initDefaultValues()
|
||||
field_244 = 1.0f;
|
||||
field_23C = 0;
|
||||
field_248 = 1.0f;
|
||||
field_23D = 0; // @NOTE: third person?
|
||||
m_bThirdPerson = false;
|
||||
field_0 = 1.0f;
|
||||
field_23E = 0;
|
||||
field_4 = 1.0f;
|
||||
m_fMasterVolume = 1.0f;
|
||||
m_bFlyCheat = false;
|
||||
field_241 = 0;
|
||||
field_8 = 0.5f;
|
||||
@@ -42,14 +42,10 @@ void Options::initDefaultValues()
|
||||
m_bInvertMouse = false;
|
||||
m_bAnaglyphs = false;
|
||||
field_16 = 0;
|
||||
#ifdef ORIGINAL_CODE
|
||||
field_18 = 0;
|
||||
#else
|
||||
field_18 = Minecraft::useAmbientOcclusion;
|
||||
#endif
|
||||
m_bAmbientOcclusion = Minecraft::useAmbientOcclusion;
|
||||
field_240 = 1;
|
||||
field_10 = 2;
|
||||
field_14 = 1;
|
||||
m_iViewDistance = 2;
|
||||
m_bViewBobbing = 1;
|
||||
m_bAutoJump = true;
|
||||
m_bFancyGraphics = true;
|
||||
field_19 = 1;
|
||||
@@ -173,9 +169,9 @@ void Options::update(const std::vector<std::string>& strings)
|
||||
else if (key == "mp_server_visible_default")
|
||||
m_bServerVisibleDefault = readBool(value);
|
||||
else if (key == "gfx_smoothlighting")
|
||||
Minecraft::useAmbientOcclusion = field_18 = readBool(value);
|
||||
Minecraft::useAmbientOcclusion = m_bAmbientOcclusion = readBool(value);
|
||||
else if (key == "gfx_viewdistance")
|
||||
field_10 = readInt(value);
|
||||
m_iViewDistance = readInt(value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,8 +186,8 @@ std::vector<std::string> Options::getOptionStrings()
|
||||
SO("ctrl_autojump", saveBool(m_bAutoJump));
|
||||
SO("gfx_fancygraphics", saveBool(m_bFancyGraphics));
|
||||
SO("mp_server_visible_default", saveBool(m_bServerVisibleDefault));
|
||||
SO("gfx_smoothlighting", saveBool(field_18));
|
||||
SO("gfx_viewdistance", saveInt (field_10));
|
||||
SO("gfx_smoothlighting", saveBool(m_bAmbientOcclusion));
|
||||
SO("gfx_viewdistance", saveInt (m_iViewDistance));
|
||||
|
||||
return vec;
|
||||
}
|
||||
|
||||
@@ -84,22 +84,22 @@ public:
|
||||
|
||||
public:
|
||||
float field_0;
|
||||
float field_4;
|
||||
float m_fMasterVolume;
|
||||
float field_8;
|
||||
bool m_bInvertMouse;
|
||||
int field_10; // @NOTE: Render distance?
|
||||
bool field_14;
|
||||
int m_iViewDistance;
|
||||
bool m_bViewBobbing;
|
||||
bool m_bAnaglyphs;
|
||||
uint8_t field_16;
|
||||
bool m_bFancyGraphics;
|
||||
uint8_t field_18; // @NOTE: Ambient occlusion?
|
||||
bool m_bAmbientOcclusion;
|
||||
uint8_t field_19;
|
||||
std::string field_1C;
|
||||
KeyBind m_keyBinds[16];
|
||||
|
||||
int field_238;
|
||||
uint8_t field_23C;
|
||||
uint8_t field_23D; // @NOTE: Third person mode?
|
||||
bool m_bThirdPerson;
|
||||
uint8_t field_23E;
|
||||
bool m_bFlyCheat;
|
||||
uint8_t field_240;
|
||||
|
||||
@@ -67,14 +67,14 @@ void OptionsScreen::UpdateTexts()
|
||||
{
|
||||
Options& o = m_pMinecraft->m_options;
|
||||
|
||||
m_AOButton.m_text = "Smooth lighting: " + BoolOptionStr(o.field_18);
|
||||
m_AOButton.m_text = "Smooth lighting: " + BoolOptionStr(o.m_bAmbientOcclusion);
|
||||
m_invertYButton.m_text = "Invert Y-axis: " + BoolOptionStr(o.m_bInvertMouse);
|
||||
m_viewBobButton.m_text = "View bobbing: " + BoolOptionStr(o.field_14);
|
||||
m_viewBobButton.m_text = "View bobbing: " + BoolOptionStr(o.m_bViewBobbing);
|
||||
m_anaglyphsButton.m_text = "3d Anaglyphs: " + BoolOptionStr(o.m_bAnaglyphs);
|
||||
m_fancyGfxButton.m_text = "Fancy graphics: " + BoolOptionStr(o.m_bFancyGraphics);
|
||||
m_flightHaxButton.m_text = "Flight hax: " + BoolOptionStr(o.m_bFlyCheat);
|
||||
m_autoJumpButton.m_text = "Auto Jump: " + BoolOptionStr(o.m_bAutoJump);
|
||||
m_viewDistButton.m_text = "View distance: " + ViewDistanceStr(o.field_10);
|
||||
m_viewDistButton.m_text = "View distance: " + ViewDistanceStr(o.m_iViewDistance);
|
||||
m_srvVisButton.m_text = "Server " + std::string(o.m_bServerVisibleDefault ? "visible" : "invisible") + " by default";
|
||||
}
|
||||
#endif
|
||||
@@ -178,8 +178,8 @@ void OptionsScreen::buttonClicked(Button* pButton)
|
||||
return;
|
||||
|
||||
case OB_AO:
|
||||
o.field_18 ^= 1;
|
||||
Minecraft::useAmbientOcclusion = o.field_18;
|
||||
o.m_bAmbientOcclusion = !o.m_bAmbientOcclusion;
|
||||
Minecraft::useAmbientOcclusion = o.m_bAmbientOcclusion;
|
||||
m_pMinecraft->m_pLevelRenderer->allChanged();
|
||||
UpdateTexts();
|
||||
return;
|
||||
@@ -190,7 +190,7 @@ void OptionsScreen::buttonClicked(Button* pButton)
|
||||
return;
|
||||
case OB_VIEW_DIST:
|
||||
// @TODO: fix the 'extreme' render distance
|
||||
o.field_10 = (o.field_10 + 1) % 4;
|
||||
o.m_iViewDistance = (o.m_iViewDistance + 1) % 4;
|
||||
UpdateTexts();
|
||||
return;
|
||||
|
||||
@@ -204,7 +204,7 @@ void OptionsScreen::buttonClicked(Button* pButton)
|
||||
pOption = &o.m_bServerVisibleDefault;
|
||||
break;
|
||||
case OB_VIEW_BOB:
|
||||
pOption = &o.field_14;
|
||||
pOption = &o.m_bViewBobbing;
|
||||
break;
|
||||
case OB_FLY_HAX:
|
||||
pOption = &o.m_bFlyCheat;
|
||||
@@ -217,7 +217,7 @@ void OptionsScreen::buttonClicked(Button* pButton)
|
||||
if (!pOption)
|
||||
return;
|
||||
|
||||
*pOption ^= 1;
|
||||
*pOption = !(*pOption);
|
||||
UpdateTexts();
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ void GameRenderer::unZoomRegion()
|
||||
|
||||
void GameRenderer::setupCamera(float f, int i)
|
||||
{
|
||||
field_8 = float(256 >> m_pMinecraft->m_options.field_10);
|
||||
field_8 = float(256 >> m_pMinecraft->m_options.m_iViewDistance);
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
@@ -109,7 +109,7 @@ void GameRenderer::setupCamera(float f, int i)
|
||||
}
|
||||
|
||||
bobHurt(f);
|
||||
if (m_pMinecraft->m_options.field_14)
|
||||
if (m_pMinecraft->m_options.m_bViewBobbing)
|
||||
bobView(f);
|
||||
|
||||
moveCameraToPlayer(f);
|
||||
@@ -127,7 +127,7 @@ void GameRenderer::moveCameraToPlayer(float f)
|
||||
|
||||
glRotatef(field_5C + f * (field_58 - field_5C), 0.0f, 0.0f, 1.0f);
|
||||
|
||||
if (m_pMinecraft->m_options.field_23D)
|
||||
if (m_pMinecraft->m_options.m_bThirdPerson)
|
||||
{
|
||||
float v11 = field_30 + (field_2C - field_30) * f;
|
||||
if (m_pMinecraft->m_options.field_241)
|
||||
@@ -253,7 +253,7 @@ void GameRenderer::setupClearColor(float f)
|
||||
Level* pLevel = pMC->m_pLevel;
|
||||
Mob* pMob = pMC->m_pMobPersp;
|
||||
|
||||
float x1 = 1.0f - powf(1.0f / float(4 - pMC->m_options.field_10), 0.25f);
|
||||
float x1 = 1.0f - powf(1.0f / float(4 - pMC->m_options.m_iViewDistance), 0.25f);
|
||||
|
||||
Vec3 skyColor = pLevel->getSkyColor(pMob, f), fogColor = pLevel->getFogColor(f);
|
||||
|
||||
@@ -427,7 +427,7 @@ void GameRenderer::renderLevel(float f)
|
||||
setupCamera(f, i);
|
||||
saveMatrices();
|
||||
|
||||
if (m_pMinecraft->m_options.field_10 <= 1)
|
||||
if (m_pMinecraft->m_options.m_iViewDistance <= 1)
|
||||
{
|
||||
#ifndef ORIGINAL_CODE
|
||||
// @NOTE: For whatever reason, Minecraft doesn't enable GL_FOG right away.
|
||||
@@ -441,7 +441,7 @@ void GameRenderer::renderLevel(float f)
|
||||
glEnable(GL_FOG);
|
||||
setupFog(1);
|
||||
|
||||
if (m_pMinecraft->m_options.field_18)
|
||||
if (m_pMinecraft->m_options.m_bAmbientOcclusion)
|
||||
glShadeModel(GL_SMOOTH);
|
||||
|
||||
Frustum& frust = Frustum::frustum;
|
||||
@@ -655,7 +655,7 @@ void GameRenderer::tick()
|
||||
}
|
||||
|
||||
float bright = m_pMinecraft->m_pLevel->getBrightness(Mth::floor(pMob->m_pos.x), Mth::floor(pMob->m_pos.y), Mth::floor(pMob->m_pos.z));
|
||||
float x3 = float(3 - m_pMinecraft->m_options.field_10);
|
||||
float x3 = float(3 - m_pMinecraft->m_options.m_iViewDistance);
|
||||
|
||||
field_C++;
|
||||
|
||||
@@ -678,21 +678,21 @@ void GameRenderer::renderItemInHand(float f, int i)
|
||||
glPushMatrix();
|
||||
bobHurt(f);
|
||||
|
||||
if (m_pMinecraft->m_options.field_14)
|
||||
if (m_pMinecraft->m_options.m_bViewBobbing)
|
||||
bobView(f);
|
||||
|
||||
if (!m_pMinecraft->m_options.field_23D && !m_pMinecraft->m_options.field_23C)
|
||||
if (!m_pMinecraft->m_options.m_bThirdPerson && !m_pMinecraft->m_options.field_23C)
|
||||
m_pItemInHandRenderer->render(f);
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
if (!m_pMinecraft->m_options.field_23D)
|
||||
if (!m_pMinecraft->m_options.m_bThirdPerson)
|
||||
{
|
||||
m_pItemInHandRenderer->renderScreenEffect(f);
|
||||
bobHurt(f);
|
||||
}
|
||||
|
||||
if (m_pMinecraft->m_options.field_14)
|
||||
if (m_pMinecraft->m_options.m_bViewBobbing)
|
||||
bobView(f);
|
||||
}
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ void LevelRenderer::allChanged()
|
||||
pLeaves->m_bTransparent = m_pMinecraft->m_options.m_bFancyGraphics;
|
||||
pLeaves->m_TextureFrame = !pLeaves->m_bTransparent + pLeaves->field_74;
|
||||
|
||||
field_BC = m_pMinecraft->m_options.field_10;
|
||||
field_BC = m_pMinecraft->m_options.m_iViewDistance;
|
||||
|
||||
int x1 = 64 << (3 - field_BC);
|
||||
if (x1 >= 400)
|
||||
@@ -489,7 +489,7 @@ void LevelRenderer::render(Mob* pMob, int a, float b)
|
||||
field_88.push_back(pChunk);
|
||||
}
|
||||
|
||||
if (m_pMinecraft->m_options.field_10 != field_BC)
|
||||
if (m_pMinecraft->m_options.m_iViewDistance != field_BC)
|
||||
allChanged();
|
||||
|
||||
if (!a)
|
||||
@@ -1022,7 +1022,7 @@ void LevelRenderer::renderEntities(Vec3 pos, Culler* culler, float f)
|
||||
if (!culler->isVisible(pEnt->m_hitbox))
|
||||
continue;
|
||||
|
||||
if (m_pMinecraft->m_pMobPersp == pEnt && !m_pMinecraft->m_options.field_23D) // @NOTE: third person ?
|
||||
if (m_pMinecraft->m_pMobPersp == pEnt && !m_pMinecraft->m_options.m_bThirdPerson)
|
||||
continue;
|
||||
|
||||
if (m_pLevel->hasChunkAt(Mth::floor(pEnt->m_pos.x), Mth::floor(pEnt->m_pos.y), Mth::floor(pEnt->m_pos.z)))
|
||||
@@ -1039,7 +1039,7 @@ void LevelRenderer::takePicture(TripodCamera* pCamera, Entity* pOwner)
|
||||
{
|
||||
Mob* pOldMob = m_pMinecraft->m_pMobPersp;
|
||||
bool bOldField23C = m_pMinecraft->m_options.field_23C;
|
||||
bool bOldField23D = m_pMinecraft->m_options.field_23D;
|
||||
bool bOldThirdPerson = m_pMinecraft->m_options.m_bThirdPerson;
|
||||
|
||||
#ifdef ENH_CAMERA_NO_PARTICLES
|
||||
extern bool g_bDisableParticles;
|
||||
@@ -1048,11 +1048,11 @@ void LevelRenderer::takePicture(TripodCamera* pCamera, Entity* pOwner)
|
||||
|
||||
m_pMinecraft->m_pMobPersp = pCamera;
|
||||
m_pMinecraft->m_options.field_23C = true;
|
||||
m_pMinecraft->m_options.field_23D = false; // really from the perspective of the camera
|
||||
m_pMinecraft->m_options.m_bThirdPerson = false; // really from the perspective of the camera
|
||||
m_pMinecraft->m_pGameRenderer->render(0.0f);
|
||||
m_pMinecraft->m_pMobPersp = pOldMob;
|
||||
m_pMinecraft->m_options.field_23C = bOldField23C;
|
||||
m_pMinecraft->m_options.field_23D = bOldField23D;
|
||||
m_pMinecraft->m_options.m_bThirdPerson = bOldThirdPerson;
|
||||
|
||||
#ifdef ENH_CAMERA_NO_PARTICLES
|
||||
g_bDisableParticles = false;
|
||||
|
||||
@@ -60,7 +60,7 @@ void SoundEngine::init(Options* options)
|
||||
|
||||
void SoundEngine::play(const std::string& name)
|
||||
{
|
||||
if (m_pOptions->field_4 == 0.0f)
|
||||
if (m_pOptions->m_fMasterVolume == 0.0f)
|
||||
return;
|
||||
|
||||
SoundDesc sd;
|
||||
@@ -70,14 +70,14 @@ void SoundEngine::play(const std::string& name)
|
||||
}
|
||||
}
|
||||
|
||||
void SoundEngine::play(const std::string& name, float a, float b, float c, float d, float e)
|
||||
void SoundEngine::play(const std::string& name, float x, float y, float z, float volume, float pitch)
|
||||
{
|
||||
if (m_pOptions->field_4 == 0.0f || d <= 0.0f)
|
||||
if (m_pOptions->m_fMasterVolume == 0.0f || volume <= 0.0f)
|
||||
return;
|
||||
|
||||
SoundDesc sd;
|
||||
|
||||
if (m_repository.get(name, sd)) {
|
||||
m_soundSystem.playAt(sd, a, b, c, d, e);
|
||||
m_soundSystem.playAt(sd, x, y, z, volume, pitch);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ public:
|
||||
SoundEngine();
|
||||
void init(Options*);
|
||||
void play(const std::string& name);
|
||||
void play(const std::string& name, float, float, float, float, float);
|
||||
void play(const std::string& name, float x, float y, float z, float volume, float pitch);
|
||||
|
||||
public:
|
||||
SOUND_SYSTEM_TYPE m_soundSystem;
|
||||
|
||||
Reference in New Issue
Block a user