• Content count

  • Joined

  • Last visited

Community Reputation

152 Neutral

About Lord_Spatulator

  • Rank
  1. Thanks a lot fellas! When I've got something cool put together I'll be sure to post it!
  2. are they static by default? eg class myClass{ final int myInt = 99; final static int myInt = 99; } obviously, being final, it's going to be the same in all instances of the class, but does that mean without the 'static' keyword, a copy of this variable will be made every time a new object is instantiated? Thanks.
  3. Hey guys, im having some trouble breaking up my code, I'd like to put all of my global variable initializations into a file other than main.cpp, and I'd also like to put my funtion declerations into another file also. but if I try either, I get errors about multiple instance problems and stuff... I'm programming in C++, and using bloodshed Dev-Cpp. And I did try hitting the Rebuild All button instead of just the recompile one, that didn't fix the problem. What I've got at the moment is line 1: #include "header.cpp" and in my header.cpp file, I've got all of my #includes (stdio, SDL, math.h, vector, etc) followed by template <class T> inline std::string toString(T data){ std::ostringstream s; s << data; return s.str(); } which i use to convert integers into strings, and found that this is th eonly place I can put that code without errors. followed by #include "globals.cpp" which is where I would like to create all of my global variables, but at the moment I've only got global constant variables in there, if I try putting the global variables in there as well I get errors. Back in includes.cpp I'd like to add #include fndecs.cpp or something similar to include all of the function declerations, but i get similar errors if I have those outside the main.cpp also. I've never done a program with code in multiple files before either, next ill be trying to get my classes into their own files, and then group all of the SDL fns into a file, and so on, untill I no longer have a 1200 line main.cpp. Any help could be appreciated. Thanks.
  4. Help learning arrays and loading from txt file

    How come it stops reading the file once it get's to a space?
  5. Dev-C++ instillation on removable media problems....

    @ Emmanuel Deloget; I've already tested to see if just creating a new project works, and even a new basic template project gives the exact same compile error. & @ kingpinzs; I don't know the first thing about batch files, how they might help me, or how I might use some.... But thanks for your advice, and if anyone else has any ideas I'd be really appreciative...
  6. I've got Dev-C++ installed and running off my iPod, and i can run it, and my programs and everything made with it fine, on any computer that didn't already have dev-c++ installed on it. but just now I've plugged it into a computer that had an older version of dev-c++, and it didn't compile because it couldn't find |SDLmain. So I figured it was having complications being already instlled and all, so no longer needing the old instillation, I uninstalled that one (the locally installed copy). Now when I try to compile it won't even get that far, giving me the error: 2 C:\Documents and Settings\staff\My Documents\C++ fmod example\2 unable to run program file. the moment I hit compile. Does anyone have any suggestions that don't involve reinstalling the dev-c++ on my iPod? Thanks.
  7. MIDI Speed manipulation w/ FMOD

    Yup, that looks like it should do nicely. Thanks :) I'll keep the link to the documentation too, I couldn't find it before.
  8. MIDI Speed manipulation w/ FMOD

    Using FMOD, can I halve or double the speed at which a MIDI file is playing?
  9. developing for consoles

    Quote:Original post by superpig Personally, I'd say that developing for the Xbox is easier than PC. Cool, so, do you like, need a modded XBox or something? Are there any links other than the one in the forum FAQ?
  10. Pausing music in SDL. [resolved w/ FMOD]

    Thanks a lot fellas, I was a little worried it was my code for a while there. Rob, I think i'll use that FMod thing, looks pretty cool! And don't worry, I'll accredit you and the other guy in the game too. Thanks for the link!
  11. Pausing music in SDL. [resolved w/ FMOD]

    Anyone? Please? Just a functional link even, anything, I've tried everything!
  12. my fn I adapted from aaroncox.net's tutorials to use SDL to write strings to the screen seems to dislike me passing it anything other than strings... so how would I go about converting a int into a string? (Or just getting it to print the int) Thanks!
  13. Pausing music in SDL. [resolved w/ FMOD]

    I've got some music playing w/ SDL, I'v loaded the midi into Mix_Music *music = Mix_LoadMUS("data/sounds/music.mid"); & I've got a global bool called 'paused' (which is a gamestate) I want the music to pause if the game is paused, and it to resume when the game resumes... Currently I've got if (paused) { if (!Mix_PlayingMusic()) Mix_FadeOutMusic(0); } else if(!Mix_PlayingMusic()) Mix_PlayMusic(music, -1); And this (successfully) plays music when the game isn't paused, and doesn't play music when it is; but, it resumes from the beginning of the midi each time which is a real bummer. I've tried with the code: if (paused) { if (!Mix_PausedMusic()) Mix_PauseMusic(); } else { if (Mix_PausedMusic()) Mix_ResumeMusic(); if(!Mix_PlayingMusic()) Mix_PlayMusic(music, -1); } Which, to my knowledge, should probebly pause the music if it should be paused, resume it if it needs to be resumed, and play it if it werent playing to begin with.. but what it does is play, never stop, regardledd of how true I make the boolean value, and cause the game to crash when I try to shut it down. little help anyone please? I've been messing aroung with this little hickup for far too long now :p [Edited by - Lord_Spatulator on March 29, 2005 6:09:43 PM]
  14. reading SDL keyboard input (very quick q)

    Thanks :)
  15. very quick question (I hope) we've got SDLK_DOWN SDLK_LEFT SDLK_RIGHT SDLK_RETURN SDLK_SPACE what do we do for getting A, B, C, 1, 2, 3, etc?