Search found 33 matches

by YoMomIsANiceLady
February 27th, 2017, 8:35 am
Forum: Everything
Topic: Help me by playing with my Snake!
Replies: 4
Views: 2182

Help me by playing with my Snake!

Hey there guys. So I created the Classic Snake Game and I have one tiiiiiny problem that I'd like to get resolved. It's a small graphical glitch that happens sometimes and I have no idea why or when it happens. Happens only very rarely on snake change direction and stays there until direction is cha...
by YoMomIsANiceLady
February 26th, 2017, 6:16 am
Forum: Everything
Topic: getenv() may be unsafe?
Replies: 3
Views: 2612

Re: getenv() may be unsafe?

Yay, okay! I got it working. Thank you!
by YoMomIsANiceLady
February 26th, 2017, 3:51 am
Forum: Everything
Topic: getenv() may be unsafe?
Replies: 3
Views: 2612

getenv() may be unsafe?

Hello, I'm trying to get file i/o working so I can store my game's top score in appdata. So I use getenv("appdata") in order to do that. But visual studio gives me a warning saying that getenv may be unsafe and that I should use _dupenv_s instead. Now I tried looking around for how to use the functi...
by YoMomIsANiceLady
February 24th, 2017, 5:46 am
Forum: Everything
Topic: Memory usage growth over time
Replies: 13
Views: 4734

Re: Memory usage growth over time

Yeah, that makes sense and works perfectly! Thanks chili <3

There's one thing I don't understand though. Why would you check in destructor? Does it matter if you check or not? Can't you just delete anyway? Even if it's a nullptr?
by YoMomIsANiceLady
February 24th, 2017, 2:27 am
Forum: Everything
Topic: Memory usage growth over time
Replies: 13
Views: 4734

Re: Memory usage growth over time

Yeah, I don't know how I should resolve the problem. Should I maybe make some sort of a function that releases the pointers? And call it after I'm done with setting it? Maybe I could limit the use of set() to once per object lifetime? OR... I could first release pointers when set is called? I guess ...
by YoMomIsANiceLady
February 24th, 2017, 12:08 am
Forum: Everything
Topic: Memory usage growth over time
Replies: 13
Views: 4734

Re: Memory usage growth over time

Okay I tried using unique pointers but it is just so iffy to work with them if you need to make an array of which size changes on runtime. Which is exactly what I needed. Maybe it's not that tricky but I found it confusing. I tried to find where i was making the mistake of not deleting properly and ...
by YoMomIsANiceLady
February 23rd, 2017, 9:55 pm
Forum: Everything
Topic: Memory usage growth over time
Replies: 13
Views: 4734

Re: Memory usage growth over time

I think I found my issue. Here: void LetterMap::set(int widthIn, char* string) { width = widthIn; map = new bool[widthIn*height]; for (int i = 0; i < widthIn*height; ++i) { if (string[i] == '1') { map[i] = true; } else if (string[i] == '0') { map[i] = false; } } } This code gets called quite often. ...
by YoMomIsANiceLady
February 23rd, 2017, 9:21 pm
Forum: Everything
Topic: Memory usage growth over time
Replies: 13
Views: 4734

Memory usage growth over time

Hello, so I'm testing my Snake game and if I run the program. Then go to task manager and check out Engine.exe, the RAM usage is constantly increasing at about 0.1MB every second. I wonder if there is an issue somewhere with my heap memory allocation or if that is normal?
by YoMomIsANiceLady
February 23rd, 2017, 9:23 am
Forum: Everything
Topic: Help with linked lists
Replies: 5
Views: 2465

Re: Help with linked lists

Okay, I removed the root node that is sort of being useless in there and just pretending to be the appendix. I replaced the root node with "top". So now anything that is on top of the menu is what root was before. I also added it to the cycle, so now it's just a pure infinite circle, no weird root n...