Skip to content

Commit

Permalink
alcove exit sound
Browse files Browse the repository at this point in the history
  • Loading branch information
otse committed Oct 28, 2022
1 parent f32fb37 commit 8677ca8
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 10 deletions.
Binary file modified apps/dark/bin/dark.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion apps/dark/bin/imgui.ini
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Collapsed=0

[Window][Models]
Pos=1350,0
Size=450,1306
Size=450,1323
Collapsed=1

[Window][Interiors]
Expand Down
3 changes: 3 additions & 0 deletions apps/dark/src/dark/dark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ bool holding_key(const char *id)

namespace dark
{
bool usePostProcessing = true;

std::map<const char *, int> keys;

void darkassert(bool e)
Expand Down Expand Up @@ -71,6 +73,7 @@ namespace dark
gworldspace = new worldspace(rg);
reference_factory<my_reference> factory;
gworldspace->build_exteriors(factory);
usePostProcessing = false;
//if (place)
// place_at_level_start();
}
Expand Down
2 changes: 2 additions & 0 deletions apps/dark/src/dark/dark.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ namespace dark

extern Draugr *draugrAlcove;
extern Monster *meanSkelly;

extern bool usePostProcessing;
}

void hero_menu();
Expand Down
12 changes: 6 additions & 6 deletions apps/dark/src/dark/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ GLFWwindow *window = nullptr;
static bool cursorShowing = false;
static bool hideOverlays = true;
static bool f10 = false;
static bool useFbo = true;
static bool wireframe = false;

void setupImgui();
Expand Down Expand Up @@ -205,7 +204,8 @@ static void toggle_debug()

static void toggle_fbo()
{
useFbo = !useFbo;
using namespace dark;
usePostProcessing = !usePostProcessing;
}

static void handle_esc()
Expand Down Expand Up @@ -419,7 +419,7 @@ void window_while_test()
glViewport(0, 0, width, height);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

if (useFbo)
if (dark::usePostProcessing)
renderTargetDef->Bind();
else
glBindFramebuffer(GL_FRAMEBUFFER, 0);
Expand Down Expand Up @@ -471,7 +471,7 @@ void window_while_test()

Material::Unuse(nullptr, nullptr);

if (useFbo)
if (dark::usePostProcessing)
{
glBindFramebuffer(GL_FRAMEBUFFER, 0);
quad.Draw(renderTargetDef);
Expand Down Expand Up @@ -545,7 +545,7 @@ void window_while()
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glViewport(0, 0, width, height);

if (useFbo)
if (usePostProcessing)
{
renderTargetDef->Bind();
}
Expand Down Expand Up @@ -605,7 +605,7 @@ void window_while()

glBindFramebuffer(GL_FRAMEBUFFER, 0);

if (useFbo)
if (usePostProcessing)
{
quad.Draw(renderTargetDef);
}
Expand Down
2 changes: 2 additions & 0 deletions miryks/include/miryks/actors.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <miryks/miryks.hpp>
#include <miryks/sound.h>
#include <miryks/collision_forwards.h>
#include <miryks/model.h>

Expand All @@ -13,6 +14,7 @@ namespace miryks
record race;
reference *start_marker;
skeleton *skel;
sound *alcoveexit;
orientation orientation;
SkinnedMesh *helmet2;
ModelSkinned *modelSkinned;
Expand Down
4 changes: 3 additions & 1 deletion miryks/src/monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ namespace miryks
wake = false;
sleeping = 0;
transition = 0;
alcoveexit = new sound("sound\\fx\\npc\\draugr\\alcoveexit\\a\\npc_draugr_alcoveexit_a_02.wav");
}

void Draugr::SetupCollision()
Expand Down Expand Up @@ -132,7 +133,6 @@ namespace miryks
idle = new animation(keyf);
idle->skel = skel;
alcove_wake->next = idle;

}

void Draugr::Step()
Expand Down Expand Up @@ -173,6 +173,8 @@ namespace miryks
}
else if (skel->anim == alcove_wake)
{
if (alcove_wake->time >= 1.5 && !alcoveexit->is_playing())
alcoveexit->play();
transition += delta / alcove_wake->keyf->controllerSequence->C->stop_time;
if (transition > 1)
transition = 1;
Expand Down
6 changes: 4 additions & 2 deletions miryks/src/sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ namespace miryks
alListenerfv(AL_ORIENTATION, listenerOri);*/

// SF_INFO sfinfo;
sound aware("sound\\fx\\npc\\draugr\\aware\\npc_draugr_aware_01.wav");
aware.play();
//sound aware("sound\\fx\\npc\\draugr\\aware\\npc_draugr_aware_01.wav");
//aware.play();
sound menu("sound\\fx\\ui\\ui_menu_ok.wav");
menu.play();
};

wav_file load_wav_file(RES res)
Expand Down

0 comments on commit 8677ca8

Please sign in to comment.