Skip to content

Commit

Permalink
More style cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
benvanik committed Aug 7, 2015
1 parent e6461f3 commit 5e08889
Show file tree
Hide file tree
Showing 76 changed files with 418 additions and 420 deletions.
2 changes: 1 addition & 1 deletion src/xenia/app/xenia_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ DEFINE_string(target, "", "Specifies the target .xex or .iso to execute.");
namespace xe {
namespace app {

int xenia_main(std::vector<std::wstring>& args) {
int xenia_main(const std::vector<std::wstring>& args) {
Profiler::Initialize();
Profiler::ThreadEnter("main");

Expand Down
10 changes: 6 additions & 4 deletions src/xenia/apu/audio_driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
#include "xenia/cpu/processor.h"
#include "xenia/cpu/thread_state.h"

using namespace xe;
using namespace xe::apu;
using namespace xe::cpu;
namespace xe {
namespace apu {

AudioDriver::AudioDriver(Emulator* emulator)
: emulator_(emulator), memory_(emulator->memory()) {}

AudioDriver::~AudioDriver() {}
AudioDriver::~AudioDriver() = default;

} // namespace apu
} // namespace xe
2 changes: 1 addition & 1 deletion src/xenia/apu/audio_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace apu {

class AudioDriver {
public:
AudioDriver(Emulator* emulator);
explicit AudioDriver(Emulator* emulator);
virtual ~AudioDriver();

virtual void SubmitFrame(uint32_t samples_ptr) = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/xenia/apu/audio_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class AudioSystem {
void SubmitFrame(size_t index, uint32_t samples_ptr);

protected:
AudioSystem(Emulator* emulator);
explicit AudioSystem(Emulator* emulator);

virtual void Initialize();

Expand Down
2 changes: 1 addition & 1 deletion src/xenia/apu/nop/nop_audio_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace nop {

class NopAudioSystem : public AudioSystem {
public:
NopAudioSystem(Emulator* emulator);
explicit NopAudioSystem(Emulator* emulator);
~NopAudioSystem() override;

static std::unique_ptr<AudioSystem> Create(Emulator* emulator);
Expand Down
23 changes: 10 additions & 13 deletions src/xenia/apu/xaudio2/xaudio2_audio_driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

// Must be included before xaudio2.h so we get the right windows.h include.
#include "xenia/base/platform_win.h"
#include <xaudio2.h>
#include <xaudio2.h> // NOLINT(build/include_order)

#include "xenia/apu/apu_flags.h"
#include "xenia/base/clock.h"
Expand All @@ -24,7 +24,8 @@ namespace xaudio2 {

class XAudio2AudioDriver::VoiceCallback : public IXAudio2VoiceCallback {
public:
VoiceCallback(xe::threading::Semaphore* semaphore) : semaphore_(semaphore) {}
explicit VoiceCallback(xe::threading::Semaphore* semaphore)
: semaphore_(semaphore) {}
~VoiceCallback() {}

void OnStreamEnd() {}
Expand Down Expand Up @@ -52,15 +53,10 @@ XAudio2AudioDriver::XAudio2AudioDriver(Emulator* emulator,
XAudio2AudioDriver::~XAudio2AudioDriver() = default;

const DWORD ChannelMasks[] = {
0, // TODO: fixme
0, // TODO: fixme
SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY,
0, // TODO: fixme
0, // TODO: fixme
0, // TODO: fixme
SPEAKER_FRONT_LEFT | SPEAKER_FRONT_CENTER | SPEAKER_FRONT_RIGHT |
SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT,
0, // TODO: fixme
0, 0, SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_LOW_FREQUENCY, 0,
0, 0, SPEAKER_FRONT_LEFT | SPEAKER_FRONT_CENTER | SPEAKER_FRONT_RIGHT |
SPEAKER_LOW_FREQUENCY | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT,
0,
};

void XAudio2AudioDriver::Initialize() {
Expand Down Expand Up @@ -152,7 +148,7 @@ void XAudio2AudioDriver::SubmitFrame(uint32_t frame_ptr) {

XAUDIO2_BUFFER buffer;
buffer.Flags = 0;
buffer.pAudioData = (BYTE*)output_frame;
buffer.pAudioData = reinterpret_cast<BYTE*>(output_frame);
buffer.AudioBytes = frame_size_;
buffer.PlayBegin = 0;
buffer.PlayLength = channel_samples_;
Expand All @@ -171,7 +167,8 @@ void XAudio2AudioDriver::SubmitFrame(uint32_t frame_ptr) {

// Update playback ratio to our time scalar.
// This will keep audio in sync with the game clock.
pcm_voice_->SetFrequencyRatio(float(xe::Clock::guest_time_scalar()));
pcm_voice_->SetFrequencyRatio(
static_cast<float>(xe::Clock::guest_time_scalar()));
}

void XAudio2AudioDriver::Shutdown() {
Expand Down
2 changes: 1 addition & 1 deletion src/xenia/apu/xaudio2/xaudio2_audio_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace xaudio2 {

class XAudio2AudioSystem : public AudioSystem {
public:
XAudio2AudioSystem(Emulator* emulator);
explicit XAudio2AudioSystem(Emulator* emulator);
~XAudio2AudioSystem() override;

static std::unique_ptr<AudioSystem> Create(Emulator* emulator);
Expand Down
Loading

0 comments on commit 5e08889

Please sign in to comment.