Merge pull request #189 from jdolan/master

Q2Pack support and small Q2W enhancements
This commit is contained in:
Timothee "TTimo" Besset 2013-06-29 08:25:59 -07:00
commit 5d3dc9ff14
9 changed files with 26 additions and 15 deletions

View file

@ -20,7 +20,7 @@
<folderInfo id="cdt.managedbuild.config.gnu.macosx.exe.debug.1391516053." name="/" resourcePath=""> <folderInfo id="cdt.managedbuild.config.gnu.macosx.exe.debug.1391516053." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.macosx.exe.debug.262092662" name="MacOSX GCC" superClass="cdt.managedbuild.toolchain.gnu.macosx.exe.debug"> <toolChain id="cdt.managedbuild.toolchain.gnu.macosx.exe.debug.262092662" name="MacOSX GCC" superClass="cdt.managedbuild.toolchain.gnu.macosx.exe.debug">
<targetPlatform id="cdt.managedbuild.target.gnu.platform.macosx.exe.debug.262419562" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.macosx.exe.debug"/> <targetPlatform id="cdt.managedbuild.target.gnu.platform.macosx.exe.debug.262419562" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.macosx.exe.debug"/>
<builder arguments="" autoBuildTarget="" buildPath="${workspace_loc:/GtkRadiant}" cleanBuildTarget=" -c" command="/opt/local/bin/scons" enableAutoBuild="false" enableCleanBuild="true" enabledIncrementalBuild="true" id="cdt.managedbuild.target.gnu.builder.macosx.exe.debug.731716976" incrementalBuildTarget="" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.macosx.exe.debug"/> <builder arguments="-j3" autoBuildTarget="" buildPath="${workspace_loc:/GtkRadiant}" cleanBuildTarget=" -c" command="/opt/local/bin/scons" enableAutoBuild="false" enableCleanBuild="true" enabledIncrementalBuild="true" id="cdt.managedbuild.target.gnu.builder.macosx.exe.debug.731716976" incrementalBuildTarget="" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.macosx.exe.debug"/>
<tool id="cdt.managedbuild.tool.macosx.c.linker.macosx.exe.debug.995614768" name="MacOS X C Linker" superClass="cdt.managedbuild.tool.macosx.c.linker.macosx.exe.debug"/> <tool id="cdt.managedbuild.tool.macosx.c.linker.macosx.exe.debug.995614768" name="MacOS X C Linker" superClass="cdt.managedbuild.tool.macosx.c.linker.macosx.exe.debug"/>
<tool id="cdt.managedbuild.tool.macosx.cpp.linker.macosx.exe.debug.522250164" name="MacOS X C++ Linker" superClass="cdt.managedbuild.tool.macosx.cpp.linker.macosx.exe.debug"> <tool id="cdt.managedbuild.tool.macosx.cpp.linker.macosx.exe.debug.522250164" name="MacOS X C++ Linker" superClass="cdt.managedbuild.tool.macosx.cpp.linker.macosx.exe.debug">
<inputType id="cdt.managedbuild.tool.macosx.cpp.linker.input.1974564587" superClass="cdt.managedbuild.tool.macosx.cpp.linker.input"> <inputType id="cdt.managedbuild.tool.macosx.cpp.linker.input.1974564587" superClass="cdt.managedbuild.tool.macosx.cpp.linker.input">
@ -486,7 +486,7 @@
<folderInfo id="cdt.managedbuild.config.macosx.exe.release.1395891432." name="/" resourcePath=""> <folderInfo id="cdt.managedbuild.config.macosx.exe.release.1395891432." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.macosx.exe.release.903143162" name="MacOSX GCC" superClass="cdt.managedbuild.toolchain.gnu.macosx.exe.release"> <toolChain id="cdt.managedbuild.toolchain.gnu.macosx.exe.release.903143162" name="MacOSX GCC" superClass="cdt.managedbuild.toolchain.gnu.macosx.exe.release">
<targetPlatform id="cdt.managedbuild.target.gnu.platform.macosx.exe.release.2052976836" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.macosx.exe.release"/> <targetPlatform id="cdt.managedbuild.target.gnu.platform.macosx.exe.release.2052976836" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.macosx.exe.release"/>
<builder buildPath="${workspace_loc:/GtkRadiant/Release}" id="cdt.managedbuild.target.gnu.builder.macosx.exe.release.414785129" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.macosx.exe.release"/> <builder arguments="-j3" buildPath="${workspace_loc:/GtkRadiant}" command="/opt/local/bin/scons" id="cdt.managedbuild.target.gnu.builder.macosx.exe.release.414785129" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.macosx.exe.release"/>
<tool id="cdt.managedbuild.tool.macosx.c.linker.macosx.exe.release.794596469" name="MacOS X C Linker" superClass="cdt.managedbuild.tool.macosx.c.linker.macosx.exe.release"/> <tool id="cdt.managedbuild.tool.macosx.c.linker.macosx.exe.release.794596469" name="MacOS X C Linker" superClass="cdt.managedbuild.tool.macosx.c.linker.macosx.exe.release"/>
<tool id="cdt.managedbuild.tool.macosx.cpp.linker.macosx.exe.release.1203855338" name="MacOS X C++ Linker" superClass="cdt.managedbuild.tool.macosx.cpp.linker.macosx.exe.release"> <tool id="cdt.managedbuild.tool.macosx.cpp.linker.macosx.exe.release.1203855338" name="MacOS X C++ Linker" superClass="cdt.managedbuild.tool.macosx.cpp.linker.macosx.exe.release">
<inputType id="cdt.managedbuild.tool.macosx.cpp.linker.input.861310958" superClass="cdt.managedbuild.tool.macosx.cpp.linker.input"> <inputType id="cdt.managedbuild.tool.macosx.cpp.linker.input.861310958" superClass="cdt.managedbuild.tool.macosx.cpp.linker.input">

