forked from Kolyah35/minecraft-pe-0.6.1
It isn't a commit without a linux compilation fail
This commit is contained in:
@@ -10,11 +10,11 @@
|
|||||||
|
|
||||||
|
|
||||||
#if defined(APPLE_DEMO_PROMOTION)
|
#if defined(APPLE_DEMO_PROMOTION)
|
||||||
#define NO_NETWORK
|
#define NO_NETWORK
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(RPI)
|
#if defined(RPI)
|
||||||
#define CREATORMODE
|
#define CREATORMODE
|
||||||
#endif
|
#endif
|
||||||
#include "../network/RakNetInstance.h"
|
#include "../network/RakNetInstance.h"
|
||||||
#include "../network/ClientSideNetworkHandler.h"
|
#include "../network/ClientSideNetworkHandler.h"
|
||||||
@@ -98,8 +98,8 @@
|
|||||||
static void checkGlError(const char* tag) {
|
static void checkGlError(const char* tag) {
|
||||||
#ifdef GLDEBUG
|
#ifdef GLDEBUG
|
||||||
while (1) {
|
while (1) {
|
||||||
const int errCode = glGetError();
|
const int errCode = glGetError();
|
||||||
if (errCode == GL_NO_ERROR) break;
|
if (errCode == GL_NO_ERROR) break;
|
||||||
|
|
||||||
LOGE("################\nOpenGL-error @ %s : #%d\n", tag, errCode);
|
LOGE("################\nOpenGL-error @ %s : #%d\n", tag, errCode);
|
||||||
}
|
}
|
||||||
@@ -117,7 +117,7 @@ const char* Minecraft::progressMessages[] = {
|
|||||||
int Minecraft::customDebugId = Minecraft::CDI_NONE;
|
int Minecraft::customDebugId = Minecraft::CDI_NONE;
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
#pragma warning( disable : 4355 ) // 'this' pointer in initialization list which is perfectly legal
|
#pragma warning( disable : 4355 ) // 'this' pointer in initialization list which is perfectly legal
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool Minecraft::useAmbientOcclusion = false;
|
bool Minecraft::useAmbientOcclusion = false;
|
||||||
@@ -175,17 +175,17 @@ Minecraft::Minecraft() :
|
|||||||
width(1), height(1),
|
width(1), height(1),
|
||||||
//_respawnPlayerTicks(-1),
|
//_respawnPlayerTicks(-1),
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
_isSuperFast(false),
|
_isSuperFast(false),
|
||||||
#endif
|
#endif
|
||||||
_powerVr(false),
|
_powerVr(false),
|
||||||
commandPort(4711),
|
commandPort(4711),
|
||||||
reserved_d1(0),reserved_d2(0),
|
reserved_d1(0),reserved_d2(0),
|
||||||
reserved_f1(0),reserved_f2(0), options(this)
|
reserved_f1(0),reserved_f2(0), options(this)
|
||||||
{
|
{
|
||||||
//#ifdef ANDROID
|
//#ifdef ANDROID
|
||||||
|
|
||||||
#if defined(NO_NETWORK)
|
#if defined(NO_NETWORK)
|
||||||
raknetInstance = new IRakNetInstance();
|
raknetInstance = new IRakNetInstance();
|
||||||
#else
|
#else
|
||||||
raknetInstance = new RakNetInstance();
|
raknetInstance = new RakNetInstance();
|
||||||
#endif
|
#endif
|
||||||
@@ -265,7 +265,7 @@ void Minecraft::setLevel(Level* level, const std::string& message /* ="" */, Loc
|
|||||||
|
|
||||||
if (level != NULL) {
|
if (level != NULL) {
|
||||||
level->raknetInstance = raknetInstance;
|
level->raknetInstance = raknetInstance;
|
||||||
gameMode->initLevel(level);
|
gameMode->initLevel(level);
|
||||||
|
|
||||||
if (!player && forceInsertPlayer)
|
if (!player && forceInsertPlayer)
|
||||||
{
|
{
|
||||||
@@ -296,18 +296,18 @@ void Minecraft::setLevel(Level* level, const std::string& message /* ="" */, Loc
|
|||||||
// Non-threaded
|
// Non-threaded
|
||||||
generateLevel("Currently not used", level);
|
generateLevel("Currently not used", level);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
player = NULL;
|
player = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->lastTickTime = 0;
|
this->lastTickTime = 0;
|
||||||
this->_running = true;
|
this->_running = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Minecraft::leaveGame(bool renameLevel /*=false*/)
|
void Minecraft::leaveGame(bool renameLevel /*=false*/)
|
||||||
{
|
{
|
||||||
if (isGeneratingLevel || !_hasSignaledGeneratingLevelFinished)
|
if (isGeneratingLevel || !_hasSignaledGeneratingLevelFinished)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
isGeneratingLevel = false;
|
isGeneratingLevel = false;
|
||||||
bool saveLevel = level && (!level->isClientSide || renameLevel);
|
bool saveLevel = level && (!level->isClientSide || renameLevel);
|
||||||
@@ -366,19 +366,19 @@ void Minecraft::prepareLevel(const std::string& title) {
|
|||||||
int Max = CHUNK_CACHE_WIDTH * CHUNK_CACHE_WIDTH;
|
int Max = CHUNK_CACHE_WIDTH * CHUNK_CACHE_WIDTH;
|
||||||
int pp = 0;
|
int pp = 0;
|
||||||
for (int x = 8; x < (CHUNK_CACHE_WIDTH * CHUNK_WIDTH); x += CHUNK_WIDTH) {
|
for (int x = 8; x < (CHUNK_CACHE_WIDTH * CHUNK_WIDTH); x += CHUNK_WIDTH) {
|
||||||
for (int z = 8; z < (CHUNK_CACHE_WIDTH * CHUNK_WIDTH); z += CHUNK_WIDTH) {
|
for (int z = 8; z < (CHUNK_CACHE_WIDTH * CHUNK_WIDTH); z += CHUNK_WIDTH) {
|
||||||
progressStagePercentage = 100 * pp++ / Max;
|
progressStagePercentage = 100 * pp++ / Max;
|
||||||
//printf("level generation progress %d\n", progressStagePercentage);
|
//printf("level generation progress %d\n", progressStagePercentage);
|
||||||
B.start();
|
B.start();
|
||||||
level->getTile(x, 64, z);
|
level->getTile(x, 64, z);
|
||||||
B.stop();
|
B.stop();
|
||||||
L.start();
|
L.start();
|
||||||
if (level->isNew())
|
if (level->isNew())
|
||||||
while (level->updateLights())
|
while (level->updateLights())
|
||||||
;
|
;
|
||||||
L.stop();
|
L.stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
A.stop();
|
A.stop();
|
||||||
level->setUpdateLights(true);
|
level->setUpdateLights(true);
|
||||||
|
|
||||||
@@ -466,16 +466,16 @@ void Minecraft::update() {
|
|||||||
}
|
}
|
||||||
TIMER_POP();
|
TIMER_POP();
|
||||||
|
|
||||||
#ifndef STANDALONE_SERVER
|
#ifndef STANDALONE_SERVER
|
||||||
if (gameMode != NULL) gameMode->render(timer.a);
|
if (gameMode != NULL) gameMode->render(timer.a);
|
||||||
TIMER_PUSH("sound");
|
TIMER_PUSH("sound");
|
||||||
soundEngine->update(player, timer.a);
|
soundEngine->update(player, timer.a);
|
||||||
TIMER_POP_PUSH("render");
|
TIMER_POP_PUSH("render");
|
||||||
gameRenderer->render(timer.a);
|
gameRenderer->render(timer.a);
|
||||||
TIMER_POP();
|
TIMER_POP();
|
||||||
#else
|
#else
|
||||||
CThread::sleep(1);
|
CThread::sleep(1);
|
||||||
#endif
|
#endif
|
||||||
#ifndef STANDALONE_SERVER
|
#ifndef STANDALONE_SERVER
|
||||||
Multitouch::resetThisUpdate();
|
Multitouch::resetThisUpdate();
|
||||||
#endif
|
#endif
|
||||||
@@ -485,14 +485,14 @@ void Minecraft::update() {
|
|||||||
checkGlError("Update finished");
|
checkGlError("Update finished");
|
||||||
|
|
||||||
if (options.getBooleanValue(OPTIONS_RENDER_DEBUG)) {
|
if (options.getBooleanValue(OPTIONS_RENDER_DEBUG)) {
|
||||||
//#ifndef PLATFORM_DESKTOP
|
//#ifndef PLATFORM_DESKTOP
|
||||||
if (!PerfTimer::enabled) {
|
if (!PerfTimer::enabled) {
|
||||||
PerfTimer::reset();
|
PerfTimer::reset();
|
||||||
PerfTimer::enabled = true;
|
PerfTimer::enabled = true;
|
||||||
}
|
}
|
||||||
_perfRenderer->renderFpsMeter(1);
|
_perfRenderer->renderFpsMeter(1);
|
||||||
checkGlError("render debug");
|
checkGlError("render debug");
|
||||||
//#endif
|
//#endif
|
||||||
} else {
|
} else {
|
||||||
PerfTimer::enabled = false;
|
PerfTimer::enabled = false;
|
||||||
}
|
}
|
||||||
@@ -569,17 +569,17 @@ void Minecraft::tick(int nTick, int maxTick) {
|
|||||||
#ifndef STANDALONE_SERVER
|
#ifndef STANDALONE_SERVER
|
||||||
textures->loadAndBindTexture("terrain.png");
|
textures->loadAndBindTexture("terrain.png");
|
||||||
if (!pause && !(screen && !screen->renderGameBehind())) {
|
if (!pause && !(screen && !screen->renderGameBehind())) {
|
||||||
#if !defined(RPI)
|
#if !defined(RPI)
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
if (isSuperFast())
|
if (isSuperFast())
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (nTick == maxTick) {
|
if (nTick == maxTick) {
|
||||||
TIMER_POP_PUSH("textures");
|
TIMER_POP_PUSH("textures");
|
||||||
textures->tick(true);
|
textures->tick(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
TIMER_POP_PUSH("particles");
|
TIMER_POP_PUSH("particles");
|
||||||
if (!pause) {
|
if (!pause) {
|
||||||
@@ -641,8 +641,8 @@ void Minecraft::tickInput() {
|
|||||||
while (Mouse::next()) {
|
while (Mouse::next()) {
|
||||||
//if (Mouse::getButtonState(MouseAction::ACTION_LEFT))
|
//if (Mouse::getButtonState(MouseAction::ACTION_LEFT))
|
||||||
// LOGI("mouse-down-at: %d, %d\n", Mouse::getX(), Mouse::getY());
|
// LOGI("mouse-down-at: %d, %d\n", Mouse::getX(), Mouse::getY());
|
||||||
int passedTime = getTimeMs() - lastTickTime;
|
int passedTime = getTimeMs() - lastTickTime;
|
||||||
if (passedTime > 200) continue; // @note: As long Mouse::clear CLEARS the whole buffer, it's safe to break here
|
if (passedTime > 200) continue; // @note: As long Mouse::clear CLEARS the whole buffer, it's safe to break here
|
||||||
// But since it might be rewritten anyway (and hopefully there aren't a lot of messages, we just continue.
|
// But since it might be rewritten anyway (and hopefully there aren't a lot of messages, we just continue.
|
||||||
|
|
||||||
const MouseAction& e = Mouse::getEvent();
|
const MouseAction& e = Mouse::getEvent();
|
||||||
@@ -673,14 +673,14 @@ void Minecraft::tickInput() {
|
|||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
if (mouseDiggable && options.useMouseForDigging) {
|
if (mouseDiggable && options.useMouseForDigging) {
|
||||||
if (Mouse::getEventButton() == MouseAction::ACTION_LEFT && Mouse::getEventButtonState()) {
|
if (Mouse::getEventButton() == MouseAction::ACTION_LEFT && Mouse::getEventButtonState()) {
|
||||||
handleMouseClick(MouseAction::ACTION_LEFT);
|
handleMouseClick(MouseAction::ACTION_LEFT);
|
||||||
lastClickTick = ticks;
|
lastClickTick = ticks;
|
||||||
}
|
}
|
||||||
if (Mouse::getEventButton() == MouseAction::ACTION_RIGHT && Mouse::getEventButtonState()) {
|
if (Mouse::getEventButton() == MouseAction::ACTION_RIGHT && Mouse::getEventButtonState()) {
|
||||||
handleMouseClick(MouseAction::ACTION_RIGHT);
|
handleMouseClick(MouseAction::ACTION_RIGHT);
|
||||||
lastClickTick = ticks;
|
lastClickTick = ticks;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
@@ -701,20 +701,20 @@ void Minecraft::tickInput() {
|
|||||||
if (slot >= 0 && slot < gui.getNumSlots())
|
if (slot >= 0 && slot < gui.getNumSlots())
|
||||||
player->inventory->selectSlot(slot);
|
player->inventory->selectSlot(slot);
|
||||||
|
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
if (digit >= 1 && GetAsyncKeyState(VK_CONTROL) < 0) {
|
if (digit >= 1 && GetAsyncKeyState(VK_CONTROL) < 0) {
|
||||||
// Set adventure settings here!
|
// Set adventure settings here!
|
||||||
AdventureSettingsPacket p(level->adventureSettings);
|
AdventureSettingsPacket p(level->adventureSettings);
|
||||||
p.toggle((AdventureSettingsPacket::Flags)(1 << slot));
|
p.toggle((AdventureSettingsPacket::Flags)(1 << slot));
|
||||||
p.fillIn(level->adventureSettings);
|
p.fillIn(level->adventureSettings);
|
||||||
raknetInstance->send(p);
|
raknetInstance->send(p);
|
||||||
}
|
}
|
||||||
if (digit == 0) {
|
if (digit == 0) {
|
||||||
Pos pos((int)player->x, (int)player->y-1, (int)player->z);
|
Pos pos((int)player->x, (int)player->y-1, (int)player->z);
|
||||||
SetSpawnPositionPacket p(pos);
|
SetSpawnPositionPacket p(pos);
|
||||||
raknetInstance->send(p);
|
raknetInstance->send(p);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key == Keyboard::KEY_LEFT_CTRL) {
|
if (key == Keyboard::KEY_LEFT_CTRL) {
|
||||||
@@ -738,7 +738,7 @@ void Minecraft::tickInput() {
|
|||||||
/*
|
/*
|
||||||
ImprovedNoise noise;
|
ImprovedNoise noise;
|
||||||
for (int i = 0; i < 16; ++i)
|
for (int i = 0; i < 16; ++i)
|
||||||
printf("%d\t%f\n", i, noise.grad2(i, 3, 8));
|
printf("%d\t%f\n", i, noise.grad2(i, 3, 8));
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -751,88 +751,88 @@ void Minecraft::tickInput() {
|
|||||||
options.set(OPTIONS_VIEW_DISTANCE, (dst + 1) % 4);
|
options.set(OPTIONS_VIEW_DISTANCE, (dst + 1) % 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CHEATS
|
#ifdef CHEATS
|
||||||
if (key == Keyboard::KEY_U) {
|
if (key == Keyboard::KEY_U) {
|
||||||
onGraphicsReset();
|
onGraphicsReset();
|
||||||
player->heal(100);
|
player->heal(100);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (key == Keyboard::KEY_B || key == 108) // Toggle the game mode
|
||||||
|
setIsCreativeMode(!isCreativeMode());
|
||||||
|
|
||||||
|
if (key == Keyboard::KEY_P) // Step forward in time
|
||||||
|
level->setTime( level->getTime() + 1000);
|
||||||
|
|
||||||
|
if (key == Keyboard::KEY_G) {
|
||||||
|
setScreen(new ArmorScreen());
|
||||||
|
/*
|
||||||
|
std::vector<AABB>& boxs = level->getCubes(NULL, AABB(128.1f, 73, 128.1f, 128.9f, 74.9f, 128.9f));
|
||||||
|
LOGI("boxes: %d\n", (int)boxs.size());
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
if (key == Keyboard::KEY_Y) {
|
||||||
|
textures->reloadAll();
|
||||||
|
player->hurtTo(2);
|
||||||
|
}
|
||||||
|
if (key == Keyboard::KEY_Z || key == 108) {
|
||||||
|
for (int i = 0; i < 1; ++i) {
|
||||||
|
Mob* mob = NULL;
|
||||||
|
int forceId = 0;//MobTypes::Sheep;
|
||||||
|
|
||||||
|
int types[] = {
|
||||||
|
MobTypes::Sheep,
|
||||||
|
MobTypes::Pig,
|
||||||
|
MobTypes::Chicken,
|
||||||
|
MobTypes::Cow,
|
||||||
|
};
|
||||||
|
|
||||||
|
int mobType = (forceId > 0)? forceId : types[Mth::random(sizeof(types) / sizeof(int))];
|
||||||
|
mob = MobFactory::CreateMob(mobType, level);
|
||||||
|
|
||||||
|
//((Animal*)mob)->setAge(-1000);
|
||||||
|
float dx = 4 - 8 * Mth::random() + 4 * Mth::sin(Mth::DEGRAD * player->yRot);
|
||||||
|
float dz = 4 - 8 * Mth::random() + 4 * Mth::cos(Mth::DEGRAD * player->yRot);
|
||||||
|
if (mob && !MobSpawner::addMob(level, mob, player->x + dx, player->y, player->z + dz, Mth::random()*360, 0, true))
|
||||||
|
delete mob;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (key == Keyboard::KEY_B || key == 108) // Toggle the game mode
|
if (key == Keyboard::KEY_X) {
|
||||||
setIsCreativeMode(!isCreativeMode());
|
const EntityList& entities = level->getAllEntities();
|
||||||
|
for (int i = entities.size()-1; i >= 0; --i) {
|
||||||
if (key == Keyboard::KEY_P) // Step forward in time
|
Entity* e = entities[i];
|
||||||
level->setTime( level->getTime() + 1000);
|
if (!e->isPlayer())
|
||||||
|
level->removeEntity(e);
|
||||||
if (key == Keyboard::KEY_G) {
|
|
||||||
setScreen(new ArmorScreen());
|
|
||||||
/*
|
|
||||||
std::vector<AABB>& boxs = level->getCubes(NULL, AABB(128.1f, 73, 128.1f, 128.9f, 74.9f, 128.9f));
|
|
||||||
LOGI("boxes: %d\n", (int)boxs.size());
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (key == Keyboard::KEY_Y) {
|
if (key == Keyboard::KEY_C /*|| key == 4*/) {
|
||||||
textures->reloadAll();
|
player->inventory->clearInventoryWithDefault();
|
||||||
player->hurtTo(2);
|
// @todo: Add saving here for benchmarking
|
||||||
}
|
}
|
||||||
if (key == Keyboard::KEY_Z || key == 108) {
|
if (key == Keyboard::KEY_H) {
|
||||||
for (int i = 0; i < 1; ++i) {
|
setScreen( new PrerenderTilesScreen() );
|
||||||
Mob* mob = NULL;
|
}
|
||||||
int forceId = 0;//MobTypes::Sheep;
|
|
||||||
|
|
||||||
int types[] = {
|
if (key == Keyboard::KEY_O) {
|
||||||
MobTypes::Sheep,
|
for (int i = Inventory::MAX_SELECTION_SIZE; i < player->inventory->getContainerSize(); ++i)
|
||||||
MobTypes::Pig,
|
if (player->inventory->getItem(i))
|
||||||
MobTypes::Chicken,
|
player->inventory->dropSlot(i, false);
|
||||||
MobTypes::Cow,
|
}
|
||||||
};
|
if (key == Keyboard::KEY_M) {
|
||||||
|
Difficulty difficulty = (Difficulty)options.getIntValue(OPTIONS_DIFFICULTY);
|
||||||
|
options.set(OPTIONS_DIFFICULTY, (difficulty == Difficulty::PEACEFUL)?
|
||||||
|
Difficulty::NORMAL : Difficulty::PEACEFUL);
|
||||||
|
//setIsCreativeMode( !isCreativeMode() );
|
||||||
|
}
|
||||||
|
|
||||||
int mobType = (forceId > 0)? forceId : types[Mth::random(sizeof(types) / sizeof(int))];
|
if (options.getBooleanValue(OPTIONS_RENDER_DEBUG)) {
|
||||||
mob = MobFactory::CreateMob(mobType, level);
|
if (key >= '0' && key <= '9') {
|
||||||
|
_perfRenderer->debugFpsMeterKeyPress(key - '0');
|
||||||
//((Animal*)mob)->setAge(-1000);
|
|
||||||
float dx = 4 - 8 * Mth::random() + 4 * Mth::sin(Mth::DEGRAD * player->yRot);
|
|
||||||
float dz = 4 - 8 * Mth::random() + 4 * Mth::cos(Mth::DEGRAD * player->yRot);
|
|
||||||
if (mob && !MobSpawner::addMob(level, mob, player->x + dx, player->y, player->z + dz, Mth::random()*360, 0, true))
|
|
||||||
delete mob;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (key == Keyboard::KEY_X) {
|
#endif
|
||||||
const EntityList& entities = level->getAllEntities();
|
|
||||||
for (int i = entities.size()-1; i >= 0; --i) {
|
|
||||||
Entity* e = entities[i];
|
|
||||||
if (!e->isPlayer())
|
|
||||||
level->removeEntity(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (key == Keyboard::KEY_C /*|| key == 4*/) {
|
|
||||||
player->inventory->clearInventoryWithDefault();
|
|
||||||
// @todo: Add saving here for benchmarking
|
|
||||||
}
|
|
||||||
if (key == Keyboard::KEY_H) {
|
|
||||||
setScreen( new PrerenderTilesScreen() );
|
|
||||||
}
|
|
||||||
|
|
||||||
if (key == Keyboard::KEY_O) {
|
|
||||||
for (int i = Inventory::MAX_SELECTION_SIZE; i < player->inventory->getContainerSize(); ++i)
|
|
||||||
if (player->inventory->getItem(i))
|
|
||||||
player->inventory->dropSlot(i, false);
|
|
||||||
}
|
|
||||||
if (key == Keyboard::KEY_M) {
|
|
||||||
Difficulty difficulty = (Difficulty)options.getIntValue(OPTIONS_DIFFICULTY);
|
|
||||||
options.set(OPTIONS_DIFFICULTY, (difficulty == Difficulty::PEACEFUL)?
|
|
||||||
Difficulty::NORMAL : Difficulty::PEACEFUL);
|
|
||||||
//setIsCreativeMode( !isCreativeMode() );
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.getBooleanValue(OPTIONS_RENDER_DEBUG)) {
|
|
||||||
if (key >= '0' && key <= '9') {
|
|
||||||
_perfRenderer->debugFpsMeterKeyPress(key - '0');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (options.getBooleanValue(OPTIONS_RENDER_DEBUG)) {
|
if (options.getBooleanValue(OPTIONS_RENDER_DEBUG)) {
|
||||||
if (key >= '0' && key <= '9') {
|
if (key >= '0' && key <= '9') {
|
||||||
@@ -843,21 +843,21 @@ void Minecraft::tickInput() {
|
|||||||
if (key == Keyboard::KEY_ESCAPE)
|
if (key == Keyboard::KEY_ESCAPE)
|
||||||
pauseGame(false);
|
pauseGame(false);
|
||||||
|
|
||||||
#ifdef PLATFORM_DESKTOP
|
#ifdef PLATFORM_DESKTOP
|
||||||
if (key == Keyboard::KEY_P) {
|
if (key == Keyboard::KEY_P) {
|
||||||
static bool isWireFrame = false;
|
static bool isWireFrame = false;
|
||||||
isWireFrame = !isWireFrame;
|
isWireFrame = !isWireFrame;
|
||||||
glPolygonMode(GL_FRONT, isWireFrame? GL_LINE : GL_FILL);
|
glPolygonMode(GL_FRONT, isWireFrame? GL_LINE : GL_FILL);
|
||||||
//glPolygonMode(GL_BACK, isWireFrame? GL_LINE : GL_FILL);
|
//glPolygonMode(GL_BACK, isWireFrame? GL_LINE : GL_FILL);
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#ifdef WIN32
|
|
||||||
if (key == Keyboard::KEY_M) {
|
|
||||||
for (int i = 0; i < 5 * SharedConstants::TicksPerSecond; ++i)
|
|
||||||
level->tick();
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
#ifdef WIN32
|
||||||
|
if (key == Keyboard::KEY_M) {
|
||||||
|
for (int i = 0; i < 5 * SharedConstants::TicksPerSecond; ++i)
|
||||||
|
level->tick();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
TIMER_POP_PUSH("handlemouse");
|
TIMER_POP_PUSH("handlemouse");
|
||||||
@@ -934,35 +934,35 @@ void Minecraft::handleBuildAction(BuildActionIntention* action) {
|
|||||||
}
|
}
|
||||||
if(player->isUsingItem())
|
if(player->isUsingItem())
|
||||||
return;
|
return;
|
||||||
bool mayUse = true;
|
bool mayUse = true;
|
||||||
|
|
||||||
if (!hitResult.isHit()) {
|
if (!hitResult.isHit()) {
|
||||||
if (action->isRemove() && !gameMode->isCreativeType()) {
|
if (action->isRemove() && !gameMode->isCreativeType()) {
|
||||||
missTime = 10;
|
missTime = 10;
|
||||||
}
|
}
|
||||||
} else if (hitResult.type == ENTITY) {
|
} else if (hitResult.type == ENTITY) {
|
||||||
if (action->isAttack()) {
|
if (action->isAttack()) {
|
||||||
player->swing();
|
player->swing();
|
||||||
//LOGI("attacking!\n");
|
//LOGI("attacking!\n");
|
||||||
InteractPacket packet(InteractPacket::Attack, player->entityId, hitResult.entity->entityId);
|
InteractPacket packet(InteractPacket::Attack, player->entityId, hitResult.entity->entityId);
|
||||||
raknetInstance->send(packet);
|
raknetInstance->send(packet);
|
||||||
gameMode->attack(player, hitResult.entity);
|
gameMode->attack(player, hitResult.entity);
|
||||||
} else if (action->isInteract()) {
|
} else if (action->isInteract()) {
|
||||||
if (hitResult.entity->interactPreventDefault())
|
if (hitResult.entity->interactPreventDefault())
|
||||||
mayUse = false;
|
mayUse = false;
|
||||||
//LOGI("interacting!\n");
|
//LOGI("interacting!\n");
|
||||||
InteractPacket packet(InteractPacket::Interact, player->entityId, hitResult.entity->entityId);
|
InteractPacket packet(InteractPacket::Interact, player->entityId, hitResult.entity->entityId);
|
||||||
raknetInstance->send(packet);
|
raknetInstance->send(packet);
|
||||||
gameMode->interact(player, hitResult.entity);
|
gameMode->interact(player, hitResult.entity);
|
||||||
}
|
}
|
||||||
} else if (hitResult.type == TILE) {
|
} else if (hitResult.type == TILE) {
|
||||||
int x = hitResult.x;
|
int x = hitResult.x;
|
||||||
int y = hitResult.y;
|
int y = hitResult.y;
|
||||||
int z = hitResult.z;
|
int z = hitResult.z;
|
||||||
int face = hitResult.f;
|
int face = hitResult.f;
|
||||||
|
|
||||||
int oldTileId = level->getTile(x, y, z);
|
int oldTileId = level->getTile(x, y, z);
|
||||||
Tile* oldTile = Tile::tiles[oldTileId];
|
Tile* oldTile = Tile::tiles[oldTileId];
|
||||||
|
|
||||||
//bool tryDestroyBlock = false;
|
//bool tryDestroyBlock = false;
|
||||||
|
|
||||||
@@ -971,7 +971,7 @@ void Minecraft::handleBuildAction(BuildActionIntention* action) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
//LOGI("tile: %s - %d, %d, %d. b: %f - %f\n", oldTile->getDescriptionId().c_str(), x, y, z, oldTile->getBrightness(level, x, y, z), oldTile->getBrightness(level, x, y+1, z));
|
//LOGI("tile: %s - %d, %d, %d. b: %f - %f\n", oldTile->getDescriptionId().c_str(), x, y, z, oldTile->getBrightness(level, x, y, z), oldTile->getBrightness(level, x, y+1, z));
|
||||||
level->extinguishFire(x, y, z, hitResult.f);
|
level->extinguishFire(x, y, z, hitResult.f);
|
||||||
|
|
||||||
if (action->isFirstRemove()) {
|
if (action->isFirstRemove()) {
|
||||||
gameMode->startDestroyBlock(x, y, z, hitResult.f);
|
gameMode->startDestroyBlock(x, y, z, hitResult.f);
|
||||||
@@ -981,16 +981,16 @@ void Minecraft::handleBuildAction(BuildActionIntention* action) {
|
|||||||
|
|
||||||
particleEngine->crack(x, y, z, hitResult.f);
|
particleEngine->crack(x, y, z, hitResult.f);
|
||||||
player->swing();
|
player->swing();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ItemInstance* item = player->inventory->getSelected();
|
ItemInstance* item = player->inventory->getSelected();
|
||||||
if (gameMode->useItemOn(player, level, item, x, y, z, face, hitResult.pos)) {
|
if (gameMode->useItemOn(player, level, item, x, y, z, face, hitResult.pos)) {
|
||||||
mayUse = false;
|
mayUse = false;
|
||||||
player->swing();
|
player->swing();
|
||||||
#ifdef RPI
|
#ifdef RPI
|
||||||
} else if (item && item->id == ((Item*)Item::sword_iron)->id) {
|
} else if (item && item->id == ((Item*)Item::sword_iron)->id) {
|
||||||
player->swing();
|
player->swing();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (item && item->count <= 0) {
|
if (item && item->count <= 0) {
|
||||||
player->inventory->clearSlot(player->inventory->selected);
|
player->inventory->clearSlot(player->inventory->selected);
|
||||||
@@ -1016,7 +1016,7 @@ void Minecraft::handleBuildAction(BuildActionIntention* action) {
|
|||||||
|
|
||||||
bool Minecraft::isOnlineClient()
|
bool Minecraft::isOnlineClient()
|
||||||
{
|
{
|
||||||
return (level != NULL && level->isClientSide);
|
return (level != NULL && level->isClientSide);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Minecraft::isOnline()
|
bool Minecraft::isOnline()
|
||||||
@@ -1083,8 +1083,8 @@ void Minecraft::setScreen( Screen* screen )
|
|||||||
|
|
||||||
if (screen->isInGameScreen() && level) {
|
if (screen->isInGameScreen() && level) {
|
||||||
level->saveLevelData();
|
level->saveLevelData();
|
||||||
level->saveGame();
|
level->saveGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
//noRender = false;
|
//noRender = false;
|
||||||
} else {
|
} else {
|
||||||
@@ -1121,7 +1121,7 @@ void Minecraft::releaseMouse()
|
|||||||
|
|
||||||
bool Minecraft::useTouchscreen() {
|
bool Minecraft::useTouchscreen() {
|
||||||
#if defined(TARGET_OS_IPHONE)
|
#if defined(TARGET_OS_IPHONE)
|
||||||
return true;
|
return true;
|
||||||
#elif defined(RPI)
|
#elif defined(RPI)
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
@@ -1153,7 +1153,7 @@ void Minecraft::init()
|
|||||||
particleEngine = new ParticleEngine(level, textures);
|
particleEngine = new ParticleEngine(level, textures);
|
||||||
|
|
||||||
// 4j's code for reference
|
// 4j's code for reference
|
||||||
// FoliageColor::init(textures->loadTexturePixels(L"misc/foliagecolor.png"));
|
// FoliageColor::init(textures->loadTexturePixels(L"misc/foliagecolor.png"));
|
||||||
|
|
||||||
|
|
||||||
// my code
|
// my code
|
||||||
@@ -1190,79 +1190,79 @@ void Minecraft::init()
|
|||||||
|
|
||||||
void Minecraft::setSize(int w, int h) {
|
void Minecraft::setSize(int w, int h) {
|
||||||
#ifndef STANDALONE_SERVER
|
#ifndef STANDALONE_SERVER
|
||||||
transformResolution(&w, &h);
|
transformResolution(&w, &h);
|
||||||
|
|
||||||
width = w;
|
width = w;
|
||||||
height = h;
|
height = h;
|
||||||
int screenWidth;
|
int screenWidth;
|
||||||
int screenHeight;
|
int screenHeight;
|
||||||
//#ifdef PLATFORM_DESKTOP
|
//#ifdef PLATFORM_DESKTOP
|
||||||
if (options.getBooleanValue(OPTIONS_WINDOW_SCALE)){ // scales with resolution using a formula instead of having hardcoded if checks
|
if (options.getBooleanValue(OPTIONS_WINDOW_SCALE)){ // scales with resolution using a formula instead of having hardcoded if checks
|
||||||
int guiScale = options.getIntValue(OPTIONS_GUI_SCALE);
|
int guiScale = options.getIntValue(OPTIONS_GUI_SCALE);
|
||||||
if (guiScale == 0) {
|
if (guiScale == 0) {
|
||||||
guiScale = 1000;
|
guiScale = 1000;
|
||||||
}
|
|
||||||
|
|
||||||
// determine gui scale, optionally overriding auto
|
|
||||||
|
|
||||||
|
|
||||||
Gui::GuiScale = (float)Mth::Min(guiScale, Mth::Max(1, Mth::Min(width / 320, height / 240)));
|
|
||||||
|
|
||||||
// 2. Calculate the Inverse based on the NEW scale
|
|
||||||
Gui::InvGuiScale = 1.0f / Gui::GuiScale;
|
|
||||||
screenWidth = (int)(width * Gui::InvGuiScale);
|
|
||||||
screenHeight = (int)(height * Gui::InvGuiScale);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
|
|
||||||
int guiScale = options.getIntValue(OPTIONS_GUI_SCALE);
|
|
||||||
|
|
||||||
// determine gui scale, optionally overriding auto
|
|
||||||
if (guiScale != 0) {
|
|
||||||
// manual selection: 1->small, 2->medium, 3->large, 4->larger, 5->largest
|
|
||||||
switch (guiScale) {
|
|
||||||
case 1: Gui::GuiScale = 2.0f; break;
|
|
||||||
case 2: Gui::GuiScale = 3.0f; break;
|
|
||||||
case 3: Gui::GuiScale = 4.0f; break;
|
|
||||||
case 4: Gui::GuiScale = 5.0f; break;
|
|
||||||
case 5: Gui::GuiScale = 6.0f; break;
|
|
||||||
default: Gui::GuiScale = 1.0f; break; // auto
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// determine gui scale, optionally overriding auto
|
||||||
|
|
||||||
|
|
||||||
|
Gui::GuiScale = (float)Mth::Min(guiScale, Mth::Max(1, Mth::Min(width / 320, height / 240)));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// auto compute from resolution
|
|
||||||
if (width >= 1000) {
|
|
||||||
#ifdef __APPLE__
|
int guiScale = options.getIntValue(OPTIONS_GUI_SCALE);
|
||||||
Gui::GuiScale = (width > 2000)? 8.0f : 4.0f;
|
|
||||||
#else
|
// determine gui scale, optionally overriding auto
|
||||||
Gui::GuiScale = 4.0f;
|
if (guiScale != 0) {
|
||||||
#endif
|
// manual selection: 1->small, 2->medium, 3->large, 4->larger, 5->largest
|
||||||
}
|
switch (guiScale) {
|
||||||
else if (width >= 800) {
|
case 1: Gui::GuiScale = 2.0f; break;
|
||||||
|
case 2: Gui::GuiScale = 3.0f; break;
|
||||||
|
case 3: Gui::GuiScale = 4.0f; break;
|
||||||
|
case 4: Gui::GuiScale = 5.0f; break;
|
||||||
|
case 5: Gui::GuiScale = 6.0f; break;
|
||||||
|
default: Gui::GuiScale = 1.0f; break; // auto
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// auto compute from resolution
|
||||||
|
if (width >= 1000) {
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
Gui::GuiScale = 4.0f;
|
Gui::GuiScale = (width > 2000)? 8.0f : 4.0f;
|
||||||
#else
|
#else
|
||||||
Gui::GuiScale = 3.0f;
|
Gui::GuiScale = 4.0f;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (width >= 400)
|
else if (width >= 800) {
|
||||||
Gui::GuiScale = 2.0f;
|
#ifdef __APPLE__
|
||||||
else
|
Gui::GuiScale = 4.0f;
|
||||||
Gui::GuiScale = 1.0f;
|
#else
|
||||||
|
Gui::GuiScale = 3.0f;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else if (width >= 400)
|
||||||
|
Gui::GuiScale = 2.0f;
|
||||||
|
else
|
||||||
|
Gui::GuiScale = 1.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// if (platform()) {
|
||||||
|
// float pixelsPerMillimeter = options.getProgressValue(&Option::PIXELS_PER_MILLIMETER);
|
||||||
|
// pixelCalc.setPixelsPerMillimeter(pixelsPerMillimeter);
|
||||||
|
// pixelCalcUi.setPixelsPerMillimeter(pixelsPerMillimeter * Gui::InvGuiScale);
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Gui::InvGuiScale = 1.0f / Gui::GuiScale;
|
Gui::InvGuiScale = 1.0f / Gui::GuiScale;
|
||||||
screenWidth = (int)(width * Gui::InvGuiScale);
|
screenWidth = (int)(width * Gui::InvGuiScale);
|
||||||
screenHeight = (int)(height * Gui::InvGuiScale);
|
screenHeight = (int)(height * Gui::InvGuiScale);
|
||||||
|
|
||||||
// if (platform()) {
|
|
||||||
// float pixelsPerMillimeter = options.getProgressValue(&Option::PIXELS_PER_MILLIMETER);
|
|
||||||
// pixelCalc.setPixelsPerMillimeter(pixelsPerMillimeter);
|
|
||||||
// pixelCalcUi.setPixelsPerMillimeter(pixelsPerMillimeter * Gui::InvGuiScale);
|
|
||||||
// }
|
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
Config config = createConfig(this);
|
Config config = createConfig(this);
|
||||||
gui.onConfigChanged(config);
|
gui.onConfigChanged(config);
|
||||||
|
|
||||||
@@ -1277,7 +1277,7 @@ if (options.getBooleanValue(OPTIONS_WINDOW_SCALE)){ // scales with resolution us
|
|||||||
char resbuf[128];
|
char resbuf[128];
|
||||||
sprintf(resbuf, " %d x %d @ scale %.2f", width, height, Gui::GuiScale);
|
sprintf(resbuf, " %d x %d @ scale %.2f", width, height, Gui::GuiScale);
|
||||||
//gui.addMessage(resbuf);
|
//gui.addMessage(resbuf);
|
||||||
|
#endif
|
||||||
#endif /* STANDALONE_SERVER */
|
#endif /* STANDALONE_SERVER */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1294,9 +1294,9 @@ void Minecraft::reloadOptions() {
|
|||||||
|
|
||||||
LOGI("Reloading-options\n");
|
LOGI("Reloading-options\n");
|
||||||
|
|
||||||
// @todo @fix Android and iOS behaves a bit differently when leaving
|
// @todo @fix Android and iOS behaves a bit differently when leaving
|
||||||
// an options screen (Android recreates OpenGL surface)
|
// an options screen (Android recreates OpenGL surface)
|
||||||
setSize(width, height);
|
setSize(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Minecraft::_reloadInput() {
|
void Minecraft::_reloadInput() {
|
||||||
@@ -1307,17 +1307,17 @@ void Minecraft::_reloadInput() {
|
|||||||
if (useTouchHolder) {
|
if (useTouchHolder) {
|
||||||
inputHolder = new TouchInputHolder(this, &options);
|
inputHolder = new TouchInputHolder(this, &options);
|
||||||
} else {
|
} else {
|
||||||
#if defined(ANDROID) || defined(__APPLE__)
|
#if defined(ANDROID) || defined(__APPLE__)
|
||||||
inputHolder = new CustomInputHolder(
|
inputHolder = new CustomInputHolder(
|
||||||
new XperiaPlayInput(&options),
|
new XperiaPlayInput(&options),
|
||||||
new ControllerTurnInput(2, ControllerTurnInput::MODE_DELTA),
|
new ControllerTurnInput(2, ControllerTurnInput::MODE_DELTA),
|
||||||
new IBuildInput());
|
new IBuildInput());
|
||||||
#else
|
#else
|
||||||
inputHolder = new CustomInputHolder(
|
inputHolder = new CustomInputHolder(
|
||||||
new KeyboardInput(&options),
|
new KeyboardInput(&options),
|
||||||
new MouseTurnInput(MouseTurnInput::MODE_DELTA, width/2, height/2),
|
new MouseTurnInput(MouseTurnInput::MODE_DELTA, width/2, height/2),
|
||||||
new MouseBuildInput());
|
new MouseBuildInput());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
mouseHandler.setTurnInput(inputHolder->getTurnInput());
|
mouseHandler.setTurnInput(inputHolder->getTurnInput());
|
||||||
@@ -1382,18 +1382,18 @@ bool Minecraft::joinMultiplayerFromString( const std::string& server )
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Minecraft::hostMultiplayer(int port) {
|
void Minecraft::hostMultiplayer(int port) {
|
||||||
// Tear down last instance
|
// Tear down last instance
|
||||||
raknetInstance->disconnect();
|
raknetInstance->disconnect();
|
||||||
delete netCallback;
|
delete netCallback;
|
||||||
netCallback = NULL;
|
netCallback = NULL;
|
||||||
|
|
||||||
#if !defined(NO_NETWORK)
|
#if !defined(NO_NETWORK)
|
||||||
netCallback = new ServerSideNetworkHandler(this, raknetInstance);
|
netCallback = new ServerSideNetworkHandler(this, raknetInstance);
|
||||||
#ifdef STANDALONE_SERVER
|
#ifdef STANDALONE_SERVER
|
||||||
raknetInstance->host("Server", port, 16);
|
raknetInstance->host("Server", port, 16);
|
||||||
#else
|
#else
|
||||||
raknetInstance->host(options.getStringValue(OPTIONS_USERNAME), port);
|
raknetInstance->host(options.getStringValue(OPTIONS_USERNAME), port);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1447,9 +1447,9 @@ void Minecraft::_levelGenerated()
|
|||||||
player->resetPos(false);
|
player->resetPos(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (level && level->dimension) {
|
if (level && level->dimension) {
|
||||||
|
|
||||||
level->dimension->FogType = options.getIntValue(OPTIONS_FOG_TYPE);
|
level->dimension->FogType = options.getIntValue(OPTIONS_FOG_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1480,14 +1480,14 @@ void Minecraft::_levelGenerated()
|
|||||||
|
|
||||||
std::string Minecraft::gatherStats1() {
|
std::string Minecraft::gatherStats1() {
|
||||||
#ifndef STANDALONE_SERVER
|
#ifndef STANDALONE_SERVER
|
||||||
return levelRenderer->gatherStats1();
|
return levelRenderer->gatherStats1();
|
||||||
#endif
|
#endif
|
||||||
return "Blank";
|
return "Blank";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Minecraft::gatherStats2() {
|
std::string Minecraft::gatherStats2() {
|
||||||
#ifndef STANDALONE_SERVER
|
#ifndef STANDALONE_SERVER
|
||||||
return levelRenderer->gatherStats2();
|
return levelRenderer->gatherStats2();
|
||||||
#endif
|
#endif
|
||||||
return "Blank";
|
return "Blank";
|
||||||
}
|
}
|
||||||
@@ -1500,7 +1500,7 @@ std::string Minecraft::gatherStats3() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string Minecraft::gatherStats4() {
|
std::string Minecraft::gatherStats4() {
|
||||||
return level->gatherChunkSourceStats();
|
return level->gatherChunkSourceStats();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1592,12 +1592,12 @@ LevelStorageSource* Minecraft::getLevelSource()
|
|||||||
|
|
||||||
void Minecraft::audioEngineOn() {
|
void Minecraft::audioEngineOn() {
|
||||||
#ifndef STANDALONE_SERVER
|
#ifndef STANDALONE_SERVER
|
||||||
soundEngine->enable(true);
|
soundEngine->enable(true);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
void Minecraft::audioEngineOff() {
|
void Minecraft::audioEngineOff() {
|
||||||
#ifndef STANDALONE_SERVER
|
#ifndef STANDALONE_SERVER
|
||||||
soundEngine->enable(false);
|
soundEngine->enable(false);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1668,17 +1668,17 @@ void Minecraft::optionUpdated(OptionId option, bool value ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Minecraft::optionUpdated(OptionId option, float value ) {
|
void Minecraft::optionUpdated(OptionId option, float value ) {
|
||||||
// #ifndef STANDALONE_SERVER
|
// #ifndef STANDALONE_SERVER
|
||||||
// if(option == OPTIONS_PIXELS_PER_MILLIMETER) {
|
// if(option == OPTIONS_PIXELS_PER_MILLIMETER) {
|
||||||
// pixelCalcUi.setPixelsPerMillimeter(value * Gui::InvGuiScale);
|
// pixelCalcUi.setPixelsPerMillimeter(value * Gui::InvGuiScale);
|
||||||
// pixelCalc.setPixelsPerMillimeter(value);
|
// pixelCalc.setPixelsPerMillimeter(value);
|
||||||
// }
|
// }
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Minecraft::optionUpdated(OptionId option, int value ) {
|
void Minecraft::optionUpdated(OptionId option, int value ) {
|
||||||
if(option == OPTIONS_GUI_SCALE) {
|
if(option == OPTIONS_GUI_SCALE) {
|
||||||
// reapply screen scaling using current window size
|
// reapply screen scaling using current window size
|
||||||
setSize(width, height);
|
setSize(width, height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user