indielib.com

IndieLib Forum
It is currently Wed Aug 21, 2019 4:37 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Thu Feb 19, 2009 3:33 am 
Offline
User avatar

Joined: Wed Jan 21, 2009 4:36 pm
Posts: 209
Location: San Diego, CA
If you add a tile, hover over it and delete it using the delete key, then click to place any new tile on any layer you get a run-time error. I'm still trying to figure it out but just wanted to relay it here in case someone already fixed it.

BTW, I'm running Vista Home edition

Steve


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 19, 2009 9:58 am 
Offline
Site Admin
User avatar

Joined: Wed Dec 26, 2007 1:38 am
Posts: 626
Location: Murcia, Spain
Hey, thank you! I'll try to reproduce and to fix it! Nobody noticed that yet.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 19, 2009 3:37 pm 
Offline
User avatar

Joined: Wed Jan 21, 2009 4:36 pm
Posts: 209
Location: San Diego, CA
Javier López wrote:
Hey, thank you! I'll try to reproduce and to fix it! Nobody noticed that yet.

No problem. I'm using your code as my level editor for my platform game. :) I hope you don't mind. Its not a commercial game.

I made a few changes in my "version" of your code. I am using a map in the Resources class for the IND_Surfaces. And I'm using std::string in more places. They provide some management that I like.

There is another thing I will need and at this point am not sure if its provided already. I will need a grid and a snap to grid feature. If you picture a typical Mario platform game you know what I mean in terms of placing world tiles. I know you have a pixel "nudge" movement (F, G, S or something like those keys) but I think a snap is easier and faster.
I saw that a surface can have a grid so I just need to figure out the snap thing.

Steve


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 19, 2009 3:58 pm 
Offline
Site Admin
User avatar

Joined: Wed Dec 26, 2007 1:38 am
Posts: 626
Location: Murcia, Spain
The tutorials is free, you can use it for commercial games too. It would be enough just crediting me in any way you wish, for example in your blog :) (you don't have to put a banner in your game with my face, haha).

Yep, snap to grid would be a cool feature :)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 19, 2009 4:42 pm 
Offline
User avatar

Joined: Wed Jan 21, 2009 4:36 pm
Posts: 209
Location: San Diego, CA
Ok, I fixed (not sure how robust) my copy of the editor. I see a lot of static object variables used in classes rather than pointers to objects created on the heap. Those static objects are all created on the stack and I'm not sure if that is a good thing or not.
I changed the Node class by making the IND_Entity2d variable a pointer to the object. I modified Node ctor by new'ing a IND_Entity2d and its destructor deletes it after calling Entity2dManager->Delete ().

That only revealed another bug. In Listener::ListenEditing() you turn off the grid for the current node the mouse is hovering over.

Code:
         if (m_pBackDropNodeOver)
         {
            m_pBackDropNodeOver->GetEntity()->ShowGridAreas (false);
         }


I get a crash on GetEntity because the current entity is now gone. For some reason the variable is 0xfeeefeee instead of 0x00000000. Like I said my solution may not be robust AND I'm not modifying nor to I fully understand the object management in the library.

Code:
   if (m_pIndieLib->Input->OnKeyPress(IND_DELETE))
   {
      m_pMap->DeleteNode (m_pBackDropNodeOver);   // Erase the node from the map vector
      m_pBackDropNodeOver = NULL; <---- added this
   }


In Listener I added the addition shown above and deleting seems to work now. Again, I'm not sure how robust this is.

Steve


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 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

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