View file

@ -28,7 +28,7 @@
</dictionary> </dictionary>
<dictionary> <dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key> <key>org.eclipse.cdt.make.core.buildArguments</key>
<value></value> <value>-j3</value>
</dictionary> </dictionary>
<dictionary> <dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key> <key>org.eclipse.cdt.make.core.buildCommand</key>

View file

@ -27,7 +27,7 @@ class Config:
# platforms for which to assemble a setup # platforms for which to assemble a setup
self.setup_platforms = [ 'local', 'x86', 'x64', 'win32' ] self.setup_platforms = [ 'local', 'x86', 'x64', 'win32' ]
# paks to assemble in the setup # paks to assemble in the setup
self.setup_packs = [ 'Q3Pack', 'UrTPack', 'ETPack', 'QLPack', 'Q2WPack' ] self.setup_packs = [ 'Q3Pack', 'UrTPack', 'ETPack', 'QLPack', 'Q2Pack', 'Q2WPack' ]
def __repr__( self ): def __repr__( self ):
return 'config: target=%s config=%s' % ( self.target_selected, self.config_selected ) return 'config: target=%s config=%s' % ( self.target_selected, self.config_selected )

View file

@ -49,6 +49,7 @@ extern _QERFileSystemTable g_FileSystemTable;
void LoadJPG( const char *filename, unsigned char **pic, int *width, int *height ); void LoadJPG( const char *filename, unsigned char **pic, int *width, int *height );
#define Error g_FuncTable.m_pfnError #define Error g_FuncTable.m_pfnError
#define vfsGetFileCount g_FileSystemTable.m_pfnGetFileCount
#define vfsLoadFile g_FileSystemTable.m_pfnLoadFile #define vfsLoadFile g_FileSystemTable.m_pfnLoadFile
#define vfsFreeFile g_FileSystemTable.m_pfnFreeFile #define vfsFreeFile g_FileSystemTable.m_pfnFreeFile

View file

@ -743,6 +743,10 @@ void LoadImage( const char *name, byte ** pic, int *width, int *height ){
return; return;
} }
if ( vfsGetFileCount( name, 0 ) == 0 ) {
return;
}
if ( !g_ascii_strcasecmp( name + len - 4, ".tga" ) ) { if ( !g_ascii_strcasecmp( name + len - 4, ".tga" ) ) {
LoadTGA( name, pic, width, height ); LoadTGA( name, pic, width, height );
} }

View file

