svn co svn://svn.ps2dev.org/psp/trunk/Jpeg
I think ...
Printable View
svn co svn://svn.ps2dev.org/psp/trunk/Jpeg
I think ...
It doesn't exist:( , some1 knows if it is possible??
Lowercase j.
svn co svn://svn.ps2dev.org/psp/trunk/jpeg
great! It works:)
I've installed the library, but which header files do I have to use (and add to my makefile)? And in the script, can I do excactly the same as with the .png's?
if youre using SDL its the same line of code.
SDL_Surface *image;
image = IMG_Load(file);
hey question:
how can i make a function with passes that are optional?
i.e.:
void func(int x,int y,bool starter){
//some code
}
now than i don't always want to pass the starter bool, is their a way to make that an optional value?
edit: i figured it out now
You need SDL_image for that, actually.Zitat:
Zitat von ernos
Hey guys
Awhile back(don't remember what page) I asked for help on AIs'. I have done different things, but I haven't managed to pull of what I need to for something that I am working on...
1) I will ask if anyone knows of a good tutorial/guide for doing the obvious.
2) If all I would like to do is have an object moving vertically or horizontally to follow another object, do I really need any more than the x or y variables?
Mm? You mean like this thing I made three years ago? Yeah, all I used were x/y coordinates and trigonometry.
Zitat:
Zitat von Archaemic
The question is, is it in C++ that you wrote it? That was similar to what I was originally thinking, but if you have multiple objects following around, you would have to set it up so that they don't hover over each other...
Could you PM the code for it? If you can, I may just be able to tailor it to my needs.
k i have a problem with 2 functions that i can't seem to fix:
Spoiler for first function:
Spoiler for second function:
now than inside the second function you can see the working way...and the non working way, as you can clearly see the working way contains the exact same code as the function it is calling in the non working way
as many of you well probably say:
hey your re-declaring the same variables
however i changed the variable names in the function as a test and it still crashes when that function is called and idk y so can someone help?
Is it possible to load an EBOOT with sceKernelLoadModule or another like function? Or, how could I strip the prx/elf from the EBOOT? I don't want to be loading the EBOOT with loadExec calls as that resets the rest of the system.
-Aura
Put up the code for both Grid struct and Enemy struct. I would like to see what member variables in both structs.Zitat:
Zitat von slicer4ever
Edit: Do you get a stack overflow exception?
no i don't get a stck overflow exception
structures:
Code:
typedef struct{
OSL_IMAGE *image;
float x;
float y;
int CT;
int angle;
int speed;
int health;
}Enemy;
typedef struct {
Tile Tiles[30*30];
int ST;
int ET;
int GSX;
int GSY;
}Grid;
What is in the Tile struct?
Try this function:
Calling it with:Code:Enemy SetupEnemy( const Grid * pGrid ){
Enemy e;
e.image = EnemyImages[CurrentWave];
e.x = pGrid->Tiles[pGrid->ST].x+pGrid->Tiles[pGrid->ST].w/2;
e.y = pGrid->Tiles[pGrid->ST].y+pGrid->Tiles[pGrid->ST].h/2;
if(pGrid->Tiles[pGrid->ST].dir==0){
e.angle=180;
}else if(pGrid->Tiles[pGrid->ST].dir==1){
e.angle=90;
}else if(pGrid->Tiles[pGrid->ST].dir==2){
e.angle=270;
}else if(pGrid->Tiles[pGrid->ST].dir==3){
e.angle=0;
}
e.CT = pGrid->ST;
e.speed=2;
e.health=10;
return e;
}
Edit: You are using straight C and not C++ right?Code:e = SetupEnemy(&g);
Well, you could load the ELF inside a 64-alligned buffer and use sceKernelLoadModuleBuffer ;)Zitat:
Zitat von Auraomega
sceIoLseek to 0x20 inside the PBP, and you'll find the offset of the ELF inside there as little endian. For example, if it says 56 06 00 00, take a look at 0x00000656. Now look at 0x24 for the next part of the PBP, aka the end of the ELF :)
And there you have it, the ELF, load it into a 64-alligned buffer and use sceKernelLoadModuleBuffer and start it ;)
Will be quite tricky to put that into reality in C code though :p
Alright, I have a quick question regarding plug-ins, what type of setup would I need to start writing some?
i'm using c++ but no more worries i'm using an alternative methodZitat:
Zitat von yaustar
Then please use classes and member functions. At the moment, all the code you have shown so far is C.Zitat:
Zitat von slicer4ever
bleh classes i prefer structures atm
Hehe, you have a long way to go :p
In C++, structs ARE classes but defaulted to public scope instead of private.Zitat:
Zitat von slicer4ever
How can I make a sound play when you hover over the game under GAME > Memory Stick? Is there a command in the makefile and what format would the sound have to be in?
-= Double Post =-
How can I make the PSP play a sound when my game is hovered over under GAME > Memory Stick? Is there a specific makefile command? If so what format would my sound have to be in?
PSP_EBOOT_SND0 = SND0.AT3 in your makefile.
The SND0.AT3 file is atrac3.
Ah thanks for that, I tried this exact method in the past, but foolishly forgot the address is backwards and wondered why I was getting weird (and wonderful?) results. Shame I deleted the code, oh well can't be too hard to get back again :)Zitat:
Zitat von JumpR
-Aura
see that's where i get confused at, these public and private scopes i've yet to truly comprehend the diffrences so instead i ignore even declaring them to save myself the troubleZitat:
Zitat von yaustar
also i've semi-delved into the full functionality of a class on various other languages but i'm uncertain of how to fully use one to it's best optimazation's
Read: Thinking in C++ Vol 1
http://www.mindviewinc.com/Books/
well do
Ok, I have no idea in hell for why this isn't working:
My main.cpp is:
Spoiler for Code:
The errors that I just don't get:
1) From one compiler:
http://img209.imageshack.us/img209/6525/errornp7.png
2) From another compiler:
Any help would be greatly appreciated because after a couple days of the same errors, I am greatly stressed. :Argh: :Argh:
Well, for one thing, there's no indentation. Another thing, where are the arguments to ai? A third thing. diff_x and diff_y are always 0 in the version you have there. The first part of the diffs are supposed to be the thing it's homing in on. Note the subtle difference between "homee" and "homer" in the code I gave you.
Also, I guess I ended up answering your question anyway. Bad me! I should be working on my midterm.
spike - include cmath first...
Zitat:
Zitat von Archaemic
Dam, I guess midterms are messing us both up. I wasn't even thinking I guess when I looked at your code :o
And my stupid C++ editor changed my code when I copy/pasted it from there to the message, I've got indentations, no worries there :)
I did change those things and as soon as I can, I will try to recompile it.
Thanks again Archaemic.
The other errors there, some of those may be unrelated though, so if anyone has an idea as to what there problem is... please fill me in! :humped:
Well I searched about this and found many different things and got confused. I'd like to know how to change the color of a pixel. Is there a function for it or do you have to do it the long way and write your own function? lol
Thanks in advance guys! :)
Zitat:
Zitat von SG57
Only one unidentifiable error :(
On line 41 of the said main.cpp... hmmm.
Can you post the code that has only one error..using the code tag this time? And also put a comment on line 41 so we don't have to C+P into a text editor to find line 41?
Zitat:
Zitat von Archaemic
Here is the root of your errors:Zitat:
Zitat von spike021
If enemies variable is an int, then it DOESN'T have a x member variable.Code:int enemies;
float theta, healthtemp;
float diff_x = enemies.x-enemies.x;
Not to mention that diff_x will always be 0.
Dam, I can't believe I wrote int. Thanks for the help guys :o
That's supposed to be != 0.0f, also. That's what was in the code I gave you.