Search found 164 matches

by Nokurn
Wed Aug 14, 2013 4:51 pm
Forum: Programming Discussion
Topic: Memory Leak with SDL Multiline Text
Replies: 12
Views: 5039

Re: Memory Leak with SDL Multiline Text

Just so you know, most people I've talked to about the SDL TTF stuff have always just opted to create a png with all the characters and just blit the characters they need onto a surface. It seems to be the way to go, and that's what I do anymore. But yeah, don't just leave that leak in and keep usi...
by Nokurn
Tue Aug 13, 2013 5:43 pm
Forum: Programming Discussion
Topic: Memory Leak with SDL Multiline Text
Replies: 12
Views: 5039

Re: Memory Leak with SDL Multiline Text

First I added the line that frees the SDL surface before starting the next loop. The program runs fine but the memory issue still occurs. This is the correct thing to do. Next I tried declaring the const char* that I pass to the SDL_RenderText_Solid function as: const char* before_newline_char = ne...
by Nokurn
Tue Aug 13, 2013 5:25 pm
Forum: Programming Discussion
Topic: Dear database designer
Replies: 2
Views: 2605

Re: Dear database designer

Mother of god. That's just asking for trouble. DId you fix it?
by Nokurn
Fri Jul 19, 2013 3:33 pm
Forum: General Gaming
Topic: Post every time you beat a game.
Replies: 629
Views: 854663

Re: Post every time you beat a game.

My cousin showed this game to me this weekend and I thought the same thing: they went through all the trouble to implement multiple engines and they just throw it away on a 4-hour game? He said the game is worth every penny, though. It really was. I couldn't put it down, which made for some disappo...
by Nokurn
Fri Jul 19, 2013 3:31 pm
Forum: Programming Discussion
Topic: C++ default operator= implementation
Replies: 12
Views: 8811

Re: C++ default operator= implementation

Rereading this thread, I can see that I shouldn't have been posting after running a donation car wash in the Mojave Desert for 8 hours during July. ;) I can see the merits of your suggestion, but my main qualm with this implementation is that it assumes that copy-assignment requires full destructio...
by Nokurn
Thu Jul 18, 2013 5:55 pm
Forum: Programming Discussion
Topic: C++ default operator= implementation
Replies: 12
Views: 8811

Re: C++ default operator= implementation

Rereading this thread, I can see that I shouldn't have been posting after running a donation car wash in the Mojave Desert for 8 hours during July. ;) I can see the merits of your suggestion, but my main qualm with this implementation is that it assumes that copy-assignment requires full destruction...
by Nokurn
Thu Jul 18, 2013 5:25 pm
Forum: General Gaming
Topic: Post every time you beat a game.
Replies: 629
Views: 854663

Re: Post every time you beat a game.

I just got Evoland on Steam yesterday (it was on sale for $5 and still is!) and played through it last night. It's not an incredibly long game, but the concept is really cool, the graphics are good, the story is entertaining, and the gameplay brings back memory. The main idea of the game is that you...
by Nokurn
Sat Jul 13, 2013 11:20 pm
Forum: Programming Discussion
Topic: C++ default operator= implementation
Replies: 12
Views: 8811

Re: C++ default operator= implementation

The more I work in C++, the more I've noticed a theme in my object design. To avoid repeating code, I often make a copy function and a destroy function. My copy constructor calls the copy function. My destructor calls the destroy function. My operator overload calls destroy followed by copy . Would...
by Nokurn
Thu Jul 04, 2013 1:04 am
Forum: General/Off-Topic
Topic: So what are you guys doing these days?
Replies: 26
Views: 10888

Re: So what are you guys doing these days?

Filling out my general ed to transfer to university (likely MIT or Stanford), going to grab a few associate's degrees for the hell of it on my way out. Working on my computer science/physics research project, which I'll be presenting to the board of trustees of my school next month. Hoping to coaut...
by Nokurn
Mon Jul 01, 2013 5:01 pm
Forum: Programming Discussion
Topic: Hoooooooly Shit (C++11)
Replies: 9
Views: 5269

Re: Hoooooooly Shit (C++11)

Especially in code chunks that have implicit conversions going on, I see this potentially resulting in a nightmare. The 'explicit' keyword for constructors and conversion operators helps with this. I've taken to marking nearly all constructors, aside from default/copy/move constructors, as explicit...
by Nokurn
Mon Jul 01, 2013 4:12 pm
Forum: Programming Discussion
Topic: Hoooooooly Shit (C++11)
Replies: 9
Views: 5269

Re: Hoooooooly Shit (C++11)

Actually, right now I'm adding move semantics to my selection datatypes (which handles tiles in ESTk, images in SheetManager), which need to be copied and returned by value liberally within the TileEngine's internal template implementation. Time to make shit less expensive. :D Move semantics are pr...
by Nokurn
Tue Jun 18, 2013 1:11 pm
Forum: Programming Discussion
Topic: [SOLVED] No image displayed at blit? (SDL, C++)
Replies: 9
Views: 6448

Re: EDITED: No image displayed at blit? (SDL, C++)

After combing through it, I could only find a few questionable things, nothing that I can be certain is causing your problem. SDLTexture eye = SDLTexture( "Lucid_Eye_Auras.jpg" ); You use the SDLTexture constructor yet the loading logic is in SDLTexture::Load. Does the constructor call Loa...
by Nokurn
Mon Jun 17, 2013 3:30 pm
Forum: Programming Discussion
Topic: [SOLVED] No image displayed at blit? (SDL, C++)
Replies: 9
Views: 6448

Re: No image displayed at blit? (SDL, C++)

if( GetGL() ) { if( mFlags & ~SDL_OPENGL ) { mFlags |= SDL_OPENGL; } } else { if( mFlags & SDL_OPENGL ) { SetGL( true ); } } // ... snip ... if( GetGL() ) { SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 ); SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 ); SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 ); SD...
by Nokurn
Mon Jun 17, 2013 3:24 pm
Forum: Programming Discussion
Topic: [solved]fwrite not writing entire buffer? C++
Replies: 3
Views: 2697

Re: fwrite not writing entire buffer? C++

Heh thanks a lot, I hadn't even realized I was printing the address because of the trailing data being what I wanted it to be. Terrible mistake, thank you. I like your for loop suggestion as well. Thanks for your help. EDIT: Your loop doesn't seem to be working in export. My program writes no lumps...
by Nokurn
Fri Jun 14, 2013 2:28 am
Forum: Programming Discussion
Topic: [solved]fwrite not writing entire buffer? C++
Replies: 3
Views: 2697

Re: fwrite not writing entire buffer? C++

fwrite( &temp->mData, sizeof(unsigned char)*temp->mSize, 1, archive ); If mData is an unsigned char*, you are writing the address of a pointer. I strongly doubt this is your intention. Do not take the address of temp->mData. You're leaking memory in both functions: p_arLump temp = new ArchiveLu...