Browse Source

Fixed sound segfault

Thomas Buck 10 years ago
parent
commit
ce5864d7f8
2 changed files with 6 additions and 3 deletions
  1. 0
    3
      src/Game.cpp
  2. 6
    0
      src/Sound.cpp

+ 0
- 3
src/Game.cpp View File

@@ -639,9 +639,6 @@ void Game::processMoveable(int index, int i, int *ent,
639 639
     }
640 640
     if (!found)
641 641
     {
642
-        if (mLara == thing) {
643
-            printf("Processing Lara...\n");
644
-        }
645 642
         sModel->model = r_model;
646 643
         mWorld.addEntity(thing);
647 644
 

+ 6
- 0
src/Sound.cpp View File

@@ -149,6 +149,9 @@ int Sound::addFile(const char *filename, int *source, unsigned int flags) {
149 149
 
150 150
     *source = -1;
151 151
     id = mSource.size();
152
+    
153
+    mSource.push_back(0);
154
+    mBuffer.push_back(0);
152 155
 
153 156
     alGetError();
154 157
     alGenBuffers(1, &mBuffer[id]);
@@ -203,6 +206,9 @@ int Sound::addWave(unsigned char *wav, unsigned int length, int *source, unsigne
203 206
 
204 207
     *source = -1;
205 208
     id = mSource.size();
209
+    
210
+    mSource.push_back(0);
211
+    mBuffer.push_back(0);
206 212
 
207 213
     data = wav;
208 214
 

Loading…
Cancel
Save