Seite 174 von 340 ErsteErste ... 74 124 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 224 274 ... LetzteLetzte
Zeige Ergebnis 5.191 bis 5.220 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; Just wondering, what ways can I load modules, which ones can load relative file names, and which can load relative ...

  
  1. #5191
    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

    Just wondering, what ways can I load modules, which ones can load relative file names, and which can load relative file paths, as I can't seem to find one that does all three correctly. (Still having this problem) :Argh:

    -Aura


    Last.fm | Deviant Art | First working OS picture

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

  2. #5192
    QJ Gamer Green
    Points: 11.300, Level: 70
    Level completed: 13%, Points required for next Level: 350
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Ort
    main();
    Beiträge
    1.071
    Points
    11.300
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    User Mode: Relative and Exact Paths
    Kernel Model: Exact Paths

  3. #5193
    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

    Is that a specific command, such as pspSdkLoadStartModule, or does it work with them all? Because I'm having problems loading in both user and kernel modes.

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

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

  4. #5194
    QJ Gamer Blue
    Points: 4.031, Level: 40
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 91,0%

    Registriert seit
    Feb 2007
    Ort
    Florida
    Beiträge
    214
    Points
    4.031
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    What are the arguments that can be used in sceKernelSleepThread(); ?

    (Lemme guess...none?)

  5. #5195
    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 MrChaos
    What are the arguments that can be used in sceKernelSleepThread(); ?

    (Lemme guess...none?)
    Yup, is
    Code:
    int sceKernelSleepThread(void);
    therefore meaning that nothing is required inside the brackets.

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

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

  6. #5196
    QJ Gamer Blue
    Points: 4.031, Level: 40
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 91,0%

    Registriert seit
    Feb 2007
    Ort
    Florida
    Beiträge
    214
    Points
    4.031
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Auraomega
    Yup, is
    Code:
    int sceKernelSleepThread(void);
    therefore meaning that nothing is required inside the brackets.

    -Aura
    It's almost the same thing as saying sceKernelSleepThread(); though.
    Ok thanks.

  7. #5197
    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 MrChaos
    It's almost the same thing as saying sceKernelSleepThread(); though.
    Ok thanks.
    Well, if you put the snippet of code that I used into your program, you will get an error (at least I think you will), thats the code contained in the pspthreadman.h file... taking a look inside the brackets indicates the required arguments, and if its void, then none are required. I was showing that code purely to prove that nothing is required... its also a good way to see what you do need for things like this in the future.

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

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

  8. #5198
    QJ Gamer Blue
    Points: 4.031, Level: 40
    Level completed: 41%, Points required for next Level: 119
    Overall activity: 91,0%

    Registriert seit
    Feb 2007
    Ort
    Florida
    Beiträge
    214
    Points
    4.031
    Level
    40
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Auraomega
    Well, if you put the snippet of code that I used into your program, you will get an error (at least I think you will), thats the code contained in the pspthreadman.h file... taking a look inside the brackets indicates the required arguments, and if its void, then none are required. I was showing that code purely to prove that nothing is required... its also a good way to see what you do need for things like this in the future.

    -Aura
    Yeah, I kinda noticed that it meant nothing is required, but I was trying to figure out if there was the argument to stall it for a few seconds, but thats a different function. (Which I just found out).

  9. #5199
    QJ Gamer Green
    Points: 11.300, Level: 70
    Level completed: 13%, Points required for next Level: 350
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Ort
    main();
    Beiträge
    1.071
    Points
    11.300
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    That's sceKernelDelayThread() for those of you who are wondering what the function is.

  10. #5200
    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

    k yaustar how would you solve the problem as like i said i've never come across this problem

    also i'm unsure what you mean by how i am accesing it by 1d array from a 2d array
    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

  11. #5201
    QJ Gamer Blue
    Points: 3.726, Level: 38
    Level completed: 51%, Points required for next Level: 74
    Overall activity: 27,0%

    Registriert seit
    Jun 2007
    Beiträge
    82
    Points
    3.726
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    I have been referred to pspprogramming.com by someone on the internet but have had heaps of problems. After downloading, when i try to set the psptoolchain up, it says that files are missing and I can't get it working. Does anyone have any ideas apart from re-downloading everything?

  12. #5202
    QJ Gamer Green
    Points: 11.300, Level: 70
    Level completed: 13%, Points required for next Level: 350
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Ort
    main();
    Beiträge
    1.071
    Points
    11.300
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Screenshots and/or error messages would be nice.

  13. #5203
    QJ Gamer Gold
    Points: 12.189, Level: 72
    Level completed: 35%, Points required for next Level: 261
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Under Your Bed
    Beiträge
    3.083
    Points
    12.189
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    Download the pre-pspdev from my sig to help you out.
    -= Double Post =-
    Also theres a fix for that problem in that thread.
    Geändert von xpack (06-27-2007 um 09:31 PM Uhr) Grund: Automerged Doublepost

  14. #5204
    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

    The psptoolchain has been made to compile on linux , you wont get any errors on linux , cygwin is only a simulation or something of linux and doesnt work that good

  15. #5205
    QJ Gamer Green
    Points: 11.300, Level: 70
    Level completed: 13%, Points required for next Level: 350
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Ort
    main();
    Beiträge
    1.071
    Points
    11.300
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von hallo007
    The psptoolchain has been made to compile on linux , you wont get any errors on linux , cygwin is only a simulation or something of linux and doesnt work that good
    That's bull****.

    Also, don't do it the easy way. Just follow this tutorial.

  16. #5206
    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

    Zitat Zitat von hallo007
    you wont get any errors on linux
    Wrong. Unless that linux distro has the required libraries installed (binutils, subversion, newlib, gcc, etc.) they'll get the same error as in cygwin.
    Zitat Zitat von hallo007
    , cygwin is only a simulation or something of linux
    He means to say it emulates a Linux environment...
    Zitat Zitat von hallo007
    and doesnt work that good
    Strictly opinionated. Just because maybe you aren't able to comprehend the anomaly that is a 'Linux environment' doesn't mean others can not.

    P.S. "and doesnt work that well"

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


  17. #5207
    QJ Cool 300th Member
    Points: 4.347, Level: 41
    Level completed: 99%, Points required for next Level: 3
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Beiträge
    173
    Points
    4.347
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von AdjutantReflex
    Unless that linux distro has the required libraries installed (binutils, subversion, newlib, gcc, etc.) they'll get the same error as in cygwin.
    True, but its much easier to solve in linux. For example when I did not have those libraries installed I just typed
    Code:
    sudo apt-get install subversion
    sudo apt-get install automake
    etc.

    There is nothing wrong with cygwin. It is easier for a noob to install psptoolchain on Linux then on cygwin though.

  18. #5208
    QJ Gamer Green
    Points: 11.300, Level: 70
    Level completed: 13%, Points required for next Level: 350
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Ort
    main();
    Beiträge
    1.071
    Points
    11.300
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von mazor55
    True, but its much easier to solve in linux. For example when I did not have those libraries installed I just typed
    Code:
    sudo apt-get install subversion
    sudo apt-get install automake
    etc.

    There is nothing wrong with cygwin. It is easier for a noob to install psptoolchain on Linux then on cygwin though.
    That is bull****, as well. How the hell do you think the toolchain gets the libraries? It uses wget. Same result, different application.

    It is not 'much easier' at all. It may be faster as linux does not have to emulate itself, as cygwin has to emulate linux.


    #1 Reason For People Failing to Install the Toolchain: Every idiot who signs on to the internet is automatically a retard and is completely too incompetent to follow a set of instructions.

    It's like having a 4 year old type a college-level essay. It is the person's (Who attempted to install the toolchain and failed) fault for being such a retard and not being able to do such a simple thing.

  19. #5209
    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

    ok how do i solve the following problem:

    Zitat Zitat von slicer4ever
    ok i keep gettin an array subscript error with the following code: (bolded lines with error)

    Code:
    float vertexs[MAX_VERTICES][7];
    float *vertexs;
    int *polygons;
    vertexs  = (float*) malloc (sizeof(float)*300);
    polygons = (int*) malloc (sizeof(int)*300);
    
    int number=0;
    int actual_polygon=0;
         for(int i=0;i<current_mesh;i++){
              for(int b=0;b<3;b++){
                   if(b==0){
                        test.vertexs[number][1] = vertexs[polygons[actual_polygon]];
                   }else if(b==1){
                        test.vertexs[number][2] = vertexs[polygons[actual_polygon]];
                   }else if(b==2){
                        test.vertexs[number][3] = vertexs[polygons[actual_polygon]];
                   }
                   actual_polygon++;
              }
              number++;
         }
    error:

    ./functions/loadxfile.txt:200: error: invalid types 'float [5000][7][1][float]'
    for array subscript

    i've never seen this error so any help would be appreciated
    ok yauster responded that i was:

    Zitat Zitat von yauster
    vertexs is a 2D array, you are trying to access it as a 1D array here:
    Code:
    vertexs[polygons[actual_polygon]]
    when i responded i thought i knew what he was saying however after re-reading it i reliezed i misread it but now i understand what he is saying however i'm unsure how i am doing this
    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

  20. #5210
    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

    No need to blame your incapabilities to read and do instructions properly on the program itself ;)

    Code:
    float vertexs[MAX_VERTICES][7];
    int *polygons;
    polygons = (int*) malloc (sizeof(int)*300);
    
    int number=0;
    int actual_polygon=0;
         for(int i=0;i<current_mesh;i++){
              for(int b=0;b<3;b++){
                   if(b==0){
                        test.vertexs[number][1] = vertexs[polygons][actual_polygon];
                   }else if(b==1){
                        test.vertexs[number][2] = vertexs[polygons][actual_polygon];
                   }else if(b==2){
                        test.vertexs[number][3] = vertexs[polygons][actual_polygon];
                   }
                   actual_polygon++;
              }
              number++;
         }
    Give that a shot, however I'm not quite sure exactly your true problem/question is though...

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


  21. #5211
    QJ Gamer Green
    Points: 11.300, Level: 70
    Level completed: 13%, Points required for next Level: 350
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Ort
    main();
    Beiträge
    1.071
    Points
    11.300
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von slicer4ever
    ok how do i solve the following problem:



    ok yauster responded that i was:



    when i responded i thought i knew what he was saying however after re-reading it i reliezed i misread it but now i understand what he is saying however i'm unsure how i am doing this
    Code:
    float vertexs[MAX_VERTICES][7];
    float *vertexs;
    int *polygons;
    vertexs  = (float*) malloc (sizeof(float)*300);
    polygons = (int*) malloc (sizeof(int)*300);
    
    int number=0;
    int actual_polygon=0;
         for(int i=0;i<current_mesh;i++){
              for(int b=0;b<3;b++){
                   if(b==0){
                        test.vertexs[number][1] = vertexs[polygons[actual_polygon]];
                   }else if(b==1){
                        test.vertexs[number][2] = vertexs[polygons[actual_polygon]];
                   }else if(b==2){
                        test.vertexs[number][3] = vertexs[polygons[actual_polygon]];
                   }
                   actual_polygon++;
              }
              number++;
         }
    Okay, I tried to go over it and fix your completely obvious mistakes, but there are too many.

    1.)
    Code:
    float vertexs[MAX_VERTICES][7];
    float *vertexs;
    So we have an array of MAX_VERTICES vertices each with 7 floats. Then we have a pointer to a float with the same name as our array? What is that?

    2.)
    We have a pointer to an int named polygons. You allocate the pointer memory, then don't assign anything to the memory. You also decide to allocate memory to vertexs. So, when you decide to assign 'test.vertexs[number][anInt]' to the 'vertexs[polygon[actual_polygon]]' you are assigning nothing to.... to nothing.

    4.)
    Why the hell do you have the temporary variables. Even though your loop makes as much sense as a retarded fish, you don't need them at all.

    Code:
         for(int i=0;i<current_mesh;i++){
              for(int b=0;b<3;b++){
                   test.vertexs[i][b] = vertexs[someWeird****ThatMakesNoSense];
              }
         }
    5.)
    Code:
    float vertexs[MAX_VERTICES][7];
    Is a 2D array. Notice, 'float vertexs[MAX_VERTICES][7]'. Two fields means it is a 2D array. One would be a 1D array.

    That being said, this makes no sense.
    Code:
                   if(b==0){
                        test.vertexs[number][1] = vertexs[polygons[actual_polygon]];
                   }else if(b==1){
                        test.vertexs[number][2] = vertexs[polygons[actual_polygon]];
                   }else if(b==2){
                        test.vertexs[number][3] = vertexs[polygons[actual_polygon]];
                   }
    You only used a 1D array for 'vertexs', which you defined as a 2D array.


    My suggestion to you would be to read a book on C syntax and usage, then try something a bit simpler as you obviously have no idea what you are doing.

    Note: There are probably more mistakes, those are just the ones that stuck out to me the most.

  22. #5212
    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

    Zitat Zitat von FistPump
    Why the hell do you have the temporary variables. Even though your loop makes as much sense as a retarded fish, you don't need them at all.
    I'm not one to bad talk a beginner (as I too was one and got my fair share of beatings) but that was pretty funny... I actually laughed when reading it, and not one of those 'oh yeah... ill just put "lol" to think make him think he's funny' kind of things...

    Anywho, yaustar should bud in soon and consult you directly (should you still need some help), either through here or PM.

    Spoiler for life:
    im so tired, im losing grip on reality right now... its all slow and its like i fall asleep and wake up real quick to realize i just fell asleep, and yet 5 words are typed that i dont remember typing... 36 hours w/ no sleep is bad for the soul

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


  23. #5213
    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

    FistPump highlighted something I completely missed which was the naming of two variables are exactly the same so I have even less of a clue what is going on in that code.

    Code:
    float vertexs[MAX_VERTICES][7];
    float *vertexs;
    THat should already give you one error. If not then you gave us a VERY bad code snippet.

    Code:
    test.vertexs[number][1]
    What structure is 'test'? What is the definition of the struct? Is vertexs in this case a 1D or 2D array? If it is 1D then why are you accessing it this way?

    Code:
    float vertexs[MAX_VERTICES][7];
    float *vertexs;
    int *polygons;
    vertexs  = (float*) malloc (sizeof(float)*300);
    polygons = (int*) malloc (sizeof(int)*300);
    
    int number=0;
    int actual_polygon=0;
         for(int i=0;i<current_mesh;i++){
              for(int b=0;b<3;b++){
                   if(b==0){
                        test.vertexs[number][1] = vertexs[polygons[actual_polygon]];
                   }else if(b==1){
                        test.vertexs[number][2] = vertexs[polygons[actual_polygon]];
                   }else if(b==2){
                        test.vertexs[number][3] = vertexs[polygons[actual_polygon]];
                   }
                   actual_polygon++;
              }
              number++;
         }
    That inner loop is pointless, this is what it should look like:
    Should be:
    Code:
    float vertexs[MAX_VERTICES][7];
    float *vertexs;
    int *polygons;
    vertexs  = (float*) malloc (sizeof(float)*300);
    polygons = (int*) malloc (sizeof(int)*300);
    
    int number=0;
    int actual_polygon=0;
         for(int i=0;i<current_mesh;i++){
              for(int b=1;b<=3;b++){
                  test.vertexs[number][i] = vertexs[polygons[actual_polygon]];
                  actual_polygon++;
              }
              number++;
         }}

  24. #5214
    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

    Ive tried so hard to figure out why this isnt working but i cant see whats wrong. When i run it, the screen is black, not even the background is the colour i wanted. Heres the code:

    window.h:
    Code:
    #ifndef WINDOW_H
    #define WINDOW_H
    
    #include <pspdisplay.h>
    #include <pspctrl.h>
    #include <pspkernel.h>
    #include <pspdebug.h>
    #include <pspgu.h>
    #include <png.h>
    #include <stdio.h>
    #include "graphics.h"
    
    #define RGB(r, g, b) ((r)|((g)<<8)|((b)<<16)) 
    
    typedef struct
    {
            int Width;
            int Height;
            int X;
            int Y;
            Color color;
    } WND;
    
    class Window
    {
          public:
                 void Register( WND wnd );
                 void DrawWindow( WND wnd );
          private:
                 Image* Pane;
                 Image* Frame;
                 bool Registered;
    };
    
    #endif
    window.cpp:
    Code:
    #include "window.h"
    
    void Window::Register( WND wnd )
    {
         Pane = createImage( wnd.Width, wnd.Height );
         Frame = createImage( (wnd.Width + 4), (wnd.Height + 14) );
         Registered = true;
    }
    
    void Window::DrawWindow( WND wnd )
    {
         if( Registered == true )
         {
             clearImage( RGB(0, 0, 255), Frame );
             clearImage( RGB(255, 255, 255), Pane );
             blitAlphaImageToScreen( 0, 0, (wnd.Width + 4), (wnd.Height + 4), Frame, (wnd.X - 2), (wnd.Y - 12) );
             blitAlphaImageToScreen( 0, 0, wnd.Width, wnd.Height, Pane, wnd.X, wnd.Y );
         }
    }
    main.cpp:
    Code:
    #include "window.h"
    
    PSP_MODULE_INFO( "Shell", 0, 1, 1 );
    
    /* Exit callback */
    int exit_callback(int arg1, int arg2, void *common) {
              sceKernelExitGame();
              return 0;
    }
    
    /* Callback thread */
    int CallbackThread(SceSize args, void *argp) {
              int cbid;
    
              cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
              sceKernelRegisterExitCallback(cbid);
    
              sceKernelSleepThreadCB();
    
              return 0;
    }
    /* Sets up the callback thread and returns its thread id */
    int SetupCallbacks(void) {
              int thid = 0;
    
              thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
              if(thid >= 0) {
                        sceKernelStartThread(thid, 0, 0);
              }
    
              return thid;
    } 
    
    int main()
    {
        SetupCallbacks();
        initGraphics();
        
        bool exit = false;
        
        WND tes;
        
        tes.color = RGB(0, 100, 100);
        tes.Height = 70;
        tes.Width = 100;
        tes.X = 20;
        tes.Y = 20;
        
        Window test;
        
        test.Register( tes );
        
        while( exit == false )
        {
               clearScreen( RGB(0, 100, 100) );
               test.DrawWindow( tes );
               flipScreen();
        }
        
        sceKernelExitGame();
        return 0;
    }
    I must be missing out something, but i cant see what.
    ...Just Returned To The Scene...

  25. #5215
    Developer
    Points: 12.154, Level: 72
    Level completed: 26%, Points required for next Level: 296
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Ort
    Dubuque
    Beiträge
    423
    Points
    12.154
    Level
    72
    My Mood
    Lurking
    Downloads
    1
    Uploads
    0

    Standard

    Where's your constructor / destructor?

    Also IIRC, graphics.c/h doesn't actually accept a RGB argument for clearscreen, it's always 0 (black).
    PSP Demo Videos (updated 11/29/08)
    MinerPSP Coder

  26. #5216
    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 jsharrad
    Where's your constructor / destructor?

    Also IIRC, graphics.c/h doesn't actually accept a RGB argument for clearscreen, it's always 0 (black).
    Hmm, ill add a constructor and destructor, but i dont think it will make a difference, the compiler didnt give any errors about my class. Your right about the background, but why cant i display the images that I have created?
    ...Just Returned To The Scene...

  27. #5217
    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 jsharrad
    Where's your constructor / destructor?

    Also IIRC, graphics.c/h doesn't actually accept a RGB argument for clearscreen, it's always 0 (black).
    If you don't explicitly declare them in your code, they are automatically generated (ref: Gang of Four).
    -= Double Post =-
    Zitat Zitat von JaSo PsP
    Your right about the background, but why cant i display the images that I have created?
    Because they are the same colour as the background?
    Geändert von yaustar (06-28-2007 um 06:07 AM Uhr) Grund: Automerged Doublepost

  28. #5218
    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
    If you don't explicitly declare them in your code, they are automatically generated (ref: Gang of Four).
    -= Double Post =-

    Because they are the same colour as the background?
    No, ive sorted it now, the images created using createImage() dont work with blitAlphaImageToScreen(), i had to use blitImageToScreen() instead.
    ...Just Returned To The Scene...

  29. #5219
    QJ Gamer Green
    Points: 11.300, Level: 70
    Level completed: 13%, Points required for next Level: 350
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Ort
    main();
    Beiträge
    1.071
    Points
    11.300
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von yaustar
    FistPump highlighted something I completely missed which was the naming of two variables are exactly the same so I have even less of a clue what is going on in that code.

    Code:
    float vertexs[MAX_VERTICES][7];
    float *vertexs;
    THat should already give you one error. If not then you gave us a VERY bad code snippet.

    Code:
    test.vertexs[number][1]
    What structure is 'test'? What is the definition of the struct? Is vertexs in this case a 1D or 2D array? If it is 1D then why are you accessing it this way?

    Code:
    float vertexs[MAX_VERTICES][7];
    float *vertexs;
    int *polygons;
    vertexs  = (float*) malloc (sizeof(float)*300);
    polygons = (int*) malloc (sizeof(int)*300);
    
    int number=0;
    int actual_polygon=0;
         for(int i=0;i<current_mesh;i++){
              for(int b=0;b<3;b++){
                   if(b==0){
                        test.vertexs[number][1] = vertexs[polygons[actual_polygon]];
                   }else if(b==1){
                        test.vertexs[number][2] = vertexs[polygons[actual_polygon]];
                   }else if(b==2){
                        test.vertexs[number][3] = vertexs[polygons[actual_polygon]];
                   }
                   actual_polygon++;
              }
              number++;
         }
    That inner loop is pointless, this is what it should look like:
    Should be:
    Code:
    float vertexs[MAX_VERTICES][7];
    float *vertexs;
    int *polygons;
    vertexs  = (float*) malloc (sizeof(float)*300);
    polygons = (int*) malloc (sizeof(int)*300);
    
    int number=0;
    int actual_polygon=0;
         for(int i=0;i<current_mesh;i++){
              for(int b=1;b<=3;b++){
                  test.vertexs[number][i] = vertexs[polygons[actual_polygon]];
                  actual_polygon++;
              }
              number++;
         }}
    The variable 'number' is also pointless as the outer-loop is incremented exactly the same way. Another thing I missed was he started his array at 1, not 0.

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

    So in short, this is what we think it is supposed to look like without fixing the compiler error:
    Code:
    int actual_polygon = 0;
    for(int i = 0; i < current_mesh; i++)
    {
    	for(int b = 0; b < 3; b++)
    	{
    		test.vertexs[i][i] = vertexs[polygons[actual_polygon]];
    		actual_polygon++;
    	}
    }


 

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

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