mirror of
https://github.com/id-Software/Wolf3D-iOS.git
synced 2026-03-19 16:39:49 +01:00
Source release of Wolfenstein 3D Classic Platinum for iOS, 2.1
This commit is contained in:
@@ -540,6 +540,9 @@ PRIVATE _boolean AI_CheckSight( entity_t *self )
|
||||
if( deltax > 0 )
|
||||
return false;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// trace a line to check for blocking tiles (corners)
|
||||
|
||||
@@ -133,8 +133,8 @@ PUBLIC void Client_PrepRefresh( const char *r_mapname )
|
||||
levelData.musicName[6 + strlen(source)] = '\0';
|
||||
}*/
|
||||
|
||||
Com_Printf("Starting Music Track: %s\n", levelData.musicName);
|
||||
Sound_StartBGTrack( levelData.musicName, levelData.musicName );
|
||||
//Com_Printf("Starting Music Track: %s\n", levelData.musicName);
|
||||
//Sound_StartBGTrack( levelData.musicName, levelData.musicName );
|
||||
|
||||
Player.playstate = ex_playing;
|
||||
}
|
||||
|
||||
@@ -925,14 +925,17 @@ PUBLIC LevelData_t *Level_LoadMap( const char *levelname )
|
||||
fhandle = FS_OpenFile( levelname, 0 );
|
||||
if( ! fhandle )
|
||||
{
|
||||
char errBuffer[1024];
|
||||
sprintf( errBuffer, "levelname: %s, could not be found", levelname);
|
||||
iphoneMessageBox("map filename", errBuffer);
|
||||
Com_Printf( "Could not load map (%s)\n", levelname );
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
filesize = FS_GetFileSize( fhandle );
|
||||
if( filesize < MAPHEADER_SIZE )
|
||||
{
|
||||
iphoneMessageBox("map header size", "header size of the map is wrong");
|
||||
Com_Printf("Map file size is smaller than mapheader size\n");
|
||||
return NULL;
|
||||
}
|
||||
@@ -944,6 +947,7 @@ PUBLIC LevelData_t *Level_LoadMap( const char *levelname )
|
||||
FS_ReadFile( &signature, 1, 4, fhandle );
|
||||
if( signature != MAP_SIGNATURE )
|
||||
{
|
||||
iphoneMessageBox("map signature", "signature of the map file is invalid");
|
||||
Com_Printf("File signature does not match MAP_SIGNATURE\n");
|
||||
return NULL;
|
||||
}
|
||||
@@ -975,6 +979,7 @@ PUBLIC LevelData_t *Level_LoadMap( const char *levelname )
|
||||
if( filesize < (MAPHEADER_SIZE + mapNameLength + musicNameLength +
|
||||
length[ 0 ] + length[ 1 ] + length[ 2 ]) )
|
||||
{
|
||||
iphoneMessageBox("map filesize", "filesize is less than MAPHEADER_SIZE + mapNameLength + musicNameLength + etc");
|
||||
Com_Printf("filesize is less than MAPHEADER_SIZE + mapNameLength + musicNameLength + etc\n");
|
||||
return NULL;
|
||||
}
|
||||
@@ -993,6 +998,7 @@ PUBLIC LevelData_t *Level_LoadMap( const char *levelname )
|
||||
|
||||
if( filesize < (MAPHEADER_SIZE + mapNameLength + musicNameLength) )
|
||||
{
|
||||
iphoneMessageBox("map filesize", "filesize is less than MAPHEADER_SIZE + mapNameLength + musicNameLength");
|
||||
Com_Printf("filesize is less than MAPHEADER_SIZE + mapNameLength + musicNameLength\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -39,6 +39,9 @@
|
||||
#ifndef __WOLF_LOCAL_H__
|
||||
#define __WOLF_LOCAL_H__
|
||||
|
||||
#include "filesystem.h"
|
||||
#include "arch.h"
|
||||
#include "cvar.h"
|
||||
|
||||
// Game Version
|
||||
#define WOLFENSTEINWL6 0x00
|
||||
|
||||
@@ -70,9 +70,9 @@ PUBLIC void Game_Init( void )
|
||||
|
||||
episode = Cvar_Get( "episode", "0", CVAR_ARCHIVE );
|
||||
skill = Cvar_Get( "skill", "1", CVAR_ARCHIVE );
|
||||
// g_version = Cvar_Get( "g_version", "0", CVAR_ARCHIVE );
|
||||
g_version = Cvar_Get( "g_version", "1", CVAR_ARCHIVE ); //we should make a #ifdef for "special version"
|
||||
//this version is to come with spear
|
||||
|
||||
|
||||
#ifndef LITE
|
||||
Cmd_AddCommand( "map", Map_f );
|
||||
|
||||
@@ -58,11 +58,12 @@
|
||||
*/
|
||||
PUBLIC void GL_SetDefaultState( void )
|
||||
{
|
||||
pfglClearColor( 1,0, 0.5 , 0.5 );
|
||||
pfglCullFace( GL_FRONT );
|
||||
pfglViewport( 0,0, viddef.height, viddef.width );
|
||||
pfglClearColor( 0.0f, 0.0f, 0.0f, 1.0f );
|
||||
pfglEnable( GL_TEXTURE_2D );
|
||||
pfglDisable( GL_DEPTH_TEST );
|
||||
pfglDisable( GL_CULL_FACE );
|
||||
pfglDisable( GL_ALPHA_TEST );
|
||||
pfglEnable( GL_CULL_FACE );
|
||||
pfglDisable( GL_BLEND );
|
||||
pfglColor4f( 1, 1, 1, 1 );
|
||||
pfglShadeModel( GL_FLAT );
|
||||
@@ -92,12 +93,12 @@ PUBLIC void R_DrawBox( int x, int y, int w, int h, W32 color )
|
||||
|
||||
pfglColor4ubv( (GLubyte *) & color );
|
||||
|
||||
pfglBegin( GL_QUADS );
|
||||
pfglBegin( GL_TRIANGLE_STRIP );
|
||||
|
||||
pfglVertex2i( x, y );
|
||||
pfglVertex2i( x, y + h);
|
||||
pfglVertex2i( x + w, y + h );
|
||||
pfglVertex2i( x + w, y );
|
||||
pfglVertex2i( x + w, y + h );
|
||||
|
||||
pfglEnd();
|
||||
|
||||
@@ -107,6 +108,41 @@ PUBLIC void R_DrawBox( int x, int y, int w, int h, W32 color )
|
||||
pfglEnable( GL_TEXTURE_2D );
|
||||
}
|
||||
|
||||
/*
|
||||
-----------------------------------------------------------------------------
|
||||
Function: R_DrawBoxFloat
|
||||
|
||||
Parameters:
|
||||
|
||||
Returns:
|
||||
|
||||
Notes:
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
*/
|
||||
PUBLIC void R_DrawBoxFloat( float x, float y, float w, float h, W32 color )
|
||||
{
|
||||
pfglDisable( GL_TEXTURE_2D );
|
||||
|
||||
// pfglEnable( GL_BLEND );
|
||||
// pfglBlendFunc( GL_SRC_COLOR, GL_DST_COLOR );
|
||||
|
||||
pfglColor4ubv( (GLubyte *) & color );
|
||||
|
||||
pfglBegin( GL_TRIANGLE_STRIP );
|
||||
|
||||
pfglVertex2f( x, y );
|
||||
pfglVertex2f( x, y + h);
|
||||
pfglVertex2f( x + w, y + h );
|
||||
pfglVertex2f( x + w, y );
|
||||
|
||||
pfglEnd();
|
||||
|
||||
pfglColor3f( 1, 1, 1 );
|
||||
// pfglBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
|
||||
// pfglDisable( GL_BLEND );
|
||||
pfglEnable( GL_TEXTURE_2D );
|
||||
}
|
||||
|
||||
/*
|
||||
====================
|
||||
@@ -211,11 +247,11 @@ PUBLIC void R_Draw_Wall( float x, float y, float z1, float z2, int type, int tex
|
||||
|
||||
LoadWallTexture( tex );
|
||||
|
||||
pfglBegin( GL_QUADS );
|
||||
pfglBegin( GL_TRIANGLE_STRIP );
|
||||
|
||||
pfglTexCoord2f( 1.0, 0.0 ); pfglVertex3f( x1, z2, y1 );
|
||||
pfglTexCoord2f( 0.0, 0.0 ); pfglVertex3f( x2, z2, y2 );
|
||||
pfglTexCoord2f( 0.0, 1.0 ); pfglVertex3f( x2, z1, y2 );
|
||||
pfglTexCoord2f( 1.0, 0.0 ); pfglVertex3f( x1, z2, y1 );
|
||||
pfglTexCoord2f( 1.0, 1.0 ); pfglVertex3f( x1, z1, y1 );
|
||||
|
||||
pfglEnd();
|
||||
@@ -276,11 +312,11 @@ PUBLIC void R_Draw_Door( int x, int y, float z1, float z2, _boolean vertical, _b
|
||||
|
||||
LoadWallTexture( tex );
|
||||
|
||||
pfglBegin( GL_QUADS );
|
||||
pfglBegin( GL_TRIANGLE_STRIP );
|
||||
|
||||
pfglTexCoord2f( backside ? 0.0f : 1.0f, 0.0 ); pfglVertex3f( x1, z2, y1 );
|
||||
pfglTexCoord2f( backside ? 1.0f : 0.0f, 0.0 ); pfglVertex3f( x2, z2, y2 );
|
||||
pfglTexCoord2f( backside ? 1.0f : 0.0f, 1.0 ); pfglVertex3f( x2, z1, y2 );
|
||||
pfglTexCoord2f( backside ? 0.0f : 1.0f, 0.0 ); pfglVertex3f( x1, z2, y1 );
|
||||
pfglTexCoord2f( backside ? 0.0f : 1.0f, 1.0 ); pfglVertex3f( x1, z1, y1 );
|
||||
|
||||
pfglEnd();
|
||||
@@ -340,7 +376,7 @@ PUBLIC void R_DrawSprites( void )
|
||||
}
|
||||
R_Bind( twall->texnum );
|
||||
|
||||
pfglBegin( GL_QUADS );
|
||||
pfglBegin( GL_TRIANGLE_STRIP );
|
||||
|
||||
if ( cropSprites->value && twall->header.numBounds > 0 ) {
|
||||
// draw one or two subrects to avoid blending all the empty space
|
||||
@@ -367,8 +403,8 @@ PUBLIC void R_DrawSprites( void )
|
||||
|
||||
pfglTexCoord2f( x1, y1 ); pfglVertex3f( Ex - x1 * 2*cosa, -(LOWERZCOORD + (UPPERZCOORD - LOWERZCOORD) * y1), -Ey + x1 * 2*sina );
|
||||
pfglTexCoord2f( x1, y2 ); pfglVertex3f( Ex - x1 * 2*cosa, -(LOWERZCOORD + (UPPERZCOORD - LOWERZCOORD) * y2), -Ey + x1 * 2*sina );
|
||||
pfglTexCoord2f( x2, y2 ); pfglVertex3f( Ex - x2 * 2*cosa, -(LOWERZCOORD + (UPPERZCOORD - LOWERZCOORD) * y2), -Ey + x2 * 2*sina );
|
||||
pfglTexCoord2f( x2, y1 ); pfglVertex3f( Ex - x2 * 2*cosa, -(LOWERZCOORD + (UPPERZCOORD - LOWERZCOORD) * y1), -Ey + x2 * 2*sina );
|
||||
pfglTexCoord2f( x2, y2 ); pfglVertex3f( Ex - x2 * 2*cosa, -(LOWERZCOORD + (UPPERZCOORD - LOWERZCOORD) * y2), -Ey + x2 * 2*sina );
|
||||
}
|
||||
} else {
|
||||
Ex = Dx = vislist[ n ].x / FLOATTILE;
|
||||
@@ -378,8 +414,8 @@ PUBLIC void R_DrawSprites( void )
|
||||
|
||||
pfglTexCoord2f( 0.0, 0.0 ); pfglVertex3f( Ex, UPPERZCOORD, -Ey );
|
||||
pfglTexCoord2f( 0.0, 1.0 ); pfglVertex3f( Ex, LOWERZCOORD, -Ey );
|
||||
pfglTexCoord2f( 1.0, 1.0 ); pfglVertex3f( Dx, LOWERZCOORD, -Dy );
|
||||
pfglTexCoord2f( 1.0, 0.0 ); pfglVertex3f( Dx, UPPERZCOORD, -Dy );
|
||||
pfglTexCoord2f( 1.0, 1.0 ); pfglVertex3f( Dx, LOWERZCOORD, -Dy );
|
||||
}
|
||||
|
||||
pfglEnd();
|
||||
@@ -429,9 +465,9 @@ PUBLIC void R_DrawNumber( int x, int y, int number )
|
||||
fcol = col * w;
|
||||
|
||||
pfglTexCoord2f( fcol, 0 ); pfglVertex2i( x, y );
|
||||
pfglTexCoord2f( fcol+w, 0 ); pfglVertex2i( x+18, y );
|
||||
pfglTexCoord2f( fcol+w, 1 ); pfglVertex2i( x+18, y+32 );
|
||||
pfglTexCoord2f( fcol, 1 ); pfglVertex2i( x, y+32 );
|
||||
pfglTexCoord2f( fcol+w, 1 ); pfglVertex2i( x+18, y+32 );
|
||||
pfglTexCoord2f( fcol+w, 0 ); pfglVertex2i( x+18, y );
|
||||
|
||||
x -= 18;
|
||||
}
|
||||
@@ -503,9 +539,10 @@ PUBLIC void R_put_line( int x, int y, const char *string )
|
||||
|
||||
|
||||
pfglTexCoord2f( fcol, frow ); pfglVertex2i( mx, y );
|
||||
pfglTexCoord2f( fcol+w, frow ); pfglVertex2i( mx+32, y );
|
||||
pfglTexCoord2f( fcol+w, frow+h ); pfglVertex2i( mx+32, y+32 );
|
||||
pfglTexCoord2f( fcol, frow+h ); pfglVertex2i( mx, y+32 );
|
||||
pfglTexCoord2f( fcol+w, frow+h ); pfglVertex2i( mx+32, y+32 );
|
||||
pfglTexCoord2f( fcol+w, frow ); pfglVertex2i( mx+32, y );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -585,7 +585,7 @@ PUBLIC void PL_Spawn( placeonplane_t location, LevelData_t *lvl )
|
||||
|
||||
//gsh
|
||||
iphoneSetLevelNotifyText();
|
||||
/*
|
||||
#if 0
|
||||
char str[128];
|
||||
//sprintf( str, "Entering level E%iM%i", currentMap.episode + 1, currentMap.map + 1 );
|
||||
//gsh
|
||||
@@ -624,10 +624,10 @@ PUBLIC void PL_Spawn( placeonplane_t location, LevelData_t *lvl )
|
||||
}
|
||||
}
|
||||
else
|
||||
sprintf( str, "Entering level custom %i", /*currentMap.episode+1,* currentMap.map+1 );
|
||||
sprintf( str, "Entering level custom %i", /*currentMap.episode+1,*/ currentMap.map+1 );
|
||||
|
||||
iphoneSetNotifyText( str );
|
||||
*/
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -295,13 +295,13 @@ PRIVATE int Pow_Give( pow_t type )
|
||||
|
||||
Com_Printf("Spear of Destiny picked up!!\n");
|
||||
|
||||
Sound_StartSound( NULL, 0, CHAN_ITEM, Sound_RegisterSound( "sfx/109.wav" ), 1, ATTN_NORM, 0 ); //gsh
|
||||
iphoneSetNotifyText( "Spear of Destiny" );
|
||||
/* //gsh
|
||||
my_snprintf( szTextMsg, sizeof( szTextMsg ), //this is supposed to load the last level... but it isn't
|
||||
"loading ; map s%.2d.map\n", 20 );
|
||||
Cbuf_AddText( szTextMsg );
|
||||
*/
|
||||
Sound_StartSound( NULL, 0, CHAN_ITEM, Sound_RegisterSound( "sfx/109.wav" ), 1, ATTN_NORM, 0 ); //gsh
|
||||
iphoneSetNotifyText( "Spear of Destiny" );
|
||||
/* //gsh
|
||||
my_snprintf( szTextMsg, sizeof( szTextMsg ), //this is supposed to load the last level... but it isn't
|
||||
"loading ; map s%.2d.map\n", 20 );
|
||||
Cbuf_AddText( szTextMsg );
|
||||
*/
|
||||
|
||||
//this might be a bit of a hack. But it works.
|
||||
//Load the last level... gsh
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#define __WOLF_RENDERER_H__
|
||||
|
||||
extern void R_DrawBox( int x, int y, int w, int h, W32 color );
|
||||
extern void R_DrawBoxFloat( float x, float y, float w, float h, W32 color );
|
||||
|
||||
extern void R_Draw_Door( int x, int y, float z1, float z2, _boolean vertical, _boolean backside, int tex, int amount );
|
||||
extern void R_Draw_Wall( float x, float y, float z1, float z2, int type, int tex );
|
||||
|
||||
Reference in New Issue
Block a user