Skip to content

Commit

Permalink
Source release of Wolfenstein 3D Classic Platinum for iOS, 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Bradshaw committed Jan 31, 2012
1 parent 1630494 commit d7fff51
Show file tree
Hide file tree
Showing 235 changed files with 64,159 additions and 1,386 deletions.
Binary file added __MACOSX/wolf3d/._README.txt
Binary file not shown.
Binary file added __MACOSX/wolf3d/._readme_iWolf_v1x.txt
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/._wolfiphone.h
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/env/._fileio.c
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/env/._files.c
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/env/._filesystem.h
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/env/._openal_main.c
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/env/._opengl_draw.c
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/env/._opengl_local.h
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/env/._opengl_main.c
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/env/._sound.c
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/env/._sound_local.h
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/env/._sound_sfx_id.c
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/env/._sound_stream.c
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/env/._texture_manager.c
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/env/._texture_manager.h
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/env/._unix_file.c
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/env/._video.h
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._.DS_Store
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._EAGLView.h
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._EAGLView.m
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._Info.plist
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._LegalViewController.h
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._LegalViewController.m
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._MissionTableViewCell.h
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._MissionTableViewCell.m
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._SkillViewController.h
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._SkillViewController.m
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._TriviaViewController.h
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._TriviaViewController.m
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._UIFontButton.h
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._UIFontButton.m
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._UIFontLabel.h
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._UIFontLabel.m
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._UITableViewScrolling.h
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._UITableViewScrolling.m
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._WolfSlider.h
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._WolfSlider.m
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._gles_glue.c
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._gles_glue.h
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._hud.c
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._iphone_alerts.h
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._iphone_alerts.m
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._iphone_downloadSOD.m
Binary file not shown.
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._iphone_loop.c
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._iphone_main.c
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._iphone_mapselector.c
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._iphone_menus.c
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._iphone_qgl.h
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._iphone_store.h
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._iphone_store.m
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._iphone_sys.m
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._iphone_wolf.h
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._main.m
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._wolf3dAppDelegate.h
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._wolf3dAppDelegate.m
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._wolf3dViewController.h
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._wolf3dViewController.m
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/iphone/._wolf3d_Prefix.pch
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/wolf/._wolf_ai_com.c
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/wolf/._wolf_client_main.c
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/wolf/._wolf_local.h
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/wolf/._wolf_math.c
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/wolf/._wolf_opengl.c
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/wolf/._wolf_player.c
Binary file not shown.
Binary file added __MACOSX/wolf3d/code/wolf/._wolf_renderer.h
Binary file not shown.
Binary file added __MACOSX/wolf3d/scripts/._scrubBase.pl
Binary file not shown.
345 changes: 345 additions & 0 deletions wolf3d/COPYING.txt

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions wolf3d/README.txt
@@ -0,0 +1,22 @@
WOLF3D iOS v2.1 GPL source release
===============================================

This file contains the following sections:

GENERAL NOTES
LICENSE

GENERAL NOTES
=============

WOLF3D iOS v2.1 is a free release, and can be downloaded from
http://idsoftware.com/idstuff/wolf3d/wolf3d_ios_v21_src.zip

This source release does not contain any game data, the game data remains subject to the original EULA and applicable law.


LICENSE
=======

See COPYING.txt for the GNU GENERAL PUBLIC LICENSE. If COPYING.txt does not accompany, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

8 changes: 6 additions & 2 deletions wolf3d/code/env/fileio.c
Expand Up @@ -109,12 +109,17 @@ PUBLIC W32 FS_FileSeek( filehandle_t *fhandle, SW32 offset, W32 origin )
return 1;
}

/* Commenting this out to avoid a warning - note that this is probably not what was
intended!
// offset is negative
if( (fhandle->filesize + offset) < 0 )
{
return 1;
}
*/

