Forum

HLBSP Roadblock

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

HLBSP Roadblock

Postby Mexicouger » Fri Dec 10, 2010 9:09 am

I decided to port The HLBSP code in Bakers Proquake into my own engine, and I have hurdled most of the problems so far. I am at point where I am stuck however, And I don't have an answer.

There is this function called GL_LoadPalettedTexture. However, when I compile in Cygwin, it will get to the end and all, But at the end it gets an error. First off, Here is the code:

Code: Select all
#if 0
      tx->gl_texturenum = GL_LoadTexture (mt->name, tx->width, tx->height, (byte *)(tx_pixels), qtrue, GU_LINEAR, level);
#else

      if (loadmodel->bspversion == HL_BSPVERSION) {
         byte      *data;
         if ((data = WAD3_LoadTexture(mt)))
         {
            tx->gl_texturenum = GL_LoadPalettedTexture (mt->name, tx->width, tx->height, (byte *)data, qtrue, GU_LINEAR, level, mt->palette);
            mapTextureNameList.push_back(tx->gl_texturenum);

            free(mt->palette);
            free(data);
            continue;
         }
      }
      else
      {
         //texture_mode = GL_LINEAR_MIPMAP_NEAREST; //_LINEAR;
         tx->gl_texturenum = GL_LoadTexture (mt->name, tx->width, tx->height, (byte *)(tx_pixels), qtrue, GU_LINEAR, level);
         mapTextureNameList.push_back(tx->gl_texturenum);
      }
#endif


Now the error says:

normal/psp/video_hardware_model.o: In function 'Mod_LoadTextures(lump_t*)';
..psp/video_hardware_model.cpp: 465: undefined reference to 'GL_LoadPalettedTexture'

Collect2: ld returned 1 exit status
make *** [normal/quake.elf] Error 1

But I defined that in the place I was supposed to (video_hardware.cpp)

Any help? And Baker, do I have to do the thing you did with the Old Palette and things? Or can I leave the default.

Thanks

[/quote]
User avatar
Mexicouger
 
Posts: 514
Joined: Sat May 01, 2010 10:12 pm

Re: HLBSP Roadblock

Postby Baker » Fri Dec 10, 2010 12:11 pm

Mexicouger wrote:I decided to port The HLBSP code in Bakers Proquake into my own engine, and I have hurdled most of the problems so far. I am at point where I am stuck however, And I don't have an answer.

There is this function called GL_LoadPalettedTexture. However, when I compile in Cygwin, it will get to the end and all, But at the end it gets an error. First off, Here is the code:

Code: Select all
#if 0
      tx->gl_texturenum = GL_LoadTexture (mt->name, tx->width, tx->height, (byte *)(tx_pixels), qtrue, GU_LINEAR, level);
#else

      if (loadmodel->bspversion == HL_BSPVERSION) {
         byte      *data;
         if ((data = WAD3_LoadTexture(mt)))
         {
            tx->gl_texturenum = GL_LoadPalettedTexture (mt->name, tx->width, tx->height, (byte *)data, qtrue, GU_LINEAR, level, mt->palette);
            mapTextureNameList.push_back(tx->gl_texturenum);

            free(mt->palette);
            free(data);
            continue;
         }
      }
      else
      {
         //texture_mode = GL_LINEAR_MIPMAP_NEAREST; //_LINEAR;
         tx->gl_texturenum = GL_LoadTexture (mt->name, tx->width, tx->height, (byte *)(tx_pixels), qtrue, GU_LINEAR, level);
         mapTextureNameList.push_back(tx->gl_texturenum);
      }
#endif


Now the error says:

normal/psp/video_hardware_model.o: In function 'Mod_LoadTextures(lump_t*)';
..psp/video_hardware_model.cpp: 465: undefined reference to 'GL_LoadPalettedTexture'

Collect2: ld returned 1 exit status
make *** [normal/quake.elf] Error 1

But I defined that in the place I was supposed to (video_hardware.cpp)

Any help? And Baker, do I have to do the thing you did with the Old Palette and things? Or can I leave the default.

Thanks

[/quote]

I have a target date of when I want to get the next version of ProQuake out and I have a lot to do to meet this deadline (Christmas, obviously) with the stuff I have done.

That being said, I can explain the error ... the "GL_LoadPalettedTexture" is being called and you do not have it your source code. Do a search in my source code locating all instances with something like TextPad and then do a search in yours --- you don't have the function in your source.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Downsider » Fri Dec 10, 2010 1:32 pm

Probably isn't in the header file.

Also, upsampling to 4bpp and not using DXT compression or paletting them to 8-bitness is a horrible, horrible idea on the PSP.
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am

Postby Mexicouger » Fri Dec 10, 2010 2:08 pm

The HLBSP code is directly from Proquake psp. And I have that function defined in Video_hardware_draw.cpp, as well as hardware-video.h(Where the other functions are like this)
User avatar
Mexicouger
 
Posts: 514
Joined: Sat May 01, 2010 10:12 pm

Postby Mexicouger » Sat Dec 11, 2010 12:12 am

Alright, I have finished HLBSP. It is in my engine, however, I can see why I need DXT texture compression. My framerate is 24 frames slower(I have a testing spot), and that is in a regular map
User avatar
Mexicouger
 
Posts: 514
Joined: Sat May 01, 2010 10:12 pm

Postby Downsider » Sat Dec 11, 2010 3:00 am

The DXT compression is for the most part to save RAM, hence compression, although obviously uploading data to the GU takes less time if there is less of it, but the performance difference isn't all that great- at least with me comparing it from paletted 8-bit -> DXT1 compression. You'd be doing from upsampled 32-bit -> DXT1 compression, so I'm not sure how big the difference is between those two.
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am

Postby Mexicouger » Sat Dec 11, 2010 3:25 am

I have seemed to encounter a problem. Whenever a sprite is drawn to the screen, it totally locks up and freezes. I have been searching through the places I have been in the code, and i haven't changed sprites at all. The sprites are correctly scaled, but it still freezes. Can't find the problem for the life of me

EDIT: Not too sure what I did, but Sprites now load in regular maps, but not HLBSP maps
User avatar
Mexicouger
 
Posts: 514
Joined: Sat May 01, 2010 10:12 pm


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest