Seite 249 von 340 ErsteErste ... 149 199 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 299 ... LetzteLetzte
Zeige Ergebnis 7.441 bis 7.470 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; Ok, i am still looking for 2 things: 1) How to flip an image using oslib (my signature sprite from ...

  
  1. #7441
    QJ Gamer Silver
    Points: 10.921, Level: 69
    Level completed: 18%, Points required for next Level: 329
    Overall activity: 0%

    Registriert seit
    May 2006
    Ort
    Behind you.
    Beiträge
    1.814
    Points
    10.921
    Level
    69
    Downloads
    0
    Uploads
    0

    Standard

    Ok, i am still looking for 2 things:

    1) How to flip an image using oslib (my signature sprite from right to left)
    2) A good scrolling tile engine (i tried to make one...not so well). If i can just get a good example...i have been asking for this quite some months now...
    Sorry for being an idiot.


    Calypso - Enjoy the excellent 2D space shooter:
    http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195

    "Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)

  2. #7442
    QJ Gamer Bronze
    Points: 8.045, Level: 60
    Level completed: 48%, Points required for next Level: 105
    Overall activity: 0%

    Registriert seit
    Aug 2007
    Ort
    Australia
    Beiträge
    659
    Points
    8.045
    Level
    60
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von _dysfunctional
    How about searching information on C structs before asking retarded questions.
    I didnt know how to go about it. Why research C structs if im not sure i need them. I was just asking for a push in the right direction, i could do the rest myself. And i apologised about the bad explaination. Im sorry for not knowing everything about C, which you obviously do.

    @TMNT, thanks, iv never used switch statements before, they seem perfect for what i want to do after reading a little about them

  3. #7443
    Your Fate is Grim...
    Points: 11.640, Level: 70
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    2.269
    Points
    11.640
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von TMNT
    Speaking of searching...er, i still couldn't find a way i can flip an image (my signature into moving left not right). I did find one thing: the oslib samples of Mickey. I found out that you can flip Mickey by deforming him...kind of wierd but once you go past a point it works. However, i was wondering if there is an easier way.

    Thanks.
    Wow. i just looked and found it within 5 seconds:

    oslMirrorImageH(img)
    oslMirrorImageV(img)

    Mirrors an image horizontally (H) or vertically (V). You can then draw it using oslDrawImage.
    Note: For experimented users, the image is not really mirrored, but just its internal coordinates that are modified, so it's very fast.

    from the docs.
    --------------------------------------------------------------------------------------

  4. #7444
    QJ Gamer Silver
    Points: 10.921, Level: 69
    Level completed: 18%, Points required for next Level: 329
    Overall activity: 0%

    Registriert seit
    May 2006
    Ort
    Behind you.
    Beiträge
    1.814
    Points
    10.921
    Level
    69
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Grimfate126
    Wow. i just looked and found it within 5 seconds:

    oslMirrorImageH(img)
    oslMirrorImageV(img)

    Mirrors an image horizontally (H) or vertically (V). You can then draw it using oslDrawImage.
    Note: For experimented users, the image is not really mirrored, but just its internal coordinates that are modified, so it's very fast.

    from the docs.
    I knew what a mirror was, lol. But i was too busy looking for "flip" so i overlooked it. Thank you and i found it too in the docs.


    Thanks Grim!
    Calypso - Enjoy the excellent 2D space shooter:
    http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195

    "Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)

  5. #7445
    QJ Gamer Blue
    Points: 3.795, Level: 38
    Level completed: 97%, Points required for next Level: 5
    Overall activity: 27,0%

    Registriert seit
    Jul 2007
    Beiträge
    296
    Points
    3.795
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    My point is that if you obviously know so little about C, you should not be using it. Go read a book.

  6. #7446
    Your Fate is Grim...
    Points: 11.640, Level: 70
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    2.269
    Points
    11.640
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    if you dont use it, you will stop learning the language. just because you suck at something doesnt mean you have to stop using it. i agree with the book part though. books help.
    --------------------------------------------------------------------------------------

  7. #7447
    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

    Wouldn't scaling the image, horizontally and/or vertically, by a factor of negative 1 produce the same effect? I always was going to rely on that should i ever need to flip an image, didn't know there was function for it

    ...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


  8. #7448
    Points: 2.948, Level: 33
    Level completed: 32%, Points required for next Level: 102
    Overall activity: 0%

    Registriert seit
    Dec 2007
    Beiträge
    30
    Points
    2.948
    Level
    33
    Downloads
    0
    Uploads
    0

    Standard

    wasn't this thread about helping each other? i've read C and C++ books, but still can't understand everything. especially how unsigned integers work.

    I most definitely agree with grimfate. i learnt most of my coding skills from actually working with the code. I used a lot of src code to get to where I am today, not to mention the value of all those maths classes...

    just my little thought =]

  9. #7449
    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 TMNT
    Ok, i am still looking for 2 things:

    1) How to flip an image using oslib (my signature sprite from right to left)
    2) A good scrolling tile engine (i tried to make one...not so well). If i can just get a good example...i have been asking for this quite some months now...
    Sorry for being an idiot.
    The one from the Aap lander beta Source code should help you quite a bit, it has the functions to Read, and Draw maps that you specify, its all so pretty Fast, as it doesn't draw the tiles out side the screen AND it uses osl's clipping function. If you need help weeding the things out that are game specific, then go ahead and post parts of the source thats a problem. I don't mind, since Aap lander will be open source from the get go any way. As for the map format, its very simple, it first reads the width and height of a map in the first line, and then loads them into a ray, each number seperated by spaces. and in the DRAW function, it goes through 2 for loops one for x and one for y to draw what ever number is there. It also scrolls if the maps are bigger than the screen, and stops when approaching edges.
    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.

  10. #7450
    Your Fate is Grim...
    Points: 11.640, Level: 70
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    2.269
    Points
    11.640
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von SG57
    Wouldn't scaling the image, horizontally and/or vertically, by a factor of negative 1 produce the same effect? I always was going to rely on that should i ever need to flip an image, didn't know there was function for it
    actually, i think its a macro O.o

    i dunno about scaling, but it might work.
    --------------------------------------------------------------------------------------

  11. #7451
    QJ Gamer Silver
    Points: 10.921, Level: 69
    Level completed: 18%, Points required for next Level: 329
    Overall activity: 0%

    Registriert seit
    May 2006
    Ort
    Behind you.
    Beiträge
    1.814
    Points
    10.921
    Level
    69
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von SG57
    Wouldn't scaling the image, horizontally and/or vertically, by a factor of negative 1 produce the same effect? I always was going to rely on that should i ever need to flip an image, didn't know there was function for it
    OMG!!! You are back! I missed you so much. Yes, that is a good idea.
    Calypso - Enjoy the excellent 2D space shooter:
    http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195

    "Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)

  12. #7452
    QJ Gamer Blue
    Points: 3.795, Level: 38
    Level completed: 97%, Points required for next Level: 5
    Overall activity: 27,0%

    Registriert seit
    Jul 2007
    Beiträge
    296
    Points
    3.795
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von pHysiX
    wasn't this thread about helping each other? i've read C and C++ books, but still can't understand everything. especially how unsigned integers work.

    I most definitely agree with grimfate. i learnt most of my coding skills from actually working with the code. I used a lot of src code to get to where I am today, not to mention the value of all those maths classes...

    just my little thought =]
    Unsigned just means the value cannot be less then zero...

  13. #7453
    It's good to be free...
    Points: 10.420, Level: 67
    Level completed: 93%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    2.440
    Points
    10.420
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    It also means you get basically twice as many positive values. So an int usually goes from -2^31 to 2^31-1. However, an unsigned int goes from 0 to 2^32-1.
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

  14. #7454
    Ænima
    Points: 6.447, Level: 52
    Level completed: 49%, Points required for next Level: 103
    Overall activity: 0%

    Registriert seit
    Sep 2007
    Beiträge
    587
    Points
    6.447
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Xsjado7
    I didnt know how to go about it. Why research C structs if im not sure i need them. I was just asking for a push in the right direction, i could do the rest myself. And i apologised about the bad explaination. Im sorry for not knowing everything about C, which you obviously do.

    @TMNT, thanks, iv never used switch statements before, they seem perfect for what i want to do after reading a little about them
    My site has a small snippet on structures. Maybe I should make one on switch statements too.
    [IMG]http://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Zoso.svg/744px-Zoso.svg.png[/IMG]

    Looking for some good C programming tutorials for the PSP? Look no further! [URL="http://psp-coding.com/"]PSP-Coding.com[/URL] is your source for all your PSP coding needs.

  15. #7455
    Your Fate is Grim...
    Points: 11.640, Level: 70
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    2.269
    Points
    11.640
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    switches are extremely easy to understand. search on google, and youll have them in no time. structures too, but theyre a bit more complicated, when you get into pointers.
    --------------------------------------------------------------------------------------

  16. #7456
    Ænima
    Points: 6.447, Level: 52
    Level completed: 49%, Points required for next Level: 103
    Overall activity: 0%

    Registriert seit
    Sep 2007
    Beiträge
    587
    Points
    6.447
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Grimfate126
    switches are extremely easy to understand. search on google, and youll have them in no time. structures too, but theyre a bit more complicated, when you get into pointers.
    Yeah, switches are so usefull, and that's why I was pissed when I found out they weren't in Lua. :Argh: And pointers are stupid altogether. :mad:
    [IMG]http://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Zoso.svg/744px-Zoso.svg.png[/IMG]

    Looking for some good C programming tutorials for the PSP? Look no further! [URL="http://psp-coding.com/"]PSP-Coding.com[/URL] is your source for all your PSP coding needs.

  17. #7457
    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

    Oh yeah pointers are totally stupid...

    You could just pass all the data around through functions, but then you'd be back asking questions about pointers when your program won't get above 1 FPS.

    Pointers are your friend.

    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

  18. #7458
    sceKernelExitGame();
    Points: 19.955, Level: 89
    Level completed: 21%, Points required for next Level: 395
    Overall activity: 0%

    Registriert seit
    Jan 2006
    Ort
    New York
    Beiträge
    3.126
    Points
    19.955
    Level
    89
    Downloads
    0
    Uploads
    0

    Standard

    Pointer are magic ;)

    You can't live with 'em, you can't live without 'em.

  19. #7459
    Your Fate is Grim...
    Points: 11.640, Level: 70
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    2.269
    Points
    11.640
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    pointers are gods in disguise. if you cant use em, them yes, they "suck", but thats not their fault ;)
    --------------------------------------------------------------------------------------

  20. #7460
    Ænima
    Points: 6.447, Level: 52
    Level completed: 49%, Points required for next Level: 103
    Overall activity: 0%

    Registriert seit
    Sep 2007
    Beiträge
    587
    Points
    6.447
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    When I said pointers are stupid, I meant I hate using them. Sometimes they can be so difficult. That doesn't mean I don't think they're useful. Hopefully after I've been programming a few years, I'll be better with them. (I'm only going on one year of programming in C.)
    [IMG]http://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Zoso.svg/744px-Zoso.svg.png[/IMG]

    Looking for some good C programming tutorials for the PSP? Look no further! [URL="http://psp-coding.com/"]PSP-Coding.com[/URL] is your source for all your PSP coding needs.

  21. #7461
    QJ Gamer Blue
    Points: 3.795, Level: 38
    Level completed: 97%, Points required for next Level: 5
    Overall activity: 27,0%

    Registriert seit
    Jul 2007
    Beiträge
    296
    Points
    3.795
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Judas
    When I said pointers are stupid, I meant I hate using them. Sometimes they can be so difficult. That doesn't mean I don't think they're useful. Hopefully after I've been programming a few years, I'll be better with them. (I'm only going on one year of programming in C.)
    So am I...

  22. #7462
    QJ Gamer Silver
    Points: 7.385, Level: 57
    Level completed: 18%, Points required for next Level: 165
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Finland
    Beiträge
    752
    Points
    7.385
    Level
    57
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von _dysfunctional
    So am I...
    Yeah but we all know that you're just inhuman.
    wheeee =:D

  23. #7463
    QJ Gamer Green
    Points: 5.712, Level: 48
    Level completed: 81%, Points required for next Level: 38
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    USA SC/NC
    Beiträge
    699
    Points
    5.712
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von MaTiAz
    Yeah but we all know that you're just inhuman.
    For a second, I thought you were about to post something relevant to C <_<.
    Anyway, I started C in December 2006 and had pointers down way less than one year after I started. Pointers are extremely useful. I don't see how you can actually hate them Judas. At first I didn't see the actual point of accessing a variable using pointers, but that changed after I read a paper about them.
    This post isn't really related to helping people in C, but I felt that I wanted to share that little bit <_< .
    [CODE]Random Facts:
    irc://irc.malloc.us #wtf #**********
    [/CODE]

    [SIZE="6"][FONT="Century Gothic"][COLOR="Blue"][URL="http://forums.**********.net"]http://forums.**********.net[/URL][/COLOR][/FONT][/SIZE]

  24. #7464
    Your Fate is Grim...
    Points: 11.640, Level: 70
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    2.269
    Points
    11.640
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    exactly. i remember i made a post in this thread a couple years ago saying "pointers seem pointless". boy was i wrong...
    --------------------------------------------------------------------------------------

  25. #7465
    Ænima
    Points: 6.447, Level: 52
    Level completed: 49%, Points required for next Level: 103
    Overall activity: 0%

    Registriert seit
    Sep 2007
    Beiträge
    587
    Points
    6.447
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Grimfate126
    exactly. i remember i made a post in this thread a couple years ago saying "pointers seem pointless". boy was i wrong...
    That's exactly why I never like them. They added more difficulty to something that I was already struggling with. And on top of that, I couldn't see a real use to using one. Now that I'm a little more advanced in C, I see the purpose of one, but still don't use them that much. Maybe when I start using them a lot, they'll become a bit more friendly.
    [IMG]http://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Zoso.svg/744px-Zoso.svg.png[/IMG]

    Looking for some good C programming tutorials for the PSP? Look no further! [URL="http://psp-coding.com/"]PSP-Coding.com[/URL] is your source for all your PSP coding needs.

  26. #7466
    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

    Gah, pointers. Hate the buggers. Dangling pointers, uninitialised pointers, pointers to pointers, deep and shallow copying, etc.

    I generally avoid raw pointers as much as possible and use C++ references or write wrapper classes (RAII) to minimise memory leaks. I can't wait till smart pointers are part of the standard.

  27. #7467
    QJ Gamer Blue
    Points: 5.871, Level: 49
    Level completed: 61%, Points required for next Level: 79
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Beiträge
    432
    Points
    5.871
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    hey if i wanted to make a formula with an exponent, i have

    result = pi*r^2;

    this is wrong though i get errors.

    how would i make an exponent, ive also tryed re2, r^=2, but nothing has worked.

  28. #7468
    QJ Gamer Blue
    Points: 3.795, Level: 38
    Level completed: 97%, Points required for next Level: 5
    Overall activity: 27,0%

    Registriert seit
    Jul 2007
    Beiträge
    296
    Points
    3.795
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Blackbelttcon
    hey if i wanted to make a formula with an exponent, i have

    result = pi*r^2;

    this is wrong though i get errors.

    how would i make an exponent, ive also tryed re2, r^=2, but nothing has worked.
    ^ is a bitwise XOR in C, use the pow() function from math.h.

  29. #7469
    QJ Gamer Blue
    Points: 5.871, Level: 49
    Level completed: 61%, Points required for next Level: 79
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Beiträge
    432
    Points
    5.871
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    um so i should put
    result= pi*r pow(2)


    srry im just a little confused

  30. #7470
    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


 

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:15 PM Uhr.

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