use Sint32 char_traits correctly
This commit is contained in:
@@ -293,7 +293,7 @@ void SoundMixBuffer::write(const Sint16 *buf, unsigned size)
|
|||||||
{
|
{
|
||||||
if(mixbuf.size() < size)
|
if(mixbuf.size() < size)
|
||||||
{
|
{
|
||||||
basic_string<Sint32,char_traits_Sint32> empty(size-mixbuf.size(), 0);
|
basic_string<Sint32> empty(size-mixbuf.size(), 0);
|
||||||
|
|
||||||
mixbuf.insert(mixbuf.end(), empty.begin(), empty.end());
|
mixbuf.insert(mixbuf.end(), empty.begin(), empty.end());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public:
|
|||||||
/* This inputs and outputs 16-bit 44khz stereo input. */
|
/* This inputs and outputs 16-bit 44khz stereo input. */
|
||||||
class SoundMixBuffer
|
class SoundMixBuffer
|
||||||
{
|
{
|
||||||
basic_string<Sint32,char_traits_Sint32> mixbuf;
|
basic_string<Sint32> mixbuf;
|
||||||
float vol;
|
float vol;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ SDL_Surface *SDL_CreateRGBSurfaceSane
|
|||||||
|
|
||||||
void FixHiddenAlpha(SDL_Surface *img);
|
void FixHiddenAlpha(SDL_Surface *img);
|
||||||
|
|
||||||
struct char_traits_Sint32: public char_traits<Sint32>
|
template<>
|
||||||
|
struct char_traits<Sint32>
|
||||||
{
|
{
|
||||||
|
|
||||||
static Sint32 *copy(Sint32 *s, const Sint32 *p, size_t n)
|
static Sint32 *copy(Sint32 *s, const Sint32 *p, size_t n)
|
||||||
{
|
{
|
||||||
memcpy(s, p, n * sizeof(Sint32));
|
memcpy(s, p, n * sizeof(Sint32));
|
||||||
@@ -50,8 +50,6 @@ struct char_traits_Sint32: public char_traits<Sint32>
|
|||||||
{
|
{
|
||||||
c1 = c2;
|
c1 = c2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user