Skip to content

Commit

Permalink
Initial QuakeLive support.
Browse files Browse the repository at this point in the history
  • Loading branch information
QBall147 authored and bnoordhuis committed Jul 31, 2012
1 parent 25b655e commit ef00485
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
6 changes: 3 additions & 3 deletions l_bsp_q3.c
Expand Up @@ -599,11 +599,11 @@ void Q3_LoadBSPFile(struct quakefile_s *qf)
// swap the header // swap the header
Q3_SwapBlock( (int *)header, sizeof(*header) ); Q3_SwapBlock( (int *)header, sizeof(*header) );


if ( header->ident != Q3_BSP_IDENT ) { if ( header->ident != Q3_BSP_IDENT && header->ident != QL_BSP_IDENT ) {
Error( "%s is not a IBSP file", qf->filename ); Error( "%s is not a IBSP file", qf->filename );
} }
if ( header->version != Q3_BSP_VERSION ) { if ( header->version != Q3_BSP_VERSION && header->version != QL_BSP_VERSION ) {
Error( "%s is version %i, not %i", qf->filename, header->version, Q3_BSP_VERSION ); Error( "%s is version %i, not (%i or %i)", qf->filename, header->version, Q3_BSP_VERSION, QL_BSP_VERSION );
} }


q3_numShaders = Q3_CopyLump( header, Q3_LUMP_SHADERS, (void *) &q3_dshaders, sizeof(q3_dshader_t) ); q3_numShaders = Q3_CopyLump( header, Q3_LUMP_SHADERS, (void *) &q3_dshaders, sizeof(q3_dshader_t) );
Expand Down
7 changes: 7 additions & 0 deletions map.c
Expand Up @@ -1212,6 +1212,13 @@ int LoadMapFromBSP(struct quakefile_s *qf)


idheader.ident = LittleLong(idheader.ident); idheader.ident = LittleLong(idheader.ident);
idheader.version = LittleLong(idheader.version); idheader.version = LittleLong(idheader.version);
//QuakeLive BSP file
if (idheader.ident == QL_BSP_IDENT && idheader.version == QL_BSP_VERSION)
{
ResetMapLoading();
Q3_LoadMapFromBSP(qf);
Q3_FreeMaxBSP();
} //end if
//Quake3 BSP file //Quake3 BSP file
if (idheader.ident == Q3_BSP_IDENT && idheader.version == Q3_BSP_VERSION) if (idheader.ident == Q3_BSP_IDENT && idheader.version == Q3_BSP_VERSION)
{ {
Expand Down
7 changes: 7 additions & 0 deletions q3files.h
Expand Up @@ -204,6 +204,13 @@ typedef struct {


#define Q3_BSP_VERSION 46 #define Q3_BSP_VERSION 46


// quick fix for creating aas files for ql bsp's.
// (later this will probably need to be seperated, if we plan to add further support for ql)
#define QL_BSP_IDENT (('P'<<24)+('S'<<16)+('B'<<8)+'I')
// little-endian "IBSP"

#define QL_BSP_VERSION 47
// ***********************************************************


// there shouldn't be any problem with increasing these values at the // there shouldn't be any problem with increasing these values at the
// expense of more memory allocation in the utilities // expense of more memory allocation in the utilities
Expand Down

0 comments on commit ef00485

Please sign in to comment.