irx, nullptr, threading patch

This commit is contained in:
h4570
2022-08-20 16:38:44 +02:00
parent 57767eee72
commit d251df8704
35 changed files with 306 additions and 115 deletions
+3 -3
View File
@@ -30,9 +30,9 @@ Enemy::Enemy(Engine* engine, const EnemyInfo& t_info) {
info.bodyTexture->addLink(bodyMaterial->id);
info.clothTexture->addLink(clothMaterial->id);
float r = Math::randomf(64.0F, 128.0F);
float g = Math::randomf(64.0F, 128.0F);
float b = Math::randomf(64.0F, 128.0F);
float r = Math::randomf(75.0F, 128.0F);
float g = Math::randomf(75.0F, 128.0F);
float b = Math::randomf(75.0F, 128.0F);
bodyMaterial->ambient.set(r, g, b);
clothMaterial->ambient.set(r, g, b);
+2 -1
View File
@@ -10,6 +10,7 @@
#include "states/game/enemy/enemy_manager.hpp"
#include <functional>
#include "game_settings.hpp"
using Tyra::FileUtils;
using Tyra::Math;
@@ -46,7 +47,7 @@ EnemyManager::EnemyManager(Engine* engine, const Heightmap& heightmap) {
auto* death = engine->audio.adpcm.load(
FileUtils::fromCwd("game/models/zombie/death.adpcm"));
const int enemyCount = 10;
const int enemyCount = IS_REAL_PS2 ? 8 : 12;
for (int i = 0; i < enemyCount; i++) {
EnemyInfo info;
info.adpcmChannel = 9 + i;
+3
View File
@@ -9,6 +9,7 @@
*/
#include "states/game/game_state.hpp"
#include "game_settings.hpp"
using std::make_unique;
using Tyra::FileUtils;
@@ -44,6 +45,8 @@ void GameState::onStart() {
engine->audio.song.setVolume(85);
if (IS_REAL_PS2) engine->renderer.setFrameLimit(false);
initialized = true;
}
@@ -155,6 +155,7 @@ void IntroPressKeyState::update() {
}
updateMap();
Threading::switchThread();
for (u8 i = 0; i < mapRows; i++)
@@ -41,6 +41,8 @@ void IntroPs2DevState::onStart() {
settings.getHeight() / 2 - sprite->size.y / 2);
sprite->color.a = 0;
Threading::switchThread();
texture = engine->renderer.core.texture.repository.add(
FileUtils::fromCwd("intro/ps2dev.png"));
texture->addLink(sprite->id);
@@ -64,6 +64,8 @@ void IntroTyraState::onStart() {
FileUtils::fromCwd("intro/tyra_bg.png"));
bgTexture->addLink(bgSprite->id);
Threading::switchThread();
bg2Texture = engine->renderer.core.texture.repository.add(
FileUtils::fromCwd("intro/tyra_bg2.png"));
bg2Texture->addLink(bg2Sprite->id);
@@ -146,7 +148,6 @@ void IntroTyraState::update() {
engine->renderer.renderer2D.render(bg2Sprite);
engine->renderer.renderer2D.render(tyraSprite);
Threading::switchThread();
renderFillers();
engine->renderer.endFrame();