QJ.NET | Videos | Forums | iPhone | MMORPG | Nintendo DS | Wii | PlayStation 3 | PSP | Xbox 360 | PC | Downloads | Contact Us
Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact

QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides

Go Back   QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides > Developers Corner > PSP Development, Hacks, and Homebrew > PSP Development Forum
The above video goes away if you are a member and logged in, so log in now!

C/C++ Programming Help Thread

This is a discussion on C/C++ Programming Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; not sure...you have to make sure you are sprintf'ing to update buffer[], everytime you change the score var, then print ...

Reply
 
LinkBack Thread Tools
Old 02-08-2006, 08:31 PM   #61
 

 
Join Date: Jun 2005
Location: Canada
Posts: 1,486
Trader Feedback: 0
Default

not sure...you have to make sure you are sprintf'ing to update buffer[], everytime you change the score var, then print it out.

As far as animations, yeah theoretically an array of images should be fine, then have a for loop to blit it, with vsyncwaits in there to control how fast the animation is....I was having problems getting it running stable that way. So instead I just loaded all the animation pics up seperately and wrote out a long ass function to play the animation (refering to the explosion when you die in my helicopter game) Works good for me, if not the best way...
__________________
PSN: Shatterdome
Shatterdome is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-08-2006, 09:27 PM   #62

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

ok, now how do i do an array, like int array() { or what?
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-08-2006, 10:35 PM   #63

Developer
 
Smerity's Avatar
 
Join Date: Jun 2005
Location: Sydney, Australia
Posts: 128
Trader Feedback: 0
Default

SG57 -
Check out Google, as C on the PSP is much the same as C on the PC, so any standard array tutorial will work on PSP, but to get you started -
Code:
int ia[6] = {0, 1, 2, 3, 4, 5}; 
// initialise array and put numbers into it

OR

int x[6]; // init array
int x[4] = 2; // put a number only in #4 of the array
And for a multidimensional array -
Code:
int psp_resolution[480][272];
This looks like a good tutorial for arrays - http://vergil.chemistry.gatech.edu/r...al/arrays.html
__________________
Developer of Airstrike
Smerity is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-08-2006, 11:01 PM   #64

Developer
 
Smerity's Avatar
 
Join Date: Jun 2005
Location: Sydney, Australia
Posts: 128
Trader Feedback: 0
Default

Shatterdome, it does support the use of seperate channels but from what I've seen it only supports a single stream at a time

Sorry about that. I'm not sure if it's possible, but John_K ported it specifically for his Media Center, so chances are if it was he skipped over it just because it was easier and he simply didn't need it.

My suggestion would probably be to use Mp3 for the background music / person's PSP/MUSIC and use another library for the sound effects.
If anyone else has any better suggestions, feel free to save the day =)

-PS-
I'm working on getting a simple file browser for Mp3's, so that a user can select an Mp3 from their MUSIC folder to play. First off, if anyone has already done it, and are fine to release the source code, please do, or if else, I'll release my source code when I'm done with it.
__________________
Developer of Airstrike
Smerity is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-12-2006, 10:10 AM   #65
 
Join Date: Jan 2006
Posts: 4,288
Trader Feedback: 0
Default

Well, lostjared released his reuseable file browser, but he uses SDL and it confuses me, otherwise I would implement it in my programs...
soccerPMN is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-12-2006, 12:20 PM   #66
 

 
Join Date: Jun 2005
Location: Canada
Posts: 1,486
Trader Feedback: 0
Default

I guess SDL doesn't support MP3's ? I am more interested in getting custom soundtracks in my game right now, over sound effects anyways...

I'm gonna take a look into how hard it would be to write a file browser....as long as the psp has functions to get a list of files in a directory or something similar, it wouldn't be too hard...
__________________
PSN: Shatterdome
Shatterdome is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-13-2006, 05:27 PM   #67
 

 
Join Date: Jun 2005
Location: Canada
Posts: 1,486
Trader Feedback: 0
Default

Hey all....does anyone have any working examples of writing and reading binary or even text files from the ms ?

I'm using some code that works compiled on the pc to read and write from a file, but for some reason when compiling on the psp it disorts numbers... heres what i'm using...

Code:
void savehighscores(void)

  {


     FILE * savegame;
     savegame = fopen("savegame.dat","w");
    
	 int i;

     rewind(savegame);

     for(i=0;i<10;i++)
     {

      fputc(highscores[i],savegame);

    
     }



      fclose(savegame);



	

  }

