8 Commits

32 changed files with 498 additions and 102 deletions

View File

@@ -41,7 +41,6 @@
042A91AE16B17517007ABBC6 /* GuiElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 042A91A316B17517007ABBC6 /* GuiElement.cpp */; };
042A91AF16B17517007ABBC6 /* NinePatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 042A91A516B17517007ABBC6 /* NinePatch.cpp */; };
042A91B016B17517007ABBC6 /* OptionsGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 042A91A716B17517007ABBC6 /* OptionsGroup.cpp */; };
042A91B116B17517007ABBC6 /* OptionsPane.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 042A91A916B17517007ABBC6 /* OptionsPane.cpp */; };
042A91B216B17517007ABBC6 /* TextBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 042A91AB16B17517007ABBC6 /* TextBox.cpp */; };
044129071682FF9600B70EE6 /* MouseHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 044129061682FF9600B70EE6 /* MouseHandler.cpp */; };
9D293CE716071C08000305C8 /* CreateNewWorld_iphone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9D293CE616071C08000305C8 /* CreateNewWorld_iphone.xib */; };
@@ -1147,6 +1146,7 @@
D5F3B7DD14548E7900D25470 /* IASKPSToggleSwitchSpecifierViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = D5F3B7C814548E7900D25470 /* IASKPSToggleSwitchSpecifierViewCell.xib */; };
D5F3B7DE14548E7900D25470 /* IASKSpecifierValuesView.xib in Resources */ = {isa = PBXBuildFile; fileRef = D5F3B7C914548E7900D25470 /* IASKSpecifierValuesView.xib */; };
D5F3B7E51454930400D25470 /* InAppSettings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D5F3B7E41454930400D25470 /* InAppSettings.bundle */; };
F912B8CF2F6C3D5200BC60DF /* TextBox.h in Sources */ = {isa = PBXBuildFile; fileRef = 042A91AC16B17517007ABBC6 /* TextBox.h */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -1208,10 +1208,8 @@
042A91A616B17517007ABBC6 /* NinePatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NinePatch.h; sourceTree = "<group>"; };
042A91A716B17517007ABBC6 /* OptionsGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OptionsGroup.cpp; sourceTree = "<group>"; };
042A91A816B17517007ABBC6 /* OptionsGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OptionsGroup.h; sourceTree = "<group>"; };
042A91A916B17517007ABBC6 /* OptionsPane.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OptionsPane.cpp; sourceTree = "<group>"; };
042A91AA16B17517007ABBC6 /* OptionsPane.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OptionsPane.h; sourceTree = "<group>"; };
042A91AB16B17517007ABBC6 /* TextBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextBox.cpp; sourceTree = "<group>"; };
042A91AC16B17517007ABBC6 /* TextBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextBox.h; sourceTree = "<group>"; };
042A91AC16B17517007ABBC6 /* TextBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextBox.h; path = ../../src/client/gui/components/TextBox.h; sourceTree = SOURCE_ROOT; };
044129061682FF9600B70EE6 /* MouseHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MouseHandler.cpp; sourceTree = "<group>"; };
9D293CE616071C08000305C8 /* CreateNewWorld_iphone.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = CreateNewWorld_iphone.xib; path = minecraftpe/dialogs/CreateNewWorld_iphone.xib; sourceTree = "<group>"; };
9D293CEA160720D6000305C8 /* worldname_iphone5_3.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = worldname_iphone5_3.png; sourceTree = "<group>"; };
@@ -3226,8 +3224,6 @@
042A91A616B17517007ABBC6 /* NinePatch.h */,
042A91A716B17517007ABBC6 /* OptionsGroup.cpp */,
042A91A816B17517007ABBC6 /* OptionsGroup.h */,
042A91A916B17517007ABBC6 /* OptionsPane.cpp */,
042A91AA16B17517007ABBC6 /* OptionsPane.h */,
042A91AB16B17517007ABBC6 /* TextBox.cpp */,
042A91AC16B17517007ABBC6 /* TextBox.h */,
D5B50C2814CFF66F005F7284 /* Button.cpp */,
@@ -4527,10 +4523,16 @@
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
TargetAttributes = {
D5CF9C41144C225000E4244F = {
DevelopmentTeam = PZUVNW8F2U;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = D5CF9C3C144C225000E4244F /* Build configuration list for PBXProject "minecraftpe" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
@@ -5339,6 +5341,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F912B8CF2F6C3D5200BC60DF /* TextBox.h in Sources */,
D5CF9C57144C225000E4244F /* main.mm in Sources */,
D5CF9C5B144C225000E4244F /* minecraftpeAppDelegate.mm in Sources */,
D5CF9C65144C225000E4244F /* EAGLView.m in Sources */,
@@ -5697,7 +5700,6 @@
042A91AE16B17517007ABBC6 /* GuiElement.cpp in Sources */,
042A91AF16B17517007ABBC6 /* NinePatch.cpp in Sources */,
042A91B016B17517007ABBC6 /* OptionsGroup.cpp in Sources */,
042A91B116B17517007ABBC6 /* OptionsPane.cpp in Sources */,
042A91B216B17517007ABBC6 /* TextBox.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -5736,24 +5738,31 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
ARCHS = "$(ARCHS_STANDARD)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Mojang AB";
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_PREPROCESSOR_DEFINITIONS = PUBLISH;
GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_VERSION = "";
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO;
GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/src/**",
"$(SRCROOT)/src/client/gui/components/**",
"$(SRCROOT)/src/client/gui/**",
);
IPHONEOS_DEPLOYMENT_TARGET = 14;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "C93D3524-5C6F-466E-B12B-833663B7EAE0";
RUN_CLANG_STATIC_ANALYZER = NO;
SDKROOT = iphoneos6.0;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**";
VALIDATE_PRODUCT = YES;
};
name = "Ad-Hoc";
@@ -5765,15 +5774,21 @@
GCC_PREFIX_HEADER = "minecraftpe/minecraftpe-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = "";
"GCC_THUMB_SUPPORT[arch=armv7]" = NO;
GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_VERSION = "";
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
HEADER_SEARCH_PATHS = "";
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/src/client/gui/components/**",
"$(SRCROOT)/src/client/gui/**",
"$(SRCROOT)/src/**",
);
INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games";
IPHONEOS_DEPLOYMENT_TARGET = 14;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64";
PRODUCT_NAME = "$(TARGET_NAME)";
RUN_CLANG_STATIC_ANALYZER = NO;
SDKROOT = iphoneos6.0;
VALID_ARCHS = "i386 armv6 armv7";
SDKROOT = iphoneos;
WRAPPER_EXTENSION = app;
};
name = "Ad-Hoc";
@@ -5847,23 +5862,30 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
ARCHS = "$(ARCHS_STANDARD)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Mojang AB";
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_VERSION = "";
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO;
GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/src/**",
"$(SRCROOT)/src/client/gui/components/**",
"$(SRCROOT)/src/client/gui/**",
);
IPHONEOS_DEPLOYMENT_TARGET = 14;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "64BA8967-1A9A-4980-972C-42E75AD5E023";
RUN_CLANG_STATIC_ANALYZER = NO;
SDKROOT = iphoneos6.0;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**";
VALIDATE_PRODUCT = YES;
};
name = AppStore;
@@ -5876,11 +5898,17 @@
GCC_PREFIX_HEADER = "minecraftpe/minecraftpe-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = PUBLISH;
"GCC_THUMB_SUPPORT[arch=armv7]" = NO;
GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_VERSION = "";
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
HEADER_SEARCH_PATHS = "";
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/src/client/gui/components/**",
"$(SRCROOT)/src/client/gui/**",
"$(SRCROOT)/src/**",
);
INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games";
IPHONEOS_DEPLOYMENT_TARGET = 14;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"-DNS_BLOCK_ASSERTIONS=1",
"-DANDROID_PUBLISH",
@@ -5888,8 +5916,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "1B194957-98CF-49B7-A0E7-76692B4B722D";
RUN_CLANG_STATIC_ANALYZER = NO;
SDKROOT = iphoneos6.0;
VALID_ARCHS = "i386 armv6 armv7";
SDKROOT = iphoneos;
WRAPPER_EXTENSION = app;
};
name = AppStore;
@@ -5923,7 +5950,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
ARCHS = "$(ARCHS_STANDARD)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
@@ -5935,17 +5962,25 @@
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_VERSION = "";
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO;
GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/src/**",
"$(SRCROOT)/src/client/gui/components/**",
"$(SRCROOT)/src/client/gui/**",
);
IPHONEOS_DEPLOYMENT_TARGET = 14;
ONLY_ACTIVE_ARCH = YES;
RUN_CLANG_STATIC_ANALYZER = NO;
SDKROOT = iphoneos6.0;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**";
VALIDATE_PRODUCT = YES;
};
name = Debug;
};
@@ -5953,23 +5988,30 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
ARCHS = "$(ARCHS_STANDARD)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_PREPROCESSOR_DEFINITIONS = PUBLISH;
GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_VERSION = "";
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO;
GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/src/**",
"$(SRCROOT)/src/client/gui/components/**",
"$(SRCROOT)/src/client/gui/**",
);
IPHONEOS_DEPLOYMENT_TARGET = 14;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
RUN_CLANG_STATIC_ANALYZER = NO;
SDKROOT = iphoneos6.0;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)\\src/**";
VALIDATE_PRODUCT = YES;
};
name = Release;
@@ -5977,19 +6019,29 @@
D5CF9C6F144C225000E4244F /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = PZUVNW8F2U;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "minecraftpe/minecraftpe-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1";
"GCC_THUMB_SUPPORT[arch=armv7]" = NO;
GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_VERSION = "";
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
HEADER_SEARCH_PATHS = "";
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/src/client/gui/components/**",
"$(SRCROOT)/src/client/gui/**",
"$(SRCROOT)/src/**",
);
INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games";
IPHONEOS_DEPLOYMENT_TARGET = 14;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
RUN_CLANG_STATIC_ANALYZER = NO;
SDKROOT = iphoneos6.0;
VALID_ARCHS = "i386 armv6 armv7";
SDKROOT = iphoneos;
WRAPPER_EXTENSION = app;
};
name = Debug;
@@ -5997,19 +6049,29 @@
D5CF9C70144C225000E4244F /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = PZUVNW8F2U;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "minecraftpe/minecraftpe-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = "";
"GCC_THUMB_SUPPORT[arch=armv7]" = NO;
GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_VERSION = "";
GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
HEADER_SEARCH_PATHS = "";
HEADER_SEARCH_PATHS = (
"$(SRCROOT)/src/client/gui/components/**",
"$(SRCROOT)/src/client/gui/**",
"$(SRCROOT)/src/**",
);
INFOPLIST_FILE = "minecraftpe/minecraftpe-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games";
IPHONEOS_DEPLOYMENT_TARGET = 14;
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.mojang.mcpe-arm64";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
RUN_CLANG_STATIC_ANALYZER = NO;
SDKROOT = iphoneos6.0;
VALID_ARCHS = "i386 armv6 armv7";
SDKROOT = iphoneos;
WRAPPER_EXTENSION = app;
};
name = Release;

View File

@@ -37,7 +37,7 @@
</dict>
</dict>
<key>CFBundleIdentifier</key>
<string>com.mojang.${PRODUCT_NAME:rfc1034identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>

View File

@@ -52,11 +52,10 @@ public:
virtual StringVector getOptionStrings();
virtual bool isPowerVR() { return false; }
virtual bool isPowerVR();
virtual bool isSuperFast();
virtual void showKeyboard();
virtual void hideKeyboard();
virtual void isPowerVR();
private:
std::string _basePath;

21
src/client/KeyMapping.h Normal file
View File

@@ -0,0 +1,21 @@
#ifndef NET_MINECRAFT_CLIENT__KeyMapping_H__
#define NET_MINECRAFT_CLIENT__KeyMapping_H__
//package net.minecraft.client;
#include <string>
class KeyMapping
{
public:
std::string name;
int key;
KeyMapping() {}
KeyMapping(const std::string& name_, int key_)
: name(name_),
key(key_)
{}
};
#endif /*NET_MINECRAFT_CLIENT__KeyMapping_H__*/

View File

@@ -1,9 +1,11 @@
#include "Minecraft.h"
#include "client/Options.h"
#include "client/player/input/IBuildInput.h"
#include "platform/input/Keyboard.h"
#include "world/item/Item.h"
#include "world/item/ItemInstance.h"
#include "Options.h"
#include "IBuildInput.h"
#include "Keyboard.h"
#include "Item.h"
#include "ItemInstance.h"
#include "XperiaPlayInput.h"
#include "ControllerTurnInput.h"
#include <string>
#include <cstdlib>
@@ -23,7 +25,7 @@
#include "../world/level/storage/LevelStorageSource.h"
#include "../world/level/storage/LevelStorage.h"
#include "player/input/KeyboardInput.h"
#include "world/level/chunk/ChunkSource.h"
#include "ChunkSource.h"
#ifndef STANDALONE_SERVER
#include "player/input/touchscreen/TouchInputHolder.h"
@@ -1195,7 +1197,7 @@ void Minecraft::setSize(int w, int h) {
int screenHeight = (int)(height * Gui::InvGuiScale);
// if (platform()) {
// float pixelsPerMillimeter = options.getProgressValue(&Options::Option::PIXELS_PER_MILLIMETER);
// float pixelsPerMillimeter = options.getProgressValue(&Option::PIXELS_PER_MILLIMETER);
// pixelCalc.setPixelsPerMillimeter(pixelsPerMillimeter);
// pixelCalcUi.setPixelsPerMillimeter(pixelsPerMillimeter * Gui::InvGuiScale);
// }

View File

@@ -221,6 +221,7 @@ private:
bool _isCreativeMode;
//int _respawnPlayerTicks;
Player* _pendingRemovePlayer; // @attn @todo @fix: remove this shait and fix the respawn behaviour
// shit* lmao
PerfRenderer* _perfRenderer;
CommandServer* _commandServer;

View File

@@ -1,7 +1,7 @@
#pragma once
#include <sstream>
#include <type_traits>
#include <util/Mth.h>
#include "Mth.h"
/*
template<typename T>
struct is_option_type : std::false_type {};
@@ -104,4 +104,4 @@ public:
private:
std::string m_value;
};
};

View File

@@ -93,6 +93,7 @@ typedef std::vector<std::string> StringVector;
class Options
{
public:
static bool debugGl;
Options(Minecraft* minecraft, const std::string& workingDirectory = "")
@@ -156,7 +157,9 @@ private:
if (m_options[key] == nullptr) return nullptr;
return dynamic_cast<T*>(m_options[key]);
}
// apple stuff
float sound;
float music;
std::array<Option*, OPTIONS_COUNT> m_options;
OptionsFile optionsFile;

View File

@@ -1,7 +1,7 @@
#include "Gui.h"
#include "Font.h"
#include "client/Options.h"
#include "platform/input/Keyboard.h"
#include "Options.h"
#include "Keyboard.h"
#include "screens/IngameBlockSelectionScreen.h"
#include "screens/ChatScreen.h"
#include "screens/ConsoleScreen.h"

View File

@@ -4,7 +4,7 @@
#include "../../../platform/log.h"
#include "../../../util/Mth.h"
#include "../../renderer/Textures.h"
#include <client/Option.h>
#include "../../Option.h"
ImageButton::ImageButton(int id, const std::string& msg)

View File

@@ -1,6 +1,6 @@
#pragma once
#include "Button.h"
#include <client/Options.h>
#include "Options.h"
class KeyOption : public Touch::TButton {
public:
@@ -11,4 +11,4 @@ public:
virtual void keyPressed(Minecraft* minecraft, int key);
protected:
bool m_captureMode;
};
};

View File

@@ -65,7 +65,7 @@ void OptionsGroup::createToggle(OptionId optId, Minecraft* minecraft ) {
std::string itemLabel = I18n::get(minecraft->options.getOpt(optId)->getStringId());
OptionsItem* item = new OptionsItem(itemLabel, element);
OptionsItem* item = new OptionsItem(optId, itemLabel, element);
addChild(item);
setupPositions();
@@ -77,7 +77,7 @@ void OptionsGroup::createProgressSlider(OptionId optId, Minecraft* minecraft ) {
element->height = 20;
std::string itemLabel = I18n::get(minecraft->options.getOpt(optId)->getStringId());
OptionsItem* item = new OptionsItem(itemLabel, element);
OptionsItem* item = new OptionsItem(optId, itemLabel, element);
addChild(item);
setupPositions();
}
@@ -87,7 +87,7 @@ void OptionsGroup::createStepSlider(OptionId optId, Minecraft* minecraft ) {
element->width = 100;
element->height = 20;
std::string itemLabel = I18n::get(minecraft->options.getOpt(optId)->getStringId());
OptionsItem* item = new OptionsItem(itemLabel, element);
OptionsItem* item = new OptionsItem(optId, itemLabel, element);
addChild(item);
setupPositions();
}
@@ -98,7 +98,7 @@ void OptionsGroup::createTextbox(OptionId optId, Minecraft* minecraft) {
element->height = 20;
std::string itemLabel = I18n::get(minecraft->options.getOpt(optId)->getStringId());
OptionsItem* item = new OptionsItem(itemLabel, element);
OptionsItem* item = new OptionsItem(optId, itemLabel, element);
addChild(item);
setupPositions();
}
@@ -109,7 +109,7 @@ void OptionsGroup::createKey(OptionId optId, Minecraft* minecraft) {
element->height = 20;
std::string itemLabel = I18n::get(minecraft->options.getOpt(optId)->getStringId());
OptionsItem* item = new OptionsItem(itemLabel, element);
OptionsItem* item = new OptionsItem(optId, itemLabel, element);
addChild(item);
setupPositions();
}

View File

@@ -1,9 +1,11 @@
#include "OptionsItem.h"
#include "../../Minecraft.h"
#include "../../../locale/I18n.h"
#include "../../../util/Mth.h"
OptionsItem::OptionsItem( std::string label, GuiElement* element )
OptionsItem::OptionsItem( OptionId optionId, std::string label, GuiElement* element )
: GuiElementContainer(false, true, 0, 0, 24, 12),
label(label) {
m_optionId(optionId),
m_label(label) {
addChild(element);
}
@@ -19,6 +21,22 @@ void OptionsItem::setupPositions() {
void OptionsItem::render( Minecraft* minecraft, int xm, int ym ) {
int yOffset = (height - 8) / 2;
minecraft->font->draw(label, (float)x, (float)y + yOffset, 0x909090, false);
std::string text = m_label;
if (m_optionId == OPTIONS_GUI_SCALE) {
int value = minecraft->options.getIntValue(OPTIONS_GUI_SCALE);
std::string scaleText;
switch (value) {
case 0: scaleText = I18n::get("options.guiScale.auto"); break;
case 1: scaleText = I18n::get("options.guiScale.small"); break;
case 2: scaleText = I18n::get("options.guiScale.medium"); break;
case 3: scaleText = I18n::get("options.guiScale.large"); break;
case 4: scaleText = I18n::get("options.guiScale.larger"); break;
case 5: scaleText = I18n::get("options.guiScale.largest"); break;
default: scaleText = I18n::get("options.guiScale.auto"); break;
}
text += ": " + scaleText;
}
minecraft->font->draw(text, (float)x, (float)y + yOffset, 0x909090, false);
super::render(minecraft, xm, ym);
}

View File

@@ -15,12 +15,13 @@ class OptionsItem: public GuiElementContainer
{
typedef GuiElementContainer super;
public:
OptionsItem(std::string label, GuiElement* element);
OptionsItem(OptionId optionId, std::string label, GuiElement* element);
virtual void render(Minecraft* minecraft, int xm, int ym);
void setupPositions();
private:
std::string label;
OptionId m_optionId;
std::string m_label;
};
#endif /*NET_MINECRAFT_CLIENT_GUI_COMPONENTS__OptionsItem_H__*/

View File

@@ -0,0 +1,63 @@
#include "OptionsPane.h"
#include "OptionsGroup.h"
#include "OptionsItem.h"
#include "ImageButton.h"
#include "Slider.h"
#include "../../Minecraft.h"
OptionsPane::OptionsPane() {
}
void OptionsPane::setupPositions() {
int currentHeight = y + 1;
for(std::vector<GuiElement*>::iterator it = children.begin(); it != children.end(); ++it ) {
(*it)->width = width;
(*it)->y = currentHeight;
(*it)->x = x;
currentHeight += (*it)->height + 1;
}
height = currentHeight;
super::setupPositions();
}
OptionsGroup& OptionsPane::createOptionsGroup( std::string label ) {
OptionsGroup* newGroup = new OptionsGroup(label);
children.push_back(newGroup);
// create and return a new group index
return *newGroup;
}
void OptionsPane::createToggle( unsigned int group, std::string label, const Option* option ) {
if(group > children.size()) return;
ImageDef def;
def.setSrc(IntRectangle(160, 206, 39, 20));
def.name = "gui/touchgui.png";
def.width = 39 * 0.7f;
def.height = 20 * 0.7f;
OptionButton* element = new OptionButton(option);
element->setImageDef(def, true);
OptionsItem* item = new OptionsItem(label, element);
((OptionsGroup*)children[group])->addChild(item);
setupPositions();
}
void OptionsPane::createProgressSlider( Minecraft* minecraft, unsigned int group, std::string label, const Option* option, float progressMin/*=1.0f*/, float progressMax/*=1.0f */ ) {
if(group > children.size()) return;
Slider* element = new Slider(minecraft, option, progressMin, progressMax);
element->width = 100;
element->height = 20;
OptionsItem* item = new OptionsItem(label, element);
((OptionsGroup*)children[group])->addChild(item);
setupPositions();
}
void OptionsPane::createStepSlider( Minecraft* minecraft, unsigned int group, std::string label, const Option* option, const std::vector<int>& stepVec ) {
if(group > children.size()) return;
Slider* element = new Slider(minecraft, option, stepVec);
element->width = 100;
element->height = 20;
OptionsItem* item = new OptionsItem(label, element);
((OptionsGroup*)children[group])->addChild(item);
setupPositions();
}

View File

@@ -0,0 +1,30 @@
#ifndef ITEMPANE_H__
#define ITEMPANE_H__
#include <string>
#include <vector>
#include "GuiElementContainer.h"
#include "../../../world/item/ItemInstance.h"
#include "../../../client/Options.h"
class Font;
class Textures;
class NinePatchLayer;
class ItemPane;
class OptionButton;
class Button;
class OptionsGroup;
class Slider;
class Minecraft;
class OptionsPane: public GuiElementContainer
{
typedef GuiElementContainer super;
public:
OptionsPane();
OptionsGroup& createOptionsGroup( std::string label );
void createToggle( unsigned int group, std::string label, const Option* option );
void createProgressSlider(Minecraft* minecraft, unsigned int group, std::string label, const Option* option, float progressMin=1.0f, float progressMax=1.0f );
void createStepSlider(Minecraft* minecraft, unsigned int group, std::string label, const Option* option, const std::vector<int>& stepVec );
void setupPositions();
};
#endif /*ITEMPANE_H__*/

View File

@@ -2,6 +2,7 @@
#include "../../Minecraft.h"
#include "../../renderer/Textures.h"
#include "../Screen.h"
#include "../../../locale/I18n.h"
#include "../../../util/Mth.h"
#include <algorithm>
#include <assert.h>
@@ -21,7 +22,7 @@ void Slider::render( Minecraft* minecraft, int xm, int ym ) {
if (m_numSteps > 2) {
int stepDistance = barWidth / (m_numSteps-1);
for(int a = 0; a <= m_numSteps; ++a) {
for(int a = 0; a < m_numSteps; ++a) {
int renderSliderStepPosX = xSliderStart + a * stepDistance + 1;
fill(renderSliderStepPosX - 1, ySliderStart - 2, renderSliderStepPosX + 1, ySliderEnd + 2, 0xff606060);
}
@@ -64,15 +65,20 @@ SliderFloat::SliderFloat(Minecraft* minecraft, OptionId option)
SliderInt::SliderInt(Minecraft* minecraft, OptionId option)
: Slider(option), m_option(dynamic_cast<OptionInt*>(minecraft->options.getOpt(option)))
{
m_numSteps = m_option->getMax() - m_option->getMin();
m_numSteps = m_option->getMax() - m_option->getMin() + 1;
m_percentage = float(m_option->get() - m_option->getMin()) / (m_numSteps-1);
}
void SliderInt::render( Minecraft* minecraft, int xm, int ym ) {
Slider::render(minecraft, xm, ym);
}
void SliderInt::mouseReleased( Minecraft* minecraft, int x, int y, int buttonNum ) {
Slider::mouseReleased(minecraft, x, y, buttonNum);
if (pointInside(x, y)) {
int curStep = Mth::floor(m_percentage * (m_numSteps-1));
int curStep = int(m_percentage * (m_numSteps-1) + 0.5f);
curStep = Mth::clamp(curStep + m_option->getMin(), m_option->getMin(), m_option->getMax());
m_percentage = float(curStep - m_option->getMin()) / (m_numSteps-1);
minecraft->options.set(m_optId, curStep);

View File

@@ -3,7 +3,6 @@
#include "GuiElement.h"
#include "../../../client/Options.h"
#include <client/Option.h>
class Slider : public GuiElement {
typedef GuiElement super;
@@ -38,6 +37,7 @@ class SliderInt : public Slider {
public:
SliderInt(Minecraft* minecraft, OptionId option);
virtual void render( Minecraft* minecraft, int xm, int ym ) override;
virtual void mouseReleased( Minecraft* minecraft, int x, int y, int buttonNum ) override;
protected:

View File

@@ -0,0 +1,24 @@
#include "SmallButton.h"
SmallButton::SmallButton( int id, int x, int y, const std::string& msg )
: super(id, x, y, 150, 20, msg),
option(NULL)
{
}
SmallButton::SmallButton( int id, int x, int y, int width, int height, const std::string& msg )
: super(id, x, y, width, height, msg),
option(NULL)
{
}
SmallButton::SmallButton( int id, int x, int y, Option* item, const std::string& msg )
: super(id, x, y, 150, 20, msg),
option(item)
{
}
Option* SmallButton::getOption()
{
return option;
}

View File

@@ -0,0 +1,23 @@
#ifndef NET_MINECRAFT_CLIENT_GUI_COMPONENTS__SmallButton_H__
#define NET_MINECRAFT_CLIENT_GUI_COMPONENTS__SmallButton_H__
//package net.minecraft.client.gui;
#include <string>
#include "Button.h"
#include "../../Options.h"
class SmallButton: public Button
{
typedef Button super;
public:
SmallButton(int id, int x, int y, const std::string& msg);
SmallButton(int id, int x, int y, int width, int height, const std::string& msg);
SmallButton(int id, int x, int y, Option* item, const std::string& msg);
Option* getOption();
private:
Option* option;
};
#endif /*NET_MINECRAFT_CLIENT_GUI_COMPONENTS__SmallButton_H__*/

View File

@@ -1,10 +1,10 @@
#pragma once
#include "TextBox.h"
#include <client/Options.h>
#include "Options.h"
class TextOption : public TextBox {
public:
TextOption(Minecraft* minecraft, OptionId optId);
virtual bool loseFocus(Minecraft* minecraft);
};
};

View File

@@ -0,0 +1,26 @@
#ifndef NET_MINECRAFT_CLIENT_GUI_SCREENS__BuyGameScreen_H__
#define NET_MINECRAFT_CLIENT_GUI_SCREENS__BuyGameScreen_H__
#include "../Screen.h"
#include "../components/Button.h"
class BuyGameScreen: public Screen
{
public:
BuyGameScreen() {}
virtual ~BuyGameScreen() {}
void init();
void render(int xm, int ym, float a);
void buttonClicked(Button* button) {
//if (button->id == bQuit.id)
}
private:
//Button bQuit;
//Button bBuyGame;
};
#endif /*NET_MINECRAFT_CLIENT_GUI_SCREENS__BuyGameScreen_H__*/

View File

@@ -0,0 +1,107 @@
#ifndef NET_MINECRAFT_CLIENT_GUI_SCREENS__InvalidLicenseScreen_H__
#define NET_MINECRAFT_CLIENT_GUI_SCREENS__InvalidLicenseScreen_H__
#include "../Screen.h"
#include "../components/Button.h"
#include "../../Minecraft.h"
#include "../../../LicenseCodes.h"
class InvalidLicenseScreen: public Screen
{
public:
InvalidLicenseScreen(int id, bool hasBuyButton)
: _id(id),
_hasBuyButton(hasBuyButton),
_baseY(0),
bOk(0),
bBuy(0)
{
}
virtual ~InvalidLicenseScreen() {
delete bOk;
delete bBuy;
}
void init() {
if (minecraft->useTouchscreen()) {
bOk = new Touch::TButton(1, "Ok");
bBuy = new Touch::TButton(2, "Buy");
} else {
bOk = new Button(1, "Ok");
bBuy = new Button(2, "Buy");
}
if (_hasBuyButton)
bOk->msg = "Quit";
if (!LicenseCodes::isOk(_id)) {
char buf[20] = {0};
sprintf(buf, "%d", _id);
desc1 = "License verification failed (error ";
desc1 += buf;
desc1 += ")";
desc2 = "Try again later.";
hint = "You need to be connected to the internet\n";
hint += "once while you start the game.";
}
buttons.push_back(bOk);
tabButtons.push_back(bOk);
if (_hasBuyButton) {
buttons.push_back(bBuy);
tabButtons.push_back(bBuy);
}
}
void setupPositions() {
_baseY = height/5 + 6;
//if (_hasBuyButton)
_baseY -= 24;
bOk->width = bBuy->width = 200;
bOk->x = bBuy->x = (width - bOk->width) / 2;
bBuy->y = _baseY + 84;
bOk->y = bBuy->y + bBuy->height + 4;
if (!_hasBuyButton)
bOk->y -= 24;
}
void tick() {}
//void keyPressed(int eventKey) {}
void render(int xm, int ym, float a) {
renderDirtBackground(0);
drawCenteredString(minecraft->font, desc1, width/2, _baseY, 0xffffff);
drawCenteredString(minecraft->font, desc2, width/2, _baseY + 24, 0xffffff);
drawCenteredString(minecraft->font, hint, width/2, _baseY + 60, 0xffffff);
Screen::render(xm, ym, a);
}
void buttonClicked(Button* button) {
if (button->id == bOk->id) {
minecraft->quit();
}
if (button->id == bBuy->id) {
minecraft->platform()->buyGame();
}
};
private:
int _id;
std::string desc1;
std::string desc2;
std::string hint;
Button* bOk;
Button* bBuy;
bool _hasBuyButton;
int _baseY;
};
#endif /*NET_MINECRAFT_CLIENT_GUI_SCREENS__InvalidLicenseScreen_H__*/

View File

@@ -2,8 +2,8 @@
#include "../Screen.h"
#include "../components/Button.h"
#include "../../Minecraft.h"
#include "client/gui/components/ImageButton.h"
#include "client/gui/components/TextBox.h"
#include "ImageButton.h"
#include "TextBox.h"
class JoinByIPScreen: public Screen
{
@@ -25,4 +25,4 @@ private:
Touch::THeader bHeader;
Touch::TButton bJoin;
ImageButton bBack;
};
};

View File

@@ -221,9 +221,9 @@ void OptionsScreen::generateOptionScreens() {
// // Graphics Pane
optionPanes[3]->addOptionItem(OPTIONS_FANCY_GRAPHICS, minecraft)
// .addOptionItem(&Options::Option::VIEW_BOBBING, minecraft)
// .addOptionItem(&Options::Option::AMBIENT_OCCLUSION, minecraft)
// .addOptionItem(&Options::Option::ANAGLYPH, minecraft)
// .addOptionItem(&Option::VIEW_BOBBING, minecraft)
// .addOptionItem(&Option::AMBIENT_OCCLUSION, minecraft)
// .addOptionItem(&Option::ANAGLYPH, minecraft)
.addOptionItem(OPTIONS_LIMIT_FRAMERATE, minecraft)
.addOptionItem(OPTIONS_VSYNC, minecraft)
.addOptionItem(OPTIONS_RENDER_DEBUG, minecraft)
@@ -271,4 +271,4 @@ void OptionsScreen::tick() {
currentOptionsGroup->tick(minecraft);
super::tick();
}
}

View File

@@ -13,7 +13,7 @@
#include "../../Minecraft.h"
#include <client/gui/screens/UsernameScreen.h>
#include "UsernameScreen.h"
Screen* ScreenChooser::createScreen( ScreenId id )
{

View File

@@ -3,7 +3,8 @@
#include "../Screen.h"
#include "../components/Button.h"
#include "client/gui/components/TextBox.h"
// this is cursed lol
#include "../../../client/gui/components/TextBox.h"
#include <string>
class UsernameScreen : public Screen

View File

@@ -16,7 +16,7 @@
#include "../../../../world/level/Level.h"
#include "../../../../world/item/DyePowderItem.h"
#include "../../../../world/item/crafting/Recipe.h"
#include "platform/input/Keyboard.h"
#include "Keyboard.h"
static NinePatchLayer* guiPaneFrame = NULL;

View File

@@ -1,5 +1,7 @@
#ifndef NET_MINECRAFT_CLIENT_PLAYER__XperiaPlayInput_H__
#define NET_MINECRAFT_CLIENT_PLAYER__XperiaPlayInput_H__
#include "Player.h"
#include "Controller.h"
//package net.minecraft.client.player;

View File

@@ -14,8 +14,8 @@
#define USE_VBO
#define GL_QUADS 0x0007
#if defined(__APPLE__)
#import <OpenGLES/ES1/gl.height>
#import <OpenGLES/ES1/glext.height>
#import <OpenGLES/ES1/gl.h>
#import <OpenGLES/ES1/glext.h>
#elif defined(ANDROID)
#include <GLES/gl.h>
#include <GLES/glext.h>

View File

@@ -3,8 +3,14 @@
#include "SoundSystem.h"
#include <AL/al.h>
#include <AL/alc.h>
// If audio breaks for other platforms, this is probably why. Here, I'm just calling where Apple's OpenAL headers live (they arent in just "AL"
#if defined(__APPLE__)
#include <OpenAL/al.h>
#include <OpenAL/alc.h>
#else
#include <AL/al.h>
#include <AL/alc.h>
#endif
#include <vector>
#include <list>

View File

@@ -6,23 +6,24 @@ NetherReactorPattern::NetherReactorPattern( ) {
const int netherCoreId = Tile::netherReactor->id;
const unsigned int types[3][3][3] =
{
// Level 0
// Changing all of these values to be unsigned is needed to get the nether reactor pattern to compile. In the past having them be normal ints was fine but the c++ convention has changed
// Level 0
{
{goldId, stoneId, goldId},
{stoneId, stoneId, stoneId},
{goldId, stoneId, goldId}
{static_cast<unsigned int>(goldId), static_cast<unsigned int>(stoneId), static_cast<unsigned int>(goldId)},
{static_cast<unsigned int>(stoneId), static_cast<unsigned int>(stoneId), static_cast<unsigned int>(stoneId)},
{static_cast<unsigned int>(goldId), static_cast<unsigned int>(stoneId), static_cast<unsigned int>(goldId)}
},
// Level 1
{
{stoneId, 0, stoneId},
{0, netherCoreId, 0},
{stoneId, 0, stoneId}
{static_cast<unsigned int>(stoneId), 0, static_cast<unsigned int>(stoneId)},
{0, static_cast<unsigned int>(netherCoreId), 0},
{static_cast<unsigned int>(stoneId), 0, static_cast<unsigned int>(stoneId)}
},
// Level 2
{
{0, stoneId, 0},
{stoneId, stoneId, stoneId},
{0, stoneId, 0}
{0, static_cast<unsigned int>(stoneId), 0},
{static_cast<unsigned int>(stoneId), static_cast<unsigned int>(stoneId), static_cast<unsigned int>(stoneId)},
{0, static_cast<unsigned int>(stoneId), 0}
}
};
for(int setLevel = 0; setLevel <= 2; ++setLevel) {