// offset is negative
fhandle->ptrCurrent = fhandle->ptrEnd + offset;
break;
Expand Down Expand Up @@ -223,15 +228,14 @@ PUBLIC filehandle_t *FS_OpenFile( const char *filename, W32 FlagsAndAttributes )
// high performance file mapping path, avoiding stdio
fd = open( netpath, O_RDONLY );
if ( fd == -1 ) {
// return NULL;
//if it couldn't be found in that path then check again in the document directory
//gsh
//pathBase = FS_ForceGamedir();
extern char iphoneDocDirectory[1024];
pathBase = iphoneDocDirectory;
my_snprintf( netpath, sizeof( netpath ), "%s/%s", pathBase, filename );
fd = open( netpath, O_RDONLY );
if ( fd == -1 ) { //okay, couldn't find it there either... return null
if ( fd == -1 ) {
return NULL;
}
}
Expand Down
15 changes: 12 additions & 3 deletions wolf3d/code/env/files.c
Expand Up @@ -172,7 +172,16 @@ PRIVATE char **FS_ListFiles( char *findname, int *numfiles, unsigned musthave, u
*/
PUBLIC void FS_InitFilesystem( void )
{
char *p;
p = getenv("CWD");
sprintf( fs_gamedir, "%s/base", p );
#define BASE_DIRECTORY "/base"

int length = SysIPhoneGetPathToMainBundleLength();

// Make sure the path will fit.
int fullPathLength = length + strlen( BASE_DIRECTORY ) + 1;

assert( fullPathLength < MAX_OSPATH );

SysIPhoneGetPathToMainBundle( fs_gamedir, length + 1 );

strcpy( fs_gamedir + length, BASE_DIRECTORY );
}
2 changes: 2 additions & 0 deletions wolf3d/code/env/filesystem.h
Expand Up @@ -39,6 +39,8 @@
#ifndef __FILESYSTEM_H__
#define __FILESYSTEM_H__

#include "arch.h"

#define MAX_GAMEPATH 256 // max length of a game pathname
#define MAX_OSPATH 256 // max length of a filesystem pathname

Expand Down
13 changes: 11 additions & 2 deletions wolf3d/code/env/openal_main.c
Expand Up @@ -76,12 +76,16 @@ W16 numSoundDevices, numDefaultSoundDevice;
PRIVATE void Sound_Device_getDeviceList( void )
{
char deviceName[ 256 ];

ALboolean isExtensionPresent = AL_FALSE;

my_strlcpy( deviceName, s_device->string, sizeof( deviceName ) );
if( pfalcIsExtensionPresent( NULL, (ALubyte*)"ALC_ENUMERATION_EXT") == AL_TRUE )
isExtensionPresent = pfalcIsExtensionPresent( NULL, (ALubyte*)"ALC_ENUMERATION_EXT");
ALC_CheckErrors();
if( isExtensionPresent == AL_TRUE )
{
// try out enumeration extension
deviceList = (char *)pfalcGetString( NULL, ALC_DEVICE_SPECIFIER );
ALC_CheckErrors();
for( numSoundDevices = 0 ; numSoundDevices < 12 ; ++numSoundDevices )
{
sound_devices[ numSoundDevices ] = NULL;
Expand Down Expand Up @@ -200,12 +204,14 @@ PUBLIC _boolean Sound_Device_Setup( void )
if( Context )
{
pfalcDestroyContext( Context );
ALC_CheckErrors();
Context = NULL;
}

if( Device )
{
pfalcCloseDevice( Device );
ALC_CheckErrors();
Device = NULL;
}

Expand All @@ -230,14 +236,17 @@ PUBLIC void Sound_Device_Shutdown( void )
if( Context )
{
pfalcMakeContextCurrent( NULL );
ALC_CheckErrors();
pfalcDestroyContext( Context );
ALC_CheckErrors();

Context = NULL;
}

if( Device )
{
pfalcCloseDevice( Device );
ALC_CheckErrors();

Device = NULL;
}
Expand Down
18 changes: 9 additions & 9 deletions wolf3d/code/env/opengl_draw.c
Expand Up @@ -93,20 +93,20 @@ PUBLIC void R_Draw_Character( int x, int y, int num, font_t *myfont )
R_Bind( myfont->texfont->texnum );


pfglBegin( GL_QUADS );
pfglBegin( GL_TRIANGLE_STRIP );


pfglTexCoord2f( fcol, frow );
pfglVertex2i( x, y );

pfglTexCoord2f( fcol, frow+myfont->hFrac );
pfglVertex2i( x, (y+sh*scale) );

pfglTexCoord2f( fcol+myfont->wFrac, frow );
pfglVertex2i( x+myfont->nMaxWidth*scale, y );

pfglTexCoord2f( fcol+myfont->wFrac, frow+myfont->hFrac );
pfglVertex2i( x+myfont->nMaxWidth*scale, (y+sh*scale) );

pfglTexCoord2f( fcol, frow+myfont->hFrac );
pfglVertex2i( x, (y+sh*scale) );



Expand Down Expand Up @@ -146,12 +146,12 @@ PUBLIC void R_Draw_StretchPic( int x, int y, int w, int h, const char *pic )

R_Bind( gl->texnum );

pfglBegin( GL_QUADS );
pfglBegin( GL_TRIANGLE_STRIP );

pfglTexCoord2f( 0.0f, 0.0f ); pfglVertex2i( x, y );
pfglTexCoord2f( 0.0f, 1.0f ); pfglVertex2i( x, y+h );
pfglTexCoord2f( 1.0f, 0.0f ); pfglVertex2i( x+w, y );
pfglTexCoord2f( 1.0f, 1.0f ); pfglVertex2i( x+w, y+h );
pfglTexCoord2f( 0.0f, 1.0f ); pfglVertex2i( x, y+h );

pfglEnd();
}
Expand Down Expand Up @@ -186,7 +186,7 @@ PUBLIC void R_Draw_Fill( int x, int y, int w, int h, colour3_t c )
c4[3] = 255;
R_Draw_Blend( x, y, w, h, c4 );
#else
if ( revLand->value ) {
if ( deviceOrientation == ORIENTATION_LANDSCAPE_RIGHT ) {
qglScissor( x, y, w, h );
} else {
qglScissor( x, 320-(y+h), w, h );
Expand All @@ -203,12 +203,12 @@ PUBLIC void R_Draw_Blend( int x, int y, int w, int h, colour4_t c )
pfglDisable( GL_TEXTURE_2D );
pfglColor4ubv( c );

pfglBegin( GL_QUADS );
pfglBegin( GL_TRIANGLE_STRIP );

pfglVertex2i( x, y );
pfglVertex2i( x, y+h );
pfglVertex2i( x+w, y );
pfglVertex2i( x+w, y+h );
pfglVertex2i( x, y+h );

pfglEnd();

Expand Down
1 change: 1 addition & 0 deletions wolf3d/code/env/opengl_local.h
Expand Up @@ -131,6 +131,7 @@ typedef struct
const char *version_string;
const char *extensions_string;
_boolean Version_1_2;
bool framebuffer_discard;

} glconfig_t;

Expand Down
15 changes: 9 additions & 6 deletions wolf3d/code/env/opengl_main.c
Expand Up @@ -284,7 +284,6 @@ PUBLIC void R_Init()
int err;
int a, b;


Com_Printf( "\n------ Display Initialization ------\n" );

Com_Printf( "Initializing OpenGL Subsystem\n" );
Expand All @@ -294,9 +293,6 @@ PUBLIC void R_Init()
// set our "safe" modes
gl_state.prev_mode = 0;

viddef.width = 480;
viddef.height = 320;

// get various GL strings
gl_config.vendor_string = (char *)pfglGetString( GL_VENDOR );
Com_Printf( "GL_VENDOR: %s\n", gl_config.vendor_string );
Expand All @@ -316,7 +312,6 @@ PUBLIC void R_Init()
my_strlcpy( vendor_buffer, gl_config.vendor_string, sizeof( vendor_buffer ) );
(void)my_strlwr( vendor_buffer );


sscanf( gl_config.version_string, "%d.%d", &a, &b );
if( a >= 1 && b >= 2 )
{
Expand All @@ -326,6 +321,14 @@ PUBLIC void R_Init()
pfglGetIntegerv( GL_MAX_TEXTURE_SIZE, &glMaxTexSize );
Com_Printf( "GL_MAX_TEXTURE_SIZE: %d\n", glMaxTexSize);

if ( strstr( gl_config.extensions_string, "GL_EXT_discard_framebuffer" ) != 0 ) {
gl_config.framebuffer_discard = true;
} else {
gl_config.framebuffer_discard = false;
}

InitImmediateModeGL();

GL_SetDefaultState();

TM_Init();
Expand Down Expand Up @@ -359,7 +362,7 @@ PUBLIC void PrintGLError( W32 err, const char *from )
return;
}

if( from != "" )
if( strlen(from) != 0 )
{
Com_Printf( "\n\n\nGL Error: %s\n", from );
}
Expand Down

0 comments on commit d7fff51

Please sign in to comment.