void loadhighscores(void)

  {


     FILE * savegame;
   
     int i;


     savegame = fopen("savegame.dat","r");


     rewind(savegame);

  //  do
  for(i=0;i<10;i++)
     {

	  highscores[i] = fgetc(savegame);



    

     }
//	while(feof(savegame) == 0);


      fclose(savegame);



	


  }

It writes to a file, but when it writes it changes the integers I have in there, and seems to read those changed integers fine...tis strange, any ideas ?

thx
__________________
PSN: Shatterdome
Shatterdome is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-13-2006, 06:31 PM   #68

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

i dunno, but i can use that read from a .txt file, will it work for reading? Ill test it, also, hwo do i make an animation?!?!?!?!?

i know its an array but i need an example!! i have blooked everywhere!! heres waht i know, i just tested this for an images actual dimensions

Code:
int array[1][0, 1][175, 125]
int main() {
    blitAlphaImageToScreen(0, 0, array[0], array[1], ya, yax, yay);
}
theres an example of what i was trying it gave me warnings for the array[0] and array[1] calls, is that right?
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-13-2006, 06:44 PM   #69

Developer
 
Join Date: Jun 2005
Location: At my house...
Posts: 885
Trader Feedback: 0
Default

For animation use a timer and then for every 5 or so #s blit a pic and clear. Sorry i am on my psp.
Twenty 2 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-13-2006, 06:47 PM   #70
 
Join Date: Jan 2006
Posts: 4,288
Trader Feedback: 0
Default

edit: NVM
soccerPMN is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-14-2006, 03:05 AM   #71

Developer
 
Join Date: Oct 2005
Posts: 408
Trader Feedback: 0
Default

Quote:
Originally Posted by Shatterdome
Hey all....does anyone have any working examples of writing and reading binary or even text files from the ms ?

I'm using some code that works compiled on the pc to read and write from a file, but for some reason when compiling on the psp it disorts numbers... heres what i'm using...

Code:
...omitted...

It writes to a file, but when it writes it changes the integers I have in there, and seems to read those changed integers fine...tis strange, any ideas ?

thx
I don't think you can trust fgetc and fputc to store numeric data unless you convert it to strings first. Fread and fwrite store binary or text more efficiently and you'll read the same thing you write.

Example:
fwrite(highscores, sizeof(highscores), 10, savegame);

This will write the entire high score list in one line. Fread is basically the same.
Samstag is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-14-2006, 01:12 PM   #72
 

 
Join Date: Jun 2005
Location: Canada
Posts: 1,486
Trader Feedback: 0
Default

Thanks man, works perfect now...strang thing is fgetc and fputc do deal with ints even though it's called put char, and those functions worked fine on the PC with saving the stats of a character created by a random roller, but just wouldn't work on the psp for some reason...

Regardless, fwrite and read will do just fine, as I always will know how much data i'm reading and writing...
__________________
PSN: Shatterdome
Shatterdome is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-14-2006, 04:49 PM   #73

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

ok, about my animation problem anyone? Twenty 2, you gave me how to do it, but i want an array because its easier right? and what about my array i posted code problem? how do i call things from my array? I just wish there was a good tutorial
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-14-2006, 04:53 PM   #74

Developer
 
Join Date: Jun 2005
Location: At my house...
Posts: 885
Trader Feedback: 0
Default

you just call the number in the array with its number...and instead of using sprite1 and sprite2 for each blit, you just use the array.
Twenty 2 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-14-2006, 08:53 PM   #75
 

 
Join Date: Jun 2005
Location: Canada
Posts: 1,486
Trader Feedback: 0
Default

sg57, just google arrays + c and you will get tons of tuts, it's one of the more basic data types (althought technically not, but when you think abouts classes, structures and linked lists, it's a little mundane :P )

int array[10];

is an array with 10 spots labeled 0-9, array[1] = 2; sets the 2nd value of array to 2, array[0] accesses the first value, array[9] the last, for loops are a good way of traversing arrays...there.

Now anyone have any problems installing libmad ? I checked it out and when I goto to make it, before having to copy any file it says i'm missing FPM or something...attached a screen cap of the error....i'm just trying to rebuild the pspsdk to see if it does anything, but maybe it's a common error, i'm hoping :P

