1
0
Fork 0
forked from len0rd/rockbox

Decrease doom's code size and some code cleanup.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9690 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Karl Kurbjun 2006-04-16 21:16:09 +00:00
parent 95325ff72a
commit f7872ac61b
3 changed files with 81 additions and 90 deletions

View file

@ -62,7 +62,7 @@
// Basically, samples from all active internal channels // Basically, samples from all active internal channels
// are modifed and added, and stored in the buffer // are modifed and added, and stored in the buffer
// that is submitted to the audio device. // that is submitted to the audio device.
signed short mixbuffer[MIXBUFFERSIZE]; signed short *mixbuffer=NULL;
typedef struct { typedef struct {
// SFX id of the playing sound effect. // SFX id of the playing sound effect.
@ -516,6 +516,9 @@ void I_InitSound()
printf( " pre-cached all sound data\n"); printf( " pre-cached all sound data\n");
if(mixbuffer==NULL)
mixbuffer=malloc(sizeof(short)*MIXBUFFERSIZE);
// Now initialize mixbuffer with zero. // Now initialize mixbuffer with zero.
for ( i = 0; i< MIXBUFFERSIZE; i++ ) for ( i = 0; i< MIXBUFFERSIZE; i++ )
mixbuffer[i] = 0; mixbuffer[i] = 0;

View file

@ -80,7 +80,7 @@ angle_t clipangle;
// flattening the arc to a flat projection plane. // flattening the arc to a flat projection plane.
// There will be many angles mapped to the same X. // There will be many angles mapped to the same X.
int viewangletox[FINEANGLES/2]; int *viewangletox=0;
// The xtoviewangleangle[] table maps a screen pixel // The xtoviewangleangle[] table maps a screen pixel
// to the lowest viewangle that maps back to x ranges // to the lowest viewangle that maps back to x ranges
@ -217,6 +217,9 @@ static void R_InitTextureMapping (void)
// Calc focallength // Calc focallength
// so FIELDOFVIEW angles covers SCREENWIDTH. // so FIELDOFVIEW angles covers SCREENWIDTH.
if(viewangletox==NULL)
viewangletox=malloc(sizeof(int)*FINEANGLES/2);
focallength = FixedDiv(centerxfrac, finetangent[FINEANGLES/4+FIELDOFVIEW/2]); focallength = FixedDiv(centerxfrac, finetangent[FINEANGLES/4+FIELDOFVIEW/2]);
for (i=0 ; i<FINEANGLES/2 ; i++) for (i=0 ; i<FINEANGLES/2 ; i++)

View file

@ -1,24 +1,33 @@
// Emacs style mode select -*- C++ -*- /* Emacs style mode select -*- C++ -*-
//----------------------------------------------------------------------------- *-----------------------------------------------------------------------------
// *
// $Id$ *
// * PrBoom a Doom port merged with LxDoom and LSDLDoom
// Copyright (C) 1993-1996 by id Software, Inc. * based on BOOM, a modified and improved DOOM engine
// * Copyright (C) 1999 by
// This program is free software; you can redistribute it and/or * id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman
// modify it under the terms of the GNU General Public License * Copyright (C) 1999-2000 by
// as published by the Free Software Foundation; either version 2 * Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze
// of the License, or (at your option) any later version. *
// * This program is free software; you can redistribute it and/or
// This program is distributed in the hope that it will be useful, * modify it under the terms of the GNU General Public License
// but WITHOUT ANY WARRANTY; without even the implied warranty of * as published by the Free Software Foundation; either version 2
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * of the License, or (at your option) any later version.
// GNU General Public License for more details. *
// * This program is distributed in the hope that it will be useful,
// DESCRIPTION: * but WITHOUT ANY WARRANTY; without even the implied warranty of
// Refresh/render internal state variables (global). * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// * GNU General Public License for more details.
//----------------------------------------------------------------------------- *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* DESCRIPTION:
* Refresh/render internal state variables (global).
*
*-----------------------------------------------------------------------------*/
#ifndef __R_STATE__ #ifndef __R_STATE__
@ -28,14 +37,11 @@
#include "d_player.h" #include "d_player.h"
#include "r_data.h" #include "r_data.h"
#ifdef __GNUG__ #ifdef __GNUG__
#pragma interface #pragma interface
#endif #endif
// //
// Refresh internal data structures, // Refresh internal data structures,
// for rendering. // for rendering.
@ -60,14 +66,11 @@ extern int firstflat;
extern int *flattranslation; extern int *flattranslation;
extern int *texturetranslation; extern int *texturetranslation;
// Sprite.... // Sprite....
extern int firstspritelump; extern int firstspritelump;
extern int lastspritelump; extern int lastspritelump;
extern int numspritelumps; extern int numspritelumps;
// //
// Lookup tables for map data. // Lookup tables for map data.
// //
@ -102,23 +105,14 @@ extern side_t* sides;
extern fixed_t viewx; extern fixed_t viewx;
extern fixed_t viewy; extern fixed_t viewy;
extern fixed_t viewz; extern fixed_t viewz;
extern angle_t viewangle; extern angle_t viewangle;
extern player_t *viewplayer; extern player_t *viewplayer;
// ?
extern angle_t clipangle; extern angle_t clipangle;
extern int *viewangletox;
extern int viewangletox[FINEANGLES/2]; extern angle_t xtoviewangle[SCREENWIDTH+1]; // killough 2/8/98
extern angle_t xtoviewangle[SCREENWIDTH+1];
//extern fixed_t finetangent[FINEANGLES/2];
extern fixed_t rw_distance; extern fixed_t rw_distance;
extern angle_t rw_normalangle; extern angle_t rw_normalangle;
// angle to line origin // angle to line origin
extern int rw_angle1; extern int rw_angle1;
@ -128,13 +122,4 @@ extern int sscount;
extern visplane_t *floorplane; extern visplane_t *floorplane;
extern visplane_t *ceilingplane; extern visplane_t *ceilingplane;
#endif #endif
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.1 2006/03/28 15:44:01 dave
// Patch #2969 - Doom! Currently only working on the H300.
//
//
//-----------------------------------------------------------------------------