Skip to content

Commit 6852d9d

Browse files
committed
Reformat: xrSound
1 parent e65a4bb commit 6852d9d

Some content is hidden

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

41 files changed

+3943
-3698
lines changed

src/xrSound/MusicStream.cpp

Lines changed: 43 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,82 +2,86 @@
22
//
33
//////////////////////////////////////////////////////////////////////
44

5-
#include "stdafx.h"
65
#include "MusicStream.h"
6+
#include "stdafx.h"
77
#include "xr_streamsnd.h"
88

9-
#include "x_ray.h"
109
#include "GameFont.h"
10+
#include "x_ray.h"
1111

1212
//////////////////////////////////////////////////////////////////////
1313
// Construction/Destruction
1414
//////////////////////////////////////////////////////////////////////
1515

1616
CMusicStream::CMusicStream()
1717
{
18-
1918
}
2019

2120
CMusicStream::~CMusicStream()
2221
{
23-
2422
}
2523

2624
int CMusicStream::FindEmptySlot()
2725
{
28-
for (u32 i=0; i<streams.size(); i++) {
29-
if (streams[i]==0) return i;
30-
}
31-
return -1;
26+
for (u32 i = 0; i < streams.size(); i++)
27+
{
28+
if (streams[i] == 0) return i;
29+
}
30+
return -1;
3231
}
3332

34-
CSoundStream* CMusicStream::CreateSound (LPCSTR name )
33+
CSoundStream* CMusicStream::CreateSound(LPCSTR name)
3534
{
36-
int slot;
37-
CSoundStream *pSnd = xr_new<CSoundStream> ();
38-
pSnd->Load(name);
35+
int slot;
36+
CSoundStream* pSnd = xr_new<CSoundStream>();
37+
pSnd->Load(name);
3938

40-
if ((slot=FindEmptySlot())>=0){
41-
streams[slot] = pSnd;
42-
return pSnd;
43-
}
39+
if ((slot = FindEmptySlot()) >= 0) {
40+
streams[slot] = pSnd;
41+
return pSnd;
42+
}
4443

45-
streams.push_back(pSnd);
46-
return pSnd;
44+
streams.push_back(pSnd);
45+
return pSnd;
4746
}
4847

49-
void CMusicStream::DeleteSound (CSoundStream* pSnd)
48+
void CMusicStream::DeleteSound(CSoundStream* pSnd)
5049
{
51-
int slot=-1;
52-
for (u32 i=0; i<streams.size(); i++){
53-
if (streams[i]==pSnd) { slot = i; break; }
54-
}
55-
56-
if (slot>=0){
57-
xr_delete(streams[slot]);
58-
pSnd = NULL;
59-
}
50+
int slot = -1;
51+
for (u32 i = 0; i < streams.size(); i++)
52+
{
53+
if (streams[i] == pSnd) {
54+
slot = i;
55+
break;
56+
}
57+
}
58+
59+
if (slot >= 0) {
60+
xr_delete(streams[slot]);
61+
pSnd = NULL;
62+
}
6063
}
6164

6265
void CMusicStream::OnMove()
6366
{
64-
for(u32 i=0; i<streams.size(); i++) streams[i]->OnMove();
65-
/* if (psDeviceFlags&rsStatistic)
66-
{
67-
int cnt = 0;
68-
for(int i=0; i<streams.size(); i++) cnt+=streams[i]->isPlaying()?1:0;
69-
pApp->pFont->Out(0,0.5f,"%d / %d",cnt,streams.size());
70-
}
71-
*/
67+
for (u32 i = 0; i < streams.size(); i++)
68+
streams[i]->OnMove();
69+
/* if (psDeviceFlags&rsStatistic)
70+
{
71+
int cnt = 0;
72+
for(int i=0; i<streams.size(); i++) cnt+=streams[i]->isPlaying()?1:0;
73+
pApp->pFont->Out(0,0.5f,"%d / %d",cnt,streams.size());
74+
}
75+
*/
7276
}
7377

7478
void CMusicStream::Reload()
7579
{
76-
// ...
80+
// ...
7781
}
7882

7983
void CMusicStream::Update()
8084
{
81-
for (u32 i=0; i<streams.size(); i++)
82-
if (streams[i]) streams[i]->bNeedUpdate=true;
85+
for (u32 i = 0; i < streams.size(); i++)
86+
if (streams[i]) streams[i]->bNeedUpdate = true;
8387
}

src/xrSound/MusicStream.h

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,21 @@
1010
class ENGINE_API CSoundStream;
1111
class ENGINE_API CInifile;
1212

13-
class CMusicStream {
14-
xr_vector<CSoundStream*> streams;
15-
int FindEmptySlot();
13+
class CMusicStream
14+
{
15+
xr_vector<CSoundStream*> streams;
16+
int FindEmptySlot();
17+
1618
public:
17-
CMusicStream ();
18-
~CMusicStream ();
19+
CMusicStream();
20+
~CMusicStream();
1921

20-
CSoundStream* CreateSound (LPCSTR name );
21-
void DeleteSound (CSoundStream* pSnd);
22+
CSoundStream* CreateSound(LPCSTR name);
23+
void DeleteSound(CSoundStream* pSnd);
2224

23-
void OnMove ();
24-
void Reload ();
25-
void Update ();
25+
void OnMove();
26+
void Reload();
27+
void Update();
2628
};
2729

28-
#endif // !defined(AFX_MUSICSTREAM_H__7DAD65D5_8E32_4262_89C8_67A135405BAF__INCLUDED_)
30+
#endif // !defined(AFX_MUSICSTREAM_H__7DAD65D5_8E32_4262_89C8_67A135405BAF__INCLUDED_)

0 commit comments

Comments
 (0)