Skip to content

Commit acc977a

Browse files
author
Blaž Hrastnik
committed
ls modules/**/*.[hc]xx | xargs clang-format -i -style="{PointerAlignment: Left, BasedOnStyle: Mozilla}"
1 parent 84bdeaa commit acc977a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+2315
-1987
lines changed

modules/audio-gorilla/include/moon/gorilla/audio.hxx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@
66
#include <gorilla/gau.h>
77

88
namespace Moon {
9-
class Audio {
10-
public:
11-
static bool Initialize();
12-
static void Update();
13-
static void Terminate();
14-
static ga_Mixer* GetMixer();
15-
static ga_StreamManager* GetStreamMgr();
16-
protected:
17-
static gau_Manager* m_mgr;
18-
static ga_Mixer* m_mixer;
19-
static ga_StreamManager* m_streamMgr;
20-
};
9+
class Audio
10+
{
11+
public:
12+
static bool Initialize();
13+
static void Update();
14+
static void Terminate();
15+
static ga_Mixer* GetMixer();
16+
static ga_StreamManager* GetStreamMgr();
17+
18+
protected:
19+
static gau_Manager* m_mgr;
20+
static ga_Mixer* m_mixer;
21+
static ga_StreamManager* m_streamMgr;
22+
};
2123
};
2224

2325
#endif
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#ifndef MMRB_MUSIC_H
22
#define MMRB_MUSIC_H
33

4+
#include "moon/api.h"
45
#include <mruby.h>
56
#include <mruby/class.h>
67
#include <mruby/data.h>
7-
#include "moon/api.h"
88

99
MOON_C_API const struct mrb_data_type music_data_type;
10-
MOON_C_API void mmrb_music_init(mrb_state *mrb);
10+
MOON_C_API void mmrb_music_init(mrb_state* mrb);
1111

1212
#endif
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#ifndef MMRB_SOUND_H
22
#define MMRB_SOUND_H
33

4+
#include "moon/api.h"
45
#include <mruby.h>
56
#include <mruby/class.h>
67
#include <mruby/data.h>
7-
#include "moon/api.h"
88

99
MOON_C_API const struct mrb_data_type sound_data_type;
10-
MOON_C_API void mmrb_sound_init(mrb_state *mrb);
10+
MOON_C_API void mmrb_sound_init(mrb_state* mrb);
1111

1212
#endif

modules/audio-gorilla/include/moon/gorilla/music.hxx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
#include "moon/gorilla/audio.hxx"
55

66
namespace Moon {
7-
struct Music {
8-
Music() : handle(NULL), loopSrc(NULL) { };
9-
ga_Handle* handle;
10-
gau_SampleSourceLoop* loopSrc;
11-
};
7+
struct Music
8+
{
9+
Music()
10+
: handle(NULL)
11+
, loopSrc(NULL){};
12+
ga_Handle* handle;
13+
gau_SampleSourceLoop* loopSrc;
14+
};
1215
};
1316

1417
#endif

modules/audio-gorilla/src/audio.cxx

Lines changed: 44 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,54 @@
11
#include "moon/gorilla/audio.hxx"
22

33
namespace Moon {
4-
gau_Manager* Audio::m_mgr = NULL;
5-
ga_Mixer* Audio::m_mixer = NULL;
6-
ga_StreamManager* Audio::m_streamMgr = NULL;
4+
gau_Manager* Audio::m_mgr = NULL;
5+
ga_Mixer* Audio::m_mixer = NULL;
6+
ga_StreamManager* Audio::m_streamMgr = NULL;
77

8-
bool Audio::Initialize() {
9-
// setup Gorilla Audio
10-
if (!m_mgr) {
11-
if (gc_initialize(0) == GC_SUCCESS) {
12-
m_mgr = gau_manager_create();
13-
m_mixer = gau_manager_mixer(m_mgr);
14-
m_streamMgr = gau_manager_streamManager(m_mgr);
15-
} else {
16-
return false;
17-
}
8+
bool
9+
Audio::Initialize()
10+
{
11+
// setup Gorilla Audio
12+
if (!m_mgr) {
13+
if (gc_initialize(0) == GC_SUCCESS) {
14+
m_mgr = gau_manager_create();
15+
m_mixer = gau_manager_mixer(m_mgr);
16+
m_streamMgr = gau_manager_streamManager(m_mgr);
17+
} else {
18+
return false;
1819
}
19-
return true;
20-
};
20+
}
21+
return true;
22+
};
2123

22-
void Audio::Update() {
23-
if (m_mgr) gau_manager_update(m_mgr);
24-
};
24+
void
25+
Audio::Update()
26+
{
27+
if (m_mgr)
28+
gau_manager_update(m_mgr);
29+
};
2530

26-
void Audio::Terminate() {
27-
if (m_mgr) {
28-
gau_manager_destroy(m_mgr);
29-
gc_shutdown();
30-
m_mgr = NULL;
31-
m_mixer = NULL;
32-
m_streamMgr = NULL;
33-
}
34-
};
31+
void
32+
Audio::Terminate()
33+
{
34+
if (m_mgr) {
35+
gau_manager_destroy(m_mgr);
36+
gc_shutdown();
37+
m_mgr = NULL;
38+
m_mixer = NULL;
39+
m_streamMgr = NULL;
40+
}
41+
};
3542

36-
ga_Mixer* Audio::GetMixer() {
37-
return m_mixer;
38-
};
43+
ga_Mixer*
44+
Audio::GetMixer()
45+
{
46+
return m_mixer;
47+
};
3948

40-
ga_StreamManager* Audio::GetStreamMgr() {
41-
return m_streamMgr;
42-
};
49+
ga_StreamManager*
50+
Audio::GetStreamMgr()
51+
{
52+
return m_streamMgr;
53+
};
4354
}
44-

modules/audio-gorilla/src/mrb_moon_audio.cxx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
#include <mruby.h>
2-
#include <mruby/class.h>
31
#include "moon/gorilla/audio.hxx"
42
#include "moon/gorilla/mrb/music.hxx"
53
#include "moon/gorilla/mrb/sound.hxx"
4+
#include <mruby.h>
5+
#include <mruby/class.h>
66

77
/* Call once per step/frame to update the internal Audio module.
88
*/
99
static mrb_value
10-
audio_update(mrb_state *mrb, mrb_value klass)
10+
audio_update(mrb_state* mrb, mrb_value klass)
1111
{
1212
Moon::Audio::Update();
1313
return klass;
@@ -16,9 +16,11 @@ audio_update(mrb_state *mrb, mrb_value klass)
1616
MOON_C_API void
1717
mrb_mruby_moon_audio_gorilla_gem_init(mrb_state* mrb)
1818
{
19-
struct RClass *moon_module = mrb_define_module(mrb, "Moon");
20-
struct RClass *audio_module = mrb_define_module_under(mrb, moon_module, "Audio");
21-
mrb_define_class_method(mrb, audio_module, "update", audio_update, MRB_ARGS_NONE());
19+
struct RClass* moon_module = mrb_define_module(mrb, "Moon");
20+
struct RClass* audio_module =
21+
mrb_define_module_under(mrb, moon_module, "Audio");
22+
mrb_define_class_method(mrb, audio_module, "update", audio_update,
23+
MRB_ARGS_NONE());
2224
mmrb_music_init(mrb);
2325
mmrb_sound_init(mrb);
2426
Moon::Audio::Initialize();

0 commit comments

Comments
 (0)