mirror of
https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-04-30 17:43:30 +00:00
forgot to change vertex size for touch circle, also shadow attempt fix again
This commit is contained in:
@@ -382,7 +382,6 @@ void Gui::renderVignette(float br, int w, int h) {
|
|||||||
|
|
||||||
void Gui::renderSlot(int slot, int x, int y, float a) {
|
void Gui::renderSlot(int slot, int x, int y, float a) {
|
||||||
ItemInstance* item = minecraft->player->inventory->getItem(slot);
|
ItemInstance* item = minecraft->player->inventory->getItem(slot);
|
||||||
|
|
||||||
if (!item) {
|
if (!item) {
|
||||||
//LOGW("Warning: item @ Gui::renderSlot is NULL\n");
|
//LOGW("Warning: item @ Gui::renderSlot is NULL\n");
|
||||||
return;
|
return;
|
||||||
@@ -596,17 +595,15 @@ void Gui::renderProgressIndicator( const bool isTouchInterface, const int screen
|
|||||||
ItemInstance* currentItem = minecraft->player->inventory->getSelected();
|
ItemInstance* currentItem = minecraft->player->inventory->getSelected();
|
||||||
bool bowEquipped = currentItem != NULL ? currentItem->getItem() == Item::bow : false;
|
bool bowEquipped = currentItem != NULL ? currentItem->getItem() == Item::bow : false;
|
||||||
bool itemInUse = currentItem != NULL ? currentItem->getItem() == minecraft->player->getUseItem()->getItem() : false;
|
bool itemInUse = currentItem != NULL ? currentItem->getItem() == minecraft->player->getUseItem()->getItem() : false;
|
||||||
//if ((!isTouchInterface || minecraft->options.getBooleanValue(OPTIONS_IS_JOY_TOUCH_AREA)
|
|
||||||
// || (bowEquipped && itemInUse)) && !minecraft->options.getBooleanValue(OPTIONS_HIDEGUI))
|
|
||||||
if ((!isTouchInterface || minecraft->options.getBooleanValue(OPTIONS_IS_JOY_TOUCH_AREA)
|
if ((!isTouchInterface || minecraft->options.getBooleanValue(OPTIONS_IS_JOY_TOUCH_AREA)
|
||||||
|| (bowEquipped && itemInUse)) && !minecraft->options.getBooleanValue(OPTIONS_HIDEGUI))
|
|| (bowEquipped && itemInUse)) && !minecraft->options.getBooleanValue(OPTIONS_HIDEGUI))
|
||||||
{
|
{
|
||||||
minecraft->textures->loadAndBindTexture("gui/icons.png");
|
minecraft->textures->loadAndBindTexture("gui/icons.png");
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
glBlendFunc2(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR);
|
glBlendFunc2(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR);
|
||||||
blit(screenWidth/2 - 8, screenHeight/2 - 8, 0, 0, 16, 16);
|
blit(screenWidth/2 - 8, screenHeight/2 - 8, 0, 0, 16, 16);
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
} else if((!bowEquipped) || (!minecraft->options.getBooleanValue(OPTIONS_IS_JOY_TOUCH_AREA))) {
|
} else if(!bowEquipped) {
|
||||||
const float tprogress = minecraft->gameMode->destroyProgress;
|
const float tprogress = minecraft->gameMode->destroyProgress;
|
||||||
const float alpha = Mth::clamp(minecraft->inputHolder->alpha, 0.0f, 1.0f);
|
const float alpha = Mth::clamp(minecraft->inputHolder->alpha, 0.0f, 1.0f);
|
||||||
//LOGI("alpha: %f\n", alpha);
|
//LOGI("alpha: %f\n", alpha);
|
||||||
@@ -624,7 +621,7 @@ void Gui::renderProgressIndicator( const bool isTouchInterface, const int screen
|
|||||||
const float x = InvGuiScale * minecraft->inputHolder->mousex;
|
const float x = InvGuiScale * minecraft->inputHolder->mousex;
|
||||||
const float y = InvGuiScale * minecraft->inputHolder->mousey;
|
const float y = InvGuiScale * minecraft->inputHolder->mousey;
|
||||||
glTranslatef2(x, y, 0);
|
glTranslatef2(x, y, 0);
|
||||||
drawArrayVT(rcFeedbackOuter.vboId, rcFeedbackOuter.vertexCount, 24);
|
drawArrayVT(rcFeedbackOuter.vboId, rcFeedbackOuter.vertexCount, 36);
|
||||||
glTranslatef2(-x, -y, 0);
|
glTranslatef2(-x, -y, 0);
|
||||||
|
|
||||||
glEnable2(GL_TEXTURE_2D);
|
glEnable2(GL_TEXTURE_2D);
|
||||||
@@ -645,12 +642,12 @@ void Gui::renderProgressIndicator( const bool isTouchInterface, const int screen
|
|||||||
const float y = InvGuiScale * minecraft->inputHolder->mousey;
|
const float y = InvGuiScale * minecraft->inputHolder->mousey;
|
||||||
glPushMatrix2();
|
glPushMatrix2();
|
||||||
glTranslatef2(x, y, 0);
|
glTranslatef2(x, y, 0);
|
||||||
drawArrayVT(rcFeedbackOuter.vboId, rcFeedbackOuter.vertexCount, 24);
|
drawArrayVT(rcFeedbackOuter.vboId, rcFeedbackOuter.vertexCount, 36);
|
||||||
glScalef2(0.5f + progress, 0.5f + progress, 1);
|
glScalef2(0.5f + progress, 0.5f + progress, 1);
|
||||||
//glDisable2(GL_CULL_FACE);
|
//glDisable2(GL_CULL_FACE);
|
||||||
glColor4f2(1, 1, 1, 1);
|
glColor4f2(1, 1, 1, 1);
|
||||||
glBlendFunc2(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR);
|
glBlendFunc2(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR);
|
||||||
drawArrayVT(rcFeedbackInner.vboId, rcFeedbackInner.vertexCount, 24, GL_TRIANGLE_FAN);
|
drawArrayVT(rcFeedbackInner.vboId, rcFeedbackInner.vertexCount, 36, GL_TRIANGLE_FAN);
|
||||||
glPopMatrix2();
|
glPopMatrix2();
|
||||||
|
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ void EntityRenderer::postRender(Entity* entity, float x, float y, float z, float
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
void EntityRenderer::renderFlame(Entity* e, float x, float y, float z, float a) {
|
void EntityRenderer::renderFlame(Entity* e, float x, float y, float z, float a) {
|
||||||
glDisable(GL_LIGHTING);
|
glDisable(GL_LIGHTING);
|
||||||
int tex = ((Tile*)Tile::fire)->tex;
|
int tex = ((Tile*)Tile::fire)->tex;
|
||||||
|
|
||||||
int xt = (tex & 0xf) << 4;
|
int xt = (tex & 0xf) << 4;
|
||||||
@@ -187,7 +187,7 @@ void EntityRenderer::renderShadow(Entity* e, float x, float y, float z, float po
|
|||||||
//Textures* textures = entityRenderDispatcher->textures;
|
//Textures* textures = entityRenderDispatcher->textures;
|
||||||
//textures->bind(textures->loadTexture("%clamp%/environment/shadow.png"));
|
//textures->bind(textures->loadTexture("%clamp%/environment/shadow.png"));
|
||||||
Textures* textures = entityRenderDispatcher->textures;
|
Textures* textures = entityRenderDispatcher->textures;
|
||||||
textures->loadAndBindTexture(("/misc/shadow.png"));
|
|
||||||
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||||
@@ -222,6 +222,7 @@ void EntityRenderer::renderShadow(Entity* e, float x, float y, float z, float po
|
|||||||
renderTileShadow(Tile::tiles[t], x, y + e->getShadowHeightOffs(), z, xt, yt, zt, pow, r, xo, yo + e->getShadowHeightOffs(), zo);
|
renderTileShadow(Tile::tiles[t], x, y + e->getShadowHeightOffs(), z, xt, yt, zt, pow, r, xo, yo + e->getShadowHeightOffs(), zo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
textures->loadAndBindTexture(("/misc/shadow.png"));
|
||||||
tt.draw();
|
tt.draw();
|
||||||
|
|
||||||
glColor4f2(1, 1, 1, 1);
|
glColor4f2(1, 1, 1, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user