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
// 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;

View file

@ -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<FINEANGLES/2 ; i++)

View file

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