@ -33,6 +33,20 @@ CPicoSurface::CPicoSurface( picoSurface_t *pSurface ){
AccumulateBBox(); AccumulateBBox();
m_shader = QERApp_Shader_ForName( GetShaderName() ); m_shader = QERApp_Shader_ForName( GetShaderName() );
// jdolan: If the shader fails to load, try skin.tga in the model's
// directory as a fall-back. This is a hack for malformed models.
if ( m_shader->IsDefault() ) {
gchar *dir = g_path_get_dirname( m_pSurface->model->name );
gchar *skin = g_strdup_printf( "%s/skin.tga", dir );
m_shader->DecRef();
m_shader = QERApp_Shader_ForName( skin );
g_free( skin );
g_free( dir );
}
} }
CPicoSurface::~CPicoSurface(){ CPicoSurface::~CPicoSurface(){

View file

@ -499,10 +499,6 @@ int main( int argc, char* argv[] ) {
// TODO: Find a better place to call this. // TODO: Find a better place to call this.
gtk_glwidget_create_font(); gtk_glwidget_create_font();
if ( ( ptr = getenv( "Q3R_LIBGL" ) ) != NULL ) {
libgl = ptr;
}
for ( i = 1; i < argc; i++ ) for ( i = 1; i < argc; i++ )
{ {
char* param = argv[i]; char* param = argv[i];
@ -510,12 +506,7 @@ int main( int argc, char* argv[] ) {
if ( param[0] == '-' && param[1] == '-' ) { if ( param[0] == '-' && param[1] == '-' ) {
param += 2; param += 2;
if ( ( strcmp( param, "libgl" ) == 0 ) && ( i != argc ) ) { if ( strcmp( param, "builddefs" ) == 0 ) {
libgl = argv[i + 1];
argv[i] = argv[i + 1] = NULL;
i++;
}
else if ( strcmp( param, "builddefs" ) == 0 ) {
g_bBuildList = true; g_bBuildList = true;
argv[i] = NULL; argv[i] = NULL;
} }

View file

@ -75,6 +75,7 @@ filetype_t g_pattern_modelmd3( "md3 models", "*.md3" );
filetype_t g_pattern_modelmdc( "mdc models", "*.mdc" ); filetype_t g_pattern_modelmdc( "mdc models", "*.mdc" );
filetype_t g_pattern_modelmd2( "md2 models", "*.md2" ); filetype_t g_pattern_modelmd2( "md2 models", "*.md2" );
filetype_t g_pattern_modelmdl( "mdl models", "*.mdl" ); filetype_t g_pattern_modelmdl( "mdl models", "*.mdl" );
filetype_t g_pattern_modelobj( "obj models", "*.obj" );
filetype_t g_pattern_soundwav( "PCM sound files", "*.wav" ); filetype_t g_pattern_soundwav( "PCM sound files", "*.wav" );
filetype_t g_pattern_ogg( "OGG sound files", "*.ogg" ); filetype_t g_pattern_ogg( "OGG sound files", "*.ogg" );
filetype_t g_pattern_regq3( "quake3 region", "*.reg" ); filetype_t g_pattern_regq3( "quake3 region", "*.reg" );

View file

@ -3506,7 +3506,7 @@ void CGameInstall::Run() {
fprintf( fg, " "ENGINEPATH_ATTRIBUTE "=\"%s\"\n", m_strEngine.GetBuffer() ); fprintf( fg, " "ENGINEPATH_ATTRIBUTE "=\"%s\"\n", m_strEngine.GetBuffer() );
switch ( m_availGames[ m_nComboSelect ] ) { switch ( m_availGames[ m_nComboSelect ] ) {
case GAME_Q2: { case GAME_Q2: {
fprintf( fg, " "TOOLS_ATTRIBUTE "=\"%sinstalls/Quake2Pack/game\"\n", g_strAppPath.GetBuffer() ); fprintf( fg, " "TOOLS_ATTRIBUTE "=\"%sinstalls/Q2Pack/game\"\n", g_strAppPath.GetBuffer() );
fprintf( fg, " prefix=\".quake2\"\n" ); fprintf( fg, " prefix=\".quake2\"\n" );
Str source = g_strAppPath.GetBuffer(); Str source = g_strAppPath.GetBuffer();
source += "installs/"; source += "installs/";