diff options
-rw-r--r-- | osirion.kdevelop.pcs | bin | 779161 -> 797672 bytes | |||
-rw-r--r-- | osirion.kdevses | 29 | ||||
-rw-r--r-- | src/audio/audio.cc | 7 | ||||
-rw-r--r-- | src/audio/audio.h | 2 | ||||
-rw-r--r-- | src/client/view.cc | 9 | ||||
-rw-r--r-- | src/render/Makefile.am | 7 | ||||
-rw-r--r-- | src/render/draw.cc | 4 | ||||
-rw-r--r-- | src/render/render.cc | 5 |
8 files changed, 37 insertions, 26 deletions
diff --git a/osirion.kdevelop.pcs b/osirion.kdevelop.pcs Binary files differindex fd56608..0f1cf3e 100644 --- a/osirion.kdevelop.pcs +++ b/osirion.kdevelop.pcs diff --git a/osirion.kdevses b/osirion.kdevses index c959ca4..2d80ddf 100644 --- a/osirion.kdevses +++ b/osirion.kdevses @@ -1,25 +1,28 @@ <?xml version = '1.0' encoding = 'UTF-8'?> <!DOCTYPE KDevPrjSession> <KDevPrjSession> - <DocsAndViews NumberOfDocuments="6" > - <Doc0 NumberOfViews="1" URL="file:///home/ingar/projects/osirion/osirion-work/src/render/draw.cc" > - <View0 Encoding="" Type="Source" /> + <DocsAndViews NumberOfDocuments="7" > + <Doc0 NumberOfViews="1" URL="file:///home/ingar/projects/osirion/osirion-work/src/game/game.cc" > + <View0 Encoding="" line="141" Type="Source" /> </Doc0> - <Doc1 NumberOfViews="1" URL="file:///home/ingar/projects/osirion/osirion-work/src/client/view.cc" > - <View0 Encoding="" Type="Source" /> + <Doc1 NumberOfViews="1" URL="file:///home/ingar/projects/osirion/osirion-work/src/render/draw.cc" > + <View0 Encoding="" line="680" Type="Source" /> </Doc1> - <Doc2 NumberOfViews="1" URL="file:///home/ingar/projects/osirion/osirion-work/src/client/radar.cc" > - <View0 Encoding="" Type="Source" /> + <Doc2 NumberOfViews="1" URL="file:///home/ingar/projects/osirion/osirion-work/src/client/view.cc" > + <View0 Encoding="" line="302" Type="Source" /> </Doc2> - <Doc3 NumberOfViews="1" URL="file:///home/ingar/projects/osirion/osirion-work/src/client/input.cc" > - <View0 Encoding="" Type="Source" /> + <Doc3 NumberOfViews="1" URL="file:///home/ingar/projects/osirion/osirion-work/src/audio/audio.h" > + <View0 Encoding="" line="44" Type="Source" /> </Doc3> - <Doc4 NumberOfViews="1" URL="file:///home/ingar/projects/osirion/osirion-work/src/client/keyboard.cc" > - <View0 Encoding="" line="147" Type="Source" /> + <Doc4 NumberOfViews="1" URL="file:///home/ingar/projects/osirion/osirion-work/src/audio/audio.cc" > + <View0 Encoding="" line="128" Type="Source" /> </Doc4> - <Doc5 NumberOfViews="1" URL="file:///home/ingar/projects/osirion/osirion-work/src/game/game.cc" > - <View0 Encoding="" line="81" Type="Source" /> + <Doc5 NumberOfViews="1" URL="file:///home/ingar/projects/osirion/osirion-work/src/audio/sources.cc" > + <View0 Encoding="" line="75" Type="Source" /> </Doc5> + <Doc6 NumberOfViews="1" URL="file:///home/ingar/projects/osirion/osirion-work/src/core/clientstate.cc" > + <View0 Encoding="" line="45" Type="Source" /> + </Doc6> </DocsAndViews> <pluginList> <kdevdebugger> diff --git a/src/audio/audio.cc b/src/audio/audio.cc index ff0918d..20f6b1d 100644 --- a/src/audio/audio.cc +++ b/src/audio/audio.cc @@ -116,20 +116,17 @@ void loop( size_t source_index, const char *name, float pitch, float gain) alSourcePlay(source); } -void update_listener(math::Vector3f const &location, math::Axis const &axis, float speed) +void update_listener(math::Vector3f const &location, math::Axis const &axis, math::Vector3f const & velocity) { alListenerfv(AL_POSITION, location.ptr()); - math::Vector3f velocity(axis.forward()); - velocity = velocity * speed; - //alListenerfv(AL_VELOCITY, velocity.ptr()); - ALfloat orientation[6]; for (size_t i =0; i <3; i++) { orientation[i] = axis.forward()[i]; orientation[i+3] = axis.up()[i]; } alListenerfv(AL_ORIENTATION, orientation); + //alListenerfv(AL_VELOCITY, velocity.ptr()); } } diff --git a/src/audio/audio.h b/src/audio/audio.h index 629ae88..a3d4010 100644 --- a/src/audio/audio.h +++ b/src/audio/audio.h @@ -42,7 +42,7 @@ void loop( size_t source_index, const char *name, float pitch=1.0f, float gain=1 void update_source(size_t source_index, math::Vector3f const & location, math::Vector3f const & velocity, float pitch=1.0f, float gain=1.0f); /// update listener parameters -void update_listener(math::Vector3f const &location, math::Axis const &axis, float speed); +void update_listener(math::Vector3f const &location, math::Axis const &axis, math::Vector3f const & velocity); } #endif // __INCLUDED_AUDIO_AUDIO_H__ diff --git a/src/client/view.cc b/src/client/view.cc index 7038a47..56c692e 100644 --- a/src/client/view.cc +++ b/src/client/view.cc @@ -61,7 +61,7 @@ void init() cl_crosshaircolor = core::Cvar::get("cl_crosshaircolor", "1 1 1", core::Cvar::Archive); cl_crosshaircolor->set_info("[r g b] crosshairs color"); - snd_engines = core::Cvar::get("snd_engines", "0", core::Cvar::Archive); + snd_engines = core::Cvar::get("snd_engines", "1", core::Cvar::Archive); snd_engines->set_info("[bool] enable or disable engine sounds"); } @@ -294,12 +294,13 @@ void render_sound() if (!(snd_engines && snd_engines->value())) return; - float speed = 0; + math::Vector3f velocity(0, 0 ,0); + if (core::localcontrol()) { - speed = core::localcontrol()->speed(); + velocity.assign(core::localcontrol()->state()->axis().forward() * core::localcontrol()->speed()); } - audio::update_listener(render::Camera::eye(), render::Camera::axis(), speed); + audio::update_listener(render::Camera::eye(), render::Camera::axis(), velocity); for (std::map<unsigned int, core::Entity *>::iterator it=core::Entity::registry.begin(); it != core::Entity::registry.end(); it++) { core::Entity *entity = (*it).second; diff --git a/src/render/Makefile.am b/src/render/Makefile.am index 166aa99..7069f97 100644 --- a/src/render/Makefile.am +++ b/src/render/Makefile.am @@ -9,6 +9,7 @@ endif librender_la_LDFLAGS = -avoid-version -no-undefined @GL_LIBS@ librender_la_LIBADD = $(top_builddir)/src/math/libmath.la -librender_la_SOURCES = camera.cc draw.cc gl.cc image.cc render.cc text.cc \ - textures.cc tga.cc -noinst_HEADERS = camera.h draw.h gl.h image.h render.h text.h textures.h tga.h +librender_la_SOURCES = camera.cc draw.cc dust.cc gl.cc image.cc render.cc \ + text.cc textures.cc tga.cc +noinst_HEADERS = camera.h draw.h dust.h gl.h image.h render.h text.h textures.h \ + tga.h diff --git a/src/render/draw.cc b/src/render/draw.cc index 18c3d73..1f920b0 100644 --- a/src/render/draw.cc +++ b/src/render/draw.cc @@ -12,6 +12,7 @@ #include "render/render.h" #include "render/textures.h" #include "render/draw.h" +#include "render/dust.h" #include "render/gl.h" namespace render @@ -317,6 +318,7 @@ void pass_prepare(float seconds) // load entity models and light flare textures if (!entity->model() && entity->modelname().size()) { entity->entity_model = model::Model::load(entity->modelname()); + entity->entity_radius = entity->model()->radius(); if (!entity->model()) { entity->entity_modelname.clear(); @@ -865,6 +867,8 @@ void draw(float seconds) draw_pass_spacegrid(); // draw the blue spacegrid + Dust::draw(); // draw spacedust + draw_pass_model_fx(); // draw entity lights and engines gl::enable(GL_LIGHTING); diff --git a/src/render/render.cc b/src/render/render.cc index ea70dbf..cb0d4dd 100644 --- a/src/render/render.cc +++ b/src/render/render.cc @@ -10,6 +10,7 @@ #include <iomanip> #include "render/gl.h" +#include "render/dust.h" #include "render/textures.h" #include "render/tga.h" #include "render/render.h" @@ -98,6 +99,8 @@ void init() Textures::init(); Text::init(); + + Dust::init(); } void shutdown() @@ -123,6 +126,8 @@ void shutdown() Textures::shutdown(); Camera::shutdown(); + + Dust::shutdown(); } } |