Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualNausea

Posted 29 March 2013 - 10:17 AM

Instead of storing the window pointers in a vector, store them in the list. Mouse testing is then done from top to bottom, and drawing is done from bottom to top. Moving a window to the top requires that the window be removed and added to the front of the list.

On an unrelated note, the code you posted is somewhat hard to follow because of all the nested code blocks. Try to make it more flat. For example,


if(!WindowList[i]->WindowItemList[itemnum]->GetActive()){continue;}else{/*do stuff*/}
is equivalent to
if(!WindowList[i]->WindowItemList[itemnum]->GetActive())    continue;/*do stuff*/

Thank you so much for your answer :) I will try to make this work. And thanks for your critique on my code blocks.

edit: I got it working thanks to you :) Happy times!

#1Nausea

Posted 29 March 2013 - 07:27 AM

Instead of storing the window pointers in a vector, store them in the list. Mouse testing is then done from top to bottom, and drawing is done from bottom to top. Moving a window to the top requires that the window be removed and added to the front of the list.

 

On an unrelated note, the code you posted is somewhat hard to follow because of all the nested code blocks. Try to make it more flat. For example,

 

 

 

if(!WindowList[i]->WindowItemList[itemnum]->GetActive())
{
continue;
}
else
{/*do stuff*/}
 

is equivalent to

if(!WindowList[i]->WindowItemList[itemnum]->GetActive())
    continue;
/*do stuff*/

 

Thank you so much for your answer :) I will try to make this work. And thanks for your critique on my code blocks.


PARTNERS