Rev 18 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 18 | Rev 20 | ||
|---|---|---|---|
| Line 2... | Line 2... | ||
| 2 | 2 | ||
| 3 | #include <stdio.h> | 
            3 | #include <stdio.h> | 
          
| 4 | #include <stdlib.h> | 
            4 | #include <stdlib.h> | 
          
| 5 | #include <string.h> | 
            5 | #include <string.h> | 
          
| 6 | 6 | ||
| 7 | #include "brender.h" | 
            7 | #include "brender/brender.h" | 
          
| 8 | #include "brucetrk.h" | 
            8 | #include "brucetrk.h" | 
          
| 9 | #include "car.h" | 
            9 | #include "car.h" | 
          
| 10 | #include "constants.h" | 
            10 | #include "constants.h" | 
          
| 11 | #include "controls.h" | 
            11 | #include "controls.h" | 
          
| 12 | #include "crush.h" | 
            12 | #include "crush.h" | 
          
| 13 | #include "depth.h" | 
            13 | #include "depth.h" | 
          
| 14 | #include "displays.h" | 
            14 | #include "displays.h" | 
          
| 15 | #include "drmem.h" | 
            15 | #include "drmem.h" | 
          
| 16 | #include "errors.h" | 
            16 | #include "errors.h" | 
          
| 17 | #include "flicplay.h" | 
            17 | #include "flicplay.h" | 
          
| 18 | #include "formats.h" | 
            - | |
| 19 | #include "globvars.h" | 
            18 | #include "globvars.h" | 
          
| 20 | #include "globvrkm.h" | 
            19 | #include "globvrkm.h" | 
          
| 21 | #include "globvrpb.h" | 
            20 | #include "globvrpb.h" | 
          
| 22 | #include "grafdata.h" | 
            21 | #include "grafdata.h" | 
          
| 23 | #include "graphics.h" | 
            22 | #include "graphics.h" | 
          
| Line 1604... | Line 1603... | ||
| 1604 |     } | 
            1603 |     } | 
          
| 1605 | } | 
            1604 | } | 
          
| 1606 | 1605 | ||
| 1607 | // IDA: void __usercall CloneCar(tCar_spec **pOutput_car@<EAX>, tCar_spec *pInput_car@<EDX>) | 
            1606 | // IDA: void __usercall CloneCar(tCar_spec **pOutput_car@<EAX>, tCar_spec *pInput_car@<EDX>) | 
          
| 1608 | void CloneCar(tCar_spec** pOutput_car, tCar_spec* pInput_car) {  | 
            1607 | void CloneCar(tCar_spec** pOutput_car, tCar_spec* pInput_car) {  | 
          
| 1609 | 
  | 
            1608 |     //int i; // Pierre-Marie Baty -- unused variable | 
          
| 1610 | LOG_TRACE("(%p, %p)", pOutput_car, pInput_car);  | 
            1609 | LOG_TRACE("(%p, %p)", pOutput_car, pInput_car);  | 
          
| 1611 | - | ||
| 1612 | *pOutput_car = BrMemAllocate(sizeof(tCar_spec), kMem_cop_car_spec);  | 
            - | |
| 1613 | 
  | 
            1610 | NOT_IMPLEMENTED();  | 
          
| 1614 | (*pOutput_car)->car_master_actor = CloneActor(pInput_car->car_master_actor);  | 
            - | |
| 1615 | BrActorAdd(gNon_track_actor, (*pOutput_car)->car_master_actor);  | 
            - | |
| 1616 | for (i = 0; i < pInput_car->car_actor_count; i++) {  | 
            - | |
| 1617 | (*pOutput_car)->car_model_actors[i].actor = DRActorFindRecurse((*pOutput_car)->car_master_actor, pInput_car->car_model_actors[i].actor->identifier);  | 
            - | |
| 1618 |     } | 
            - | |
| 1619 | } | 
            1611 | } | 
          
| 1620 | 1612 | ||
| 1621 | // IDA: void __usercall DisposeClonedCar(tCar_spec *pCar@<EAX>) | 
            1613 | // IDA: void __usercall DisposeClonedCar(tCar_spec *pCar@<EAX>) | 
          
