Seite 319 von 340 ErsteErste ... 219 269 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 ... LetzteLetzte
Zeige Ergebnis 9.541 bis 9.570 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; Zitat von slicer4ever edit: and lastly, my post wasn't pointless, do you only take the most negative thing in a ...

  
  1. #9541
    I'm back!
    Points: 8.236, Level: 61
    Level completed: 29%, Points required for next Level: 214
    Overall activity: 99,0%

    Registriert seit
    Feb 2007
    Ort
    England
    Beiträge
    902
    Points
    8.236
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von slicer4ever Beitrag anzeigen
    edit: and lastly, my post wasn't pointless, do you only take the most negative thing in a post, and immediately think a post is meaningless, when that's said, perhaps you forgot the first part:
    Because its another post that you've given no real advice only said that its stupid, as I said you never explained why, if someone is wanting to use that method they obviously think its a good idea and giving them some real proof as to why its stupid would be better than just coming out with it and having no evidence.

    I'd like to see though how you get this bit:
    Zitat Zitat von slicer4ever Beitrag anzeigen
    you only take the most negative thing in a post, and immediately think a post is meaningless
    What other times have I ever looked at a post and made it appear negative without good reason? As I said, there was NOTHING constructive about your post at all, it held no real help just a blatent "this is stupid" remark to it. Yes this is negative in my opinion because its a help thread and you just appear to be throwing your knowledge around without offering advice or showing where people make their mistakes. It wouldn't have been difficult to have compiled your second post into your first and avoid my comment. A help thread is for help.

    -Aura


    Last.fm | Deviant Art | First working OS picture

    Zitat Zitat von nickxab Beitrag anzeigen
    I will beat myself. :p

  2. #9542
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    Zitat Zitat von daaa57150 Beitrag anzeigen
    Edit: beaten by Slicer :)
    You have a point Slicer, but I think what Netaro wants is the pretty effect, nothing more.
    -=Double Post Merge =-
    I took a look on wikipedia before trying the code... it's helping having a nice background effect, and knowing how to use the GU with oslib, to sometimes do things oslib doesn't allow by itself.
    if it's the effect he's going after, than it doesn't require the use of the CLUT, but just manipulation of the data field inside of OSL_IMAGE, trying to use the CLUT for the same effect, which yes is pretty intresting, is alot of waste of code

    @aura, i could have gone about it at a nicer way indeed
    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

  3. #9543
    xMod.
    Points: 4.576, Level: 43
    Level completed: 13%, Points required for next Level: 174
    Overall activity: 0%

    Registriert seit
    Oct 2008
    Ort
    Melbourne, Australia
    Beiträge
    675
    Points
    4.576
    Level
    43
    My Mood
    Daring
    Downloads
    0
    Uploads
    0

    Standard

    guys im having some trouble...
    how can i fix:

    Code:
    $ ./toolchain.sh 3 6
    ERROR: Add C:/PSP/pspdev/bin to your path before continuing.
    ../depends/check-pspdev.sh: Failed.
    ?

    ~!SlasheR!~

  4. #9544
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    did u even google your problem?

    googled: ERROR: Add C:/PSP/pspdev/bin to your path before continuing.

    2 results, second one:
    http://ubuntuforums.org/showthread.php?t=554423

    solution:

    export PATH=$PATH:/usr/local/pspdev/bin

    before you run the toolchain

    IIRC, doing that is in the readme of the tootchain as well as another command you have to do in bash first, maybe checking the readme would help to
    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

  5. #9545
    xMod.
    Points: 4.576, Level: 43
    Level completed: 13%, Points required for next Level: 174
    Overall activity: 0%

    Registriert seit
    Oct 2008
    Ort
    Melbourne, Australia
    Beiträge
    675
    Points
    4.576
    Level
    43
    My Mood
    Daring
    Downloads
    0
    Uploads
    0

    Standard

    slicer i did google,

    my pspdev folder is actuallt located at C:\psp\pspdev\
    so i do:
    Code:
    export PATH=$PATH:C:\\psp\\pspdev\\
    ?

    ~!SlasheR!~

  6. #9546
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    psptoolchain readme:

    Zitat Zitat von readme
    ====================
    What does this do?
    ====================

    This program will automatically build and install a compiler and other
    tools used in the creation of homebrew software for the Sony Playstation
    Portable handheld videogame system.

    ==================
    How do I use it?
    ==================

    1) Set up your environment by installing the following software:

    autoconf, automake, bison, flex, gcc, make, ncurses, patch, subversion, texinfo, wget

    2) Add the following to your login script:

    export PSPDEV=/usr/local/pspdev
    export PATH=$PATH:$PSPDEV/bin

    3) Run the toolchain script:

    ./toolchain.sh

    ========================= =
    Where do I go from here?
    ========================= =

    Visit the following sites to learn more:

    http://www.ps2dev.org
    http://forums.ps2dev.org
    specifically "How do i use?" number 2.

    try it before u ask again please
    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

  7. #9547
    xMod.
    Points: 4.576, Level: 43
    Level completed: 13%, Points required for next Level: 174
    Overall activity: 0%

    Registriert seit
    Oct 2008
    Ort
    Melbourne, Australia
    Beiträge
    675
    Points
    4.576
    Level
    43
    My Mood
    Daring
    Downloads
    0
    Uploads
    0

    Standard

    ok srry i thought becuase i installed in dif location!
    THX!!!

    ~!SlasheR!~

  8. #9548
    I'm back!
    Points: 8.236, Level: 61
    Level completed: 29%, Points required for next Level: 214
    Overall activity: 99,0%

    Registriert seit
    Feb 2007
    Ort
    England
    Beiträge
    902
    Points
    8.236
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    I posted this earlier but I've done some extra work now (check the bottom)

    I'm having an annoying compiler issue with some code of mine...

    makefile:
    Code:
    ...
    OBJS =\
    PBPDepack.o\
    ...
    main.cpp:
    Code:
    #include "depack.h"
    ...
    FILE *fp;
    fp = fopen("ms0:/test.pbp", "r");
    long int one = 0;
    long int two = 0;
    getOffsets(fp, 0, &one, &two);
    fclose(fp);
    depack.h:
    Code:
    #include <stdio.h>
    
    void getOffsets(FILE *pbp, int position, long int *pointerStart, long int *pointerEnd);
    PBPDepack.s:
    Code:
    	.set noreorder
    
    #include "pspstub.s"
    
    	STUB_START "PBPDepack",0x40090000,0x00010005
    	STUB_FUNC  0x5FF3D8D7,getOffsets
    	STUB_END
    Error:
    main.o: In function `loadOption(int)':
    ...:381: undefined reference to `getOffsets(
    __sFILE*, int, long*, long*)'
    No idea what is going on, its not exclusive to PBPDepack either, I've tried a couple of modules and exports, all giving the same problem that its undefined. Anyone know whats going on here?

    *
    I've attempted to use a "wrapper" function in a c file, as I've noticed errors compiling modules in cpp I wondered if linking to a c file and running would work - epic fail. Same error as above with the wrapper function (I.E. the function in the c file) although strangely the wrapper file compiled fine :Argh:

    I compiled the exact same code on my Ubuntu setup, which as an up-to-date toolchain, sdk, etc (my PC is running on maybe 18 month old one). The same thing occurs on there, same error everything.

    I attempted to change my cpp file to c but seeing as I'm using lots of class functions it'd be very time consuming to get it compiling in c and calling on c++ files, although I'm certain this would work its just not worth the effort.

    Is there anything that needs adding to the makefile to compile c++ files correctly without this onslaught of random errors? I've included -lstdc++ but its not made any difference that I can see.
    *

    -Aura
    Last.fm | Deviant Art | First working OS picture

    Zitat Zitat von nickxab Beitrag anzeigen
    I will beat myself. :p

  9. #9549
    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

    Try:

    MyCppFile.cpp
    Code:
    extern "C" {
        #include "MyCFile.h"
    }
    
    int myCppFunc()
    {
        return myCFunc();
    }
    That is if myCFunc() is in a file that is compiled as a C file, and not a C++ file.

  10. #9550
    xMod.
    Points: 4.576, Level: 43
    Level completed: 13%, Points required for next Level: 174
    Overall activity: 0%

    Registriert seit
    Oct 2008
    Ort
    Melbourne, Australia
    Beiträge
    675
    Points
    4.576
    Level
    43
    My Mood
    Daring
    Downloads
    0
    Uploads
    0

    Standard

    i did ./toolchain 3 6 and left it for an hour when i came back it hadnt finished but it stopped and said

    Code:
    make: *** [all] Error 2
    ../scripts/006-pspsdk-stage2.sh: Failed.
    what wrong??

    ~!SlasheR!~

  11. #9551
    QJ Gamer Gold
    Points: 17.453, Level: 84
    Level completed: 21%, Points required for next Level: 397
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    everywhere
    Beiträge
    3.526
    Points
    17.453
    Level
    84
    Downloads
    1
    Uploads
    0

    Standard

    that's the only thing it outputed?
    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

  12. #9552
    Art
    Art ist offline
    Bush Programmer
    Points: 60.149, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Beiträge
    3.658
    Points
    60.149
    Level
    100
    Downloads
    0
    Uploads
    0

    Standard

    Hi Guys,
    Trying to grab a colour screen and convert it to black & white, and write that to an image.
    Something wrong here.. any ideas?

    void blackwhite() {
    u8 b; u8 g; u8 r; int xxx;
    for (pxx=0; pxx<480; pxx++) { // image width
    for (pyy=0; pyy<272; pyy++) { // image height
    pixel = getPixelScreen(pxx, pyy);
    r = pixel & 0xFF;
    g = (pixel & 0xFF00) >> 8;
    b = (pixel & 0xFF0000) >> 16;
    xxx = r + b + g;
    pixel = xxx * 0x10000;
    pixel = pixel + (xxx * 0x100);
    pixel = pixel + xxx;
    putPixelImage(pixel,pxx,p yy,bwscreen);
    }}
    }
    The image is b&W, but some bright colours turn out really dark.
    Oh yeah.. the idea is to add the values of R,G & B, then divide that by three for each pixel.
    Then write that value back to R,G & B for the greyscale colour.

  13. #9553
    QJ Gamer Blue
    Points: 4.980, Level: 45
    Level completed: 15%, Points required for next Level: 170
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Ort
    Chigasaki, Japan
    Beiträge
    226
    Points
    4.980
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Art Beitrag anzeigen
    The image is b&W, but some bright colours turn out really dark. Oh yeah.. the idea is to add the values of R,G & B, then divide that by three for each pixel. Then write that value back to R,G & B for the greyscale colour.
    You may get an overflow by adding all three components (e.g. 3x255). Also, for RGB to gray scale conversion you should use weights for the components, IIRC gray = .3 * r + .59 * g + .11 * b (I could be wrong, has been a while). To be safe you should clip the values against [0..255].

    HTH

  14. #9554
    I'm back!
    Points: 8.236, Level: 61
    Level completed: 29%, Points required for next Level: 214
    Overall activity: 99,0%

    Registriert seit
    Feb 2007
    Ort
    England
    Beiträge
    902
    Points
    8.236
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    Thanks _dysfunctional that worked, I feel a bit stupid now because I've done this in the past but completely forgot about it :o

    -Aura
    Last.fm | Deviant Art | First working OS picture

    Zitat Zitat von nickxab Beitrag anzeigen
    I will beat myself. :p

  15. #9555
    QJ Gamer Green
    Points: 5.495, Level: 47
    Level completed: 73%, Points required for next Level: 55
    Overall activity: 0%

    Registriert seit
    Aug 2008
    Ort
    Cyprus
    Beiträge
    48
    Points
    5.495
    Level
    47
    Downloads
    0
    Uploads
    0

    Standard

    Hi, I've just started PSP programming, and I have a problem.
    I'm trying to display an image, but the application seems to skip lines and go directly to sceKernelSleepThread!

    Code:
    int main(){
    SceCtrlData reqpad;
    char imgadr[20];
    Image* loamg; 
    
    pspDebugScreenInit();
    SetupCallbacks();
    initGraphics(); 
    printf("press x");
    
    reqpad.Buttons = PSP_CTRL_CROSS;
    getkey(reqpad);
    printf("exit");
    sprintf(imgadr,"imgi.png");
    printf("www");
    // ---Skips here
    loamg = loadImage(imgaddr); 
    printf("xc");
    ikona(0,0,480,272,loamg,0,0);
    printf("ikona");
    flipScreen();
    
    sceKernelSleepThread();
    return 0;
    }
    Never mind about those printf's, i just used them to see the app's flow. Ikona is declared as blitAlphaImagetoScreen. The problem is loadimage, for whatever reason. Getkey() is also a function I wrote.

    Can someone help me? Thanks.

  16. #9556
    QJ Gamer Green
    Points: 6.366, Level: 52
    Level completed: 8%, Points required for next Level: 184
    Overall activity: 71,0%

    Registriert seit
    Apr 2008
    Ort
    in a hobbit hole
    Beiträge
    67
    Points
    6.366
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    The problem is loadimage, for whatever reason
    In this case, it might be heplful to check if loadImage() is returning NULL. If so, then it may be a problem with the path.

    Code:
    ...
    char imgadr[20];
    
    ...
    
    sprintf(imgadr,"imgi.png");
    printf("www");
    // ---Skips here
    loamg = loadImage(imgaddr);
    See? You declare imgadr but you pass imgaddr to the function. I'd be surprised if you didn't get any errors compiling.

    Also, I don't see any reason to use sprintf when your just writing a plain string to a buffer.

    Code:
    sprintf(imgadr,"imgi.png");

  17. #9557
    QJ Gamer Green
    Points: 5.495, Level: 47
    Level completed: 73%, Points required for next Level: 55
    Overall activity: 0%

    Registriert seit
    Aug 2008
    Ort
    Cyprus
    Beiträge
    48
    Points
    5.495
    Level
    47
    Downloads
    0
    Uploads
    0

    Standard

    I tried checking for NULL, but it seems that it's correct.

    I've also entered a plain string to loadImage, but it still gets stuck there.

  18. #9558
    I'm back!
    Points: 8.236, Level: 61
    Level completed: 29%, Points required for next Level: 214
    Overall activity: 99,0%

    Registriert seit
    Feb 2007
    Ort
    England
    Beiträge
    902
    Points
    8.236
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    You said it skips to the sleep function, but do you get output with printf? And have you tried blitImage instead of blitAlphaImage, the alpha can sometimes have problems so it'd be a 1 time check to see if that changes anything.

    Also, for safety add a check that the image loads as standard (even if it loads now, someone might not copy the file or whatever in the future) and hard code the path instead of using a buffer as its just a waste of code.

    Whats in Getkey()? Experiance also tells me that doing reqpad.Buttons = PSP_CTRL_CROSS; won't have the effect you want it to.

    -Aura
    Last.fm | Deviant Art | First working OS picture

    Zitat Zitat von nickxab Beitrag anzeigen
    I will beat myself. :p

  19. #9559
    QJ Gamer Green
    Points: 5.495, Level: 47
    Level completed: 73%, Points required for next Level: 55
    Overall activity: 0%

    Registriert seit
    Aug 2008
    Ort
    Cyprus
    Beiträge
    48
    Points
    5.495
    Level
    47
    Downloads
    0
    Uploads
    0

    Standard

    Getkey is just a function that ends when a specified button is pressed and released. That reqpad.Buttons = PSP_CTRL_CROSS actually works for me, at least using the X button.

    Code:
    void getkey(SceCtrlData butid){
    SceCtrlData pad,lastpad;
    
    while (1){
    sceCtrlReadBufferPositive(&pad, 1);
            if (lastpad.Buttons != pad.Buttons){
            if (pad.Buttons & butid.Buttons){
            
            return;
            
            lastpad.Buttons = pad.Buttons;
            }
            else{
            lastpad.Buttons = 0;}
            
        }
    }
    }
    From other tests I have come to realise it stops at loadimage. Perhaps I should take a look with the address or something.

  20. #9560
    I'm back!
    Points: 8.236, Level: 61
    Level completed: 29%, Points required for next Level: 214
    Overall activity: 99,0%

    Registriert seit
    Feb 2007
    Ort
    England
    Beiträge
    902
    Points
    8.236
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    Does it sleep or crash? Have you tried running it inside PSPLink? You may be better able to pinpoint the time of the problem inside there.

    If it crashes post the picture on here as that may be the cause.

    -Aura
    Last.fm | Deviant Art | First working OS picture

    Zitat Zitat von nickxab Beitrag anzeigen
    I will beat myself. :p

  21. #9561
    QJ Gamer Green
    Points: 5.495, Level: 47
    Level completed: 73%, Points required for next Level: 55
    Overall activity: 0%

    Registriert seit
    Aug 2008
    Ort
    Cyprus
    Beiträge
    48
    Points
    5.495
    Level
    47
    Downloads
    0
    Uploads
    0

    Standard

    When it displays te "www" I can use the home button and exit to the XMB, only that it doesn't, it crashes. I'll try PSPLink.

    EDIT: Btw, can you tell me more specifically what to do with PSPLink? I've installed and managed to connect it with usbhostfs_pc.exe, but I'm sleepy, can't figure out what to do next.

    I'll also try using another image.
    Geändert von kostakis (01-20-2009 um 12:10 PM Uhr) Grund: Avoiding sequential posts

  22. #9562
    I'm back!
    Points: 8.236, Level: 61
    Level completed: 29%, Points required for next Level: 214
    Overall activity: 99,0%

    Registriert seit
    Feb 2007
    Ort
    England
    Beiträge
    902
    Points
    8.236
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    Once you've got it loaded as well as the PC side shell you type in stuff and PSPLink will make the PSP do other stuff... yay my powers of explaination are amazing.

    Example, typing project4.prx would load Project4 for me from the current working directory, modlist would list the modules loaded, reset vsh would reset the vsh mode. The real beauty comes in crashes where it actually outputs something useful for you and printf commands print to the shell... which leads me to another point.

    [RANT]
    Never use #define because:
    A) When people read your code its next to impossible to see whats going on.
    B) You may make functions useless, for example pspDebugScreenPrintf to printf just removed the ability to use printf with PSPLink.
    [/RANT]

    When in the shell you can type help to get a list of 5 main options, then help [option] to see more info on things... help module for example gives a list of functions available that work with modules, either reading, loading, stopping, sleeping... whatever its all there.

    PSPLink = God of PSP debugger software imho.

    -Aura
    Last.fm | Deviant Art | First working OS picture

    Zitat Zitat von nickxab Beitrag anzeigen
    I will beat myself. :p

  23. #9563
    QJ Gamer Blue
    Points: 2.981, Level: 33
    Level completed: 54%, Points required for next Level: 69
    Overall activity: 0%

    Registriert seit
    Nov 2007
    Beiträge
    29
    Points
    2.981
    Level
    33
    Downloads
    0
    Uploads
    0

    Standard

    I would just say "thank you" and that would finish it, but then, there's more problems with the CLUT.

    So, using the provided solution, which helped me, thanks, copied it into two functions, initClut and drawClut, which are in the "working" section of the attachment.
    They work perfectly, as you can see when compiling it.

    Then, i moved these two functions to the Class, map it's name, and now it doesn't work at all. The graphics are all scrawny, out of sync. i double checked, the functions are LITERALLY the same, and the makefile also contains the same flags.

    And now i'm in the dark. Why, and what shall be done in order to repair it?
    Angehängte Dateien Angehängte Dateien

  24. #9564
    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 Auraomega Beitrag anzeigen
    [RANT]
    Never use #define because:
    A) When people read your code its next to impossible to see whats going on.
    B) You may make functions useless, for example pspDebugScreenPrintf to printf just removed the ability to use printf with PSPLink.
    [/RANT]
    To clarify:

    Don't use #define for constants if you are using C++ (with C you haven't got much of a choice).
    Don't use #define to give an alias to a function, class, variable or struct name unless there is good reason to.

    There will be times where using a #define is a valid choice.

  25. #9565
    Developer
    Points: 5.085, Level: 45
    Level completed: 68%, Points required for next Level: 65
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    206
    Points
    5.085
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von yaustar Beitrag anzeigen
    To clarify:

    There will be times where using a #define is a valid choice.
    Such as if you're trying to build a program for multi-platform release.

    I made a program a long time ago which was compiled both for PSP and PC. It contained code which was related only to to the PSP or the PC. I used defines to block out platform-specific code, so I didn't have to make separate projects to work concurrently when I chose which version to compile.
    GameSnooper - Random drawing of gaming news

    The 32 Bit Shell - My development blog (also includes gaming oddities)

  26. #9566
    xMod.
    Points: 4.576, Level: 43
    Level completed: 13%, Points required for next Level: 174
    Overall activity: 0%

    Registriert seit
    Oct 2008
    Ort
    Melbourne, Australia
    Beiträge
    675
    Points
    4.576
    Level
    43
    My Mood
    Daring
    Downloads
    0
    Uploads
    0

    Standard

    very valid to me

    ~!SlasheR!~

  27. #9567
    I'm back!
    Points: 8.236, Level: 61
    Level completed: 29%, Points required for next Level: 214
    Overall activity: 99,0%

    Registriert seit
    Feb 2007
    Ort
    England
    Beiträge
    902
    Points
    8.236
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    Sorry yaustar, I didn't make that very clear, sometimes #define is required but as a general rule it can be avoided.

    JustChris meant using something like this:
    Code:
    #ifdef __PC__
    //PC Specific code here
    #endif
    
    #ifdef __PSP__
    //PSP Specific code here
    #endif
    
    #ifdef __OTHER__
    //Other Specific code here
    #endif
    Then you can either define at the top #define __PC__ or compile with the __PC__ flag I believe in the makefile?

    As for consts in C, can't you use const int blah = 0; or whatever as a global or does that only work in C++?

    -Aura
    Last.fm | Deviant Art | First working OS picture

    Zitat Zitat von nickxab Beitrag anzeigen
    I will beat myself. :p

  28. #9568
    QJ Gamer Green
    Points: 5.495, Level: 47
    Level completed: 73%, Points required for next Level: 55
    Overall activity: 0%

    Registriert seit
    Aug 2008
    Ort
    Cyprus
    Beiträge
    48
    Points
    5.495
    Level
    47
    Downloads
    0
    Uploads
    0

    Talking

    OK, I've managed to overcome my n00b status And I got the error we were looking for:

    Code:
    libpng error: Too many IDAT's found
    Geändert von kostakis (01-21-2009 um 05:23 AM Uhr)

  29. #9569
    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

    Thumbs down

    Zitat Zitat von Insert_Witty_Name Beitrag anzeigen
    That's an array of pointers, the first entry being at array[0].

    Just do array[0] = malloc(...);
    So simple, I don't know how I didn't think of that :o . Thanks

  30. #9570
    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 Auraomega Beitrag anzeigen
    As for consts in C, can't you use const int blah = 0; or whatever as a global or does that only work in C++?

    -Aura
    You can but they don't work for switch statements in C whereas they do in C++.


 

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

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