Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
Nether Earth
 Brain Games Forums : Nether Earth
Subject Topic: Little annoying bug Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
fuxx
Newbie
Newbie


Joined: 04 October 2006
Location: Russian Federation
Posts: 2
Posted: 30 October 2007 at 02:52 | IP Logged Quote fuxx

Hi, there is bug in class NETHER - member variable zoom isn't initialized to zero in class constructor.

And since singleton instance of NETHER is created on the heap rather than as a static variable it's not always initialized to zero.

Particulary newer versions of SDL allocate and deallocate dynamic memory BEFORE calling main() and now zoom isn't zero after creating instance of NETHER.

This has effect when you see black gamefield area after beginning new game. It's black because zoom has random big value.

Adding initialization to constructor helps:

NETHER::NETHER(char *mapname)
: zoom(0)
{
}

Back to Top View fuxx's Profile Search for other posts by fuxx Visit fuxx's Homepage Send Private Message Add to Buddy List
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.01
Copyright ©2001-2003 Web Wiz Guide

This page was generated in 0,0938 seconds.