Source release of Wolfenstein 3D Classic Platinum for iOS, 1.0

This commit is contained in:
Travis Bradshaw
2012-01-31 16:46:52 -06:00
commit e20e553baf
1001 changed files with 54065 additions and 0 deletions

View File

@@ -0,0 +1,94 @@
/*
Copyright (C) 2004 Michael Liebscher
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.
*/
#include "../wolfiphone.h"
/*
-----------------------------------------------------------------------------
Function:
Parameters:
Returns:
Notes:
-----------------------------------------------------------------------------
*/
PUBLIC void Client_PrepRefresh( const char *r_mapname )
{
char mapname[ 32 ];
if( ! r_mapname || ! *r_mapname )
{
return;
}
if( g_version->value == SPEAROFDESTINY )
{
spritelocation = SODSPRITESDIRNAME;
}
else
{
spritelocation = WL6SPRITESDIRNAME;
}
my_strlcpy( mapname, r_mapname, sizeof( mapname ) ); // skip "maps/"
// !@# fix crash bug if you type something short...
if ( strlen( mapname ) > 4 && !strcmp( mapname + strlen( mapname ) - 4, ".map" ) ) {
mapname[ strlen( mapname ) - 4 ] = '\0'; // cut off ".map"
}
// register models, pics, and skins
R_BeginRegistration( mapname );
if( r_world == NULL )
{
return;
}
Com_Printf( "Map: %s\n", r_world->mapName );
Level_ScanInfoPlane( r_world ); // Spawn items/guards
Com_Printf( "Spawning Entities\n" );
PL_Spawn( r_world->pSpawn, r_world ); // Spawn Player
Com_Printf( "Caching Textures and Sounds\n" );
Level_PrecacheTextures_Sound( r_world );
// clear any lines of console text
Con_ClearNotify();
if( r_world->musicName )
{
Sound_StartBGTrack( r_world->musicName, r_world->musicName );
}
Player.playstate = ex_playing;
}
int tics;