| 1622 | void DisposeClonedCar(tCar_spec* pCar) {  | 
            1614 | void DisposeClonedCar(tCar_spec* pCar) {  | 
          
| 1623 | LOG_TRACE("(%p)", pCar);  | 
            1615 | LOG_TRACE("(%p)", pCar);  | 
          
| Line 2086... | Line 2078... | ||
| 2086 | 2078 | ||
| 2087 | number_of_floorpans = 5;  | 
            2079 | number_of_floorpans = 5;  | 
          
| 2088 | for (i = old_material_count; i < pStorage_space->materials_count; i++) {  | 
            2080 | for (i = old_material_count; i < pStorage_space->materials_count; i++) {  | 
          
| 2089 | if (pStorage_space->materials[i] != NULL && pStorage_space->materials[i]->colour_map != NULL) {  | 
            2081 | if (pStorage_space->materials[i] != NULL && pStorage_space->materials[i]->colour_map != NULL) {  | 
          
| 2090 | pStorage_space->materials[i]->flags |= BR_MATF_LIGHT | BR_MATF_PRELIT | BR_MATF_SMOOTH;  | 
            2082 | pStorage_space->materials[i]->flags |= BR_MATF_LIGHT | BR_MATF_PRELIT | BR_MATF_SMOOTH;  | 
          
| 2091 |             // Added by jeff. This seems to be required with BRender 1.3.2 | 
            - | |
| 2092 | pStorage_space->materials[i]->flags &= ~BR_MATF_LIGHT;  | 
            - | |
| 2093 | if (pStorage_space->materials[i]->flags & BR_MATF_TWO_SIDED) {  | 
            2083 | if (pStorage_space->materials[i]->flags & BR_MATF_TWO_SIDED) {  | 
          
| 2094 | its_a_floorpan = 0;  | 
            2084 | its_a_floorpan = 0;  | 
          
| 2095 | for (j = 0; j < number_of_floorpans; j++) {  | 
            2085 | for (j = 0; j < number_of_floorpans; j++) {  | 
          
| 2096 | if (strcmp(gFloorpan_names[j], pStorage_space->materials[i]->identifier) == 0) {  | 
            2086 | if (strcmp(gFloorpan_names[j], pStorage_space->materials[i]->identifier) == 0) {  | 
          
| 2097 | its_a_floorpan = 1;  | 
            2087 | its_a_floorpan = 1;  | 
          
| Line 2905... | Line 2895... | ||
| 2905 | float GetAFloatPercent(FILE* pF) {  | 
            2895 | float GetAFloatPercent(FILE* pF) {  | 
          
| 2906 |     //char s[256]; // Pierre-Marie Baty -- unused variable | 
            2896 |     //char s[256]; // Pierre-Marie Baty -- unused variable | 
          
| 2907 |     //char* str; // Pierre-Marie Baty -- unused variable | 
            2897 |     //char* str; // Pierre-Marie Baty -- unused variable | 
          
| 2908 |     //float result; // Pierre-Marie Baty -- unused variable | 
            2898 |     //float result; // Pierre-Marie Baty -- unused variable | 
          
| 2909 | LOG_TRACE("(%p)", pF);  | 
            2899 | LOG_TRACE("(%p)", pF);  | 
          
| 2910 | - | ||
| 2911 | GetALineAndDontArgue(pF, s);  | 
            - | |
| 2912 | str = strtok(s, "\t ,/");  | 
            - | |
| 2913 | sscanf(str, "%f", &result);  | 
            - | |
| 2914 | 
  | 
            2900 | NOT_IMPLEMENTED();  | 
          
| 2915 | } | 
            2901 | } | 
          
| 2916 | 2902 | ||
| 2917 | // IDA: void __usercall GetPairOfFloats(FILE *pF@<EAX>, float *pF1@<EDX>, float *pF2@<EBX>) | 
            2903 | // IDA: void __usercall GetPairOfFloats(FILE *pF@<EAX>, float *pF1@<EDX>, float *pF2@<EBX>) | 
          
| 2918 | void GetPairOfFloats(FILE* pF, float* pF1, float* pF2) {  | 
            2904 | void GetPairOfFloats(FILE* pF, float* pF1, float* pF2) {  | 
          
| 2919 | char s[256];  | 
            2905 | char s[256];  | 
          
| Line 2969... | Line 2955... | ||
| 2969 | // IDA: void __usercall GetThreeIntsAndAString(FILE *pF@<EAX>, int *pF1@<EDX>, int *pF2@<EBX>, int *pF3@<ECX>, char *pS) | 
            2955 | // IDA: void __usercall GetThreeIntsAndAString(FILE *pF@<EAX>, int *pF1@<EDX>, int *pF2@<EBX>, int *pF3@<ECX>, char *pS) | 
          
| 2970 | void GetThreeIntsAndAString(FILE* pF, int* pF1, int* pF2, int* pF3, char* pS) {  | 
            2956 | void GetThreeIntsAndAString(FILE* pF, int* pF1, int* pF2, int* pF3, char* pS) {  | 
          
| 2971 |     //char s[256]; // Pierre-Marie Baty -- unused variable | 
            2957 |     //char s[256]; // Pierre-Marie Baty -- unused variable | 
          
| 2972 |     //char* str; // Pierre-Marie Baty -- unused variable | 
            2958 |     //char* str; // Pierre-Marie Baty -- unused variable | 
          
| 2973 | LOG_TRACE("(%p, %p, %p, %p, \"%s\")", pF, pF1, pF2, pF3, pS);  | 
            2959 | LOG_TRACE("(%p, %p, %p, %p, \"%s\")", pF, pF1, pF2, pF3, pS);  | 
          
| 2974 | - | ||
| 2975 | GetALineAndDontArgue(pF, s);  | 
            - | |
| 2976 | str = strtok(s, "\t ,/");  | 
            - | |
| 2977 | sscanf(str, "%d", pF1);  | 
            - | |
| 2978 | str = strtok(NULL, "\t ,/");  | 
            - | |
| 2979 | sscanf(str, "%d", pF2);  | 
            - | |
| 2980 | str = strtok(NULL, "\t ,/");  | 
            - | |
| 2981 | sscanf(str, "%d", pF3);  | 
            - | |
| 2982 | str = strtok(NULL, "\t ,/");  | 
            - | |
| 2983 | 
  | 
            2960 | NOT_IMPLEMENTED();  | 
          
| 2984 | } | 
            2961 | } | 
          
| 2985 | 2962 | ||
| 2986 | // IDA: void __usercall GetFourInts(FILE *pF@<EAX>, int *pF1@<EDX>, int *pF2@<EBX>, int *pF3@<ECX>, int *pF4) | 
            2963 | // IDA: void __usercall GetFourInts(FILE *pF@<EAX>, int *pF1@<EDX>, int *pF2@<EBX>, int *pF3@<ECX>, int *pF4) | 
          
| 2987 | void GetFourInts(FILE* pF, int* pF1, int* pF2, int* pF3, int* pF4) {  | 
            2964 | void GetFourInts(FILE* pF, int* pF1, int* pF2, int* pF3, int* pF4) {  | 
          
| 2988 | char s[256];  | 
            2965 | char s[256];  | 
          
| Line 3007... | Line 2984... | ||
| 3007 | } | 
            2984 | } | 
          
| 3008 | 2985 | ||
| 3009 | // IDA: void __usercall GetPairOfScalars(FILE *pF@<EAX>, br_scalar *pS1@<EDX>, br_scalar *pS2@<EBX>) | 
            2986 | // IDA: void __usercall GetPairOfScalars(FILE *pF@<EAX>, br_scalar *pS1@<EDX>, br_scalar *pS2@<EBX>) | 
          
| 3010 | void GetPairOfScalars(FILE* pF, br_scalar* pS1, br_scalar* pS2) {  | 
            2987 | void GetPairOfScalars(FILE* pF, br_scalar* pS1, br_scalar* pS2) {  | 
          
| 3011 | LOG_TRACE("(%p, %p, %p)", pF, pS1, pS2);  | 
            2988 | LOG_TRACE("(%p, %p, %p)", pF, pS1, pS2);  | 
          
| 3012 | - | ||
| 3013 | 
  | 
            2989 | NOT_IMPLEMENTED();  | 
          
| 3014 | } | 
            2990 | } | 
          
| 3015 | 2991 | ||
| 3016 | // IDA: void __usercall GetThreeScalars(FILE *pF@<EAX>, br_scalar *pS1@<EDX>, br_scalar *pS2@<EBX>, br_scalar *pS3@<ECX>) | 
            2992 | // IDA: void __usercall GetThreeScalars(FILE *pF@<EAX>, br_scalar *pS1@<EDX>, br_scalar *pS2@<EBX>, br_scalar *pS3@<ECX>) | 
          
| 3017 | void GetThreeScalars(FILE* pF, br_scalar* pS1, br_scalar* pS2, br_scalar* pS3) {  | 
            2993 | void GetThreeScalars(FILE* pF, br_scalar* pS1, br_scalar* pS2, br_scalar* pS3) {  | 
          
| 3018 | LOG_TRACE("(%p, %p, %p, %p)", pF, pS1, pS2, pS3);  | 
            2994 | LOG_TRACE("(%p, %p, %p, %p)", pF, pS1, pS2, pS3);  |