Search found 240 matches
- 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.
- 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
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 KingsJaxDragon 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.
- 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...
- Thu Jul 15, 2010 5:13 pm
- Forum: Programming Discussion
- Topic: Learning C++
- Replies: 12
- Views: 1200
Re: Learning C++
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.wearymemory wrote:<Quoting wearymemory's post>
- 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!!!!
- 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...
- 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...
- 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...
- 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 ...
- 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...
- 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 ...
- 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
Im not using iterators though, how would it become undefined?K-Bal wrote:DeleteItems
- 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?
- 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...
- 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
touche, edited the code i postedXianForce wrote:Only suggestion I'll add is to have the SetWep function take a reference or pointer, rather than a copy. Optimizations ftw?