Jump to content

  • Log In with Google      Sign In   
  • Create Account

LunaticEdit

Member Since 29 Mar 2011
Offline Last Active Feb 15 2016 04:25 PM

Posts I've Made

In Topic: Harvest moon / rune factory style roguelike

15 February 2016 - 04:20 PM

alpha1.png

 

 

More progress biggrin.png

We've also got a website now at http://www.harvestrogue.com/


In Topic: C++ without pointers

10 January 2016 - 05:56 PM

New question as I'm trying to use the new pointer features...

 

if I have in my class:

std::shared_ptr<Scene> CurrentScene;
std::shared_ptr<Scene> NextScene;

 

and a function like so:

void SetNextScene(std::shared_ptr<Scene> nextScene) {
   NextScene = nextScene;
}
 
void Update() {
   if (NextScene != null) {
      CurrentScene->Finalize();
      NextScene = CurrentScene;
      CurrentScene = NULL;
   }
}

 

I set the scene like this:

sceneManager->SetNextScene(SceneMainMenu::Create(settings));

 

Is this a proper way to 'flip' pointers?


In Topic: C++ without pointers

31 December 2015 - 10:18 PM

Yeah, I've done a lot of C so malloc/realloc/free is more natural to me than new/delete, and other C++y things. I also use C# a lot, which has GC, which is a very different beast. C++ feels like a weird middle of the road, not quiet C#, not quite C. I do realize references are pointers, as the only things that actually exist are 64 bit values (or smaller depending on the architecture). You can't actually represent "MyClass" as anything more than a pointer to a block of memory that contains atomic values (int/byte/etc) or pointers (struct/class/etc) as far as passing goes -- it just pushes a pointer to the object onto the stack before calling the method.

 

So I'll read up on smart pointers, but honestly at this point I might as well just stick with new/delete as it is closer to malloc/free that I'm used to.

 

Thanks guys!

 

[Edit]

Yup I switch to standard pointers where it makes sense. I'll use visual leak detector and keep an eye out on things!


In Topic: For Those of You Who Have Children

29 December 2015 - 12:19 PM

Both me and my wife are huge computer nerds. We have a 6 year old who is also on computers a lot. We spend a lot of time together, digitally, but also go on hikes and such every other weekend to get some 'fresh air'. As far as small children go, get good at multi-tasking. When mine was a baby, I would rapidly switch between coding and the baby (typically laying on my lap at my desk). Obviously I would take breaks to give the baby full-on attention, but when they are an infant, pretty much all they want to do is eat, sleep, cry, and poop anyway, and the skin-to-skin contact is tons better, IMO, then just putting them in a swing all day. The plus of this is, instead of arguing over who had the baby, it was arguing over me having the baby too much!

 

Also, play trance while coding, you can bounce him to the beat of the music, they love that :P

 

When they get a bit older and want to 'help', just give them their own mini keyboard that's not plugged in, it's super cute how they get excited when they 'help' you and get excited :D


In Topic: SSD for programming?

29 December 2015 - 12:08 PM

What I've done is purchased a 256GB SSD, installed all my main apps on it, but set my downloads, projects folder, steam game folder, etc to a 1TB spinny drive. Everything runs stupid fast. Having said that, windows writes tons of temp files all the time, and SSD drives are pretty smart about file placement on the physical media.

 

If you want to be extra paranoid, however, just have a massive spinny drive and run your projects from there.


PARTNERS