Verge crashes when I add another local INT or STRING
Displaying 21-28 of 28 total.
prev 1 2
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
RageCage

BAHAAHA! I figured it out!

in that same function you have:

int M_M2FH;
int M_M2FH = TBMenu[MenuNR].Font_H;

now why verge didnt catch this or crash becaus eof this is beyond me but... if you cant figure it out it SHOULD be:

int M_M2FH = TBMenu[MenuNR].Font_H;

or

int M_M2FH;
M_M2FH = TBMenu[MenuNR].Font_H;

and that'll fix all your problems ^_^

btw, that whole system looks pretty freakin cool

Posted on 2004-05-25 03:57:39 (last edited on 2004-05-25 03:59:16)

vecna

ok the problem is with that particular function. You've gone over the limit for local variables. I'll increase it.

Also, dear god that function makes me cry to try to follow the code ^_^

Posted on 2004-05-25 04:09:51

vecna

oh yeah. rage and I are both right actually! I still need to increase the locals limit tho.

Posted on 2004-05-25 04:11:15

rpgking

[deleted]

Posted on 2004-05-25 04:15:23 (last edited on 2004-05-25 04:15:54)

Buckermann

Quote:Originally posted by RageCage

BAHAAHA! I figured it out!
[snip]
int M_M2FH;
M_M2FH = TBMenu[MenuNR].Font_H;
and that'll fix all your problems ^_^
btw, that whole system looks pretty freakin cool

Thanks RageCage. But that would give me only ONE more int/string to play with. When I correct my error, and than add another local, verge will crash again.
But I REALLY appreciate the time and effort you took to look through my messy code.
And thanks for the compliment.

Quote:Originally posted by vecna

ok the problem is with that particular function. You've gone over the limit for local variables. I'll increase it.

Thanks Vecna, you are my hero :)

Also, dear god that function makes me cry to try to follow the code ^_^

Not only you. It seems to me that you are quite a gifted coder, contrary to me. I would say I'm more or less just average. Can you imagine the amounts of tears I sheded during debugging?
But fear not, before I release that function to the general public, it should be way more readable. I plan on making it a part of my windows library, and during that I have to rewrite maybe 50% of it. And I WILL make sure that I don't create a monster like that again :)

Edit:
May I ask by what amount will you increase the locals? Just curious.

Posted on 2004-05-25 05:03:32 (last edited on 2004-05-25 05:07:26)

vecna

Quote:Originally posted by Buckermann
May I ask by what amount will you increase the locals? Just curious.


I've bumped the limit from 40 to 100. I think if you have 100 locals, you'd be wise to decompose your function into further subfunctions anyway. ^_^ The v2 limit was 20.

Posted on 2004-05-25 05:41:26

Buckermann

Quote:Originally posted by vecna

Quote:
I've bumped the limit from 40 to 100. I think if you have 100 locals, you'd be wise to decompose your function into further subfunctions anyway. ^_^

I completly agree.

Posted on 2004-05-25 14:08:10

Overkill

I reccomend you move the constant color variables outside the function.

So:

int COLOR_MAGENTA=RGB(255, 0, 255);
int COLOR_BLACK = RGB(0,0,0);
int COLOR_WHITE = RGB(255,255,255);

void TB_Menu()
{
...etc..
}

If you made more menu-related vars global, things would be easier to a small extent (though not necessarily ideal). Also, seperate functions to initialize/free the menu could make it smoother, but that'll only work if you opt for the global var idea.

void TB_InitMenu()
{
//Allocate menu variables...
}

void TB_Menu()
{
TB_InitMenu();
//Menu looping
TB_FreeMenu();
}

void TB_FreeMenu()
{
//Free all the memory we used...
}

Posted on 2004-05-26 03:22:14


Displaying 21-28 of 28 total.
prev 1 2
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.