Nevermind, much googling later I solved it...
Attached Thumbnails
C/C++ Programming Help Thread-libmaderror.jpg  
__________________
PSN: Shatterdome

Last edited by Shatterdome; 02-15-2006 at 01:25 AM..
Shatterdome is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-15-2006, 05:37 PM   #76

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

Thanks Shatterdome, i'll google arrays later, but all I wanted to know was how to call something in an array, so what you put should work if I made array[0-2] = blitAlphaImageToScreen(ya da ya da); then just say something like:

Code:
for(i=0; i<93479; i--) {
   sceKernelDelayThread(100);
   array[0];
   sceKernelDelayThread(100);
   array[1];
   sceKernelDelayThread(100);
   array[2];
}
That would make my animation go forever and change frames every 100 vblanks? Unless someone else has a better animation engine/effect?
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-16-2006, 02:12 AM   #77
 

 
Join Date: Jun 2005
Location: Canada
Posts: 1,486
Trader Feedback: 0
Default

You have the right idea, but arrays can't hold functions, only data types, so you're looking at...

Code:
for(i=0; i<93479; i--) {
   sceKernelDelayThread(100)  ;
   blitimage(x,y,array[0],x,y);
   sceKernelDelayThread(100)  ;
   blitimage(x,y,array[1],x,y);
   sceKernelDelayThread(100)  ;
   blitimage(x,y,array[2],x,y);}
and you would make array[] an array of images...I was having problems doing that so I didn't use an array (for the explosion in my helicopter game), but in theory it should work fine...
__________________
PSN: Shatterdome
Shatterdome is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-16-2006, 07:44 AM   #78

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

ya, I noticed that, in your helicopter game, you had like 5 images of the explosion, and you had one of my own .mp3 playing? how? So, I can mkae
Code:
char/int explosion[2];
char/int explosion[0] = blitalphaImageToScreen();
char/int explosion[1] = blitAlphaImageToScreen();
char/int explosion[2] = blitAlphaImageToScreen();
 
while(1) {
	blitAlphaImageToScreen(0, 0, 32, 32, explosion[0], and so on?);
	explosion[++];
	if(explosion[2] >= [3]) {
		explosion[2] = explosion[0];
}
}
that would assign the 3 images to an array, then blit the first one, and later, have the loop increase to the array thing, thus making an animation? How'd you do an animation for your explosion? Should I use a string instead? Or make a pointer to my images that happens to be inside the array also?
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-16-2006, 05:09 PM   #79

Developer
 
Smerity's Avatar
 
Join Date: Jun 2005
Location: Sydney, Australia
Posts: 128
Trader Feedback: 0
Default

Not quite right there SG57...

