mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-16 10:04:28 +02:00
#11 fix black background on first inventory toggle
This commit is contained in:
@@ -368,6 +368,8 @@ struct Inventory {
|
||||
}
|
||||
|
||||
bool toggle(Page curPage = PAGE_INVENTORY, TR::Entity::Type type = TR::Entity::LARA) {
|
||||
titleTimer = 0.0f;
|
||||
|
||||
if (phaseRing == 0.0f || phaseRing == 1.0f) {
|
||||
active = !active;
|
||||
vec3 p;
|
||||
@@ -751,7 +753,7 @@ struct Inventory {
|
||||
return false;
|
||||
}
|
||||
|
||||
void prepareBackground() {
|
||||
Texture* getBackgroundTarget() {
|
||||
if (background[0] && (background[0]->origWidth != INVENTORY_BG_SIZE || background[0]->origHeight != INVENTORY_BG_SIZE)) {
|
||||
delete background[0];
|
||||
background[0] = NULL;
|
||||
@@ -761,6 +763,10 @@ struct Inventory {
|
||||
if (!background[i])
|
||||
background[i] = new Texture(INVENTORY_BG_SIZE, INVENTORY_BG_SIZE, Texture::RGBA, false);
|
||||
|
||||
return background[0];
|
||||
}
|
||||
|
||||
void prepareBackground() {
|
||||
Core::setDepthTest(false);
|
||||
Core::setBlending(bmNone);
|
||||
|
||||
|
@@ -1250,7 +1250,7 @@ struct Level : IGame {
|
||||
}
|
||||
}
|
||||
|
||||
if (Input::state[cInventory] && !level.isTitle()) {
|
||||
if (Input::state[cInventory] && !level.isTitle() && inventory.titleTimer < 1.0f) {
|
||||
if (lara->health <= 0.0f)
|
||||
inventory.toggle(Inventory::PAGE_OPTION, TR::Entity::INV_PASSPORT);
|
||||
else
|
||||
@@ -1936,7 +1936,7 @@ struct Level : IGame {
|
||||
}
|
||||
|
||||
if (copyBg) {
|
||||
Core::defaultTarget = inventory.background[0];
|
||||
Core::defaultTarget = inventory.getBackgroundTarget();
|
||||
bool stereo = Core::settings.detail.stereo;
|
||||
Core::settings.detail.stereo = false;
|
||||
renderGame();
|
||||
|
Reference in New Issue
Block a user