Rev 1 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1 | Rev 18 | ||
---|---|---|---|
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 " |
7 | #include "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" |
|
18 | #include "globvars.h" |
19 | #include "globvars.h" |
19 | #include "globvrkm.h" |
20 | #include "globvrkm.h" |
20 | #include "globvrpb.h" |
21 | #include "globvrpb.h" |
21 | #include "grafdata.h" |
22 | #include "grafdata.h" |
22 | #include "graphics.h" |
23 | #include "graphics.h" |
Line 1603... | Line 1604... | ||
1603 | } |
1604 | } |
1604 | } |
1605 | } |
1605 | 1606 | ||
1606 | // IDA: void __usercall CloneCar(tCar_spec **pOutput_car@<EAX>, tCar_spec *pInput_car@<EDX>) |
1607 | // IDA: void __usercall CloneCar(tCar_spec **pOutput_car@<EAX>, tCar_spec *pInput_car@<EDX>) |
1607 | void CloneCar(tCar_spec** pOutput_car, tCar_spec* pInput_car) { |
1608 | void CloneCar(tCar_spec** pOutput_car, tCar_spec* pInput_car) { |
1608 |
|
1609 | int i; |
1609 | LOG_TRACE("(%p, %p)", pOutput_car, pInput_car); |
1610 | LOG_TRACE("(%p, %p)", pOutput_car, pInput_car); |
- | 1611 | ||
- | 1612 | *pOutput_car = BrMemAllocate(sizeof(tCar_spec), kMem_cop_car_spec); |
|
1610 |
|
1613 | **pOutput_car = *pInput_car; |
- | 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 | } |
|
1611 | } |
1619 | } |
1612 | 1620 | ||
1613 | // IDA: void __usercall DisposeClonedCar(tCar_spec *pCar@<EAX>) |
1621 | // IDA: void __usercall DisposeClonedCar(tCar_spec *pCar@<EAX>) |
1614 | void DisposeClonedCar(tCar_spec* pCar) { |
1622 | void DisposeClonedCar(tCar_spec* pCar) { |
1615 | LOG_TRACE("(%p)", pCar); |
1623 | LOG_TRACE("(%p)", pCar); |
Line 2078... | Line 2086... | ||
2078 | 2086 | ||
2079 | number_of_floorpans = 5; |
2087 | number_of_floorpans = 5; |
2080 | for (i = old_material_count; i < pStorage_space->materials_count; i++) { |
2088 | for (i = old_material_count; i < pStorage_space->materials_count; i++) { |
2081 | if (pStorage_space->materials[i] != NULL && pStorage_space->materials[i]->colour_map != NULL) { |
2089 | if (pStorage_space->materials[i] != NULL && pStorage_space->materials[i]->colour_map != NULL) { |
2082 | pStorage_space->materials[i]->flags |= BR_MATF_LIGHT | BR_MATF_PRELIT | BR_MATF_SMOOTH; |
2090 | 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; |
|
2083 | if (pStorage_space->materials[i]->flags & BR_MATF_TWO_SIDED) { |
2093 | if (pStorage_space->materials[i]->flags & BR_MATF_TWO_SIDED) { |
2084 | its_a_floorpan = 0; |
2094 | its_a_floorpan = 0; |
2085 | for (j = 0; j < number_of_floorpans; j++) { |
2095 | for (j = 0; j < number_of_floorpans; j++) { |
2086 | if (strcmp(gFloorpan_names[j], pStorage_space->materials[i]->identifier) == 0) { |
2096 | if (strcmp(gFloorpan_names[j], pStorage_space->materials[i]->identifier) == 0) { |
2087 | its_a_floorpan = 1; |
2097 | its_a_floorpan = 1; |
Line 2895... | Line 2905... | ||
2895 | float GetAFloatPercent(FILE* pF) { |
2905 | float GetAFloatPercent(FILE* pF) { |
2896 | //char s[256]; // Pierre-Marie Baty -- unused variable |
2906 | //char s[256]; // Pierre-Marie Baty -- unused variable |
2897 | //char* str; // Pierre-Marie Baty -- unused variable |
2907 | //char* str; // Pierre-Marie Baty -- unused variable |
2898 | //float result; // Pierre-Marie Baty -- unused variable |
2908 | //float result; // Pierre-Marie Baty -- unused variable |
2899 | LOG_TRACE("(%p)", pF); |
2909 | LOG_TRACE("(%p)", pF); |
- | 2910 | ||
- | 2911 | GetALineAndDontArgue(pF, s); |
|
- | 2912 | str = strtok(s, "\t ,/"); |
|
- | 2913 | sscanf(str, "%f", &result); |
|
2900 |
|
2914 | return result / 100.f; |
2901 | } |
2915 | } |
2902 | 2916 | ||
2903 | // IDA: void __usercall GetPairOfFloats(FILE *pF@<EAX>, float *pF1@<EDX>, float *pF2@<EBX>) |
2917 | // IDA: void __usercall GetPairOfFloats(FILE *pF@<EAX>, float *pF1@<EDX>, float *pF2@<EBX>) |
2904 | void GetPairOfFloats(FILE* pF, float* pF1, float* pF2) { |
2918 | void GetPairOfFloats(FILE* pF, float* pF1, float* pF2) { |
2905 | char s[256]; |
2919 | char s[256]; |
Line 2955... | Line 2969... | ||
2955 | // IDA: void __usercall GetThreeIntsAndAString(FILE *pF@<EAX>, int *pF1@<EDX>, int *pF2@<EBX>, int *pF3@<ECX>, char *pS) |
2969 | // IDA: void __usercall GetThreeIntsAndAString(FILE *pF@<EAX>, int *pF1@<EDX>, int *pF2@<EBX>, int *pF3@<ECX>, char *pS) |
2956 | void GetThreeIntsAndAString(FILE* pF, int* pF1, int* pF2, int* pF3, char* pS) { |
2970 | void GetThreeIntsAndAString(FILE* pF, int* pF1, int* pF2, int* pF3, char* pS) { |
2957 | //char s[256]; // Pierre-Marie Baty -- unused variable |
2971 | //char s[256]; // Pierre-Marie Baty -- unused variable |
2958 | //char* str; // Pierre-Marie Baty -- unused variable |
2972 | //char* str; // Pierre-Marie Baty -- unused variable |
2959 | LOG_TRACE("(%p, %p, %p, %p, \"%s\")", pF, pF1, pF2, pF3, pS); |
2973 | 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 ,/"); |
|
2960 |
|
2983 | strcpy(pS, str); |
2961 | } |
2984 | } |
2962 | 2985 | ||
2963 | // IDA: void __usercall GetFourInts(FILE *pF@<EAX>, int *pF1@<EDX>, int *pF2@<EBX>, int *pF3@<ECX>, int *pF4) |
2986 | // IDA: void __usercall GetFourInts(FILE *pF@<EAX>, int *pF1@<EDX>, int *pF2@<EBX>, int *pF3@<ECX>, int *pF4) |
2964 | void GetFourInts(FILE* pF, int* pF1, int* pF2, int* pF3, int* pF4) { |
2987 | void GetFourInts(FILE* pF, int* pF1, int* pF2, int* pF3, int* pF4) { |
2965 | char s[256]; |
2988 | char s[256]; |
Line 2984... | Line 3007... | ||
2984 | } |
3007 | } |
2985 | 3008 | ||
2986 | // IDA: void __usercall GetPairOfScalars(FILE *pF@<EAX>, br_scalar *pS1@<EDX>, br_scalar *pS2@<EBX>) |
3009 | // IDA: void __usercall GetPairOfScalars(FILE *pF@<EAX>, br_scalar *pS1@<EDX>, br_scalar *pS2@<EBX>) |
2987 | void GetPairOfScalars(FILE* pF, br_scalar* pS1, br_scalar* pS2) { |
3010 | void GetPairOfScalars(FILE* pF, br_scalar* pS1, br_scalar* pS2) { |
2988 | LOG_TRACE("(%p, %p, %p)", pF, pS1, pS2); |
3011 | LOG_TRACE("(%p, %p, %p)", pF, pS1, pS2); |
- | 3012 | ||
2989 |
|
3013 | GetPairOfFloats(pF, pS1, pS2); |
2990 | } |
3014 | } |
2991 | 3015 | ||
2992 | // IDA: void __usercall GetThreeScalars(FILE *pF@<EAX>, br_scalar *pS1@<EDX>, br_scalar *pS2@<EBX>, br_scalar *pS3@<ECX>) |
3016 | // IDA: void __usercall GetThreeScalars(FILE *pF@<EAX>, br_scalar *pS1@<EDX>, br_scalar *pS2@<EBX>, br_scalar *pS3@<ECX>) |
2993 | void GetThreeScalars(FILE* pF, br_scalar* pS1, br_scalar* pS2, br_scalar* pS3) { |
3017 | void GetThreeScalars(FILE* pF, br_scalar* pS1, br_scalar* pS2, br_scalar* pS3) { |
2994 | LOG_TRACE("(%p, %p, %p, %p)", pF, pS1, pS2, pS3); |
3018 | LOG_TRACE("(%p, %p, %p, %p)", pF, pS1, pS2, pS3); |