Skip to content
Browse files

Initial QuakeLive support.

  • Loading branch information...
1 parent 25b655e commit ef00485e5d26f0a4b8dd21af959a4695f833d770 @QBall147 QBall147 committed with bnoordhuis
Showing with 17 additions and 3 deletions.
  1. +3 −3 l_bsp_q3.c
  2. +7 −0 map.c
  3. +7 −0 q3files.h
View
6 l_bsp_q3.c
@@ -599,11 +599,11 @@ void Q3_LoadBSPFile(struct quakefile_s *qf)
// swap the 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 );
}
- if ( header->version != Q3_BSP_VERSION ) {
- Error( "%s is version %i, not %i", qf->filename, header->version, Q3_BSP_VERSION );
+ if ( header->version != Q3_BSP_VERSION && header->version != QL_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) );
View
7 map.c
@@ -1212,6 +1212,13 @@ int LoadMapFromBSP(struct quakefile_s *qf)
idheader.ident = LittleLong(idheader.ident);
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
if (idheader.ident == Q3_BSP_IDENT && idheader.version == Q3_BSP_VERSION)
{
View
7 q3files.h
@@ -204,6 +204,13 @@ typedef struct {
#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
// expense of more memory allocation in the utilities

0 comments on commit ef00485

Please sign in to comment.
Something went wrong with that request. Please try again.