Horde3D

Next-Generation Graphics Engine
It is currently 22.11.2024, 07:49

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 23.11.2010, 22:40 
Offline

Joined: 15.06.2008, 11:21
Posts: 166
Location: Germany
egTexture.cpp:
Code:
      if( !(ddsHeader.caps.dwCaps2 & DDSCAPS2_CM_COMPLETE) )
         raiseError( "DDS cubemap does not contain all cube sides" );


Is this correct? What about
Code:
      if((ddsHeader.caps.dwCaps2 & DDSCAPS2_CM_COMPLETE) != DDSCAPS2_CM_COMPLETE )

?
Looks more like what was intended.

EDIT:
Code:
      if( ddsHeader.pixFormat.dwRBitMask == 0x00ff0000 &&
          ddsHeader.pixFormat.dwGBitMask == 0x0000ff00 &&
          ddsHeader.pixFormat.dwBBitMask == 0x000000ff ) pixFmt = pfBGR;
      else
      if( ddsHeader.pixFormat.dwRBitMask == 0x00ff0000 &&
          ddsHeader.pixFormat.dwGBitMask == 0x0000ff00 &&
          ddsHeader.pixFormat.dwBBitMask == 0x000000ff ) pixFmt = pfRGB;

2x the same check?


Top
 Profile  
Reply with quote  
PostPosted: 24.11.2010, 22:17 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
The check for the cubemap flags is correct. This is just standard bitmask/flag logic:
Code:
set flag: flags |= MY_FLAG
unset flag: flags &= ~MY_FLAG
check for flag:  if( flags & MY_FLAG )

However, the double format check is wrong of course. I think the second condition should have the red and blue masks swapped.


Top
 Profile  
Reply with quote  
PostPosted: 25.11.2010, 14:52 
Offline

Joined: 15.06.2008, 11:21
Posts: 166
Location: Germany
are you checking that at least one cube side exists, or are you checking for all sides? You initialize numSlices to 6, even if only one of the bits within DDSCAPS2_CM_COMPLETE is set, although the file only contains 5 or less sides. But that check will pass in this case as & checks for the existance of at least one bit in the area of that bit mask.

So:
Code:
set flag: flags |= MY_FLAG
unset flag: flags &= ~MY_FLAG
check for flag:  if( flags & MY_FLAG )
check for a single bit in a mask:  if( flags & MY_MASK )
check for ALL bits in a mask:  if( ( flags & MY_MASK ) == MY_MASK )


Top
 Profile  
Reply with quote  
PostPosted: 29.11.2010, 21:39 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Ah right, DDSCAPS2_CM_COMPLETE is a combination of several flags, so you are right. Will be fixed, thanks for bringing this up.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group