Programming 2D Games

The official forum for "Programming 2D Games" the book by: Charles Kelly

It is currently Sun Oct 22, 2017 10:00 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Game Engine V2.5
PostPosted: Sun Mar 24, 2013 5:32 pm 
Offline

Joined: Tue Dec 11, 2012 8:04 pm
Posts: 36
I just noticed, in the latest version of the Game Engine, there is an error in the TextureManager initialize function.
When loading the texture(s), the new code looks like so:
Code:
// load texture files
for(UINT i=0; i<fileNames.size(); i++)
{
   hr = graphics->loadTexture(fileNames[i].c_str(),
         graphicsNS::TRANSCOLOR, width[i], height[i], texture[i]);
   if (FAILED(hr))
      safeReleaseTexture(texture.at(i));
}

However, if it fails to load a texture, it doesn't return false, which in turn doesn't throw a game error.

_________________
Nick


Top
 Profile  
Reply with quote  
 Post subject: Re: Game Engine V2.5
PostPosted: Thu Mar 28, 2013 7:27 pm 
Offline
Site Admin
User avatar

Joined: Sat Jan 28, 2012 4:36 pm
Posts: 542
Good catch.

Corrected in Game Engine v2.6

_________________
Professor Kelly


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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

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