Code:
int x = 0;
while(1) {
	blitAlphaImageToScreen(0,   0, 32, 32, explosion[x], and so on?);
	x++;
	if(x > 3) {
		x = 0;
}
That's the way I'd do it. You have to understand explosion[number] implies that you need to input a number, it doesn't take any other form of input, so it'd just give you an error and say '++ not valid blah blah blah'

Still though, with that code there, unless you're just doing a concept, it really doesn't work that well...

The two main problems :

You're in a while loop which won't let you do anything else at the moment, this would be placed somewhere in your main loop.

Especially in this setup the images would flash by much too fast, I'm talking tenths of a second total here.

Solutions :

Because my main loop runs at a pretty specific interval, I use that loop as the loop for my animations.
To get the images to hold a bit longer however, I had something similar to -


Code:
int anim = 1;
int frame = 0;
while (1) {

// other code / codes here

// imagine there are 5 frames in our animation

if (frame > 6 && anim == 1) { // change frame here to effect how long it's displayed
     frame = 0; 
     x++;
} 
else frame++;

if (anim == 1) blitAlphaImageToScreen(0,   0, 32, 32, explosion[x], etc);

if (x > 5) { x = 0; anim = 0; } // saying if x > 5 our animation is over

// other code / codes here

}
Obviously thats pseudo code, you need to reword a few things, but yeah.
__________________
Developer of Airstrike
Smerity is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-16-2006, 07:20 PM   #80

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

Ok, I think I get it, but if I put blitAlphaImageToScreen(); anywhere after the flipScreen();, I'm going to get flashy effects. Maybe I'll do something like,
Code:
Image* explosion1;
Image* explosion2;
Image* explosion3;
//LOAD ALL THE IMAGES AND DEFINE THEM (JUST DON'T BLIT THEM)
int time =0;
void explosion = explosion1;
while(1) {
	blitAlphaImageToScreen(0, 0, 32, 32, explosion, ya da ya da);
	time++:
	if(time > 300 && time < 600) {
		  explosion = explosion2;
	} else if(explosion >= 600) {
		explosion = explosion3;
	 } else if(time > 900) {
		  time = 0;
	 }
	 flipScreen();
}
This might be the one (if it works) that I will use. It loads all the images, blits explosion1, then the timer increases, and if the timer goes over 300 but under 600, then the explosion1, switches to explosion2, then if the timer goes over 600, explosion2 = explosion3, and if the timer goes over 900, then the timer is reset and it changes the explosion3, back to explosion1.
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-18-2006, 11:50 AM   #81
 

 
Join Date: Jun 2005
Location: Canada
Posts: 1,486
Trader Feedback: 0
Default

Yeah, this is where having the process of one frame of your program down is stone helps...

such as every frame program..

gets user input
figures out what to do with it
updates players and objects x y positions
checks for collisions
draws everything
goto begining

Also like smerity said, it depends on how often your looping etc...

for an explosion you probably only want to blit it when a missile colides with something...for me it was easy because it was only when the player died, so when the player died I just transfered control of the loop to my playerdead() function which then just needed to draw all the buildings where they were last and then draw the explosion. and I could control how fast it plays with waitforscreens...

Having an animated character or an explosion that will play as everything else moves around it is a little trickier....in that case you would probably have to count your frames and impose a FPS limiter so that animations weren't playing too quickly, because you can't use waitforscreens to slow down the explosion animation because it would slow down everything else as well....something i'm not looking forward to but am going to tackle in my next game
__________________
PSN: Shatterdome
Shatterdome is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-18-2006, 01:46 PM   #82

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

Ok, I'll use you rexplosion example for mine. But how would I get the last screen that was shown to display? Maybe just make everything that's moving, have the speed of 0, then everything will stop. I can easily have the explosion animation blit ontop of what's dieing.
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-18-2006, 03:54 PM   #83
 

 
Join Date: Jun 2005
Location: Canada
Posts: 1,486
Trader Feedback: 0
Default

in that case you need to...

draw everything without movement - what you want blowing up
then draw first explosion
then flip
wait for x amount of vsync
then repeat and increment the explosion to 2nd, 3rd, 4th etc
__________________
PSN: Shatterdome
Shatterdome is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-19-2006, 10:59 PM   #84

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

Ok, im just going to test an animation program for a bullet and a gun. Ill have X fire a bullet. Ill have UP rotate the gun. Now, I think I understand the animation well enough to make the bullet "blit" at the end of the gun and have a little twisting effect. But I'm left in the dark when it comes to rotation an image. Cant even begin where to start. Ill search my cygwin files and stuf for something that rotates. But in the meantime, anyone know so I can save my self the trouble?
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-19-2006, 11:44 PM   #85

Developer
 
Smerity's Avatar
 
Join Date: Jun 2005
Location: Sydney, Australia
Posts: 128
Trader Feedback: 0
Default

SG57 -
Rotation of images is a bit of a stickler... Very hard to get right...

Two main ways I looked at doing it -

The First Way - Our Friends Sine and Cosine

That was an earlier WIP of my rotation function. I've now gotten rid of the lines (they were because I didn't put 'if (x>imgx)' and 'if (y>imgy)' and also added a filter to remove the aliasing...
What I did behind that was use a pretty standard rotation algorithm (I got it from a huge Computer Graphics book I have, covers 2D and 3D concepts, but it's the same algorithm as the one used here
Code:
int angle = 180, imgx = 100, imgy = 100;
if ( angle != 0 )
{
int yx = 0;
int xx = 0;
int px = 0;
int py = 0;
int color;
    while (yx < imgy){
        while (xx < imgx){
            int xi = xx - (imgx/2);
            int yi = yx - (imgy/2);

            px = xi*cos(angle) - yi*sin(angle) + (imgx/2);
            py = xi*sin(angle) + yi*cos(angle) + (imgy/2);

            color = getPixelImage( px, py, cannon_o);
            putPixelImage(color, xx, yx, cannon);

            xx++;
           } // x <
        xx=0;
        yx++;
} // y <
} // if angle ! 0
That actually ends up working fine. The problem (as always) is with the memory used in the process. For every pixel that is rotated, the pixel from the first image must be retrieved, and then the pixel in the next image has to be placed in the relevant spot. This ended up choking the VRAM and I ended up with v. slow (1 FPS) performance.
NOTE - If you don't need performance / need to change the image's rotation every second, this is still a pretty good way to do it.

The Second Way - Rotating the Vertices of which the image resides
Dr Watson gave me a link to his game library, StarBugz game prototype and engine (using Gu) with source

Background - Most graphics libraries used with PSP coding atm pastes an image onto a plane (texture onto a quad) and displays it like that. That means that you can support alpha and all that other jazz whilst it being extremely fast (as it uses the GPU)

Having a look in there, I discovered he used a very clever short cut. Instead of rotating the image before hand, you just rotate the plane (quad) of which the image is on. This means that the GPU does all the work, and the GPU is very efficient at such transformations.

Only problem? Dr Watson's code is in C++ ^_^

The graphics library used by Yeldarb et al uses the same concept as Dr Watson's however, and so you can rotate the vertices of the plane, thus rotating the texture (image)
NOTE - You can rotate the vertices (just point <x, y>) using the same algorithm as above, except replace imgx, imgy for vertx, verty or similar.

At that point however, school started back up and I haven't really had a chance to code O_O

I'm sure there are other techniques, but they were the ones I looked at so far...
Good luck, may have to scratch up on your math for this one...
__________________
Developer of Airstrike
Smerity is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-20-2006, 12:12 AM   #86

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

I never really noticd this Smerity, but Me and You are the only ones that actually stay up as some of the late members. The only reason I am up so late, is because I want to learn more about coding, and I don't have school tomorrow (presidents day).

ON TOPIC: So, your saying that you got your Airstrike rotating barrell working? Or are you still working on it? Also, when rotating, does it rotate the offsets? So I can have the bullet come out of the offset value where the end of the barrel is, cause in alot of shooters, they have a little ship thin going around, then multiple directions to shoot it from. That Geometry type shooter thing, that one has a rotating image that shoots from the 'barrel' so im assuming that the offset values rotate too, that way Ican assign the launching of the bullet from the offset value at the dn of the barrel.

Hopefully you stay up a little late tonight Smerity, that way if I have questions you can hopefully answer them ?
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-20-2006, 01:33 AM   #87

Developer
 
Smerity's Avatar
 
Join Date: Jun 2005
Location: Sydney, Australia
Posts: 128
Trader Feedback: 0
Default

You really have to specify the technique you mean SG57.
For example, offsets won't work in technique 1, but in technique 2 they will.

On the Airstrike gun barrel, still working on it, but the concept is sound, just haven't had enough time recently to implement it.

Off topic - Only 8:30 atm, but yes, I have stayed up very late coding, most devs have, it's just the whole timezone that distorts the sense that people are staying up late.
__________________
Developer of Airstrike
Smerity is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-20-2006, 02:15 AM   #88

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

Well, it's 2:13 am, here.

Well, if you think my idea of having a barrell moving and something launching from it via an offset, what was your idea for a moving barrel, and still be able to launch stuff from it? In your game, your going to have to do something like that you know...
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-20-2006, 02:48 AM   #89

Developer
 
Smerity's Avatar
 
Join Date: Jun 2005
Location: Sydney, Australia
Posts: 128
Trader Feedback: 0
Default

Dude, I have no clue what you're on about, please explain.

Do you mean offset as in where the object is emitted from?
If so, it's v. easy, find a point just infront of the cannon and apply the exact same rotations to it as you do the cannon...
__________________
Developer of Airstrike
Smerity is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-20-2006, 06:35 AM   #90

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

I am going to make the barrell all its own image and rotate it on the actual 'cannon' body, just by making that one end a half circle, but i just need to know how to rotate an image 1 *, then I can make a 'for' statement and rotate it as much as I want. So basically, does anyone have a working rotating function that I can put into a prototype to call easily like:

Code:
int rotateImage(int width, int height, some other stuff) {
         do the fancy stuff here.
  return NewImage;
}
Something of the sort...
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
c or c , c++ , c/c++ , code , coding , c_language , programming , psp , psp programming , thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -8. The time now is 02:53 AM.



Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © 2009, QJ.NET. All Rights Reserved.
Contact Us