diff --git a/apps/plugins/doom/i_sound.c b/apps/plugins/doom/i_sound.c index 471b0ee193..2d0ebe9262 100644 --- a/apps/plugins/doom/i_sound.c +++ b/apps/plugins/doom/i_sound.c @@ -62,7 +62,7 @@ // Basically, samples from all active internal channels // are modifed and added, and stored in the buffer // that is submitted to the audio device. -signed short mixbuffer[MIXBUFFERSIZE]; +signed short *mixbuffer=NULL; typedef struct { // SFX id of the playing sound effect. @@ -516,6 +516,9 @@ void I_InitSound() printf( " pre-cached all sound data\n"); + if(mixbuffer==NULL) + mixbuffer=malloc(sizeof(short)*MIXBUFFERSIZE); + // Now initialize mixbuffer with zero. for ( i = 0; i< MIXBUFFERSIZE; i++ ) mixbuffer[i] = 0; diff --git a/apps/plugins/doom/r_main.c b/apps/plugins/doom/r_main.c index 5afb85b3ce..58fe9d0f96 100644 --- a/apps/plugins/doom/r_main.c +++ b/apps/plugins/doom/r_main.c @@ -80,7 +80,7 @@ angle_t clipangle; // flattening the arc to a flat projection plane. // There will be many angles mapped to the same X. -int viewangletox[FINEANGLES/2]; +int *viewangletox=0; // The xtoviewangleangle[] table maps a screen pixel // to the lowest viewangle that maps back to x ranges @@ -217,6 +217,9 @@ static void R_InitTextureMapping (void) // Calc focallength // so FIELDOFVIEW angles covers SCREENWIDTH. + if(viewangletox==NULL) + viewangletox=malloc(sizeof(int)*FINEANGLES/2); + focallength = FixedDiv(centerxfrac, finetangent[FINEANGLES/4+FIELDOFVIEW/2]); for (i=0 ; i