Search found 240 matches

by mv2112
Sat Jul 17, 2010 3:13 pm
Forum: Programming Discussion
Topic: Handling multiple text sizes
Replies: 5
Views: 622

Re: Handling multiple text sizes

I had thought about doing that, i was just wondering if there was a better way than just loading the fonts you need.
by mv2112
Fri Jul 16, 2010 10:00 pm
Forum: General/Off-Topic
Topic: Saw the BEST License Plate Today
Replies: 6
Views: 884

Re: Saw the BEST License Plate Today

JaxDragon wrote:I don't get it either. Although I assume its "rush" because of the posts people have made, but still don't get the 2112.
Rush 2112, the second greatest Rush album of all time, its in my username! mv2112. However the greatest Rush album of all time will always be A Farewell To Kings
by mv2112
Fri Jul 16, 2010 8:01 pm
Forum: Programming Discussion
Topic: Handling multiple text sizes
Replies: 5
Views: 622

Handling multiple text sizes

In my engine i want to have freedom with what text size i can render with, but SDL_TTF only lets you choose 1 text size and you cant re-size it without reloading the text which gets slow. Right now i just pre-load all text sizes from 2-42, incrementing by 2 each time, however this is also inefficien...
by mv2112
Thu Jul 15, 2010 5:13 pm
Forum: Programming Discussion
Topic: Learning C++
Replies: 12
Views: 1200

Re: Learning C++

wearymemory wrote:<Quoting wearymemory's post>
The books are more of a reference that you indirectly learn from, of course you cant learn C++ in 24 hours or 21 days, but you can look at the examples in the books and learn by actually programming.
by mv2112
Thu Jul 15, 2010 12:28 pm
Forum: Programming Discussion
Topic: SDL_ttf wii crash<SOLVED>
Replies: 3
Views: 668

Re: SDL_ttf wii crash<SOLVED>

I am a retard:

Code: Select all

Text.LoadFont("verdana.txt",42); //.txt!!!!
by mv2112
Thu Jul 15, 2010 12:05 pm
Forum: Programming Discussion
Topic: SDL_ttf wii crash<SOLVED>
Replies: 3
Views: 668

Re: SDL_ttf wii crash

Yea it is SDL_ttf that is the problem, i've singled it out...
by mv2112
Thu Jul 15, 2010 12:04 pm
Forum: Programming Discussion
Topic: Learning C++
Replies: 12
Views: 1200

Re: Learning C++

Thanks for the replies, yeah thats pretty much all I can do at the current moment, the book I got didn't go over files or anything else, just syntax and a bit of the STL I had the same book and i know it is truely shit. If I was you i'd get a different book. I have that book also, i would recommend...
by mv2112
Thu Jul 15, 2010 1:50 am
Forum: Programming Discussion
Topic: SDL_ttf wii crash<SOLVED>
Replies: 3
Views: 668

SDL_ttf wii crash<SOLVED>

Ok, so im writing a function that blits text to the screen, however it keeps crashing on me. I use the same text system to blit text to my text log and it works but this function doesnt work: void TextSystem::Print(std::string input,int x,int y,int width,int height,int r,int g,int b,SDL_Surface * bu...
by mv2112
Wed Jul 07, 2010 12:15 am
Forum: Programming Discussion
Topic: vectors, pointers and wii<SOLVED>
Replies: 9
Views: 949

Re: vectors, pointers and wii<SOLVED>

Yeah... Start developing good coding practices. After you free the memory associated with a pointer, set it to NULL. Item::~Item() { if(image) SDL_FreeSurface(image); image = NULL; } This way, the memory is only freed if it exists, and then it is set to NULL after it is freed. If you try to render ...
by mv2112
Tue Jul 06, 2010 9:57 pm
Forum: Programming Discussion
Topic: vectors, pointers and wii<SOLVED>
Replies: 9
Views: 949

Re: vectors, pointers and wii<SOLVED>

I am a retard and here is why: Item::~Item() { SDL_FreeSurface(image); } I copy the item and then delete it when i transfer it from itemsys to itemsys. This calls the destructor so the pointer to the image is NULLed out and SDL causes the crash when the map tries to render the item whos image doesnt...
by mv2112
Tue Jul 06, 2010 6:41 pm
Forum: Programming Discussion
Topic: vectors, pointers and wii<SOLVED>
Replies: 9
Views: 949

Re: vectors, pointers and wii

Im not using iterators though, how would it become undefined? You really should be instead of addressing by index. When you erase and item, the size is decreased, so once you reach the higher end of the loop, you'll be trying to access out of range data. The index i'm searching for isnt the actual ...
by mv2112
Tue Jul 06, 2010 5:28 pm
Forum: Programming Discussion
Topic: vectors, pointers and wii<SOLVED>
Replies: 9
Views: 949

Re: vectors, pointers and wii

K-Bal wrote:DeleteItems
Im not using iterators though, how would it become undefined?
by mv2112
Tue Jul 06, 2010 1:51 pm
Forum: Programming Discussion
Topic: vectors, pointers and wii<SOLVED>
Replies: 9
Views: 949

Re: vectors, pointers and wii

Where would i do that?
by mv2112
Mon Jul 05, 2010 11:57 pm
Forum: Programming Discussion
Topic: vectors, pointers and wii<SOLVED>
Replies: 9
Views: 949

vectors, pointers and wii<SOLVED>

Ok so i am making an item system and there are these functions //itemsys.h void ItemSys::Transfer(ItemSys*tar,int item_index) { for(int i=0;i<Items.size();i++) { if(Items[i]->GetID()==item_index) { tar->AddItem(Items[i]); //Items is a std::vector<Item*> DeleteItem(item_index); } } } void ItemSys::Ad...
by mv2112
Mon Jul 05, 2010 4:55 pm
Forum: Programming Discussion
Topic: Help Involving Vectors/Class Inheritance
Replies: 13
Views: 1061

Re: Help Involving Vectors/Class Inheritance

XianForce wrote:Only suggestion I'll add is to have the SetWep function take a reference or pointer, rather than a copy. Optimizations ftw?
touche, edited the code i posted