Results 1 to 3 of 3

Thread: Debug and release compile differences

  1. #1
    Serf
    Join Date
    Jul 2013
    Location
    Monitor's neighbourhood
    Posts
    3

    Question Debug and release compile differences

    Hey,

    Working on the Memory game (hop: http://www.rtsoft.com/forums/showthr...-Birthday-Game ) I have faced a weird problem. When compiling in Debug mode everything works fine, while when in Release mode random bricks in the game don't show up. Why could that happen?

    Some probably useless code:

    Rendering bricks:
    Code:
    for(int i=0;i<36;++i) {
    	if(pool[i].active || game_finished) {
    		pool[i].get_current_image().draw(gc,pool[i].get_x(),pool[i].get_y());
    	}
    }
    Initiating bricks:
    Code:
    CL_ResourceManager image_resources("image_resources.xml");
    Brick::hidden_image = CL_Sprite(gc, "hidden", &image_resources);
    for(int i=0;i<36;++i) {
    	pool[i].init(CL_Sprite(gc, CL_StringHelp::int_to_text(pool[i].index%18 + 1),&image_resources));
    	pool[i].set_current_image(Brick::hidden_image);
    }
    Thx in advance,
    terrifish

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Sorry for the delay for approving your post. For some reason, your post was tagged as "moderated"

    Anyway, errors like that are usually caused by an uninitialised variable somewhere in the code.

    Maybe "active" is not set/cleared on initialisation

  3. #3
    Serf
    Join Date
    Jul 2013
    Location
    Monitor's neighbourhood
    Posts
    3

    Default

    Quote Originally Posted by rombust View Post
    Maybe "active" is not set/cleared on initialisation
    Good guess (haha, I often say: C++ is not as "idiot resistant" as some other programming languages. worked out )

    Thanks, I'm gonna try to avoid this working on the next project (coming (not so) soon)

Similar Threads

  1. Can compile a release version but can't compile a debug version
    By cymcrh55 in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 07-16-2013, 01:55 PM
  2. Cannot compile with new mesa release
    By jreidinger in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 12-12-2012, 01:02 PM
  3. How to make release and debug program with ClanLib?
    By leixiong in forum Official ClanLib SDK Forums
    Replies: 3
    Last Post: 10-12-2011, 10:59 AM
  4. Debug version FPS is better than Release version
    By babyvegas in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 08-13-2008, 09:44 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •