Seite 171 von 340 ErsteErste ... 71 121 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 221 271 ... LetzteLetzte
Zeige Ergebnis 5.101 bis 5.130 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; I have Tryed Programing in Visual Basic and get that quite easy ( not that its hard lol) and make ...

  
  1. #5101
    Points: 3.158, Level: 34
    Level completed: 72%, Points required for next Level: 42
    Overall activity: 0%

    Registriert seit
    Jun 2007
    Beiträge
    2
    Points
    3.158
    Level
    34
    Downloads
    0
    Uploads
    0

    Standard

    I have Tryed Programing in Visual Basic and get that quite easy ( not that its hard lol) and make simple -games like pong, connect 4 and so on i just wanna step up to do some better programing



  2. #5102
    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

    Unless you have a specific reason to learn C++, I would recommend C# over C++. Then you can easily make games using the XNA framework for the PC and Xbox360.

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

    What's the best method to NULL out a char array in c?

    I do sprint(var,""); but it gives me a warning...

  4. #5104
    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

    Code:
    char blah[] = "What the Hack?!"
    blah[0] = '\0';
    Crude, but works.

  5. #5105
    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

    blah[0] = NULL;?
    ...Just Returned To The Scene...

  6. #5106
    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

    iirc, NULL doesn't necessarily represent the NULL character.

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


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

    when you say NULL , it will return 0 , when you say \0 , it will return null

  8. #5108
    QJ Gamer Blue
    Points: 3.679, Level: 38
    Level completed: 20%, Points required for next Level: 121
    Overall activity: 0%

    Registriert seit
    Apr 2007
    Ort
    Relative
    Beiträge
    135
    Points
    3.679
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von yaustar
    Code:
    char blah[] = "What the Hack?!"
    blah[0] = '\0';
    Crude, but works.
    So if there is a string like

    str[10] = {'T', 'e', 'd', '\0'};

    and we say

    str [0] = '\0';

    will the rest of the string be emptied or we just get

    '\0', 'e', 'd', '\0' and all functions stop reading after the first '\0' ?

  9. #5109
    Developer
    Points: 5.359, Level: 47
    Level completed: 5%, Points required for next Level: 191
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Ort
    Norway
    Beiträge
    384
    Points
    5.359
    Level
    47
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von radioactive_X
    So if there is a string like

    str[10] = {'T', 'e', 'd', '\0'};

    and we say

    str [0] = '\0';

    will the rest of the string be emptied or we just get

    '\0', 'e', 'd', '\0' and all functions stop reading after the first '\0' ?
    The first byte gets set to 0, all string functions stop after the first null byte.


  10. #5110
    QJ Gamer Blue
    Points: 3.679, Level: 38
    Level completed: 20%, Points required for next Level: 121
    Overall activity: 0%

    Registriert seit
    Apr 2007
    Ort
    Relative
    Beiträge
    135
    Points
    3.679
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    I just tried this
    Code:
    char str[1000] = "Hello";
    
    str[0] = '\0';
    
    putchar(str[1]);
    And it prints "e", how would you go emptying the whole string do we need a loop or is there a function. It is somewhat irritating to have leftover values like that.

  11. #5111
    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

    '\0' == 0
    NULL == (void*)0 in most C implementations, hence == 0, but it's better to not assume it in general

    memset( str, 0, 1000 );
    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.

  12. #5112
    QJ Gamer Blue
    Points: 3.679, Level: 38
    Level completed: 20%, Points required for next Level: 121
    Overall activity: 0%

    Registriert seit
    Apr 2007
    Ort
    Relative
    Beiträge
    135
    Points
    3.679
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    Thank you!

  13. #5113
    QJ Gamer Bronze
    Points: 7.047, Level: 55
    Level completed: 49%, Points required for next Level: 103
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Beiträge
    144
    Points
    7.047
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    The MIPS standard implementation requires r0 (register zero, or $zr in mnemonic notation) to be hardwired to zero :) So I think NULL is the register 0 value in the case of the PSP :P An absolute zero xD
    Adrahil - Software architect and specialist in Reverse Engineering.
    Spoiler for Guilt of a Dev:
    17:17 < InsertWittyName> Can't pin user error on a dev ;)
    17:18 < InsertWittyName> Lesson learnt on both sides I would say.
    17:18 < InsertWittyName> You learnt to treat the end-user as a retarded fish.
    17:18 < InsertWittyName> They learnt to read readme's ;)

    Spoiler for me:
    17:12 <+dot_blank> are you the long haired pimp ;)

  14. #5114
    QJ Gamer Bronze
    Points: 5.092, Level: 45
    Level completed: 72%, Points required for next Level: 58
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    169
    Points
    5.092
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    i know how to blit an image to the screen, but
    how would i blit an image to another one?

  15. #5115
    QJ Gamer Bronze
    Points: 3.754, Level: 38
    Level completed: 70%, Points required for next Level: 46
    Overall activity: 0%

    Registriert seit
    Mar 2007
    Beiträge
    103
    Points
    3.754
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    If your using graphics.c/h use

    blitAlphaImageToImage

    or

    blitImageToImage

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

    or just blit the one one the back first

  17. #5117
    QJ Gamer Bronze
    Points: 5.402, Level: 47
    Level completed: 26%, Points required for next Level: 148
    Overall activity: 0%

    Registriert seit
    Apr 2007
    Beiträge
    468
    Points
    5.402
    Level
    47
    Downloads
    0
    Uploads
    0

    Standard

    on this thread i've heard many times about "bad ports of graphics.c". Well if there are multiple ports out there i'd like to know which one is considered the best

  18. #5118
    QJ Gamer Bronze
    Points: 3.754, Level: 38
    Level completed: 70%, Points required for next Level: 46
    Overall activity: 0%

    Registriert seit
    Mar 2007
    Beiträge
    103
    Points
    3.754
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von brethren
    on this thread i've heard many times about "bad ports of graphics.c". Well if there are multiple ports out there i'd like to know which one is considered the best
    You will need zlib and libpng installed to use it,

    I use the graphics.c obtained from lesson 4 on psp-programming,

    I have never had any problems with it,

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

    I also use the graphics.c/graphics.h from lesson 4 on psp-programming and I have never had any problems either.

  20. #5120
    QJ Gamer Bronze
    Points: 3.754, Level: 38
    Level completed: 70%, Points required for next Level: 46
    Overall activity: 0%

    Registriert seit
    Mar 2007
    Beiträge
    103
    Points
    3.754
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    It is very limited with what you can do with it but what it can do seems to work well,

  21. #5121
    QJ Gamer Green
    Points: 5.795, Level: 49
    Level completed: 23%, Points required for next Level: 155
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Cape Town, South Africa
    Beiträge
    714
    Points
    5.795
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    Keep an eye on Easy Accelerated Image Rendering Library; that's pretty much as easy to use as graphics.c and it's (apparently) much faster. It as image rotation and scaling too. Raphael says its got some issues right now that need to be sorted out before it's a viable use though.

  22. #5122
    QJ Gamer Bronze
    Points: 3.754, Level: 38
    Level completed: 70%, Points required for next Level: 46
    Overall activity: 0%

    Registriert seit
    Mar 2007
    Beiträge
    103
    Points
    3.754
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    Yeah some of the functions should prove to be useful for people who can't do it themselfs,

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

    If you want to use something good, try OSLib. It's by far the best 2D library around.
    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.

  24. #5124
    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 Raphael
    If you want to use something good, try OSLib. It's by far the best 2D library around.
    Is it faster than graphics.c with all PSP-programming mods? [if u know what I am sayin']

  25. #5125
    QJ Gamer Bronze
    Points: 3.754, Level: 38
    Level completed: 70%, Points required for next Level: 46
    Overall activity: 0%

    Registriert seit
    Mar 2007
    Beiträge
    103
    Points
    3.754
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    head over to psp-hacks and try PSdonkey's tuts

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

    Zitat Zitat von Mr305
    Is it faster than graphics.c with all PSP-programming mods? [if u know what I am sayin']
    Yes. Plus it has much more functionality.
    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.

  27. #5127
    QJ Gamer Blue
    Points: 6.041, Level: 50
    Level completed: 46%, Points required for next Level: 109
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Missouri
    Beiträge
    451
    Points
    6.041
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    I need to know how I'm to find libraries on my own. I only learn about them by seeing them on tutorials. I've looked up psp c library reference, but I can't find anything.

    I was gonna ask if there was anything better than graphics.c, but I saw that was covered. But I want a way where I can find these on my own.

  28. #5128
    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

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


  29. #5129
    QJ Gamer Blue
    Points: 6.041, Level: 50
    Level completed: 46%, Points required for next Level: 109
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Missouri
    Beiträge
    451
    Points
    6.041
    Level
    50
    Downloads
    0
    Uploads
    0

    Standard

    Thank you much.

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

    hello again people i'm yet again on the topic of an x loader as i really want this to work and have been trying, unsuccessfully, to get it to work so thusly i bring it here again

    Spoiler for code:

    Code:
    #include <string.h>
    #include <stdio.h>
    #include <malloc.h>
    #define MAX_VERTICES (5000)
    
    typedef struct {
         unsigned int color;
    	float x, y, z;
    } Vertex;
    
    typedef struct {
         int current_frame;
         int max_frame;
    	int numTriangles;
    	int object_play;
    	float vertexs[MAX_VERTICES][7];
    	Vertex *triangle;
    } object;
    
    object loadxfile(char file_name[100]);
    void trace(char text[500]);
    
    object test;
    object testing;
    
    int main(int argc,char** argv){
         test.triangle = (Vertex*) malloc( 500*3*sizeof(Vertex) );
         testing.triangle = (Vertex*) malloc( 500*3*sizeof(Vertex));
         
         testing = loadxfile("test0.x");
         
         for(int i=0;i<testing.numTriangles*3;i++){
              printf("x %d: %f\n",i,testing.triangle[i].x);
              printf("y %d: %f\n",i,testing.triangle[i].y);
              printf("z %d: %f\n\n",i,testing.triangle[i].z);
         }
    
         return 0;
    }
    
    void trace(char text[500]){
         FILE *ofile;
         ofile = fopen("tracee.txt","a+");
         fputs(text,ofile);
         fputs("\n",ofile);
         fclose(ofile);
    }
    
    object loadxfile(char file_name[100]){
              FILE *pfile;
              char string[0];
              int next=0;
              char word_string[100];
              char last_word[100];
              int number_of_brackets=0;
              int full=0;
              int mesh_found=0;
              int num_of_vertexs[500];
              float vertexs[500][100];
              float frame_transform_matrix[100][16];
              int num_of_polygons[500];
              int polygons[500][100];
              int current_number = 0;
              int current_mesh = 0;
              int in_decimals=0;
              int full_num_of_vertices=0;
              int current_decimal=10;
              int frame_brackets=0;
              int mesh_brackets=0;
              int colons_in_row=0;
              int negative_number=0;
              int frame_transform=0;
              num_of_vertexs[current_mesh]=0;
              pfile = fopen(file_name,"r");
              if(pfile != NULL){
                   trace("opened file");
                   rewind(pfile);
                   trace("rewound file");
                   while(!feof(pfile) && !ferror(pfile)){
                        if(!feof(pfile)){
                             fgets(string,2,pfile);
                             trace(string);
                             if(strcmp(string,"{")==0){
                                  number_of_brackets++;
                             }else if(strcmp(string,"}")==0){
                                  number_of_brackets--;
                             }else if(strcmp(string," ")==0){
                                  sprintf(last_word,"%s",word_string);
                                  sprintf(word_string," ");
                             }else if(strcmp(string,"a")==0 || strcmp(string,"A")==0){
                                  sprintf(word_string,"%sa",word_string);
                             }else if(strcmp(string,"b")==0 || strcmp(string,"B")==0){
                                  sprintf(word_string,"%sb",word_string);
                             }else if(strcmp(string,"c")==0 || strcmp(string,"C")==0){
                                  sprintf(word_string,"%sc",word_string);
                             }else if(strcmp(string,"d")==0 || strcmp(string,"D")==0){
                                  sprintf(word_string,"%sd",word_string);
                             }else if(strcmp(string,"e")==0 || strcmp(string,"E")==0){
                                  sprintf(word_string,"%se",word_string);
                             }else if(strcmp(string,"f")==0 || strcmp(string,"F")==0){
                                  sprintf(word_string,"%sf",word_string);
                             }else if(strcmp(string,"g")==0 || strcmp(string,"G")==0){
                                  sprintf(word_string,"%sg",word_string);
                             }else if(strcmp(string,"h")==0 || strcmp(string,"H")==0){
                                  sprintf(word_string,"%sh",word_string);
                             }else if(strcmp(string,"i")==0 || strcmp(string,"I")==0){
                                  sprintf(word_string,"%si",word_string);
                             }else if(strcmp(string,"j")==0 || strcmp(string,"J")==0){
                                  sprintf(word_string,"%sj",word_string);
                             }else if(strcmp(string,"k")==0 || strcmp(string,"K")==0){
                                  sprintf(word_string,"%sk",word_string);
                             }else if(strcmp(string,"l")==0 || strcmp(string,"L")==0){
                                  sprintf(word_string,"%sl",word_string);
                             }else if(strcmp(string,"m")==0 || strcmp(string,"M")==0){
                                  sprintf(word_string,"%sm",word_string);
                             }else if(strcmp(string,"n")==0 || strcmp(string,"N")==0){
                                  sprintf(word_string,"%sn",word_string);
                             }else if(strcmp(string,"o")==0 || strcmp(string,"O")==0){
                                  sprintf(word_string,"%so",word_string);
                             }else if(strcmp(string,"p")==0 || strcmp(string,"P")==0){
                                  sprintf(word_string,"%sp",word_string);
                             }else if(strcmp(string,"q")==0 || strcmp(string,"Q")==0){
                                  sprintf(word_string,"%sq",word_string);
                             }else if(strcmp(string,"r")==0 || strcmp(string,"R")==0){
                                  sprintf(word_string,"%sr",word_string);
                             }else if(strcmp(string,"s")==0 || strcmp(string,"S")==0){
                                  sprintf(word_string,"%ss",word_string);
                             }else if(strcmp(string,"t")==0 || strcmp(string,"T")==0){
                                  sprintf(word_string,"%st",word_string);
                             }else if(strcmp(string,"u")==0 || strcmp(string,"U")==0){
                                  sprintf(word_string,"%su",word_string);
                             }else if(strcmp(string,"v")==0 || strcmp(string,"V")==0){
                                  sprintf(word_string,"%sv",word_string);
                             }else if(strcmp(string,"w")==0 || strcmp(string,"W")==0){
                                  sprintf(word_string,"%sw",word_string);
                             }else if(strcmp(string,"x")==0 || strcmp(string,"X")==0){
                                  sprintf(word_string,"%sx",word_string);
                             }else if(strcmp(string,"y")==0 || strcmp(string,"Y")==0){
                                  sprintf(word_string,"%sy",word_string);
                             }else if(strcmp(string,"z")==0 || strcmp(string,"Z")==0){
                                  sprintf(word_string,"%sz",word_string);
                             }
                             if(strcmp(last_word," frame")==0){
                                  mesh_found=1;
                                  frame_brackets = number_of_brackets+1;
                                  sprintf(last_word," ");
                                  trace("found frame translation");
                             }
                             if(mesh_found == 1 && number_of_brackets==frame_brackets){
                                  mesh_found=2;
                                  trace("reading frame translation");
                             }
                             if(mesh_found==2){
                                  if(strcmp(string,"-")==0){
                                       negative_number=1;
                                  }
                                  if(strcmp(string,"0")==0){
                                       if(in_decimals==0){
                                            frame_transform_matrix[current_mesh][frame_transform]=frame_transform_matrix[current_mesh][frame_transform]*10;
                                       }else{
                                            frame_transform_matrix[current_mesh][frame_transform]=frame_transform_matrix[current_mesh][frame_transform]+(0/((float)current_decimal));
                                            current_decimal=current_decimal*10;
                                       }
                                  }
                                  if(strcmp(string,"1")==0){
                                       if(in_decimals==0){
                                            frame_transform_matrix[current_mesh][frame_transform]=frame_transform_matrix[current_mesh][frame_transform]*10+1;
                                       }else{
                                            frame_transform_matrix[current_mesh][frame_transform]=frame_transform_matrix[current_mesh][frame_transform]+(1/((float)current_decimal));
                                            current_decimal=current_decimal*10;
                                       }
                                  }
                                  if(strcmp(string,"2")==0){
                                       if(in_decimals==0){
                                            frame_transform_matrix[current_mesh][frame_transform]=frame_transform_matrix[current_mesh][frame_transform]*10+2;
                                       }else{
                                            frame_transform_matrix[current_mesh][frame_transform]=frame_transform_matrix[current_mesh][frame_transform]+(2/((float)current_decimal));
                                            current_decimal=current_decimal*10;
                                       }
                                  }
                                  if(strcmp(string,"3")==0){
                                       if(in_decimals==0){
                                            frame_transform_matrix[current_mesh][frame_transform]=frame_transform_matrix[current_mesh][frame_transform]*10+3;
                                       }else{
                                            frame_transform_matrix[current_mesh][frame_transform]=frame_transform_matrix[current_mesh][frame_transform]+(3/((float)current_decimal));
                                            current_decimal=current_decimal*10;
                                       }
                                  }
                                  if(strcmp(string,"4")==0){
                                       if(in_decimals==0){
                                            frame_transform_matrix[current_mesh][frame_transform]=frame_transform_matrix[current_mesh][frame_transform]*10+4;
                                       }else{
                                            frame_transform_matrix[current_mesh][frame_transform]=frame_transform_matrix[current_mesh][frame_transform]+(4/((float)current_decimal));
                                            current_decimal=current_decimal*10;
                                       }
                                  }
                                  if(strcmp(string,"5")==0){
                                       if(in_decimals==0){
                                            frame_transform_matrix[current_mesh][frame_transform]=frame_transform_matrix[current_mesh][frame_transform]*10+5;
                                       }else{
                                            frame_transform_matrix[current_mesh][frame_transform]=frame_transform_matrix[current_mesh][frame_transform]+(5/((float)current_decimal));
                                            current_decimal=current_decimal*10;
                                       }
                                  }
                                  if(strcmp(string,"6")==0){
                                       if(in_decimals==0){
                                            frame_transform_matrix[current_mesh][frame_transform]=frame_transform_matrix[current_mesh][frame_transform]*10+6;
                                       }else{
                                            frame_transform_matrix[current_mesh][frame_transform]=frame_transform_matrix[current_mesh][frame_transform]+(6/(float)current_decimal);
                                            current_decimal=current_decimal*10;
                                       }
                                  }
                                  if(strcmp(string,"7")==0){
                                       if(in_decimals==0){
                                            frame_transform_matrix[current_mesh][frame_transform]=frame_transform_matrix[current_mesh][frame_transform]*10+7;
                                       }else{
                                            frame_transform_matrix[current_mesh][frame_transform]=frame_transform_matrix[current_mesh][frame_transform]+(7/((float)current_decimal));
                                            current_decimal=current_decimal*10;
                                       }
                                  }
                                  if(strcmp(string,"8")==0){
                                       if(in_decimals==0){
                                            frame_transform_matrix[current_mesh][frame_transform]=frame_transform_matrix[current_mesh][frame_transform]*10+8;
                                       }else{
                                            frame_transform_matrix[current_mesh][frame_transform]=frame_transform_matrix[current_mesh][frame_transform]+(8/((float)current_decimal));
                                            current_decimal=current_decimal*10;
                                       }
                                  }
                                  if(strcmp(string,"9")==0){
                                       if(in_decimals==0){
                                            frame_transform_matrix[current_mesh][frame_transform]=frame_transform_matrix[current_mesh][frame_transform]*10+9;
                                       }else{
                                            frame_transform_matrix[current_mesh][frame_transform]=frame_transform_matrix[current_mesh][frame_transform]+(9/((float)current_decimal));
                                            current_decimal=current_decimal*10;
                                       }
                                  }
                                  if(strcmp(string,",")==0){
                                       in_decimals=0;
                                       current_decimal=10;
                                       if(negative_number==1){
                                            frame_transform_matrix[current_mesh][frame_transform]=frame_transform_matrix[current_mesh][frame_transform]*-1;
                                       }
                                       frame_transform++;
                                       frame_transform_matrix[current_mesh][frame_transform]=0.0f;
                                       negative_number=0;
                                  }
                                  if(strcmp(string,";")==0){
                                       in_decimals=0;
                                       current_decimal=1;
                                       if(negative_number==1){
                                            frame_transform_matrix[current_mesh][frame_transform]=frame_transform_matrix[current_mesh][frame_transform]*-1;
                                       }
                                       negative_number=0;
                                       mesh_found=3;
                                       frame_transform=0;
                                       trace("read frame translation");
                                  }
                                  if(strcmp(string,".")==0){
                                       in_decimals=1;
                                  }
                             }
                             if(strcmp(last_word," mesh")==0){
                                  mesh_found=4;
                                  mesh_brackets=number_of_brackets+1;
                                  sprintf(last_word," ");
                                  trace("found mesh vetexs");
                             }
                             if(mesh_found == 4 && number_of_brackets==mesh_brackets){
                                  mesh_found=5;
                                  trace("reading mesh vertexs");
                             }
                             if(mesh_found==5){
                                  if(strcmp(string,"0")==0){
                                       num_of_vertexs[current_mesh]=num_of_vertexs[current_mesh]*10;
                                  }
                                  if(strcmp(string,"1")==0){
                                       num_of_vertexs[current_mesh]=num_of_vertexs[current_mesh]*10+1;
                                  }
                                  if(strcmp(string,"2")==0){
                                       num_of_vertexs[current_mesh]=num_of_vertexs[current_mesh]*10+2;
                                  }
                                  if(strcmp(string,"3")==0){
                                       num_of_vertexs[current_mesh]=num_of_vertexs[current_mesh]*10+3;
                                  }
                                  if(strcmp(string,"4")==0){
                                       num_of_vertexs[current_mesh]=num_of_vertexs[current_mesh]*10+4;
                                  }
                                  if(strcmp(string,"5")==0){
                                       num_of_vertexs[current_mesh]=num_of_vertexs[current_mesh]*10+5;
                                  }
                                  if(strcmp(string,"6")==0){
                                       num_of_vertexs[current_mesh]=num_of_vertexs[current_mesh]*10+6;
                                  }
                                  if(strcmp(string,"7")==0){
                                       num_of_vertexs[current_mesh]=num_of_vertexs[current_mesh]*10+7;
                                  }
                                  if(strcmp(string,"8")==0){
                                       num_of_vertexs[current_mesh]=num_of_vertexs[current_mesh]*10+8;
                                  }
                                  if(strcmp(string,"9")==0){
                                       num_of_vertexs[current_mesh]=num_of_vertexs[current_mesh]*10+9;
                                  }
                                  if(strcmp(string,";")==0){
                                       mesh_found=6;
                                       trace("read mesh vertex");
                                       trace("reading mesh corrdinates locations");
                                  }
                             }
    
                             if(mesh_found==6){
    
                                  if(strcmp(string,"-")==0){
                                       negative_number=1;
                                  }
                                  if(strcmp(string,"0")==0){
                                       if(in_decimals==0){
                                            vertexs[current_number][current_mesh]=vertexs[current_number][current_mesh]*10;
                                       }else{
                                            vertexs[current_number][current_mesh]=vertexs[current_number][current_mesh]+(0/((float)current_decimal));
                                            current_decimal=current_decimal*10;
                                       }
                                  }
                                  if(strcmp(string,"1")==0){
                                       if(in_decimals==0){
                                            vertexs[current_number][current_mesh]=vertexs[current_number][current_mesh]*10+1;
                                       }else{
                                            vertexs[current_number][current_mesh]=vertexs[current_number][current_mesh]+(1/((float)current_decimal));
                                            current_decimal=current_decimal*10;
                                       }
                                  }
                                  if(strcmp(string,"2")==0){
                                       if(in_decimals==0){
                                            vertexs[current_number][current_mesh]=vertexs[current_number][current_mesh]*10+2;
                                       }else{
                                            vertexs[current_number][current_mesh]=vertexs[current_number][current_mesh]+(2/((float)current_decimal));
                                            current_decimal=current_decimal*10;
                                       }
                                  }
                                  if(strcmp(string,"3")==0){
                                       if(in_decimals==0){
                                            vertexs[current_number][current_mesh]=vertexs[current_number][current_mesh]*10+3;
                                       }else{
                                            vertexs[current_number][current_mesh]=vertexs[current_number][current_mesh]+(3/((float)current_decimal));
                                            current_decimal=current_decimal*10;
                                       }
                                  }
                                  if(strcmp(string,"4")==0){
                                       if(in_decimals==0){
                                            vertexs[current_number][current_mesh]=vertexs[current_number][current_mesh]*10+4;
                                       }else{
                                            vertexs[current_number][current_mesh]=vertexs[current_number][current_mesh]+(4/((float)current_decimal));
                                            current_decimal=current_decimal*10;
                                       }
                                  }
                                  if(strcmp(string,"5")==0){
                                       if(in_decimals==0){
                                            vertexs[current_number][current_mesh]=vertexs[current_number][current_mesh]*10+5;
                                       }else{
                                            vertexs[current_number][current_mesh]=vertexs[current_number][current_mesh]+(5/((float)current_decimal));
                                            current_decimal=current_decimal*10;
                                       }
                                  }
                                  if(strcmp(string,"6")==0){
                                       if(in_decimals==0){
                                            vertexs[current_number][current_mesh]=vertexs[current_number][current_mesh]*10+6;
                                       }else{
                                            vertexs[current_number][current_mesh]=vertexs[current_number][current_mesh]+(6/((float)current_decimal));
                                            current_decimal=current_decimal*10;
                                       }
                                  }
                                  if(strcmp(string,"7")==0){
                                       if(in_decimals==0){
                                            vertexs[current_number][current_mesh]=vertexs[current_number][current_mesh]*10+7;
                                       }else{
                                            vertexs[current_number][current_mesh]=vertexs[current_number][current_mesh]+(7/((float)current_decimal));
                                            current_decimal=current_decimal*10;
                                       }
                                  }
                                  if(strcmp(string,"8")==0){
                                       if(in_decimals==0){
                                            vertexs[current_number][current_mesh]=vertexs[current_number][current_mesh]*10+8;
                                       }else{
                                            vertexs[current_number][current_mesh]=vertexs[current_number][current_mesh]+(8/((float)current_decimal));
                                            current_decimal=current_decimal*10;
                                       }
                                  }
                                  if(strcmp(string,"9")==0){
                                       if(in_decimals==0){
                                            vertexs[current_number][current_mesh]=vertexs[current_number][current_mesh]*10+9;
                                       }else{
                                            vertexs[current_number][current_mesh]=vertexs[current_number][current_mesh]+(9/((float)current_decimal));
                                            current_decimal=current_decimal*10;
                                       }
                                  }
    
                                  if(strcmp(string,";")==0){
                                       in_decimals=0;
                                       current_decimal=10;
                                       colons_in_row++;
                                       if(negative_number==1){
                                            vertexs[current_number][current_mesh]=vertexs[current_number][current_mesh]*-1;
                                       }
                                       current_number++;
                                       vertexs[current_number][current_mesh]=0.0f;
                                       negative_number=0;
                                       if(colons_in_row==2){
                                            mesh_found=7;
                                            current_number=1;
                                            colons_in_row=0;
                                            trace("read mesh vertex locations");
                                            trace("reading polygons");
                                       }
                                  }
                                  if(!(strcmp(string,";")==0)){
                                       colons_in_row=0;
                                  }
                                  if(strcmp(string,".")==0){
                                       in_decimals=1;
                                  }
                             }
    
                             if(mesh_found==7){
                                  if(strcmp(string,"0")==0){
                                       num_of_polygons[current_mesh]=num_of_polygons[current_mesh]*10;
                                  }
                                  if(strcmp(string,"1")==0){
                                       num_of_polygons[current_mesh]=num_of_polygons[current_mesh]*10+1;
                                  }
                                  if(strcmp(string,"2")==0){
                                       num_of_polygons[current_mesh]=num_of_polygons[current_mesh]*10+2;
                                  }
                                  if(strcmp(string,"3")==0){
                                       num_of_polygons[current_mesh]=num_of_polygons[current_mesh]*10+3;
                                  }
                                  if(strcmp(string,"4")==0){
                                       num_of_polygons[current_mesh]=num_of_polygons[current_mesh]*10+4;
                                  }
                                  if(strcmp(string,"5")==0){
                                       num_of_polygons[current_mesh]=num_of_polygons[current_mesh]*10+5;
                                  }
                                  if(strcmp(string,"6")==0){
                                       num_of_polygons[current_mesh]=num_of_polygons[current_mesh]*10+6;
                                  }
                                  if(strcmp(string,"7")==0){
                                       num_of_polygons[current_mesh]=num_of_polygons[current_mesh]*10+7;
                                  }
                                  if(strcmp(string,"8")==0){
                                       num_of_polygons[current_mesh]=num_of_polygons[current_mesh]*10+8;
                                  }
                                  if(strcmp(string,"9")==0){
                                       num_of_polygons[current_mesh]=num_of_polygons[current_mesh]*10+9;
                                  }
                                  if(strcmp(string,";")==0){
                                       colons_in_row++;
                                       if(colons_in_row==2){
                                            trace("read polygons");
                                            trace("reading plygons number");
                                            mesh_found=8;
                                            colons_in_row=0;
                                       }
                                  }
                             }
    
    
                             if(mesh_found==8){
                                  if(colons_in_row==2){
                                       if(strcmp(string,"0")==0){
                                            polygons[current_number][current_mesh]=polygons[current_number][current_mesh]*10;
                                       }
                                       if(strcmp(string,"1")==0){
                                            polygons[current_number][current_mesh]=polygons[current_number][current_mesh]*10+1;
                                       }
                                       if(strcmp(string,"2")==0){
                                            polygons[current_number][current_mesh]=polygons[current_number][current_mesh]*10+2;
                                       }
                                       if(strcmp(string,"3")==0){
                                            polygons[current_number][current_mesh]=polygons[current_number][current_mesh]*10+3;
                                       }
                                       if(strcmp(string,"4")==0){
                                            polygons[current_number][current_mesh]=polygons[current_number][current_mesh]*10+4;
                                       }
                                       if(strcmp(string,"5")==0){
                                            polygons[current_number][current_mesh]=polygons[current_number][current_mesh]*10+5;
                                       }
                                       if(strcmp(string,"6")==0){
                                            polygons[current_number][current_mesh]=polygons[current_number][current_mesh]*10+6;
                                       }
                                       if(strcmp(string,"7")==0){
                                            polygons[current_number][current_mesh]=polygons[current_number][current_mesh]*10+7;
                                       }
                                       if(strcmp(string,"8")==0){
                                            polygons[current_number][current_mesh]=polygons[current_number][current_mesh]*10+8;
                                       }
                                       if(strcmp(string,"9")==0){
                                            polygons[current_number][current_mesh]=polygons[current_number][current_mesh]*10+9;
                                       }
                                  }
                                  if(strcmp(string,",")==0){
                                       current_number++;
                                  }
                                  if(strcmp(string,";")==0){
                                       colons_in_row++;
                                       if(colons_in_row==3){
                                            colons_in_row=1;
                                       }
                                  }
                             }
    
                             if(mesh_found>4 && number_of_brackets!=mesh_brackets){
                                  trace("read polygon's location");
                                  trace("finish reading mesh");
                                  mesh_found=0;
                                  current_mesh++;
                                  current_number=0;
                                  frame_transform=0;
                                  num_of_vertexs[current_mesh]=0;
                             }
                        }
                   }
              }
    
              fclose(pfile);
              trace("file closed");
              trace("translating vertexs");
              for(int d=0;d<current_mesh;d++){
                   for(int i=1;i<=num_of_vertexs[d];i++){
                        for(int b=1;b<4;b++){
                             if(b==1){
                                  vertexs[(i*3-3+b)][d]+=frame_transform_matrix[d][12];
                             }else if(b==2){
                                  vertexs[(i*3-3+b)][d]+=frame_transform_matrix[d][13];
                             }else if(b==3){
                                  vertexs[(i*3-3+b)][d]+=frame_transform_matrix[d][14];
                             }
                        }
                   }
              }
              trace("finished translating vertexs");
    
              trace("getting total number of vertices");
              for(int d=0;d<current_mesh;d++){
                   full_num_of_vertices+=num_of_polygons[d];
              }
              full=0;
    
              trace("finished getting total number of vertices");
              trace("placeing vertexs in proper order");
              for(int d=0;d<current_mesh;d++){
                   for(int i=1;i<=num_of_polygons[d]*3;i++){
                        for(int b=1;b<4;b++){
                             if(b==1){
                                  test.vertexs[full][b]=vertexs[polygons[i][d]*3+b][d];
                             }else if(b==2){
                                  test.vertexs[full][b]=vertexs[polygons[i][d]*3+b][d];
                             }else if(b==3){
                                  test.vertexs[full][b]=vertexs[polygons[i][d]*3+b][d];
                             }
                             full++;
                        }
                   }
              }
              trace("finished placeing vertexs in proper order");
              trace("appending data to triangle");
              full=0;
              next=0;
              test.numTriangles=full_num_of_vertices;
              for(int i=1;i<=full_num_of_vertices*3;i++){
                   for(int b=1;b<4;b++){
                        if(b == 1){
                             test.triangle[next].x=test.vertexs[full][b];
                        }else if(b == 2){
                             test.triangle[next].y=test.vertexs[full][b];
                        }else if(b == 3){
                             test.triangle[next].z=test.vertexs[full][b];
                        }
                        test.vertexs[full][4]=1.0f;
                        test.vertexs[full][5]=1.0f;
                        test.vertexs[full][6]=1.0f;
                        test.vertexs[full][7]=1.0f;
                        full++;
                   }
                   next++;
              }
              test.object_play=0;
              test.current_frame=1;
              test.max_frame=1;
    
              trace("finished appending data");
              trace("returning info");
              return test;
    }


    this is the code i use on the computer it works perfectly fine however on the psp it just randomly breaks at different points and i'm unsure as to why
    -= Double Post =-
    also heres proof that it randomly breaks at different points after three runs my trace file looks like this:

    Spoiler for trace file:

    opened file
    rewound file
    x
    o
    f

    0
    3
    0
    2
    t
    x
    t

    0
    0
    6
    4






    #

    T
    h
    i
    s

    D
    i
    r
    e
    c
    t
    X

    f
    i
    l
    e

    w
    a
    s

    w
    r
    i
    t
    t
    e
    n

    b
    y

    a

    C
    a
    l
    i
    g
    a
    r
    i

    (
    t
    m
    )

    p
    r
    o
    d
    u
    c
    t






    H
    e
    a
    d
    e
    r

    {




    1
    ;




    0
    ;




    1
    ;



    }



    F
    r
    a
    m
    e

    found frame translation
    N
    o
    N
    a
    opened file
    rewound file
    x
    o
    f

    0
    3
    0
    2
    t
    x
    t

    0
    0
    6
    4






    #

    T
    h
    i
    s

    D
    i
    r
    e
    c
    t
    X

    f
    i
    l
    e

    w
    a
    s

    w
    r
    i
    t
    t
    e
    n

    b
    y

    a

    C
    a
    l
    i
    g
    a
    r
    i

    (
    t
    m
    )

    p
    r
    o
    d
    u
    c
    t






    H
    e
    a
    d
    e
    r

    {




    1
    ;




    0
    ;




    1
    ;



    }



    F
    r
    a
    m
    e

    found frame translation
    N
    o
    N
    a
    m
    opened file
    rewound file
    x
    o
    f

    0
    3
    0



    the first 2 break at noname and the second 1 only reads a few letters before it breaks and i'm at a complete loss i've seen other 1's go further and some only write 1 letter and idk why
    Geändert von slicer4ever (06-23-2007 um 07:21 PM Uhr) Grund: Automerged Doublepost
    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


 

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 .