diff --git a/assets/BUILD.gn b/assets/demo/BUILD.gn similarity index 92% rename from assets/BUILD.gn rename to assets/demo/BUILD.gn index 9fccc17..b4e0115 100644 --- a/assets/BUILD.gn +++ b/assets/demo/BUILD.gn @@ -1,4 +1,4 @@ -copy("assets") { +copy("demo") { sources = [ "bead.png", "boss_explosion.mp3", @@ -40,5 +40,5 @@ copy("assets") { "woom_logo_start_frames_02-03.png", ] - outputs = ["$root_out_dir/assets/{{source_file_part}}"] + outputs = ["$root_out_dir/assets/demo/{{source_file_part}}"] } diff --git a/assets/Boss_ok.png b/assets/demo/Boss_ok.png similarity index 100% rename from assets/Boss_ok.png rename to assets/demo/Boss_ok.png diff --git a/assets/Boss_ok_lvl2.png b/assets/demo/Boss_ok_lvl2.png similarity index 100% rename from assets/Boss_ok_lvl2.png rename to assets/demo/Boss_ok_lvl2.png diff --git a/assets/Boss_ok_lvl3.png b/assets/demo/Boss_ok_lvl3.png similarity index 100% rename from assets/Boss_ok_lvl3.png rename to assets/demo/Boss_ok_lvl3.png diff --git a/assets/Game_2_Boss.mp3 b/assets/demo/Game_2_Boss.mp3 similarity index 100% rename from assets/Game_2_Boss.mp3 rename to assets/demo/Game_2_Boss.mp3 diff --git a/assets/Game_2_Main.mp3 b/assets/demo/Game_2_Main.mp3 similarity index 100% rename from assets/Game_2_Main.mp3 rename to assets/demo/Game_2_Main.mp3 diff --git a/assets/PixelCaps!.ttf b/assets/demo/PixelCaps!.ttf similarity index 100% rename from assets/PixelCaps!.ttf rename to assets/demo/PixelCaps!.ttf diff --git a/assets/bead.png b/assets/demo/bead.png similarity index 100% rename from assets/bead.png rename to assets/demo/bead.png diff --git a/assets/boss_explosion.mp3 b/assets/demo/boss_explosion.mp3 similarity index 100% rename from assets/boss_explosion.mp3 rename to assets/demo/boss_explosion.mp3 diff --git a/assets/boss_intro.mp3 b/assets/demo/boss_intro.mp3 similarity index 100% rename from assets/boss_intro.mp3 rename to assets/demo/boss_intro.mp3 diff --git a/assets/chromatic_aberration.glsl_fragment b/assets/demo/chromatic_aberration.glsl_fragment similarity index 100% rename from assets/chromatic_aberration.glsl_fragment rename to assets/demo/chromatic_aberration.glsl_fragment diff --git a/assets/chromatic_aberration.glsl_vertex b/assets/demo/chromatic_aberration.glsl_vertex similarity index 100% rename from assets/chromatic_aberration.glsl_vertex rename to assets/demo/chromatic_aberration.glsl_vertex diff --git a/assets/enemy_anims_01_frames_ok.png b/assets/demo/enemy_anims_01_frames_ok.png similarity index 100% rename from assets/enemy_anims_01_frames_ok.png rename to assets/demo/enemy_anims_01_frames_ok.png diff --git a/assets/enemy_anims_02_frames_ok.png b/assets/demo/enemy_anims_02_frames_ok.png similarity index 100% rename from assets/enemy_anims_02_frames_ok.png rename to assets/demo/enemy_anims_02_frames_ok.png diff --git a/assets/enemy_anims_blast_ok.png b/assets/demo/enemy_anims_blast_ok.png similarity index 100% rename from assets/enemy_anims_blast_ok.png rename to assets/demo/enemy_anims_blast_ok.png diff --git a/assets/enemy_anims_flare_ok.png b/assets/demo/enemy_anims_flare_ok.png similarity index 100% rename from assets/enemy_anims_flare_ok.png rename to assets/demo/enemy_anims_flare_ok.png diff --git a/assets/enemy_ray_ok.png b/assets/demo/enemy_ray_ok.png similarity index 100% rename from assets/enemy_ray_ok.png rename to assets/demo/enemy_ray_ok.png diff --git a/assets/enemy_target_single_ok.png b/assets/demo/enemy_target_single_ok.png similarity index 100% rename from assets/enemy_target_single_ok.png rename to assets/demo/enemy_target_single_ok.png diff --git a/assets/explosion.mp3 b/assets/demo/explosion.mp3 similarity index 100% rename from assets/explosion.mp3 rename to assets/demo/explosion.mp3 diff --git a/assets/hit.mp3 b/assets/demo/hit.mp3 similarity index 100% rename from assets/hit.mp3 rename to assets/demo/hit.mp3 diff --git a/assets/laser.mp3 b/assets/demo/laser.mp3 similarity index 100% rename from assets/laser.mp3 rename to assets/demo/laser.mp3 diff --git a/assets/menu_click.mp3 b/assets/demo/menu_click.mp3 similarity index 100% rename from assets/menu_click.mp3 rename to assets/demo/menu_click.mp3 diff --git a/assets/menu_icons.png b/assets/demo/menu_icons.png similarity index 100% rename from assets/menu_icons.png rename to assets/demo/menu_icons.png diff --git a/assets/no_nuke.mp3 b/assets/demo/no_nuke.mp3 similarity index 100% rename from assets/no_nuke.mp3 rename to assets/demo/no_nuke.mp3 diff --git a/assets/nuke.mp3 b/assets/demo/nuke.mp3 similarity index 100% rename from assets/nuke.mp3 rename to assets/demo/nuke.mp3 diff --git a/assets/nuke_frames.png b/assets/demo/nuke_frames.png similarity index 100% rename from assets/nuke_frames.png rename to assets/demo/nuke_frames.png diff --git a/assets/nuke_pack_OK.png b/assets/demo/nuke_pack_OK.png similarity index 100% rename from assets/nuke_pack_OK.png rename to assets/demo/nuke_pack_OK.png diff --git a/assets/powerup-pick.mp3 b/assets/demo/powerup-pick.mp3 similarity index 100% rename from assets/powerup-pick.mp3 rename to assets/demo/powerup-pick.mp3 diff --git a/assets/powerup-spawn.mp3 b/assets/demo/powerup-spawn.mp3 similarity index 100% rename from assets/powerup-spawn.mp3 rename to assets/demo/powerup-spawn.mp3 diff --git a/assets/renderer_logo.png b/assets/demo/renderer_logo.png similarity index 100% rename from assets/renderer_logo.png rename to assets/demo/renderer_logo.png diff --git a/assets/shield.mp3 b/assets/demo/shield.mp3 similarity index 100% rename from assets/shield.mp3 rename to assets/demo/shield.mp3 diff --git a/assets/sky.glsl_fragment b/assets/demo/sky.glsl_fragment similarity index 100% rename from assets/sky.glsl_fragment rename to assets/demo/sky.glsl_fragment diff --git a/assets/sky.glsl_vertex b/assets/demo/sky.glsl_vertex similarity index 100% rename from assets/sky.glsl_vertex rename to assets/demo/sky.glsl_vertex diff --git a/assets/sky_without_nebula.glsl_fragment b/assets/demo/sky_without_nebula.glsl_fragment similarity index 100% rename from assets/sky_without_nebula.glsl_fragment rename to assets/demo/sky_without_nebula.glsl_fragment diff --git a/assets/sky_without_nebula.glsl_vertex b/assets/demo/sky_without_nebula.glsl_vertex similarity index 100% rename from assets/sky_without_nebula.glsl_vertex rename to assets/demo/sky_without_nebula.glsl_vertex diff --git a/assets/stealth.mp3 b/assets/demo/stealth.mp3 similarity index 100% rename from assets/stealth.mp3 rename to assets/demo/stealth.mp3 diff --git a/assets/woom_enemy_shield.png b/assets/demo/woom_enemy_shield.png similarity index 100% rename from assets/woom_enemy_shield.png rename to assets/demo/woom_enemy_shield.png diff --git a/assets/woom_logo_start_frames_01.png b/assets/demo/woom_logo_start_frames_01.png similarity index 100% rename from assets/woom_logo_start_frames_01.png rename to assets/demo/woom_logo_start_frames_01.png diff --git a/assets/woom_logo_start_frames_02-03.png b/assets/demo/woom_logo_start_frames_02-03.png similarity index 100% rename from assets/woom_logo_start_frames_02-03.png rename to assets/demo/woom_logo_start_frames_02-03.png diff --git a/build/android/app/build.gradle b/build/android/app/build.gradle index 384cbe7..93e5b6d 100644 --- a/build/android/app/build.gradle +++ b/build/android/app/build.gradle @@ -156,7 +156,7 @@ utils.addGameTask('runNinjaFor') { String taskName, String buildType, String arc dependsOn "runGnFor${arch}${buildType}" executable rootProject.ext.ninja - args '-C', "${utils.getOutDir(buildType)}/${arch}", utils.getGnTargetFor(game) + args '-C', "${utils.getOutDir(buildType)}/${arch}", "src/${utils.getGnTargetFor(game)}" // Always run ninja and let it figure out what needs to be compiled. outputs.upToDateWhen { false } diff --git a/src/demo/BUILD.gn b/src/demo/BUILD.gn index 9933120..d8a7300 100644 --- a/src/demo/BUILD.gn +++ b/src/demo/BUILD.gn @@ -19,7 +19,7 @@ game("demo") { "sky_quad.h", ] deps = [ - "//assets", + "//assets/demo", "//src/base", "//src/engine", ] diff --git a/src/demo/demo.cc b/src/demo/demo.cc index 4dc51e7..ce3b424 100644 --- a/src/demo/demo.cc +++ b/src/demo/demo.cc @@ -45,15 +45,15 @@ Demo::~Demo() { } bool Demo::PreInitialize() { - if (!font_.Load("PixelCaps!.ttf")) + if (!font_.Load("demo/PixelCaps!.ttf")) return false; Engine::Get().SetShaderSource("sky_without_nebula", - "sky_without_nebula.glsl"); - Engine::Get().SetShaderSource("sky", "sky.glsl"); + "demo/sky_without_nebula.glsl"); + Engine::Get().SetShaderSource("sky", "demo/sky.glsl"); - Engine::Get().AsyncLoadSound("music", "Game_2_Main.mp3", true); - Engine::Get().AsyncLoadSound("boss_music", "Game_2_Boss.mp3", true); + Engine::Get().AsyncLoadSound("music", "demo/Game_2_Main.mp3", true); + Engine::Get().AsyncLoadSound("boss_music", "demo/Game_2_Boss.mp3", true); if (!enemy_.PreInitialize()) { LOG(0) << "Failed to create the enemy."; diff --git a/src/demo/enemy.cc b/src/demo/enemy.cc index ed36ece..0461310 100644 --- a/src/demo/enemy.cc +++ b/src/demo/enemy.cc @@ -78,17 +78,20 @@ Enemy::Enemy() = default; Enemy::~Enemy() = default; bool Enemy::PreInitialize() { - Engine::Get().SetImageSource("skull_tex", "enemy_anims_01_frames_ok.png", + Engine::Get().SetImageSource("skull_tex", "demo/enemy_anims_01_frames_ok.png", true); - Engine::Get().SetImageSource("bug_tex", "enemy_anims_02_frames_ok.png", true); - Engine::Get().SetImageSource("boss_tex1", "Boss_ok.png", true); - Engine::Get().SetImageSource("boss_tex2", "Boss_ok_lvl2.png", true); - Engine::Get().SetImageSource("boss_tex3", "Boss_ok_lvl3.png", true); - Engine::Get().SetImageSource("target_tex", "enemy_target_single_ok.png", + Engine::Get().SetImageSource("bug_tex", "demo/enemy_anims_02_frames_ok.png", true); - Engine::Get().SetImageSource("blast_tex", "enemy_anims_blast_ok.png", true); - Engine::Get().SetImageSource("shield_tex", "woom_enemy_shield.png", true); - Engine::Get().SetImageSource("crate_tex", "nuke_pack_OK.png", true); + Engine::Get().SetImageSource("boss_tex1", "demo/Boss_ok.png", true); + Engine::Get().SetImageSource("boss_tex2", "demo/Boss_ok_lvl2.png", true); + Engine::Get().SetImageSource("boss_tex3", "demo/Boss_ok_lvl3.png", true); + Engine::Get().SetImageSource("target_tex", "demo/enemy_target_single_ok.png", + true); + Engine::Get().SetImageSource("blast_tex", "demo/enemy_anims_blast_ok.png", + true); + Engine::Get().SetImageSource("shield_tex", "demo/woom_enemy_shield.png", + true); + Engine::Get().SetImageSource("crate_tex", "demo/nuke_pack_OK.png", true); for (int i = 0; i < kEnemyType_Max; ++i) { if (i == kEnemyType_PowerUp) @@ -99,16 +102,16 @@ bool Enemy::PreInitialize() { } Engine::Get().SetShaderSource("chromatic_aberration", - "chromatic_aberration.glsl"); + "demo/chromatic_aberration.glsl"); - Engine::Get().AsyncLoadSound("boss_intro", "boss_intro.mp3"); - Engine::Get().AsyncLoadSound("boss_explosion", "boss_explosion.mp3"); - Engine::Get().AsyncLoadSound("explosion", "explosion.mp3"); - Engine::Get().AsyncLoadSound("stealth", "stealth.mp3"); - Engine::Get().AsyncLoadSound("shield", "shield.mp3"); - Engine::Get().AsyncLoadSound("hit", "hit.mp3"); - Engine::Get().AsyncLoadSound("powerup-spawn", "powerup-spawn.mp3"); - Engine::Get().AsyncLoadSound("powerup-pick", "powerup-pick.mp3"); + Engine::Get().AsyncLoadSound("boss_intro", "demo/boss_intro.mp3"); + Engine::Get().AsyncLoadSound("boss_explosion", "demo/boss_explosion.mp3"); + Engine::Get().AsyncLoadSound("explosion", "demo/explosion.mp3"); + Engine::Get().AsyncLoadSound("stealth", "demo/stealth.mp3"); + Engine::Get().AsyncLoadSound("shield", "demo/shield.mp3"); + Engine::Get().AsyncLoadSound("hit", "demo/hit.mp3"); + Engine::Get().AsyncLoadSound("powerup-spawn", "demo/powerup-spawn.mp3"); + Engine::Get().AsyncLoadSound("powerup-pick", "demo/powerup-pick.mp3"); return true; } diff --git a/src/demo/menu.cc b/src/demo/menu.cc index 65bb522..54d2f49 100644 --- a/src/demo/menu.cc +++ b/src/demo/menu.cc @@ -55,7 +55,7 @@ Menu::~Menu() = default; bool Menu::PreInitialize() { click_sound_ = std::make_shared(); - if (!click_sound_->Load("menu_click.mp3", false)) + if (!click_sound_->Load("demo/menu_click.mp3", false)) return false; Demo* game = static_cast(Engine::Get().GetGame()); @@ -72,12 +72,12 @@ bool Menu::PreInitialize() { Engine::Get().SetImageSource("menu_tex", std::bind(&Menu::CreateMenuImage, this), true); - Engine::Get().SetImageSource("logo_tex0", "woom_logo_start_frames_01.png", - true); - Engine::Get().SetImageSource("logo_tex1", "woom_logo_start_frames_02-03.png", - true); - Engine::Get().SetImageSource("buttons_tex", "menu_icons.png", true); - Engine::Get().SetImageSource("renderer_logo", "renderer_logo.png", true); + Engine::Get().SetImageSource("logo_tex0", + "demo/woom_logo_start_frames_01.png", true); + Engine::Get().SetImageSource("logo_tex1", + "demo/woom_logo_start_frames_02-03.png", true); + Engine::Get().SetImageSource("buttons_tex", "demo/menu_icons.png", true); + Engine::Get().SetImageSource("renderer_logo", "demo/renderer_logo.png", true); Engine::Get().SetImageSource( "version_tex", diff --git a/src/demo/player.cc b/src/demo/player.cc index f259836..e05160d 100644 --- a/src/demo/player.cc +++ b/src/demo/player.cc @@ -30,14 +30,15 @@ Player::Player() = default; Player::~Player() = default; bool Player::PreInitialize() { - Engine::Get().SetImageSource("weapon_tex", "enemy_anims_flare_ok.png", true); - Engine::Get().SetImageSource("beam_tex", "enemy_ray_ok.png", true); - Engine::Get().SetImageSource("nuke_symbol_tex", "nuke_frames.png", true); - Engine::Get().SetImageSource("health_bead", "bead.png", true); + Engine::Get().SetImageSource("weapon_tex", "demo/enemy_anims_flare_ok.png", + true); + Engine::Get().SetImageSource("beam_tex", "demo/enemy_ray_ok.png", true); + Engine::Get().SetImageSource("nuke_symbol_tex", "demo/nuke_frames.png", true); + Engine::Get().SetImageSource("health_bead", "demo/bead.png", true); - Engine::Get().AsyncLoadSound("laser", "laser.mp3"); - Engine::Get().AsyncLoadSound("nuke", "nuke.mp3"); - Engine::Get().AsyncLoadSound("no_nuke", "no_nuke.mp3"); + Engine::Get().AsyncLoadSound("laser", "demo/laser.mp3"); + Engine::Get().AsyncLoadSound("nuke", "demo/nuke.mp3"); + Engine::Get().AsyncLoadSound("no_nuke", "demo/no_nuke.mp3"); return true; }