Zeige Ergebnis 9.781 bis 9.810 von 10174
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; Also, how would you put something on 0.1 pixel......
-
03-16-2009, 10:33 AM #9781QJ Gamer Blue
- Registriert seit
- Dec 2007
- Ort
- Netherlands
- Beiträge
- 148
- Points
- 5.672
- Level
- 48
- Downloads
- 0
- Uploads
- 0
Also, how would you put something on 0.1 pixel...
[SIZE="1"][color=#D1D1FF]______________________________________________________________[/color]
[i]Last edited by basfreak; 01-01-1990 at [color=#666686]12:00 PM[/color][/i].[/SIZE]
-
03-16-2009, 12:29 PM #9782QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
[Blog] [Portfolio]
[Homebrew Illuminati - Serious Homebrew Development Forums]
[I want to make Homebrew FAQ] [How I broke into the Games Industry]
[Programming Book List] [Programming Article List]
-
03-16-2009, 12:32 PM #9783QJ Gamer Blue
- Registriert seit
- Dec 2007
- Ort
- Netherlands
- Beiträge
- 148
- Points
- 5.672
- Level
- 48
- Downloads
- 0
- Uploads
- 0
-
03-16-2009, 06:57 PM #9784Developer
- Registriert seit
- Jul 2008
- Ort
- Grand Rapids! MI
- Beiträge
- 125
- Points
- 8.092
- Level
- 60
- Downloads
- 5
- Uploads
- 2
Ok Im working on NitePR renamed DayPR for kicks and giggles,
but i have recently tried changing the picture on the top-left corner of the screen. I know know its writing to the vram using image blitting. and it does the image blitting part using the pixel data. Thats where im having trouble at. i know the Pixel data is in the picture's hex but when i tr locating it and then put it in the telazorn.h and i compile the prx and test it out it comes up as a box with the image looking like a tv with no antenna on it. i need help cause i don't know what im doing wrong. I don't know any thing about image blitting or how to get the pixel data in the way it needs to be.
Another thing im i need help with im adding a new tab for something that has to do with the site i am based from but i added the menu header for it but its not letting me switch to it so can someone tell me the structure of Crt0_prx.c so it will work correctly.
i searched all around google and a lot other sites and i got nothing.
(sorry if this is posted int the wrong section again)
-
03-17-2009, 02:08 AM #9785QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
How many bits per pixel are you using to store the data in the header file? What tool are you using to convert the files from binary to source?
[Blog] [Portfolio]
[Homebrew Illuminati - Serious Homebrew Development Forums]
[I want to make Homebrew FAQ] [How I broke into the Games Industry]
[Programming Book List] [Programming Article List]
-
03-17-2009, 12:30 PM #9786QJ Gamer Blue
- Registriert seit
- Dec 2007
- Ort
- Netherlands
- Beiträge
- 148
- Points
- 5.672
- Level
- 48
- Downloads
- 0
- Uploads
- 0
Hmm, can anyone help me out with audio in OSLib?
I declare the sound: OSL_SOUND * jump;
init the audio: oslInitAudio();
load the sound: jump = oslLoadSoundFile("jump.mp 3", OSL_FMT_NONE);
and play the sound: oslPlaySound(jump, 0);
But when I press the jump button it crashes so that's at the play sound.
Can anyone help me?
Thanks:Punk:[SIZE="1"][color=#D1D1FF]______________________________________________________________[/color]
[i]Last edited by basfreak; 01-01-1990 at [color=#666686]12:00 PM[/color][/i].[/SIZE]
-
03-17-2009, 12:40 PM #9787Developer
- Registriert seit
- Jul 2008
- Ort
- Grand Rapids! MI
- Beiträge
- 125
- Points
- 8.092
- Level
- 60
- Downloads
- 5
- Uploads
- 2
-
03-17-2009, 04:25 PM #9788QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
1. Failed....again...
2. http://slicer.gibbocool.com/ stay updated on all my projects
3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been
-
03-17-2009, 06:24 PM #9789lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
SANiK I think used bin2c to convert his picture.
The new tab you made, assuming you did it right actually will not be selectable until you change something. By something I mean there is a part in the source file that limits it to 5 tabs(I think nitePR has 5 tabs or so). You have to increase the number 5 assuming it is 5 to 6.
I can tell you know little nothing of coding in C so don't try and make another knockoff of nitePR, especially since its coding is real messy.
-
03-17-2009, 07:02 PM #9790Developer
- Registriert seit
- Jul 2008
- Ort
- Grand Rapids! MI
- Beiträge
- 125
- Points
- 8.092
- Level
- 60
- Downloads
- 5
- Uploads
- 2
i seen that on goolgoe today and just downloaded it. i changed the nitprthreas value from 5 to 6 but it still didnt let me select it. i'll just trasg the new tab and remove the logger. thanx though
and i know basicly the basic but C looks like php s i know the gist of whats going on so like i care about criticism thanx though +rep
-
03-18-2009, 01:33 AM #9791QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
[Blog] [Portfolio]
[Homebrew Illuminati - Serious Homebrew Development Forums]
[I want to make Homebrew FAQ] [How I broke into the Games Industry]
[Programming Book List] [Programming Article List]
-
03-18-2009, 02:12 AM #9792QJ Gamer Blue
- Registriert seit
- Aug 2006
- Beiträge
- 30
- Points
- 4.111
- Level
- 40
- Downloads
- 0
- Uploads
- 0
structure member pointing to structure of same type
Hi everyone,
C programming question: How do you define a structure with a member, which points to another structure of the same type?
Maybe some sample code is easier to understand: How do I get the following to work? (myStruct is used before it's defined)Thanks, BenHurCode:typedef struct { int number; myStruct* anotherMyStruct; } myStruct;
PS: I could use void*, but there has to be a more elegant solution...
-
03-18-2009, 03:14 AM #9793QJ Gamer Blue
- Registriert seit
- Sep 2005
- Ort
- Chigasaki, Japan
- Beiträge
- 226
- Points
- 4.980
- Level
- 45
- Downloads
- 0
- Uploads
- 0
This should do.Code:typedef struct myStruct { int number; struct myStruct* anotherMyStruct; } myStruct;
-
03-18-2009, 05:09 AM #9794QJ Gamer Bronze

- Registriert seit
- Sep 2006
- Ort
- france
- Beiträge
- 170
- Points
- 6.359
- Level
- 52
- Downloads
- 0
- Uploads
- 0
-
03-18-2009, 05:41 AM #9795QJ Gamer Blue
- Registriert seit
- Dec 2007
- Ort
- Netherlands
- Beiträge
- 148
- Points
- 5.672
- Level
- 48
- Downloads
- 0
- Uploads
- 0
I use wavs now and the stream method but if the sounds are played often I hear a cracking sound?
Nvm, works with FMT_NONE now, thanks ;)Geändert von basfreak (03-18-2009 um 05:55 AM Uhr)
[SIZE="1"][color=#D1D1FF]______________________________________________________________[/color]
[i]Last edited by basfreak; 01-01-1990 at [color=#666686]12:00 PM[/color][/i].[/SIZE]
-
03-18-2009, 07:43 AM #9796
- Registriert seit
- Mar 2008
- Beiträge
- 22
- Points
- 2.831
- Level
- 32
- Downloads
- 0
- Uploads
- 0
How to print a variable? I tried this way, but it doesn't work.
Code:printTextScreen(150, 150, mousex, white);
-
03-18-2009, 08:04 AM #9797QJ Gamer Blue
- Registriert seit
- Aug 2006
- Beiträge
- 30
- Points
- 4.111
- Level
- 40
- Downloads
- 0
- Uploads
- 0
-
03-18-2009, 11:36 AM #9798QJ Gamer Blue
- Registriert seit
- Jul 2007
- Beiträge
- 296
- Points
- 3.795
- Level
- 38
- Downloads
- 0
- Uploads
- 0
Assuming printTextScreen() takes a C-style string and mousex is an integer, you could do:
However, this is a bit of CCode:char tempStrBuffer[12]; // mousex probably isn't that big snprintf(tempStrBuffer, 12, "%i", mousex); printTextScreen(150, 150, tempStrBuffer, white);
y, so you could also consider:
if you are willing to use some C++.Code:std::stringstream ss; ss << mousex; std::string mousexStr = ss.str(); printTextScreen(150, 150, mousexStr.c_str(), white);
-
03-18-2009, 11:53 AM #9799
- Registriert seit
- Mar 2008
- Beiträge
- 22
- Points
- 2.831
- Level
- 32
- Downloads
- 0
- Uploads
- 0
-
03-19-2009, 08:20 AM #9800
- Registriert seit
- Nov 2007
- Beiträge
- 21
- Points
- 2.908
- Level
- 33
- Downloads
- 0
- Uploads
- 0
Hello
Has anybody idea, to do it so the tower (wieza struct) atacks the mobs (potfur struct) only once at time ??? I mean some time ago I did it but the tower was attacking all mobs that were on map, i want 1 tower = 1 mob attacked by it. Now one tower attacks one mob but only once (so it hits it by 5hp and tower doesnt do anything next)
Anybody help ?
here's the attacking loop:
Code:for(i = 0; i <= DefNr; i++) //main loop, 0 to towers amount { if(wieza[i] != NULL && !wieza[i]->isAttack) // if tower exist { for(b = 0; b <= MobNr; b++)//loop from 0 to mob amount { if(potfur[b] != NULL && potfur[b]->hp > 0 && !wieza[i]->isAttack) //if tower isnt attacking yet, the mob is not dead, and if it exist... { oslDrawLine(wieza[i]->wiezaspr->x + wieza[i]->wiezaspr->sizeX/2,wieza[i]->wiezaspr->y + wieza[i]->wiezaspr->sizeY/2, potfur[b]->potforek->x + potfur[b]->potforek->sizeX/2,potfur[b]->potforek->y + potfur[b]->potforek->sizeY/2, RGBA(0,0,255,200)); // draws "beam" potfur[b]->hp -= 5; // hits it... wieza[i]->isAttack = true; // and make boolean isAttack true, so it shoudnt attack any other monster till this is death break; } else { wieza[i]->isAttack = false; } if(wieza[i]->isAttack) break; } } }
-
03-19-2009, 09:27 AM #9801QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Generally looks fine to me from a glance. Are you sure it attacks everything at once? Don't forget this code will generally run up to 60 frames per second so it is making up to 60 attacks per second.
[Blog] [Portfolio]
[Homebrew Illuminati - Serious Homebrew Development Forums]
[I want to make Homebrew FAQ] [How I broke into the Games Industry]
[Programming Book List] [Programming Article List]
-
03-19-2009, 10:15 AM #9802
- Registriert seit
- Nov 2007
- Beiträge
- 21
- Points
- 2.908
- Level
- 33
- Downloads
- 0
- Uploads
- 0
I want one tower to attack only one mob at time till it's dead, now it shoot only 1 beam to one mob. It stops me from developing this game
-
03-19-2009, 12:09 PM #9803QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
I know what you want, what I am not sure is whether you are describing something that happens over one frame or something that is happening over several frames but in a very short amount of time.
As I said above:
"Don't forget this code will generally run up to 60 frames per second so it is making up to 60 attacks per second."
Which is 5 hp off a monster per frame. How much health does each monster have?[Blog] [Portfolio]
[Homebrew Illuminati - Serious Homebrew Development Forums]
[I want to make Homebrew FAQ] [How I broke into the Games Industry]
[Programming Book List] [Programming Article List]
-
03-20-2009, 10:19 AM #9804
- Registriert seit
- Nov 2007
- Beiträge
- 21
- Points
- 2.908
- Level
- 33
- Downloads
- 0
- Uploads
- 0
-
03-20-2009, 10:44 AM #9805
- Registriert seit
- Mar 2008
- Beiträge
- 22
- Points
- 2.831
- Level
- 32
- Downloads
- 0
- Uploads
- 0
Hello, is there any function to change printing text size? Thank you.
-
03-20-2009, 10:52 AM #9806Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
I think debug is a specific size, are you using debug text?
-
03-20-2009, 10:54 AM #9807
- Registriert seit
- Mar 2008
- Beiträge
- 22
- Points
- 2.831
- Level
- 32
- Downloads
- 0
- Uploads
- 0
-
03-20-2009, 11:45 AM #9808Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
I would advise you to stop using graphics.c :/
-
03-20-2009, 06:58 PM #9809xMod.
- Registriert seit
- Oct 2008
- Ort
- Melbourne, Australia
- Beiträge
- 675
- Points
- 4.576
- Level
- 43
- My Mood
-
- Downloads
- 0
- Uploads
- 0
Use pspDebugScreenPrintf instead.
It's much more reliable.
--SLasher
-
03-20-2009, 11:29 PM #9810
- Registriert seit
- Mar 2008
- Beiträge
- 22
- Points
- 2.831
- Level
- 32
- Downloads
- 0
- Uploads
- 0
I don't know how in pspDebugScreenPrintf set x, y coordinates, color, size..
Where i can get more information about pspDebugScreenPrintf?Geändert von xDeaglex (03-21-2009 um 01:01 AM Uhr)


LinkBack URL
About LinkBacks
Mit Zitat antworten


Hello everyone I am new here and I am glad to be part of this amazing community and I think there...
New to forum