fixes bad initialization for o-scope data, as well as an uninitialized var

in comm.c


git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@613 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
ghaushe
2003-01-30 19:50:56 +00:00
parent 0795bd15b3
commit ab2ec7d451
2 changed files with 5 additions and 7 deletions
+1 -2
View File
@@ -1161,7 +1161,7 @@ SpewPhrases (COUNT wait_track)
BOOLEAN ContinuityBreak; BOOLEAN ContinuityBreak;
DWORD TimeIn; DWORD TimeIn;
COUNT which_track; COUNT which_track;
INPUT_STATE InputState, LastInputState; INPUT_STATE InputState, LastInputState = (INPUT_STATE)~0;
FRAME F; FRAME F;
TimeIn = GetTimeCounter (); TimeIn = GetTimeCounter ();
@@ -1195,7 +1195,6 @@ SpewPhrases (COUNT wait_track)
else if (which_track <= wait_track) else if (which_track <= wait_track)
ResumeTrack (); ResumeTrack ();
LastInputState = 0;
do do
{ {
ClearSemaphore (GraphicsSem); ClearSemaphore (GraphicsSem);
+4 -5
View File
@@ -49,8 +49,7 @@ PlayStream (TFB_SoundSample *sample, uint32 source, bool looping, bool scope, bo
if (scope) if (scope)
{ {
pos = PAD_SCOPE_BYTES; soundSource[source].sbuffer = HMalloc (PAD_SCOPE_BYTES);
soundSource[source].sbuffer = HMalloc (pos);
} }
if (sample->read_chain_ptr && sample->read_chain_ptr->tag.type) if (sample->read_chain_ptr && sample->read_chain_ptr->tag.type)
@@ -77,7 +76,7 @@ PlayStream (TFB_SoundSample *sample, uint32 source, bool looping, bool scope, bo
{ {
UBYTE *p; UBYTE *p;
soundSource[source].sbuffer = HRealloc (soundSource[source].sbuffer, soundSource[source].sbuffer = HRealloc (soundSource[source].sbuffer,
pos + decoded_bytes); pos + decoded_bytes + PAD_SCOPE_BYTES);
p = (UBYTE *)soundSource[source].sbuffer; p = (UBYTE *)soundSource[source].sbuffer;
memcpy (&p[pos], sample->decoder->buffer, decoded_bytes); memcpy (&p[pos], sample->decoder->buffer, decoded_bytes);
pos += decoded_bytes; pos += decoded_bytes;
@@ -105,8 +104,8 @@ PlayStream (TFB_SoundSample *sample, uint32 source, bool looping, bool scope, bo
if (sample->buffer_tag) if (sample->buffer_tag)
for ( ; i <sample->num_buffers; ++i) for ( ; i <sample->num_buffers; ++i)
sample->buffer_tag[i] = 0; sample->buffer_tag[i] = 0;
soundSource[source].sbuf_size = pos; soundSource[source].sbuf_size = pos + PAD_SCOPE_BYTES;
soundSource[source].sbuf_start = pos - PAD_SCOPE_BYTES; soundSource[source].sbuf_start = pos;
soundSource[source].sbuf_lasttime = GetTimeCounter (); soundSource[source].sbuf_lasttime = GetTimeCounter ();
soundSource[source].start_time = (sint32)GetTimeCounter () - offset; soundSource[source].start_time = (sint32)GetTimeCounter () - offset;
soundSource[source].stream_should_be_playing = TRUE; soundSource[source].stream_should_be_playing = TRUE;