Seite 95 von 340 ErsteErste ... 45 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 145 195 ... LetzteLetzte
Zeige Ergebnis 2.821 bis 2.850 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; yaustar - It seems gluLookAt has all glLoadIdentities point to where the camera is, which is where my person is. ...

  
  1. #2821
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    yaustar - It seems gluLookAt has all glLoadIdentities point to where the camera is, which is where my person is. After removing the glLoadIdentity() from my cube function, it draws the cube just as i wanted.

    Ok, now the only thing is, can I use glPush/PopMatrix to be able to translate, and still go back to 0,0,0 without calling glLoadIdentity, or after all drawing is done after translating to where i wanted and retranslating back negative whatever i had before... ahh its hard to explain. Can i do this:
    Code:
    glPushMatrix();
      DrawCube(10,4,10); // x,y,z are the arguments
    glPopMatrix();
    DrawCube(0,0,0);
    Would the above draw 2 cubes at 10,4,10, or would it drawone cube at 10,4,10 and one at 0,0,0?

    If it does draw 2 cubesat 10,4,10, than can ido this to compensate:
    Code:
    DrawCube(10,4,10);
    DrawCube(-10,-4,-10);



    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  2. #2822
    Developer
    Points: 7.577, Level: 58
    Level completed: 14%, Points required for next Level: 173
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    1.026
    Points
    7.577
    Level
    58
    Downloads
    0
    Uploads
    0

    Standard

    Both of your code samples will work SG57.

    I'd recommend using push/pop or using something like:

    Code:
    glLoadIdentity();
    DrawCube(10,4,10); // x,y,z are the arguments
    glLoadIdentity();
    DrawCube(0,0,0);

    Check out my homebrew & C tutorials at http://insomniac.0x89.org/
    Coder formerly known as Insomniac197

    tshirtz: what is irshell ??
    Atarian_: it's where people who work for the IRS go when they die

  3. #2823
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    Thats just it though, it seems when using gluLookAt (im using it for my camera class, so i can move around, look around, etc.) it resest the view matrix to my camera, so calling glLoadIdentity() than drawcube(1,1,1), it draws my cube where my camera is + 1,1,1. But your saying hte pushing/popping of hte matrix will work? Either way, Id get it to work as reverse translating would be hte same as reloading the identity.

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  4. #2824
    QJ Gamer Green
    Points: 9.165, Level: 64
    Level completed: 39%, Points required for next Level: 185
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    England ~¦¦¦|+|¦¦¦~
    Beiträge
    1.112
    Points
    9.165
    Level
    64
    My Mood
    Bored
    Downloads
    0
    Uploads
    0

    Standard

    I have made a game. When the game is complete, i want to be able to restart the game. I am looking for a method to restart the application. Any ideas? Would calling the main loop work?
    ...Just Returned To The Scene...

  5. #2825
    QJ Gamer Silver
    Points: 10.263, Level: 67
    Level completed: 54%, Points required for next Level: 187
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    UK
    Beiträge
    2.326
    Points
    10.263
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von SG57
    Thats just it though, it seems when using gluLookAt (im using it for my camera class, so i can move around, look around, etc.) it resest the view matrix to my camera, so calling glLoadIdentity() than drawcube(1,1,1), it draws my cube where my camera is + 1,1,1. But your saying hte pushing/popping of hte matrix will work? Either way, Id get it to work as reverse translating would be hte same as reloading the identity.
    It has been a while since I used OpenGL, this *should work*

    glLookAt
    glPushMatrix
    glTranslate
    // Draw the first model
    glPopMatrix

    glPushMatrix
    glTranslate
    // Draw the second model
    glPopMatrix
    -= Double Post =-
    Zitat Zitat von JaSo PsP
    I have made a game. When the game is complete, i want to be able to restart the game. I am looking for a method to restart the application. Any ideas? Would calling the main loop work?
    No.

    Code:
    bool exitFlag = false, resetFlag = false;
    
    while( !exitFlag )
    {
    	// Reinitialise the game
    	while( !resetFlag )
    	{
    		// Run the game
    		if( /* the reset condition is met */ )
    		{
    			resetFlag = true;
    		}
    	}
    	// Deinit the game
    	resetFlag = false;
    }
    Geändert von yaustar (02-17-2007 um 04:03 PM Uhr) Grund: Automerged Doublepost

  6. #2826
    QJ Gamer Gold
    Points: 14.678, Level: 78
    Level completed: 57%, Points required for next Level: 172
    Overall activity: 0%

    Registriert seit
    Nov 2006
    Beiträge
    1.523
    Points
    14.678
    Level
    78
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von JaSo PsP
    I have made a game. When the game is complete, i want to be able to restart the game. I am looking for a method to restart the application. Any ideas? Would calling the main loop work?
    Code:
    continue;
    Or Use goto
    just some help from my part;

  7. #2827
    QJ Gamer Silver
    Points: 10.263, Level: 67
    Level completed: 54%, Points required for next Level: 187
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    UK
    Beiträge
    2.326
    Points
    10.263
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Mr305
    Code:
    continue;
    Or Use goto
    just some help from my part;
    Woah. Goto == bad. There is on one real reason to use goto in code and that is to get out of a REALLY nested loop/if statements. Goto in general confuses the compiler so it won't make the best optimisations and also VERY prone to spagetti code and is a maintenence nightmare. You don't need goto for something this simple.

    Continue just finishes the current loop immediately. It doesn't really reset anything.

  8. #2828
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    yet again, this (i hope) should be a fairly simple question, how do you play sounds on the psp?
    -= Double Post =-
    O also, How do you make the "printTextScreen" text bigger, (is there a way?) or can you load true type fonts?
    Geändert von BlackShark (02-17-2007 um 06:16 PM Uhr) Grund: Automerged Doublepost
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

  9. #2829
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    I was told goto and continue statments should be avoided at all costs. So, I didnt learn how to use them :P Im sure it's something like:
    Code:
    constructor:
      score = 0; life=100;
      // basically run through whole code, from the start of 'main'
    ...
    
    if(life<=0) { goto constructor; }
    Im sure it's wrong, but from a logical point of view, thats how Id imagine it works... Its probably for hte best i dont learn them, else ill try to use them in situations where i have no other choice (that i know of).

    I can load and render MD2 models and there animations now very easily, ive been able to since last summer, but until now i could never get the rendering correct since when i translated my model, itd always move with the camera. This was good, but only for the characters model :P

    Anyways... Ill post back here with another question/problem. One will most likely be collision, Ill be doing either bounding box collision in 3 dimensions, or sphere-sphere collision insomniac mentioned to me... Can anyone possibly paste the function for one of them? If not, thats fine, ill go googling around and find one, and port it to C/C++ if necessary.

    BlackShark - How about you take the initiative and SEARCH. The SDK has audio samples. As for the printTextScreen, you CANT change hte font size, and you CAN load and display TTF fonts (which can be scaled in size and whatnot incode). Try searching for a change... FLIB i believe its called.
    -= Double Post =-
    ahhh... Ok, i need someone to look at my code. After changing all my macros to constants, and changing all things like 'macro*2' to there actual values) Now its all screwd up :-\ Ive tried changing them all back, but its still happening, meaning i havent changed everything back... Im sure theres just some bug that is making hte camera move out in the middle of nowwhere. I mean, it should atleast show the 200x200 grid that is around thecamera, but it doesnt... So, insomniac/yaustar (raphael probably won't want to help sincehe's away from his computer.... or he might not want to help period ) if you are feeling generous, could you help if i dont eventually get it tonight? As I said, it's probably a novice mistake, so it should stick out i hope (although it isnt sticking out for me...). Thanks alot if you canhelp, im just starting to find my models and whatnot, so having to stop and debug is kind of a let down :-\
    -= Double Post =-
    I know how much all of you were dying to help me with my problem [/sarcasm] but Ive fixed it. Turns out my little tweakings led to a push/popMatrix error, which led to unknown results which endep sending my camera flying randomly 8-|

    Now, Im getting back to actual fun stuff... Time to render alot of MD2 models, animate each one by the same animation number, and see which one i like... Oh and my game im planning on creating, is a type of sword fighting survival game... You go into a room, you fight an enemy, if you win, you go to the next room and fight either: the same guy but with a different skin, or scaled bigger, or better health or better strength and whatnot. Or, a completely diferent model. I hope to have it after you get past every 5 rooms, you have a different weapon. I have a whole surplus of MD2 models, and weapons and all there animations, so given timethis will work. And best of all, the collision shouldnt be too difficult. If you wswing your sword and it collides with teh enemy (give or take a unit or 2) and the sword collides with the other model, it hurts them. The problem that is closest to me in code is the tesselation of the rooms walls. I know each room can be a skybox which i will be doing, but first i need to write the function that Raphael posted an example, im just procrastinating as i really dont want to do the math and work it out so all 6 faces of the room are drawn without culling :\ Id absolutly love if someone else did Save me the headache, but im a novice, so it might be best if i do it myself...
    Geändert von SG57 (02-17-2007 um 11:26 PM Uhr) Grund: Automerged Doublepost

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  10. #2830
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    mm, im having trouble introducing a state system, what im trying to do is first define the state like...

    bool gState = "menu";

    then ill try to make loops that happen when in that state, like

    while (gState == "menu") {
    blaba bal
    balb al bal
    interger 1337 bla counterstrike bap
    blaj baoi }

    so fare i tried adding just those to but i get errors such as,

    'bool' undeclared (first use in this function)
    syntax error before 'gState'
    'gState' undeclared (first use in this function)

    any suggestions?
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

  11. #2831
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    I suggest you read up on the bool data type (booleans are either true or false Also, Ill spare you the bash and just say, either include typedef.h or copy and paste:
    Code:
    typedef enum _bool { FALSE, TRUE } bool;
    into your code. But enumerators arent that necessary when you can simply use the integer data type, along with 2 macros (or const if you wish)
    Code:
    #define true 1
    #define false !true
    
    int my_bool = false;
    or you can even go a step further:
    Code:
    #define true 1
    #define false !true
    #define bool int
    
    bool my_bool = false;
    Anyawys, for your case, youd have to use C++ to compare strings using the == operator, else youll have to use strcmp or some other method .. But, i highly recommend using macros as they would take up 2 bytes or so (i think its 2 bytes for just a whole number), compared to the 2 bytes per-character if you were to use a string (i think it's 2 bytes per char.. or is it 4?) This is what im talking about:
    Code:
    #define menu 1
    
    int game_state = menu;
    
    ...
    
    while(game_state == menu) { ... }

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  12. #2832
    QJ Gamer Silver
    Points: 14.087, Level: 77
    Level completed: 10%, Points required for next Level: 363
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Germany
    Beiträge
    926
    Points
    14.087
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    a boolean is generally a variable that is made to hold two states: TRUE or FALSE. You are trying to assign it a string. That won't work. Apart from that, there's no default bool type defined in GCC (you'd have to do it yourself through a typedef int bool;).
    Code:
    char* gState = "state1";
    
    while (gState=="state1")
    {
    ...
    // some condition
       gState = "state2";
    }
    This will work because you are having constant strings in memory and assigning a pointer to the string to the variable gState. Don't get the idea that it actually copies the string "statex" into the variable gState, or that you can compare two strings with 'string1 == string2'. It only works because they are always different in this case, if the pointers are different.

    However, for your minds' sake, I would recommend you try to define states through integer values as most people do it.
    Code:
    #define STATE1 0
    #define STATE2 1
    ... more
    
    int gState = STATE1;
    
    while (gState==STATE1)
    {
    ....
    // The same
    gState = STATE2;
    }
    @SG57: Try to come up with that yourself, really. It's not hard at all, you just need to concentrate on what you want to achieve (create a tesselated unit cube) and go through the single steps of my sample code and think up what it actually does, then change it so it fits your need. Most of the time you'll only need to swap around two of three coordinates in my code to get another cube face.
    Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
    Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
    Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
    Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.

  13. #2833
    QJ Gamer Green
    Points: 9.165, Level: 64
    Level completed: 39%, Points required for next Level: 185
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    England ~¦¦¦|+|¦¦¦~
    Beiträge
    1.112
    Points
    9.165
    Level
    64
    My Mood
    Bored
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von yaustar
    Code:
    bool exitFlag = false, resetFlag = false;
    
    while( !exitFlag )
    {
    	// Reinitialise the game
    	while( !resetFlag )
    	{
    		// Run the game
    		if( /* the reset condition is met */ )
    		{
    			resetFlag = true;
    		}
    	}
    	// Deinit the game
    	resetFlag = false;
    }
    hmm, I dont quite understand whats going on? How do I 'Deinit' the game?
    ...Just Returned To The Scene...

  14. #2834
    QJ Gamer Silver
    Points: 10.263, Level: 67
    Level completed: 54%, Points required for next Level: 187
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    UK
    Beiträge
    2.326
    Points
    10.263
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Ok, I rephrase that:
    Code:
    bool exitFlag = false, resetFlag = false;
    
    while( false == exitFlag )
    {
    	// Initiialise the game. Allocate memory, set values correctly etc.
    	while( false == resetFlag )
    	{
    		// Run the game
    		if( /* the reset condition is met */ )
    		{
    			resetFlag = true;
    		}
    	}
    	// Clean up the game. Free any allocated memory, resest values etc
    	resetFlag = false;
    }

  15. #2835
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    Raphael - Didnt I say a variation of what you said ;) As for the tesselation (god i love that word... its just so... foreign to me...) I know, Ill probably just treat one value as a '1', and the other as 0. Than, ill compare your set of verticies to a cubes set, and replace all 1s with there respective values, and 0s with theres. Its hard to explain it, but I understand it, and I know i can do it myself, i just am procrastinating the headache I have a feeling ill get

    Also, 10, ~1,000 poly, animated-textured MD2 models of a knight and his sword (so its 20 models, since tris + weapon), running at around 30 FPS. (sorry for the attactment, i cant upload it to my site at the moment) Thats promising :) That means i can have around 7,500 (im averaging) poly's for a decent game all rendered at once... Yay :)
    Miniaturansicht angehängter Grafiken Miniaturansicht angehängter Grafiken C/C++ Programming Help Thread-snap0002_thumb.jpg  

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  16. #2836
    QJ Gamer Blue
    Points: 3.624, Level: 37
    Level completed: 83%, Points required for next Level: 26
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    67
    Points
    3.624
    Level
    37
    Downloads
    0
    Uploads
    0

    Standard

    Can someone tell me how exactly (and/or provide a sampleà to print a png on the screen using Gu ? i have one way to do it, but it's really dirtry coz it implies blitting the images then start gu and finally draw what gu has to draw, and then flip the screen. This causes an huge performance loss and I think it would be better to use Gu (less graphics bugs than the described "workaround" (we can see the screen flicker when an mp3 is played)), but I really ain't able to use Gu properly by unterstanding it's parameters. You'll understand why I ask :)

    Basically, what I want to do is to draw a background under the "donut" gu example (celshading), already managed to print texte, but I don't undersand for png files.

  17. #2837
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    DreamTeam - Simple; map your PNG texture onto a quad, and scale it so it fills the screen (or us an ortho view, but i dont know if you can z-order it so the torus is infront).

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  18. #2838
    QJ Gamer Green
    Points: 9.165, Level: 64
    Level completed: 39%, Points required for next Level: 185
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    England ~¦¦¦|+|¦¦¦~
    Beiträge
    1.112
    Points
    9.165
    Level
    64
    My Mood
    Bored
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von yaustar
    Ok, I rephrase that:
    Code:
    bool exitFlag = false, resetFlag = false;
    
    while( false == exitFlag )
    {
    	// Initiialise the game. Allocate memory, set values correctly etc.
    	while( false == resetFlag )
    	{
    		// Run the game
    		if( /* the reset condition is met */ )
    		{
    			resetFlag = true;
    		}
    	}
    	// Clean up the game. Free any allocated memory, resest values etc
    	resetFlag = false;
    }
    thank you very much! it works very well!
    ...Just Returned To The Scene...

  19. #2839
    Developer
    Points: 7.577, Level: 58
    Level completed: 14%, Points required for next Level: 173
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    1.026
    Points
    7.577
    Level
    58
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von SG57
    That means i can have around 7,500 (im averaging) poly's for a decent game all rendered at once... Yay :)
    7,500 isn't a lot really at 30 FPS. Once you add sound playback, collisions etc etc that'll drop dramatically.

    That's 225,000 triangles per second.

    For comparison I'm pushing around 20,000 triangles with 3 lights, full audio playback, collisions etc etc at around ~120 FPS.

    That's 2,400,000 triangles per second - a big difference :)

    Check out my homebrew & C tutorials at http://insomniac.0x89.org/
    Coder formerly known as Insomniac197

    tshirtz: what is irshell ??
    Atarian_: it's where people who work for the IRS go when they die

  20. #2840
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    Thank you SG57 and Raphael, very helpful

    EDIT: nice screen there SG :)
    Geändert von BlackShark (02-18-2007 um 10:45 AM Uhr)
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

  21. #2841
    Heroes never die
    Points: 8.645, Level: 62
    Level completed: 65%, Points required for next Level: 105
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    ...........
    Beiträge
    1.323
    Points
    8.645
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    error
    Code:
    /tmp/pspdev/pspsdk/src/startup/crt0_prx.c:88: undefined reference to `atexit'
    /tmp/pspdev/pspsdk/src/startup/crt0_prx.c:94: undefined reference to `exit'
    /usr/local/pspdev/psp/sdk/lib/libpspdebug.a(scr_printf.o): In function `pspDebug
    ScreenPrintf':
    /tmp/pspdev/pspsdk/src/debug/scr_printf.c:168: undefined reference to `vsnprintf
    '
    collect2: ld returned 1 exit status
    make: *** [file1.elf] Error 1
    Code:
    TARGET = file1
    OBJS = main.o
    
    BUILD_PRX=1
    
    
    PRX_EXPORTS=exports.exp
    
    USE_KERNEL_LIBC = 1
    
    CFLAGS = -O2 -G0 -Wall
    CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
    ASFLAGS = $(CFLAGS)
    LIBS = -lpsppower
    
    
    
    
    PSPSDK=$(shell psp-config --pspsdk-path)
    include $(PSPSDK)/lib/build.mak

    i found its because the USE_KERNEL_LIBC = 1
    (it compilles fine as eboot) , how do i fix this?

  22. #2842
    QJ Gamer Green
    Points: 9.165, Level: 64
    Level completed: 39%, Points required for next Level: 185
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    England ~¦¦¦|+|¦¦¦~
    Beiträge
    1.112
    Points
    9.165
    Level
    64
    My Mood
    Bored
    Downloads
    0
    Uploads
    0

    Standard

    when making a game have hi scores, how would i go about saving them to a file so it cant be altered by anyone exept the PSP?
    ...Just Returned To The Scene...

  23. #2843
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    JaSo - You'd have to encrypt the highscores file. As for read/writing to and from it, google fread and fwrite. Or, use the PSPs sceIo* functions, but thos ehave less documentation..

    ...at what speed must I live.. to be able to see you again?...

    Projects

    You can support my Open World 3D RPG for PSP by voting for it here


  24. #2844
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    I got a problem with a while loop, when i run it the Menu works Perfectly, but when i press X on Zombie hunt (the first option) i have it go to another loop, all it should do is desplay a background, and stay there untill START is pressed, then it should go back to the menu, but when i press Zombie Hunt, it crashes, Here is the While Parts of my code,

    Spoiler for Code:
    //***********************
    //Game loop (yay! games!) (MENU)
    //***********************
    while(gState == STATE1) {
    clearScreen(0);
    sceCtrlReadBufferPositive (&pad, 1);


    //What happens when up and down is pressed??????
    if(pad.Buttons & PSP_CTRL_UP) {
    selComponent--;
    for(i=0; i<10; i++) {
    sceDisplayWaitVblankStart ();
    }
    } else if(pad.Buttons & PSP_CTRL_DOWN) {
    selComponent++;
    for(i=0; i<10; i++) {
    sceDisplayWaitVblankStart ();
    }
    }

    //Here are a couple of if statements that make it so that if you go over the
    //maximum selection in the menu, you go back to the first selection, easy really.....
    if (selComponent > maxS) {
    selComponent = 0;
    }
    if (selComponent < 0) {
    selComponent = maxS;
    }

    ///X is pressed, now what????
    if(pad.Buttons & PSP_CTRL_CROSS) {
    if (selComponent == 0){
    gState = STATE2;
    }

    if (selComponent == 4) {
    sceKernelExitGame();
    }
    }

    //Drawing of the Background to the Screen
    blitAlphaImageToScreen(0 ,0 ,480 , 272, ourImage, x, y);
    //now see, that wasn't too different from lua now was it?
    //now here is the menu
    printTextScreen(24, 200, "Menu", dimmedColor);
    printTextScreen(25, 200, "Menu", red);


    //and now for the Options
    if(selComponent == 0) {
    printTextScreen(10, 220,"Zombie Hunt", shadowColorH);
    printTextScreen(9, 220, "Zombie Hunt", highlightColor);
    } else {
    printTextScreen(12, 220, "Zombie Hunt", shadowColorD);
    printTextScreen(11, 220, "Zombie Hunt", dimmedColor);
    }

    if(selComponent == 1) {
    printTextScreen(10, 230, "Weapons", shadowColorH);
    printTextScreen(9, 230, "Weapons", highlightColor);
    } else {
    printTextScreen(12, 230, "Weapons", shadowColorD);
    printTextScreen(11, 230, "Weapons", dimmedColor);
    }

    if(selComponent == 2) {
    printTextScreen(10, 240, "Options", shadowColorH);
    printTextScreen(9, 240, "Options", highlightColor);
    } else {
    printTextScreen(12, 240, "Options", shadowColorD);
    printTextScreen(11, 240, "Options", dimmedColor);
    }

    if(selComponent == 3) {
    printTextScreen(10, 250, "High Score", shadowColorH);
    printTextScreen(9, 250, "High Score", highlightColor);
    } else {
    printTextScreen(12, 250, "High Score", shadowColorD);
    printTextScreen(11, 250, "High Score", dimmedColor);
    }

    if(selComponent == 4) {
    printTextScreen(10, 260, "Quit", shadowColorH);
    printTextScreen(9, 260, "Quit", highlightColor);
    } else {
    printTextScreen(12, 260, "Quit", shadowColorD);
    printTextScreen(11, 260, "Quit", dimmedColor);
    }
    flipScreen();

    for(i=0; i<1; i++) {
    sceDisplayWaitVblankStart ();
    }
    }
    //***********************
    //Game loop (yay! games!) (GAME)
    //***********************
    while (gState == STATE2) {
    sceCtrlReadBufferPositive (&pad, 1);

    blitAlphaImageToScreen(0 ,0 ,480 , 272, levelb1, x, y);


    if(pad.Buttons & PSP_CTRL_START) {
    gState = STATE1;
    }

    flipScreen();

    for(i=0; i<1; i++) {
    sceDisplayWaitVblankStart ();
    }
    }


    any thing obvious that would make it crash? (it compiles and runs the menu correctly)

    EDIT: My code really is Indented but it isn't in this post, just to make that clear :P
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

  25. #2845
    QJ Gamer Silver
    Points: 14.087, Level: 77
    Level completed: 10%, Points required for next Level: 363
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    Germany
    Beiträge
    926
    Points
    14.087
    Level
    77
    Downloads
    0
    Uploads
    0

    Standard

    Your level1b is NULL or just not loaded correctly?
    Also, you should think about putting your "STATE2" loop into a seperate funtion and just call that when the first option is selected. That saves you a lot of while(while(while(while repetition.
    Also, try using sceKernelDelayThread(micr oseconds); rather than that ugly looped VBlank that just takes 1/6th of a second. sceKernelDelayThread(1000 *1000*1/6); would be equal but only one line. Plus you can easily change the delay to any amount of seconds.

    PS: You could also have relabeled my STATE1/STATE2 defines :P
    Raphs board rules #31: Excessive use of punctuation is either a sign of a lesser ego or a small mind. Avoid it if you don't want to look like a total moron.
    Raphs board rules #17: When you need to ask whether you are capable of doing something, you are not.
    Raphs board rules #2: Exploits aren't found by changing version numbers, blindly merging data into a file or turning your PSP upside down.
    Raphs board rules #1: If you have no clue how exploits work, don't come up with ideas about them.

  26. #2846
    Heroes never die
    Points: 8.645, Level: 62
    Level completed: 65%, Points required for next Level: 105
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    ...........
    Beiträge
    1.323
    Points
    8.645
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    I need help
    evrytime i want to do something new it goes wrong
    i cant make
    a VSH prx
    install zziplib
    install prxtool
    intstall freetype

    i always read the readme and the how to install
    has this something to do with my toolchain or something?

  27. #2847
    QJ Gamer Gold
    Points: 14.678, Level: 78
    Level completed: 57%, Points required for next Level: 172
    Overall activity: 0%

    Registriert seit
    Nov 2006
    Beiträge
    1.523
    Points
    14.678
    Level
    78
    Downloads
    0
    Uploads
    0

    Standard A huge problem.

    Did any one ever experience a problem with Start?
    even if I press it once, it acts as if the button's pressed twice, breaking the loop!
    OR is my button faulty?

  28. #2848
    QJ Gamer Green
    Points: 9.165, Level: 64
    Level completed: 39%, Points required for next Level: 185
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    England ~¦¦¦|+|¦¦¦~
    Beiträge
    1.112
    Points
    9.165
    Level
    64
    My Mood
    Bored
    Downloads
    0
    Uploads
    0

    Standard

    Random Numbers. I need to be able to create random numbers between two integers. I dont have a clue how to get started on how to create a random seed and display a number. I need some in-depth help on how to do randoms. Post an example maybe? I need to know the libs used too, and what to put into my makefile. Thanx very much in advance.
    ...Just Returned To The Scene...

  29. #2849
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Raphael
    Your level1b is NULL or just not loaded correctly?
    Also, you should think about putting your "STATE2" loop into a seperate funtion and just call that when the first option is selected. That saves you a lot of while(while(while(while repetition.
    Also, try using sceKernelDelayThread(micr oseconds); rather than that ugly looped VBlank that just takes 1/6th of a second. sceKernelDelayThread(1000 *1000*1/6); would be equal but only one line. Plus you can easily change the delay to any amount of seconds.

    PS: You could also have relabeled my STATE1/STATE2 defines :P
    thanks very much for your help (also i was going to change the STATE names but thats what they really were, STATEs, so i just decided to keep them, but looks like i won't need alot of them much longer, thanks again!

    EDIT: alright this should be about the last question I but you with for now,
    but how would i go about making a 4 direction bullet system and how do I implement the analogue stick?

    -= Double Post =-
    Zitat Zitat von JaSo PsP
    Random Numbers. I need to be able to create random numbers between two integers. I dont have a clue how to get started on how to create a random seed and display a number. I need some in-depth help on how to do randoms. Post an example maybe? I need to know the libs used too, and what to put into my makefile. Thanx very much in advance.

    Try defining this above your while loop...

    Code:
    int GetRandomNum(int lo, int hi) {
     SceKernelUtilsMt19937Context ctx;
     sceKernelUtilsMt19937Init(&ctx, time(NULL)); //SEED TO TIME
     u32 rand_val = sceKernelUtilsMt19937UInt(&ctx);
     rand_val = lo + rand_val % hi;
     return (int)rand_val;
    }
    Then call it like,

    Code:
    GetRandomNum(*INSERT # HERE* , *INSERT # HERE*)

    O yes, and MAKE SURE that you put

    Code:
    #include </usr/include/sys/stat.h>
    up were the rest of your #include's are let me know if this works for you.
    Geändert von BlackShark (02-19-2007 um 08:43 PM Uhr) Grund: Automerged Doublepost
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

  30. #2850
    QJ Gamer Green
    Points: 9.165, Level: 64
    Level completed: 39%, Points required for next Level: 185
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    England ~¦¦¦|+|¦¦¦~
    Beiträge
    1.112
    Points
    9.165
    Level
    64
    My Mood
    Bored
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von BlackShark
    thanks very much for your help (also i was going to change the STATE names but thats what they really were, STATEs, so i just decided to keep them, but looks like i won't need alot of them much longer, thanks again!

    EDIT: alright this should be about the last question I but you with for now,
    but how would i go about making a 4 direction bullet system and how do I implement the analogue stick?

    -= Double Post =-



    Try defining this above your while loop...

    Code:
    int GetRandomNum(int lo, int hi) {
     SceKernelUtilsMt19937Context ctx;
     sceKernelUtilsMt19937Init(&ctx, time(NULL)); //SEED TO TIME
     u32 rand_val = sceKernelUtilsMt19937UInt(&ctx);
     rand_val = lo + rand_val % hi;
     return (int)rand_val;
    }
    Then call it like,

    Code:
    GetRandomNum(*INSERT # HERE* , *INSERT # HERE*)

    O yes, and MAKE SURE that you put

    Code:
    #include </usr/include/sys/stat.h>
    up were the rest of your #include's are let me know if this works for you.
    Ill try it when i get home from school, thanx
    ...Just Returned To The Scene...


 

Tags for this Thread

Forumregeln

  • Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
  • Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
  • Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
  • Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.
  •  





Alle Zeitangaben in WEZ -8. Es ist jetzt 09:27 PM Uhr.

Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © , Caputo Media, LLC. All Rights Reserved. Cluster .