mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-07-13 01:17:12 +00:00
Added option to use the TU panorama or the Java one.
This commit is contained in:
parent
975f716f9c
commit
b854af49c6
|
|
@ -189,6 +189,7 @@ options.renderDistance.short=Short
|
|||
options.renderDistance.normal=Normal
|
||||
options.renderDistance.far=Far
|
||||
options.viewBobbing=View Bobbing
|
||||
options.classicPanorama=Classic Panorama
|
||||
options.ao=Smooth Lighting
|
||||
options.anaglyph=3D Anaglyph
|
||||
options.framerateLimit=Performance
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
// 4J - the Option sub-class used to be an java enumerated type, trying to
|
||||
// emulate that functionality here
|
||||
const Options::Option Options::Option::options[17] = {
|
||||
const Options::Option Options::Option::options[18] = {
|
||||
Options::Option(L"options.music", true, false),
|
||||
Options::Option(L"options.sound", true, false),
|
||||
Options::Option(L"options.invertMouse", false, true),
|
||||
|
|
@ -34,6 +34,7 @@ const Options::Option Options::Option::options[17] = {
|
|||
Options::Option(L"options.gamma", true, false),
|
||||
Options::Option(L"options.renderClouds", false, true),
|
||||
Options::Option(L"options.particles", false, false),
|
||||
Options::Option(L"options.classicPanorama", false, true),
|
||||
};
|
||||
|
||||
const Options::Option* Options::Option::MUSIC = &Options::Option::options[0];
|
||||
|
|
@ -65,6 +66,8 @@ const Options::Option* Options::Option::RENDER_CLOUDS =
|
|||
&Options::Option::options[15];
|
||||
const Options::Option* Options::Option::PARTICLES =
|
||||
&Options::Option::options[16];
|
||||
const Options::Option* Options::Option::CLASSIC_PANORAMA =
|
||||
&(Options::Option::options[17]);
|
||||
|
||||
const Options::Option* Options::Option::getItem(int id) { return &options[id]; }
|
||||
|
||||
|
|
@ -111,6 +114,8 @@ void Options::init() {
|
|||
invertYMouse = false;
|
||||
viewDistance = 0;
|
||||
bobView = true;
|
||||
// 4jcraft
|
||||
classicPanorama = false;
|
||||
anaglyph3d = false;
|
||||
advancedOpengl = false;
|
||||
|
||||
|
|
@ -238,9 +243,12 @@ void Options::toggle(const Options::Option* option, int dir) {
|
|||
if (option == Option::PARTICLES) particles = (particles + dir) % 3;
|
||||
|
||||
// 4J-PB - changing
|
||||
// if (option == Option::VIEW_BOBBING) bobView = !bobView;
|
||||
if (option == Option::VIEW_BOBBING)
|
||||
((dir == 0) ? bobView = false : bobView = true);
|
||||
// 4jcraft: uncommented this so that the view bobbing option works
|
||||
if (option == Option::VIEW_BOBBING) bobView = !bobView;
|
||||
// 4jcraft
|
||||
if (option == Option::CLASSIC_PANORAMA) {
|
||||
classicPanorama = !classicPanorama;
|
||||
}
|
||||
if (option == Option::RENDER_CLOUDS) renderClouds = !renderClouds;
|
||||
if (option == Option::ADVANCED_OPENGL) {
|
||||
advancedOpengl = !advancedOpengl;
|
||||
|
|
@ -293,6 +301,8 @@ bool Options::getBooleanValue(const Options::Option* item) {
|
|||
// types
|
||||
if (item == Option::INVERT_MOUSE) return invertYMouse;
|
||||
if (item == Option::VIEW_BOBBING) return bobView;
|
||||
// 4jcraft
|
||||
if (item == Option::CLASSIC_PANORAMA) return classicPanorama;
|
||||
if (item == Option::ANAGLYPH) return anaglyph3d;
|
||||
if (item == Option::ADVANCED_OPENGL) return advancedOpengl;
|
||||
if (item == Option::AMBIENT_OCCLUSION) return ambientOcclusion;
|
||||
|
|
@ -405,6 +415,8 @@ void Options::load() {
|
|||
if (cmds[0] == L"guiScale") guiScale = _fromString<int>(cmds[1]);
|
||||
if (cmds[0] == L"particles") particles = _fromString<int>(cmds[1]);
|
||||
if (cmds[0] == L"bobView") bobView = cmds[1] == L"true";
|
||||
// 4jcraft
|
||||
if (cmds[0] == L"classicPanorama") classicPanorama = cmds[1] == L"true";
|
||||
if (cmds[0] == L"anaglyph3d") anaglyph3d = cmds[1] == L"true";
|
||||
if (cmds[0] == L"advancedOpengl") advancedOpengl = cmds[1] == L"true";
|
||||
if (cmds[0] == L"fpsLimit") framerateLimit = _fromString<int>(cmds[1]);
|
||||
|
|
@ -459,6 +471,9 @@ void Options::save() {
|
|||
dos.writeChars(L"guiScale:" + _toString<int>(guiScale));
|
||||
dos.writeChars(L"particles:" + _toString<int>(particles));
|
||||
dos.writeChars(L"bobView:" + std::wstring(bobView ? L"true" : L"false"));
|
||||
// 4jcraft
|
||||
dos.writeChars(L"classicPanorama:" +
|
||||
std::wstring(classicPanorama ? L"true" : L"false"));
|
||||
dos.writeChars(L"anaglyph3d:" +
|
||||
std::wstring(anaglyph3d ? L"true" : L"false"));
|
||||
dos.writeChars(L"advancedOpengl:" +
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ public:
|
|||
// 4J - this used to be an enum
|
||||
class Option {
|
||||
public:
|
||||
static const Option options[17];
|
||||
static const Option options[18];
|
||||
static const Option* MUSIC;
|
||||
static const Option* SOUND;
|
||||
static const Option* INVERT_MOUSE;
|
||||
|
|
@ -31,6 +31,7 @@ public:
|
|||
static const Option* GAMMA;
|
||||
static const Option* RENDER_CLOUDS;
|
||||
static const Option* PARTICLES;
|
||||
static const Option* CLASSIC_PANORAMA;
|
||||
|
||||
private:
|
||||
const bool _isProgress;
|
||||
|
|
@ -61,6 +62,7 @@ public:
|
|||
bool invertYMouse;
|
||||
int viewDistance;
|
||||
bool bobView;
|
||||
bool classicPanorama;
|
||||
bool anaglyph3d;
|
||||
bool advancedOpengl;
|
||||
int framerateLimit;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ class UIScene_SettingsOptionsMenu : public UIScene {
|
|||
private:
|
||||
enum EControls {
|
||||
eControl_ViewBob,
|
||||
// 4jcraft
|
||||
eControl_ClassicPanorama,
|
||||
eControl_ShowHints,
|
||||
eControl_ShowTooltips,
|
||||
eControl_InGameGamertags,
|
||||
|
|
@ -20,8 +22,8 @@ protected:
|
|||
static int m_iDifficultyTitleSettingA[4];
|
||||
|
||||
private:
|
||||
UIControl_CheckBox m_checkboxViewBob, m_checkboxShowHints,
|
||||
m_checkboxShowTooltips, m_checkboxInGameGamertags,
|
||||
UIControl_CheckBox m_checkboxViewBob, m_checkboxClassicPanorama,
|
||||
m_checkboxShowHints, m_checkboxShowTooltips, m_checkboxInGameGamertags,
|
||||
m_checkboxMashupWorlds; // Checkboxes
|
||||
UIControl_Slider m_sliderAutosave, m_sliderDifficulty; // Sliders
|
||||
UIControl_Label m_labelDifficultyText; // Text
|
||||
|
|
@ -29,6 +31,8 @@ private:
|
|||
|
||||
UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene)
|
||||
UI_MAP_ELEMENT(m_checkboxViewBob, "ViewBob")
|
||||
// 4jcraft
|
||||
UI_MAP_ELEMENT(m_checkboxClassicPanorama, "ClassicPanorama")
|
||||
UI_MAP_ELEMENT(m_checkboxShowHints, "ShowHints")
|
||||
UI_MAP_ELEMENT(m_checkboxShowTooltips, "ShowTooltips")
|
||||
UI_MAP_ELEMENT(m_checkboxInGameGamertags, "InGameGamertags")
|
||||
|
|
|
|||
|
|
@ -181,6 +181,12 @@ const wchar_t* Textures::preLoaded[TN_COUNT] = {
|
|||
L"gui/anvil",
|
||||
L"gui/trap",
|
||||
L"title/bg/panorama",
|
||||
L"title/bg/panorama0",
|
||||
L"title/bg/panorama1",
|
||||
L"title/bg/panorama2",
|
||||
L"title/bg/panorama3",
|
||||
L"title/bg/panorama4",
|
||||
L"title/bg/panorama5",
|
||||
#endif
|
||||
// L"item/christmas",
|
||||
// L"item/christmas_double",
|
||||
|
|
@ -1494,4 +1500,4 @@ bool Textures::IsOriginalImage(TEXTURE_NAME texId, const std::wstring& name) {
|
|||
i++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -163,6 +163,12 @@ typedef enum _TEXTURE_NAME {
|
|||
TN_GUI_ANVIL,
|
||||
TN_GUI_TRAP,
|
||||
TN_TITLE_BG_PANORAMA,
|
||||
TN_TITLE_BG_PANORAMA0,
|
||||
TN_TITLE_BG_PANORAMA1,
|
||||
TN_TITLE_BG_PANORAMA2,
|
||||
TN_TITLE_BG_PANORAMA3,
|
||||
TN_TITLE_BG_PANORAMA4,
|
||||
TN_TITLE_BG_PANORAMA5,
|
||||
#endif
|
||||
// TN_TILE_XMAS_CHEST,
|
||||
// TN_TILE_LARGE_XMAS_CHEST,
|
||||
|
|
@ -360,4 +366,4 @@ public:
|
|||
// drive
|
||||
static bool IsTUImage(TEXTURE_NAME texId, const std::wstring& name);
|
||||
static bool IsOriginalImage(TEXTURE_NAME texId, const std::wstring& name);
|
||||
};
|
||||
};
|
||||
|
|
@ -17,8 +17,7 @@ Random* TitleScreen::random = new Random();
|
|||
|
||||
TitleScreen::TitleScreen() {
|
||||
// 4J - added initialisers
|
||||
// vo = 0; // 4jcraft removed
|
||||
panoramaTimer = 0.0f;
|
||||
vo = 0;
|
||||
multiplayerButton = NULL;
|
||||
|
||||
splash = L"missingno";
|
||||
|
|
@ -67,18 +66,10 @@ TitleScreen::TitleScreen() {
|
|||
}
|
||||
|
||||
splash = splashes.at(splashIndex);
|
||||
|
||||
titlePanoramaPaths[0] = L"title/bg/panorama0.png";
|
||||
titlePanoramaPaths[1] = L"title/bg/panorama1.png";
|
||||
titlePanoramaPaths[2] = L"title/bg/panorama2.png";
|
||||
titlePanoramaPaths[3] = L"title/bg/panorama3.png";
|
||||
titlePanoramaPaths[4] = L"title/bg/panorama4.png";
|
||||
titlePanoramaPaths[5] = L"title/bg/panorama5.png";
|
||||
}
|
||||
|
||||
void TitleScreen::tick() {
|
||||
panoramaTimer += 1.0f;
|
||||
// vo += 1.0f; // 4jcraft removed
|
||||
vo += 1.0f;
|
||||
// if( vo > 100.0f ) minecraft->setScreen(new SelectWorldScreen(this));
|
||||
// // 4J - temp testing
|
||||
}
|
||||
|
|
@ -173,139 +164,203 @@ void TitleScreen::buttonClicked(Button* button) {
|
|||
void TitleScreen::renderPanorama(float a) {
|
||||
#ifdef ENABLE_JAVA_GUIS
|
||||
Tesselator* t = Tesselator::getInstance();
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
gluPerspective(120.0f, 1.0f, 0.05f, 10.0f);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
glRotatef(180.0f, 1.0f, 0.0f, 0.0f);
|
||||
glEnable(GL_BLEND);
|
||||
glDisable(GL_ALPHA_TEST);
|
||||
glDisable(GL_CULL_FACE);
|
||||
glDepthMask(false);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
char offsetPasses = 8;
|
||||
|
||||
for (int i = 0; i < (offsetPasses * offsetPasses); i++) {
|
||||
if (minecraft->options->classicPanorama) {
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPushMatrix();
|
||||
float x =
|
||||
((float)(i % offsetPasses) / (float)offsetPasses - 0.5f) / 64.0f;
|
||||
float y =
|
||||
((float)(i / offsetPasses) / (float)offsetPasses - 0.5f) / 64.0f;
|
||||
float z = 0.0f;
|
||||
glTranslatef(x, y, z);
|
||||
glRotatef(sin((panoramaTimer + a) / 400.0f) * 25.0f + 20.0f, 1.0f, 0.0f,
|
||||
0.0f);
|
||||
glRotatef(-(panoramaTimer + a) * 0.1f, 0.0f, 1.0f, 0.0f);
|
||||
glLoadIdentity();
|
||||
gluPerspective(120.0f, 1.0f, 0.05f, 10.0f);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
glRotatef(180.0f, 1.0f, 0.0f, 0.0f);
|
||||
glEnable(GL_BLEND);
|
||||
glDisable(GL_ALPHA_TEST);
|
||||
glDisable(GL_CULL_FACE);
|
||||
glDepthMask(false);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
char offsetPasses = 8;
|
||||
|
||||
for (int j = 0; j < 6; j++) {
|
||||
for (int i = 0; i < (offsetPasses * offsetPasses); i++) {
|
||||
glPushMatrix();
|
||||
float x = ((float)(i % offsetPasses) / (float)offsetPasses - 0.5f) /
|
||||
64.0f;
|
||||
float y = ((float)(i / offsetPasses) / (float)offsetPasses - 0.5f) /
|
||||
64.0f;
|
||||
float z = 0.0f;
|
||||
glTranslatef(x, y, z);
|
||||
glRotatef(sin((vo + a) / 400.0f) * 25.0f + 20.0f, 1.0f, 0.0f, 0.0f);
|
||||
glRotatef(-(vo + a) * 0.1f, 0.0f, 1.0f, 0.0f);
|
||||
|
||||
switch (j) {
|
||||
case 1:
|
||||
glRotatef(90.0f, 0.0f, 1.0f, 0.0f);
|
||||
break;
|
||||
case 2:
|
||||
glRotatef(180.0f, 0.0f, 1.0f, 0.0f);
|
||||
break;
|
||||
case 3:
|
||||
glRotatef(-90.0f, 0.0f, 1.0f, 0.0f);
|
||||
break;
|
||||
case 4:
|
||||
glRotatef(90.0f, 1.0f, 0.0f, 0.0f);
|
||||
break;
|
||||
case 5:
|
||||
glRotatef(-90.0f, 1.0f, 0.0f, 0.0f);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
for (int j = 0; j < 6; j++) {
|
||||
glPushMatrix();
|
||||
|
||||
switch (j) {
|
||||
case 1:
|
||||
glRotatef(90.0f, 0.0f, 1.0f, 0.0f);
|
||||
break;
|
||||
case 2:
|
||||
glRotatef(180.0f, 0.0f, 1.0f, 0.0f);
|
||||
break;
|
||||
case 3:
|
||||
glRotatef(-90.0f, 0.0f, 1.0f, 0.0f);
|
||||
break;
|
||||
case 4:
|
||||
glRotatef(90.0f, 1.0f, 0.0f, 0.0f);
|
||||
break;
|
||||
case 5:
|
||||
glRotatef(-90.0f, 1.0f, 0.0f, 0.0f);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, minecraft->textures->loadTexture(
|
||||
TN_TITLE_BG_PANORAMA0 + j));
|
||||
t->begin();
|
||||
t->color(16777215, 255 / (i + 1));
|
||||
t->vertexUV(-1.0f, -1.0f, 1.0f, 0.0f, 0.0f);
|
||||
t->vertexUV(1.0f, -1.0f, 1.0f, 1.0f, 0.0f);
|
||||
t->vertexUV(1.0f, 1.0f, 1.0f, 1.0f, 1.0f);
|
||||
t->vertexUV(-1.0f, 1.0f, 1.0f, 0.0f, 1.0f);
|
||||
t->end();
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
minecraft->textures->bindTexture(titlePanoramaPaths[j]);
|
||||
t->begin();
|
||||
t->color(16777215, 255 / (i + 1));
|
||||
t->vertexUV(-1.0f, -1.0f, 1.0f, 0.0f, 0.0f);
|
||||
t->vertexUV(1.0f, -1.0f, 1.0f, 1.0f, 0.0f);
|
||||
t->vertexUV(1.0f, 1.0f, 1.0f, 1.0f, 1.0f);
|
||||
t->vertexUV(-1.0f, 1.0f, 1.0f, 0.0f, 1.0f);
|
||||
t->end();
|
||||
glPopMatrix();
|
||||
glColorMask(true, true, true, false);
|
||||
}
|
||||
glPopMatrix();
|
||||
glColorMask(true, true, true, false);
|
||||
}
|
||||
|
||||
t->offset(0.0f, 0.0f, 0.0f);
|
||||
glColorMask(true, true, true, true);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPopMatrix();
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPopMatrix();
|
||||
glDepthMask(true);
|
||||
glEnable(GL_CULL_FACE);
|
||||
glEnable(GL_ALPHA_TEST);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
t->offset(0.0f, 0.0f, 0.0f);
|
||||
glColorMask(true, true, true, true);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPopMatrix();
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPopMatrix();
|
||||
glDepthMask(true);
|
||||
glEnable(GL_CULL_FACE);
|
||||
glEnable(GL_ALPHA_TEST);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
} else {
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
glOrtho(0, width, height, 0, 1000, 3000);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
glTranslatef(0, 0, -2000);
|
||||
|
||||
glDisable(GL_LIGHTING);
|
||||
glDisable(GL_FOG);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glDisable(GL_ALPHA_TEST);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glDepthMask(false);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D,
|
||||
minecraft->textures->loadTexture(TN_TITLE_BG_PANORAMA));
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
|
||||
float off = vo * 0.0004f;
|
||||
|
||||
float screenAspect = (float)width / (float)height;
|
||||
float texAspect = 1748.0f / 144.0f;
|
||||
float scale;
|
||||
if (screenAspect > texAspect) {
|
||||
scale = (float)width / 1748.0f;
|
||||
} else {
|
||||
scale = (float)height / 144.0f;
|
||||
}
|
||||
|
||||
float texWidth = 1748.0f * scale;
|
||||
float texHeight = 144.0f * scale;
|
||||
float yOff = (height - texHeight) / 2.0f;
|
||||
|
||||
float uMax = off + (texWidth / 1748.0f);
|
||||
|
||||
t->begin(GL_QUADS);
|
||||
t->color(0xffffff, 255);
|
||||
t->vertexUV(0, yOff + texHeight, 0, off, 1.0f);
|
||||
t->vertexUV(texWidth, yOff + texHeight, 0, uMax, 1.0f);
|
||||
t->vertexUV(texWidth, yOff, 0, uMax, 0.0f);
|
||||
t->vertexUV(0, yOff, 0, off, 0.0f);
|
||||
t->end();
|
||||
|
||||
glDepthMask(true);
|
||||
glDisable(GL_BLEND);
|
||||
glEnable(GL_ALPHA_TEST);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPopMatrix();
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPopMatrix();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// 4jcraft
|
||||
void TitleScreen::renderSkybox(float a) {
|
||||
glViewport(0, 0, 256, 256);
|
||||
renderPanorama(a);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
rotateAndBlur(a);
|
||||
#ifdef ENABLE_JAVA_GUIS
|
||||
if (minecraft->options->classicPanorama) {
|
||||
glViewport(0, 0, 256, 256);
|
||||
}
|
||||
renderPanorama(a);
|
||||
if (minecraft->options->classicPanorama) {
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
|
||||
glViewport(0, 0, minecraft->width, minecraft->height);
|
||||
for (int i = 0; i < 8; i++) {
|
||||
rotateAndBlur(a);
|
||||
}
|
||||
|
||||
Tesselator* t = Tesselator::getInstance();
|
||||
t->begin();
|
||||
float aspect =
|
||||
width > height ? 120.0f / (float)width : 120.0f / (float)height;
|
||||
float sWidth = (float)height * aspect / 256.0f;
|
||||
float sHeight = (float)width * aspect / 256.0f;
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
t->color(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
t->vertexUV(0.0f, height, 0.0f, (0.5f - sWidth), (0.5f + sHeight));
|
||||
t->vertexUV(width, height, 0.0f, (0.5f - sWidth), (0.5f - sHeight));
|
||||
t->vertexUV(width, 0.0f, 0.0f, (0.5f + sWidth), (0.5f - sHeight));
|
||||
t->vertexUV(0.0f, 0.0f, 0.0f, (0.5f + sWidth), (0.5f + sHeight));
|
||||
t->end();
|
||||
return;
|
||||
glViewport(0, 0, minecraft->width, minecraft->height);
|
||||
|
||||
Tesselator* t = Tesselator::getInstance();
|
||||
t->begin();
|
||||
float aspect =
|
||||
width > height ? 120.0f / (float)width : 120.0f / (float)height;
|
||||
float sWidth = (float)height * aspect / 256.0f;
|
||||
float sHeight = (float)width * aspect / 256.0f;
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
t->color(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
t->vertexUV(0.0f, height, 0.0f, (0.5f - sWidth), (0.5f + sHeight));
|
||||
t->vertexUV(width, height, 0.0f, (0.5f - sWidth), (0.5f - sHeight));
|
||||
t->vertexUV(width, 0.0f, 0.0f, (0.5f + sWidth), (0.5f - sHeight));
|
||||
t->vertexUV(0.0f, 0.0f, 0.0f, (0.5f + sWidth), (0.5f + sHeight));
|
||||
t->end();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// 4jcraft
|
||||
void TitleScreen::rotateAndBlur(float a) {
|
||||
#ifdef ENABLE_JAVA_GUIS
|
||||
glBindTexture(GL_TEXTURE_2D, viewportTexture);
|
||||
// this.mc.renderEngine.resetBoundTexture();
|
||||
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 256, 256);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glColorMask(true, true, true, false);
|
||||
Tesselator* t = Tesselator::getInstance();
|
||||
t->begin();
|
||||
char blurPasses = 3;
|
||||
if (minecraft->options->classicPanorama) {
|
||||
glBindTexture(GL_TEXTURE_2D, viewportTexture);
|
||||
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 256, 256);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glColorMask(true, true, true, false);
|
||||
Tesselator* t = Tesselator::getInstance();
|
||||
t->begin();
|
||||
char blurPasses = 3;
|
||||
|
||||
for (int i = 0; i < blurPasses; i++) {
|
||||
t->color(1.0f, 1.0f, 1.0f, 1.0f / (float)(i + 1));
|
||||
float offset = (float)(i - blurPasses / 2) / 256.0f;
|
||||
t->vertexUV(width, height, 0.0f, (0.0f + offset), 0.0f);
|
||||
t->vertexUV(width, 0.0f, 0.0f, (1.0f + offset), 0.0f);
|
||||
t->vertexUV(0.0f, 0.0f, 0.0f, (1.0f + offset), 1.0f);
|
||||
t->vertexUV(0.0f, height, 0.0f, (0.0f + offset), 1.0f);
|
||||
for (int i = 0; i < blurPasses; i++) {
|
||||
t->color(1.0f, 1.0f, 1.0f, 1.0f / (float)(i + 1));
|
||||
float offset = (float)(i - blurPasses / 2) / 256.0f;
|
||||
t->vertexUV(width, height, 0.0f, (0.0f + offset), 0.0f);
|
||||
t->vertexUV(width, 0.0f, 0.0f, (1.0f + offset), 0.0f);
|
||||
t->vertexUV(0.0f, 0.0f, 0.0f, (1.0f + offset), 1.0f);
|
||||
t->vertexUV(0.0f, height, 0.0f, (0.0f + offset), 1.0f);
|
||||
}
|
||||
|
||||
t->end();
|
||||
glColorMask(true, true, true, true);
|
||||
}
|
||||
|
||||
t->end();
|
||||
glColorMask(true, true, true, true);
|
||||
// this.mc.renderEngine.resetBoundTexture();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -321,9 +376,11 @@ void TitleScreen::render(int xm, int ym, float a) {
|
|||
int logoX = width / 2 - logoWidth / 2;
|
||||
int logoY = 30;
|
||||
|
||||
// 4jcraft: gradient
|
||||
fillGradient(0, 0, width, height, -2130706433, 16777215);
|
||||
fillGradient(0, 0, width, height, 0, INT_MIN);
|
||||
// 4jcraft: gradient for classic panorama
|
||||
if (minecraft->options->classicPanorama) {
|
||||
fillGradient(0, 0, width, height, -2130706433, 16777215);
|
||||
fillGradient(0, 0, width, height, 0, INT_MIN);
|
||||
}
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D,
|
||||
minecraft->textures->loadTexture(TN_TITLE_MCLOGO));
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ private:
|
|||
void renderSkybox(float a);
|
||||
void rotateAndBlur(float a);
|
||||
int viewportTexture;
|
||||
float panoramaTimer;
|
||||
std::wstring titlePanoramaPaths[6];
|
||||
|
||||
// 4jcraft: taken from UIScene_MainMenu
|
||||
// 4J Added
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@
|
|||
#include "ControlsScreen.h"
|
||||
#include "../../../Minecraft.World/Headers/net.minecraft.locale.h"
|
||||
|
||||
// 4jcraft
|
||||
#define ITEM_COUNT 11
|
||||
|
||||
VideoSettingsScreen::VideoSettingsScreen(Screen* lastScreen, Options* options) {
|
||||
this->title = L"Video Settings"; // 4J - added
|
||||
this->lastScreen = lastScreen;
|
||||
|
|
@ -16,18 +19,20 @@ void VideoSettingsScreen::init() {
|
|||
Language* language = Language::getInstance();
|
||||
this->title = language->getElement(L"options.videoTitle");
|
||||
|
||||
const Options::Option* items[10] = {Options::Option::GRAPHICS,
|
||||
Options::Option::RENDER_DISTANCE,
|
||||
Options::Option::AMBIENT_OCCLUSION,
|
||||
Options::Option::FRAMERATE_LIMIT,
|
||||
Options::Option::ANAGLYPH,
|
||||
Options::Option::VIEW_BOBBING,
|
||||
Options::Option::GUI_SCALE,
|
||||
Options::Option::ADVANCED_OPENGL,
|
||||
Options::Option::GAMMA,
|
||||
Options::Option::FOV};
|
||||
const Options::Option* items[ITEM_COUNT] = {
|
||||
Options::Option::GRAPHICS,
|
||||
Options::Option::RENDER_DISTANCE,
|
||||
Options::Option::AMBIENT_OCCLUSION,
|
||||
Options::Option::FRAMERATE_LIMIT,
|
||||
Options::Option::ANAGLYPH,
|
||||
Options::Option::VIEW_BOBBING,
|
||||
Options::Option::GUI_SCALE,
|
||||
Options::Option::ADVANCED_OPENGL,
|
||||
Options::Option::GAMMA,
|
||||
Options::Option::FOV,
|
||||
Options::Option::CLASSIC_PANORAMA};
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
for (int i = 0; i < ITEM_COUNT; i++) {
|
||||
const Options::Option* item = items[i];
|
||||
int xPos = width / 2 - 155 + (i % 2 * 160);
|
||||
int yPos = height / 6 + 24 * (i / 2);
|
||||
|
|
|
|||
Loading…
Reference in a new issue