* correctly render track based on current view and yon factor * some physics code * rotate, translate, self centering steering * Fix ordering of global variables * ApplyPhysicsToCars * car is moving somewhat * fixes stumbling at low revs * camera swings around properly when switching direction * fix compile errors
This commit is contained in:
parent
3244bdbd55
commit
f1ed9ff522
|
@ -0,0 +1,15 @@
|
||||||
|
# Unused functions
|
||||||
|
|
||||||
|
### ToggleControls
|
||||||
|
Appears to have been a way to change the steering handling? "Original Controls", "Accelerated steering", "0.75 Accelerated", "0.5 Accelerated", "New controls". The game is hardcoded to use "0.5 Accelerated" and this function is not called from anywhere.
|
||||||
|
|
||||||
|
### DrawSomeText / DrawSomeText2
|
||||||
|
Not accessible in the retail game, but the functions still exists. Can be invoked in a very early demo build. For each of 7 fonts, it prints 15 lines of dummy text and saves a screenshot each time.
|
||||||
|
|
||||||
|
### ToggleArrow
|
||||||
|
Does a `return` at the top of the function in the retail game. Appears to have been used for debugging. Replaces the current car model with an arrow(?). Also enables debug output showing the car location and stats.
|
||||||
|
|
||||||
|
### SetFlag2 / ToggleFlying
|
||||||
|
TBA
|
||||||
|
|
||||||
|
|
26
README.md
26
README.md
|
@ -44,10 +44,29 @@ export DETHRACE_ROOT_DIR=/path/to/carmageddon
|
||||||
|
|
||||||
## Build
|
## Build
|
||||||
|
|
||||||
|
Dethrace uses [cmake](https://cmake.org/) for generating build files.
|
||||||
|
|
||||||
|
To generate the build files (generally only required once):
|
||||||
```sh
|
```sh
|
||||||
make build
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake ..
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Build:
|
||||||
|
```sh
|
||||||
|
make && ./dethrace
|
||||||
|
```
|
||||||
|
|
||||||
|
### Run
|
||||||
|
|
||||||
|
After building, `build/dethrace` is created
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./dethrace [args]
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Run tests
|
## Run tests
|
||||||
|
|
||||||
A subset of tests do not require `DETHRACE_ROOT_DIR`. They run via Github actions when code is committed to this repo. This allows us to keep nice and clean and avoid storing any potentially legally problematic resouces in our repo.
|
A subset of tests do not require `DETHRACE_ROOT_DIR`. They run via Github actions when code is committed to this repo. This allows us to keep nice and clean and avoid storing any potentially legally problematic resouces in our repo.
|
||||||
|
@ -71,11 +90,6 @@ To run a single test
|
||||||
DETHRACE_TEST_ARGS="-n test_name" make test
|
DETHRACE_TEST_ARGS="-n test_name" make test
|
||||||
```
|
```
|
||||||
|
|
||||||
## Run game
|
|
||||||
```sh
|
|
||||||
make run
|
|
||||||
```
|
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
[From the beginning until release](docs/CHANGELOG.md)
|
[From the beginning until release](docs/CHANGELOG.md)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,72 @@
|
||||||
|
// SCRATCH
|
||||||
|
|
||||||
|
// gRender_screen = DRPixelmapAllocateSub(gBack_screen, pX_offset, pY_offset, pWidth, pHeight);
|
||||||
|
render background(sky) to gRender_screen(back screen)
|
||||||
|
render 3d scene
|
||||||
|
render foreground to gBack_screen(cockpit, headups etc)
|
||||||
|
swap buffers
|
||||||
|
|
||||||
|
render background(sky) to gRender_screen(back screen)
|
||||||
|
- harness_renderscreen
|
||||||
|
render 3d scene
|
||||||
|
- clear back screen to black
|
||||||
|
- do opengl rendering
|
||||||
|
|
||||||
|
render foreground to gBack_screen(cockpit, headups etc)
|
||||||
|
- ignore any black pixels
|
||||||
|
|
||||||
|
swap buffers
|
||||||
|
|
||||||
|
0053A250
|
||||||
|
- 0x53A43C gKey_array
|
||||||
|
|
||||||
|
005505F4 dword_5505F4 //joy?
|
||||||
|
005507C0
|
||||||
|
- 005507e0 gJoy_array
|
||||||
|
005507E0
|
||||||
|
- 005508EC gKey_mapping
|
||||||
|
|
||||||
|
005505F4 offset in cyclepollkeys to gJoy_array
|
||||||
|
- diff is 115 ints
|
||||||
|
|
||||||
|
0x550428
|
||||||
|
|
||||||
|
/ DOS
|
||||||
|
|
||||||
|
00136444 gKey_array
|
||||||
|
001363A0 gJoy_array
|
||||||
|
|
||||||
|
0x1361D4 offset in cyclepollkeys to gJoy_array
|
||||||
|
- diff is 115 ints
|
||||||
|
|
||||||
|
[DEBUG] ShiftBoundGrooveFunks bound funk 0 : 0x0
|
||||||
|
[DEBUG] ShiftBoundGrooveFunks bound funk 1 : 0x1008c897c
|
||||||
|
[DEBUG] ShiftBoundGrooveFunks bound funk 2 : 0x1008c8a04
|
||||||
|
[DEBUG] ShiftBoundGrooveFunks bound funk 3 : 0x1008c8828
|
||||||
|
[DEBUG] ShiftBoundGrooveFunks bound funk 4 : 0x1008c88b0
|
||||||
|
[DEBUG] ShiftBoundGrooveFunks bound funk 5 : 0x1008c8938
|
||||||
|
[DEBUG] ShiftBoundGrooveFunks bound funk 6 : 0x1008c89c0
|
||||||
|
[DEBUG] ShiftBoundGrooveFunks bound funk 7 : 0x1008c886c
|
||||||
|
[DEBUG] ShiftBoundGrooveFunks bound funk 8 : 0x1008c88f4
|
||||||
|
[DEBUG] ShiftBoundGrooveFunks bound funk 9 : 0x1008c8a8c
|
||||||
|
[DEBUG] ShiftBoundGrooveFunks bound funk 10 : 0x1008c8b14
|
||||||
|
|
||||||
|
[DEBUG] ShiftBoundGrooveFunks bound funk 0 : 0x0
|
||||||
|
[DEBUG] ShiftBoundGrooveFunks bound funk 1 : 0x10389837c
|
||||||
|
[DEBUG] ShiftBoundGrooveFunks bound funk 2 : 0x103898404
|
||||||
|
[DEBUG] ShiftBoundGrooveFunks bound funk 3 : 0x103898228
|
||||||
|
[DEBUG] ShiftBoundGrooveFunks bound funk 4 : 0x1038982b0
|
||||||
|
[DEBUG] ShiftBoundGrooveFunks bound funk 5 : 0x103898338
|
||||||
|
[DEBUG] ShiftBoundGrooveFunks bound funk 6 : 0x1038983c0
|
||||||
|
[DEBUG] ShiftBoundGrooveFunks bound funk 7 : 0x10389826c
|
||||||
|
[DEBUG] ShiftBoundGrooveFunks bound funk 8 : 0x1038982f4
|
||||||
|
[DEBUG] ShiftBoundGrooveFunks bound funk 9 : 0x10389848c
|
||||||
|
[DEBUG] ShiftBoundGrooveFunks bound funk 10 : 0x103898514
|
||||||
|
|
||||||
|
sometimes selfcentre is called multiple times per frame
|
||||||
|
applyphysicstocars always is within time_step
|
||||||
|
|
||||||
|
acc_force is not dropping down fast enough
|
||||||
|
|
||||||
|
ts2 8.015344638012678e-11,
|
||||||
|
acc 5.92524658203125e2, revs 1.16219453125e4 v160 2.962623291015625e2, v118 1.703537831632129e-11, speed 0.0 max_force_rear 7.437321662902832, v135 1.481311645507812e2, limit 1 ts2 3.074372708797455e-1, acc 4.121511840820312e2, revs 7.6736416015625e3 v160 2.05921875e2, v118 3.127531499558245e-6, speed 0.0 max_force_rear 7.437321662902832, v135 1.029609375e2, limit 1 ts2 3.450555503368378e-1, acc 2.825576171875e2, revs 5.08019775390625e3 v160 1.411062774658203e2, v118 3.965127234550891e-6, speed 2.803576358087277 max_force_rear 8.247367858886719, v135 7.055313873291016e1, limit 1 ts2 3.663769066333771e-1, acc 1.920951385498047e2, revs 3.416863525390625e3 v160 9.58643798828125e1, v118 4.987010015611304e-6, speed 4.356438601662044 max_force_rear 8.737387657165527, v135 4.793218994140625e1, limit 1 ts2 3.764173984527588e-1, acc 1.30189453125e2, revs 2.38487939453125e3 v160 6.490651702880859e1, v118 3.554842805897351e-6, speed 5.955295815963242 max_force_rear 9.003288269042969, v135 3.24532585144043e1, limit 1 ts2 3.783531486988068e-1, acc 8.838812255859375e1, revs 1.777574462890625e3 v160 4.40048828125e1, v118 - 5.434078630059958e-4, speed 5.955295815963242 max_force_rear 9.125821113586426, v135 2.200244140625e1, limit 1 ts2 3.753950297832489e-1, acc 6.089559936523438e1, revs 1.454000854492188e3 v160 3.026010131835938e1, v118 - 1.982751418836415e-4, speed 9.13116980073459 max_force_rear 9.149258613586426, v135 1.513005065917969e1, limit 1 ts2 3.73871237039566e-1, acc 4.246442031860352e1, revs 1.315802001953125e3 v160 2.104527473449707e1, v118 1.181649276986718e-4, speed 9.13116980073459 max_force_rear 9.113421440124512, v135 1.052263736724854e1, limit 1 ts2 3.743874132633209e-1, acc 3.010890197753906e1, revs 1.3012431640625e3 v160 1.48672571182251e1, v118 - 4.263391747372225e-5, speed 1.228963766974154e1 max_force_rear 9.094904899597168, v135 7.433628559112549, limit 1 ts2 3.726563155651093e-1, acc 2.178503227233887e1, revs 1.369130737304688e3 v160 1.07061882019043e1, v118 - 1.312031417910475e-5, speed 1.228963766974154e1 max_force_rear 9.101181030273438, v135 5.353094100952148, limit 1 ts2 3.762767016887665e-1, acc 1.618281555175781e1, revs 1.492148193359375e3 v160 7.903269290924072, v118 - 1.101096768252319e-5, speed 1.548429768039707e1 max_force_rear 9.08011531829834, v135 3.951634645462036, limit 0
|
|
@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
|
||||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### July 17 2021
|
||||||
|
- 3d rendering somewhat implemented. Flat shaded, no textures, but camera, cars and track are visible in the right place!
|
||||||
|
|
||||||
|
### April 21 2021
|
||||||
|
- Actual game main loop running! Rendering, phyiscs, sound etc commented out, so all we can see is a black screen with the 2d rendering.
|
||||||
|
|
||||||
|
### March 24 2021
|
||||||
|
- Menu screens up to and including race and car selection implemented
|
||||||
|
- Fixed OpenGL crashes by moving back to single thread
|
||||||
|
|
||||||
### September 3 2020
|
### September 3 2020
|
||||||
- Cutscenes displayed on startup.
|
- Cutscenes displayed on startup.
|
||||||
- Main menu renders and responds to key up and down events. Hitting "enter" on any option causes a crash
|
- Main menu renders and responds to key up and down events. Hitting "enter" on any option causes a crash
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "matrix34.h"
|
#include "matrix34.h"
|
||||||
#include "harness_trace.h"
|
#include "harness_trace.h"
|
||||||
|
#include "vector.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
br_matrix34 mattmp1;
|
br_matrix34 mattmp1;
|
||||||
|
@ -140,7 +141,31 @@ void BrMatrix34Rotate(br_matrix34* mat, br_angle r, br_vector3* a) {
|
||||||
br_scalar sy;
|
br_scalar sy;
|
||||||
br_scalar sz;
|
br_scalar sz;
|
||||||
LOG_TRACE("(%p, %d, %p)", mat, r, a);
|
LOG_TRACE("(%p, %d, %p)", mat, r, a);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
s = BR_SIN(r);
|
||||||
|
c = BR_COS(r);
|
||||||
|
t = 1.0 - c;
|
||||||
|
|
||||||
|
txy = t * a->v[0];
|
||||||
|
txz = txy * a->v[2];
|
||||||
|
txy = txy * a->v[1];
|
||||||
|
tyz = t * a->v[1] * a->v[2];
|
||||||
|
|
||||||
|
sx = s * a->v[0];
|
||||||
|
sy = s * a->v[1];
|
||||||
|
sz = s * a->v[2];
|
||||||
|
|
||||||
|
M(0, 0) = t * a->v[0] * a->v[0] + c;
|
||||||
|
M(0, 1) = txy + sz;
|
||||||
|
M(0, 2) = txz - sy;
|
||||||
|
M(1, 0) = txy - sz;
|
||||||
|
M(1, 1) = t * a->v[1] * a->v[1] + c;
|
||||||
|
M(1, 2) = tyz + sx;
|
||||||
|
M(2, 0) = txz + sy;
|
||||||
|
M(2, 1) = tyz - sx;
|
||||||
|
M(2, 2) = t * a->v[2] * a->v[2] + c;
|
||||||
|
|
||||||
|
M(3, 0) = M(3, 1) = M(3, 2) = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __cdecl BrMatrix34Translate(br_matrix34 *mat, br_scalar dx, br_scalar dy, br_scalar dz)
|
// IDA: void __cdecl BrMatrix34Translate(br_matrix34 *mat, br_scalar dx, br_scalar dy, br_scalar dz)
|
||||||
|
@ -297,7 +322,15 @@ void BrMatrix34LPInverse(br_matrix34* A, br_matrix34* B) {
|
||||||
// IDA: void __cdecl BrMatrix34LPNormalise(br_matrix34 *A, br_matrix34 *B)
|
// IDA: void __cdecl BrMatrix34LPNormalise(br_matrix34 *A, br_matrix34 *B)
|
||||||
void BrMatrix34LPNormalise(br_matrix34* A, br_matrix34* B) {
|
void BrMatrix34LPNormalise(br_matrix34* A, br_matrix34* B) {
|
||||||
LOG_TRACE("(%p, %p)", A, B);
|
LOG_TRACE("(%p, %p)", A, B);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
BrVector3Normalise((br_vector3*)A->m[2], (br_vector3*)B->m[2]);
|
||||||
|
BrVector3Cross((br_vector3*)A->m[0], (br_vector3*)B->m[1], (br_vector3*)A->m[2]);
|
||||||
|
BrVector3Normalise((br_vector3*)A->m[0], (br_vector3*)A->m[0]);
|
||||||
|
BrVector3Cross((br_vector3*)A->m[1], (br_vector3*)A->m[2], (br_vector3*)A->m[0]);
|
||||||
|
|
||||||
|
A(3, 0) = B(3, 0);
|
||||||
|
A(3, 1) = B(3, 1);
|
||||||
|
A(3, 2) = B(3, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __cdecl BrMatrix34RollingBall(br_matrix34 *mat, int dx, int dy, int radius)
|
// IDA: void __cdecl BrMatrix34RollingBall(br_matrix34 *mat, int dx, int dy, int radius)
|
||||||
|
@ -441,7 +474,10 @@ void BrMatrix34PostRotateZ(br_matrix34* mat, br_angle rz) {
|
||||||
// IDA: void __cdecl BrMatrix34PreRotate(br_matrix34 *mat, br_angle r, br_vector3 *axis)
|
// IDA: void __cdecl BrMatrix34PreRotate(br_matrix34 *mat, br_angle r, br_vector3 *axis)
|
||||||
void BrMatrix34PreRotate(br_matrix34* mat, br_angle r, br_vector3* axis) {
|
void BrMatrix34PreRotate(br_matrix34* mat, br_angle r, br_vector3* axis) {
|
||||||
LOG_TRACE("(%p, %d, %p)", mat, r, axis);
|
LOG_TRACE("(%p, %d, %p)", mat, r, axis);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
BrMatrix34Rotate(&mattmp1, r, axis);
|
||||||
|
BrMatrix34Mul(&mattmp2, &mattmp1, mat);
|
||||||
|
BrMatrix34Copy(mat, &mattmp2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __cdecl BrMatrix34PostRotate(br_matrix34 *mat, br_angle r, br_vector3 *axis)
|
// IDA: void __cdecl BrMatrix34PostRotate(br_matrix34 *mat, br_angle r, br_vector3 *axis)
|
||||||
|
@ -453,7 +489,10 @@ void BrMatrix34PostRotate(br_matrix34* mat, br_angle r, br_vector3* axis) {
|
||||||
// IDA: void __cdecl BrMatrix34PreTranslate(br_matrix34 *mat, br_scalar x, br_scalar y, br_scalar z)
|
// IDA: void __cdecl BrMatrix34PreTranslate(br_matrix34 *mat, br_scalar x, br_scalar y, br_scalar z)
|
||||||
void BrMatrix34PreTranslate(br_matrix34* mat, br_scalar x, br_scalar y, br_scalar z) {
|
void BrMatrix34PreTranslate(br_matrix34* mat, br_scalar x, br_scalar y, br_scalar z) {
|
||||||
LOG_TRACE("(%p, %f, %f, %f)", mat, x, y, z);
|
LOG_TRACE("(%p, %f, %f, %f)", mat, x, y, z);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
BrMatrix34Translate(&mattmp1, x, y, z);
|
||||||
|
BrMatrix34Mul(&mattmp2, &mattmp1, mat);
|
||||||
|
BrMatrix34Copy(mat, &mattmp2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __cdecl BrMatrix34PostTranslate(br_matrix34 *mat, br_scalar x, br_scalar y, br_scalar z)
|
// IDA: void __cdecl BrMatrix34PostTranslate(br_matrix34 *mat, br_scalar x, br_scalar y, br_scalar z)
|
||||||
|
|
|
@ -563,11 +563,8 @@ void BrModelUpdate(br_model* model, br_uint_16 flags) {
|
||||||
br_face* fp;
|
br_face* fp;
|
||||||
LOG_TRACE("(%p, %d)", model, flags);
|
LOG_TRACE("(%p, %d)", model, flags);
|
||||||
|
|
||||||
LOG_DEBUG("flags %d", model->flags);
|
|
||||||
if (!(model->flags & BR_MODF_PREPREPARED)) {
|
if (!(model->flags & BR_MODF_PREPREPARED)) {
|
||||||
LOG_DEBUG("inside confi");
|
|
||||||
if (!model->faces || !model->vertices) {
|
if (!model->faces || !model->vertices) {
|
||||||
LOG_DEBUG("exit 2");
|
|
||||||
BrFailure("BrModelUpdate: model has no faces or vertices (%s)", model->identifier ? model->identifier : "<NULL>");
|
BrFailure("BrModelUpdate: model has no faces or vertices (%s)", model->identifier ? model->identifier : "<NULL>");
|
||||||
}
|
}
|
||||||
if (flags & BR_MODU_UNKNOWN) {
|
if (flags & BR_MODU_UNKNOWN) {
|
||||||
|
@ -582,7 +579,6 @@ void BrModelUpdate(br_model* model, br_uint_16 flags) {
|
||||||
}
|
}
|
||||||
if (!model->prepared || flags & 0xFFD0) {
|
if (!model->prepared || flags & 0xFFD0) {
|
||||||
if (!model->faces || !model->vertices) {
|
if (!model->faces || !model->vertices) {
|
||||||
LOG_DEBUG("exit 1");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PrepareFaceNormals(model);
|
PrepareFaceNormals(model);
|
||||||
|
@ -606,7 +602,6 @@ void BrModelUpdate(br_model* model, br_uint_16 flags) {
|
||||||
v11m = (v11model*)model->prepared;
|
v11m = (v11model*)model->prepared;
|
||||||
|
|
||||||
if (v11m) {
|
if (v11m) {
|
||||||
LOG_DEBUG("has prepared model");
|
|
||||||
for (g = 0; g < v11m->ngroups; g++) {
|
for (g = 0; g < v11m->ngroups; g++) {
|
||||||
//prepareEdges(&v11m->groups[g], model);
|
//prepareEdges(&v11m->groups[g], model);
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,6 +73,10 @@ void BrMatrix34PreTransform(br_matrix34* mat, br_transform* xform);
|
||||||
void BrMatrix34PostTransform(br_matrix34* mat, br_transform* xform);
|
void BrMatrix34PostTransform(br_matrix34* mat, br_transform* xform);
|
||||||
void BrMatrix34PreRotateX(br_matrix34* mat, br_angle rx);
|
void BrMatrix34PreRotateX(br_matrix34* mat, br_angle rx);
|
||||||
void BrMatrix34TApplyV(br_vector3* A, br_vector3* B, br_matrix34* C);
|
void BrMatrix34TApplyV(br_vector3* A, br_vector3* B, br_matrix34* C);
|
||||||
|
void BrMatrix34LPNormalise(br_matrix34* A, br_matrix34* B);
|
||||||
|
void BrMatrix34PreRotate(br_matrix34* mat, br_angle r, br_vector3* axis);
|
||||||
|
void BrMatrix34Rotate(br_matrix34* mat, br_angle r, br_vector3* a);
|
||||||
|
void BrMatrix34PreTranslate(br_matrix34* mat, br_scalar x, br_scalar y, br_scalar z);
|
||||||
|
|
||||||
// BrMem
|
// BrMem
|
||||||
void BrMemFree(void* block);
|
void BrMemFree(void* block);
|
||||||
|
|
|
@ -35,7 +35,7 @@ elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||||
-Wno-unused-result
|
-Wno-unused-result
|
||||||
-Wno-error=sign-compare
|
-Wno-error=sign-compare
|
||||||
-Wno-error=format-overflow
|
-Wno-error=format-overflow
|
||||||
-Wno-error=unused-but-set-variable # (SelectRaceDraw::test2)
|
-Wno-error=unused-but-set-variable # (SelectRaceDraw::test2), etc
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
target_compile_definitions(dethrace_obj PRIVATE -D_CRT_SECURE_NO_WARNINGS)
|
target_compile_definitions(dethrace_obj PRIVATE -D_CRT_SECURE_NO_WARNINGS)
|
||||||
|
|
|
@ -90,19 +90,10 @@ intptr_t ProcessModelsCB(br_actor* pActor, tTrack_spec* pTrack_spec) {
|
||||||
int group;
|
int group;
|
||||||
LOG_TRACE("(%p, %p)", pActor, pTrack_spec);
|
LOG_TRACE("(%p, %p)", pActor, pTrack_spec);
|
||||||
|
|
||||||
if (sscanf(pActor->identifier, "%u%u", &x, &z) != 2 || pTrack_spec->ncolumns_x <= x || pTrack_spec->ncolumns_z <= z) {
|
if (sscanf(pActor->identifier, "%u%u", &x, &z) == 2 && pTrack_spec->ncolumns_x > x && pTrack_spec->ncolumns_z > z) {
|
||||||
if (*pActor->identifier != '%'
|
|
||||||
|| sscanf((const char*)pActor->identifier + 1, "%u%u", &x, &z) != 2
|
|
||||||
|| pTrack_spec->ncolumns_x <= x
|
|
||||||
|| pTrack_spec->ncolumns_z <= z) {
|
|
||||||
BrActorEnum(pActor, (br_actor_enum_cbfn*)ProcessModelsCB, pTrack_spec);
|
|
||||||
} else {
|
|
||||||
pTrack_spec->lollipops[z][x] = pActor;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
pActor->material = gDefault_track_material;
|
pActor->material = gDefault_track_material;
|
||||||
pTrack_spec->columns[z][x] = pActor;
|
pTrack_spec->columns[z][x] = pActor;
|
||||||
gMr_blendy = 0;
|
gMr_blendy = NULL;
|
||||||
if (pActor->model && !gAusterity_mode) {
|
if (pActor->model && !gAusterity_mode) {
|
||||||
StripBlendedFaces(pActor, pActor->model);
|
StripBlendedFaces(pActor, pActor->model);
|
||||||
}
|
}
|
||||||
|
@ -110,13 +101,17 @@ intptr_t ProcessModelsCB(br_actor* pActor, tTrack_spec* pTrack_spec) {
|
||||||
if (gMr_blendy) {
|
if (gMr_blendy) {
|
||||||
BrActorAdd(pActor, gMr_blendy);
|
BrActorAdd(pActor, gMr_blendy);
|
||||||
BrModelAdd(gMr_blendy->model);
|
BrModelAdd(gMr_blendy->model);
|
||||||
for (group = 0; group < V11MODEL(gMr_blendy->model)->ngroups; group++) {
|
for (group = 0; V11MODEL(gMr_blendy->model)->ngroups > group; ++group) {
|
||||||
V11MODEL(gMr_blendy->model)->groups[group].face_colours[0] = gMr_blendy->model->faces[V11MODEL(gMr_blendy->model)->groups[group].face_user[0]].material->colour;
|
V11MODEL(gMr_blendy->model)->groups[group].face_colours_material = gMr_blendy->model->faces[*V11MODEL(gMr_blendy->model)->groups[group].face_user].material;
|
||||||
}
|
}
|
||||||
gMr_blendy->model->flags &= 0xFF7Fu;
|
gMr_blendy->model->flags &= 0xFF7Fu;
|
||||||
DodgyModelUpdate(gMr_blendy->model);
|
DodgyModelUpdate(gMr_blendy->model);
|
||||||
pTrack_spec->blends[z][x] = gMr_blendy;
|
pTrack_spec->blends[z][x] = gMr_blendy;
|
||||||
}
|
}
|
||||||
|
} else if (*pActor->identifier == '%' && sscanf((const char*)pActor->identifier + 1, "%u%u", &x, &z) == 2 && pTrack_spec->ncolumns_x > x && pTrack_spec->ncolumns_z > z) {
|
||||||
|
pTrack_spec->lollipops[z][x] = pActor;
|
||||||
|
} else {
|
||||||
|
BrActorEnum(pActor, (br_actor_enum_cbfn*)ProcessModelsCB, pTrack_spec);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -185,14 +180,29 @@ void ExtractColumns(tTrack_spec* pTrack_spec) {
|
||||||
// IDA: void __usercall LollipopizeActor4(br_actor *pActor@<EAX>, br_matrix34 *pRef_to_world@<EDX>, br_actor *pCamera@<EBX>)
|
// IDA: void __usercall LollipopizeActor4(br_actor *pActor@<EAX>, br_matrix34 *pRef_to_world@<EDX>, br_actor *pCamera@<EBX>)
|
||||||
void LollipopizeActor4(br_actor* pActor, br_matrix34* pRef_to_world, br_actor* pCamera) {
|
void LollipopizeActor4(br_actor* pActor, br_matrix34* pRef_to_world, br_actor* pCamera) {
|
||||||
LOG_TRACE("(%p, %p, %p)", pActor, pRef_to_world, pCamera);
|
LOG_TRACE("(%p, %p, %p)", pActor, pRef_to_world, pCamera);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
pActor->t.t.mat.m[1][0] = 0.0;
|
||||||
|
pActor->t.t.mat.m[1][1] = 1.0;
|
||||||
|
pActor->t.t.mat.m[1][2] = 0.0;
|
||||||
|
pActor->t.t.mat.m[2][0] = pRef_to_world->m[2][0];
|
||||||
|
pActor->t.t.mat.m[2][1] = pRef_to_world->m[2][1];
|
||||||
|
pActor->t.t.mat.m[2][2] = pRef_to_world->m[2][2];
|
||||||
|
pActor->t.t.mat.m[0][0] = pActor->t.t.mat.m[1][1] * pActor->t.t.mat.m[2][2]
|
||||||
|
- pActor->t.t.mat.m[1][2] * pActor->t.t.mat.m[2][1];
|
||||||
|
pActor->t.t.mat.m[0][1] = pActor->t.t.mat.m[1][2] * pActor->t.t.mat.m[2][0]
|
||||||
|
- pActor->t.t.mat.m[1][0] * pActor->t.t.mat.m[2][2];
|
||||||
|
pActor->t.t.mat.m[0][2] = pActor->t.t.mat.m[2][1] * pActor->t.t.mat.m[1][0]
|
||||||
|
- pActor->t.t.mat.m[1][1] * pActor->t.t.mat.m[2][0];
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: br_uint_32 __cdecl LollipopizeChildren(br_actor *pActor, void *pArg)
|
// IDA: br_uint_32 __cdecl LollipopizeChildren(br_actor *pActor, void *pArg)
|
||||||
br_uint_32 LollipopizeChildren(br_actor* pActor, void* pArg) {
|
intptr_t LollipopizeChildren(br_actor* pActor, void* pArg) {
|
||||||
tMatrix_and_actor* maa;
|
tMatrix_and_actor* maa;
|
||||||
LOG_TRACE("(%p, %p)", pActor, pArg);
|
LOG_TRACE("(%p, %p)", pActor, pArg);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
maa = pArg;
|
||||||
|
LollipopizeActor4(pActor, maa->m, maa->a);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __usercall DrawColumns(int pDraw_blends@<EAX>, tTrack_spec *pTrack_spec@<EDX>, int pMin_x@<EBX>, int pMax_x@<ECX>, int pMin_z, int pMax_z, br_matrix34 *pCamera_to_world)
|
// IDA: void __usercall DrawColumns(int pDraw_blends@<EAX>, tTrack_spec *pTrack_spec@<EDX>, int pMin_x@<EBX>, int pMax_x@<ECX>, int pMin_z, int pMax_z, br_matrix34 *pCamera_to_world)
|
||||||
|
@ -204,7 +214,73 @@ void DrawColumns(int pDraw_blends, tTrack_spec* pTrack_spec, int pMin_x, int pMa
|
||||||
tMatrix_and_actor maa;
|
tMatrix_and_actor maa;
|
||||||
br_actor* blended_polys;
|
br_actor* blended_polys;
|
||||||
LOG_TRACE("(%d, %p, %d, %d, %d, %d, %p)", pDraw_blends, pTrack_spec, pMin_x, pMax_x, pMin_z, pMax_z, pCamera_to_world);
|
LOG_TRACE("(%d, %p, %d, %d, %d, %d, %p)", pDraw_blends, pTrack_spec, pMin_x, pMax_x, pMin_z, pMax_z, pCamera_to_world);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
maa.m = pCamera_to_world;
|
||||||
|
if (fabs(pCamera_to_world->m[2][2]) >= fabs(pCamera_to_world->m[2][0])) {
|
||||||
|
for (column_z = pMin_z; column_z <= pMax_z; ++column_z) {
|
||||||
|
for (column_x = pMin_x; column_x <= pMax_x; ++column_x) {
|
||||||
|
if (pCamera_to_world->m[2][0] <= 0.0) {
|
||||||
|
column_x2 = pMin_x + pMax_x - column_x;
|
||||||
|
} else {
|
||||||
|
column_x2 = column_x;
|
||||||
|
}
|
||||||
|
if (pCamera_to_world->m[2][2] <= 0.0) {
|
||||||
|
column_z2 = pMax_z + pMin_z - column_z;
|
||||||
|
} else {
|
||||||
|
column_z2 = column_z;
|
||||||
|
}
|
||||||
|
if (pDraw_blends) {
|
||||||
|
blended_polys = pTrack_spec->blends[column_z2][column_x2];
|
||||||
|
if (blended_polys) {
|
||||||
|
blended_polys->render_style = BR_RSTYLE_FACES;
|
||||||
|
BrZbSceneRenderAdd(blended_polys);
|
||||||
|
blended_polys->render_style = BR_RSTYLE_NONE;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (pTrack_spec->columns[column_z2][column_x2]) {
|
||||||
|
BrZbSceneRenderAdd(pTrack_spec->columns[column_z2][column_x2]);
|
||||||
|
}
|
||||||
|
if (pTrack_spec->lollipops[column_z2][column_x2]) {
|
||||||
|
maa.a = pTrack_spec->lollipops[column_z2][column_x2];
|
||||||
|
BrActorEnum(pTrack_spec->lollipops[column_z2][column_x2], LollipopizeChildren, &maa);
|
||||||
|
BrZbSceneRenderAdd(pTrack_spec->lollipops[column_z2][column_x2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (column_x = pMin_x; column_x <= pMax_x; ++column_x) {
|
||||||
|
for (column_z = pMin_z; column_z <= pMax_z; ++column_z) {
|
||||||
|
if (pCamera_to_world->m[2][0] <= 0.0) {
|
||||||
|
column_x2 = pMin_x + pMax_x - column_x;
|
||||||
|
} else {
|
||||||
|
column_x2 = column_x;
|
||||||
|
}
|
||||||
|
if (pCamera_to_world->m[2][2] <= 0.0) {
|
||||||
|
column_z2 = pMax_z + pMin_z - column_z;
|
||||||
|
} else {
|
||||||
|
column_z2 = column_z;
|
||||||
|
}
|
||||||
|
if (pDraw_blends) {
|
||||||
|
blended_polys = pTrack_spec->blends[column_z2][column_x2];
|
||||||
|
if (blended_polys) {
|
||||||
|
blended_polys->render_style = 4;
|
||||||
|
BrZbSceneRenderAdd(blended_polys);
|
||||||
|
blended_polys->render_style = 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (pTrack_spec->columns[column_z2][column_x2]) {
|
||||||
|
BrZbSceneRenderAdd(pTrack_spec->columns[column_z2][column_x2]);
|
||||||
|
}
|
||||||
|
if (pTrack_spec->lollipops[column_z2][column_x2]) {
|
||||||
|
maa.a = pTrack_spec->lollipops[column_z2][column_x2];
|
||||||
|
BrActorEnum(pTrack_spec->lollipops[column_z2][column_x2], LollipopizeChildren, &maa);
|
||||||
|
BrZbSceneRenderAdd(pTrack_spec->lollipops[column_z2][column_x2]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __usercall RenderTrack(br_actor *pWorld@<EAX>, tTrack_spec *pTrack_spec@<EDX>, br_actor *pCamera@<EBX>, br_matrix34 *pCamera_to_world@<ECX>, int pRender_blends)
|
// IDA: void __usercall RenderTrack(br_actor *pWorld@<EAX>, tTrack_spec *pTrack_spec@<EDX>, br_actor *pCamera@<EBX>, br_matrix34 *pCamera_to_world@<ECX>, int pRender_blends)
|
||||||
|
@ -222,7 +298,107 @@ void RenderTrack(br_actor* pWorld, tTrack_spec* pTrack_spec, br_actor* pCamera,
|
||||||
static br_actor* result;
|
static br_actor* result;
|
||||||
LOG_TRACE("(%p, %p, %p, %p, %d)", pWorld, pTrack_spec, pCamera, pCamera_to_world, pRender_blends);
|
LOG_TRACE("(%p, %p, %p, %p, %d)", pWorld, pTrack_spec, pCamera, pCamera_to_world, pRender_blends);
|
||||||
|
|
||||||
BrZbSceneRenderAdd(pWorld);
|
if (pTrack_spec->columns) {
|
||||||
|
if (pRender_blends) {
|
||||||
|
DrawColumns(1, pTrack_spec, min_x, max_x, min_z, max_z, pCamera_to_world);
|
||||||
|
} else {
|
||||||
|
camera = (br_camera*)pCamera->type_data;
|
||||||
|
XZToColumnXZ(&column_x, &column_z, pCamera_to_world->m[3][0], pCamera_to_world->m[3][2], pTrack_spec);
|
||||||
|
min_x = column_x;
|
||||||
|
max_x = column_x;
|
||||||
|
min_z = column_z;
|
||||||
|
max_z = column_z;
|
||||||
|
tan_fov_ish = sin(BrAngleToRadian(camera->field_of_view / 2)) / cos(BrAngleToRadian(camera->field_of_view / 2));
|
||||||
|
edge_after.v[0] = camera->aspect * tan_fov_ish;
|
||||||
|
edge_after.v[1] = tan_fov_ish;
|
||||||
|
edge_after.v[2] = -1.0;
|
||||||
|
edge_before.v[0] = camera->yon_z * gYon_factor * edge_after.v[0];
|
||||||
|
edge_before.v[1] = camera->yon_z * gYon_factor * tan_fov_ish;
|
||||||
|
edge_before.v[2] = camera->yon_z * gYon_factor * -1.0;
|
||||||
|
BrMatrix34ApplyV(&edge_after, &edge_before, pCamera_to_world);
|
||||||
|
XZToColumnXZ(&column_x, &column_z, pCamera_to_world->m[3][0] + edge_after.v[0], pCamera_to_world->m[3][2] + edge_after.v[2], pTrack_spec);
|
||||||
|
if (column_x >= min_x) {
|
||||||
|
if (column_x > max_x) {
|
||||||
|
max_x = column_x;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
min_x = column_x;
|
||||||
|
}
|
||||||
|
if (column_z >= min_z) {
|
||||||
|
if (column_z > max_z) {
|
||||||
|
max_z = column_z;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
min_z = column_z;
|
||||||
|
}
|
||||||
|
edge_before.v[0] = -edge_before.v[0];
|
||||||
|
BrMatrix34ApplyV(&edge_after, &edge_before, pCamera_to_world);
|
||||||
|
XZToColumnXZ(&column_x, &column_z, pCamera_to_world->m[3][0] + edge_after.v[0], pCamera_to_world->m[3][2] + edge_after.v[2], pTrack_spec);
|
||||||
|
if (column_x >= min_x) {
|
||||||
|
if (column_x > max_x) {
|
||||||
|
max_x = column_x;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
min_x = column_x;
|
||||||
|
}
|
||||||
|
if (column_z >= min_z) {
|
||||||
|
if (column_z > max_z) {
|
||||||
|
max_z = column_z;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
min_z = column_z;
|
||||||
|
}
|
||||||
|
edge_before.v[1] = -edge_before.v[1];
|
||||||
|
BrMatrix34ApplyV(&edge_after, &edge_before, pCamera_to_world);
|
||||||
|
XZToColumnXZ(&column_x, &column_z, pCamera_to_world->m[3][0] + edge_after.v[0], pCamera_to_world->m[3][2] + edge_after.v[2], pTrack_spec);
|
||||||
|
if (column_x >= min_x) {
|
||||||
|
if (column_x > max_x) {
|
||||||
|
max_x = column_x;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
min_x = column_x;
|
||||||
|
}
|
||||||
|
if (column_z >= min_z) {
|
||||||
|
if (column_z > max_z) {
|
||||||
|
max_z = column_z;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
min_z = column_z;
|
||||||
|
}
|
||||||
|
edge_before.v[0] = -edge_before.v[0];
|
||||||
|
BrMatrix34ApplyV(&edge_after, &edge_before, pCamera_to_world);
|
||||||
|
XZToColumnXZ(&column_x, &column_z, pCamera_to_world->m[3][0] + edge_after.v[0], pCamera_to_world->m[3][2] + edge_after.v[2], pTrack_spec);
|
||||||
|
if (column_x >= min_x) {
|
||||||
|
if (column_x > max_x) {
|
||||||
|
max_x = column_x;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
min_x = column_x;
|
||||||
|
}
|
||||||
|
if (column_z >= min_z) {
|
||||||
|
if (column_z > max_z) {
|
||||||
|
max_z = column_z;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
min_z = column_z;
|
||||||
|
}
|
||||||
|
if (min_x) {
|
||||||
|
min_x--;
|
||||||
|
}
|
||||||
|
if (pTrack_spec->ncolumns_x - 1 > max_x) {
|
||||||
|
max_x++;
|
||||||
|
}
|
||||||
|
if (min_z) {
|
||||||
|
min_z--;
|
||||||
|
}
|
||||||
|
if (pTrack_spec->ncolumns_z - 1 > max_z) {
|
||||||
|
max_z++;
|
||||||
|
}
|
||||||
|
DrawColumns(0, pTrack_spec, min_x, max_x, min_z, max_z, pCamera_to_world);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
BrZbSceneRenderAdd(pWorld);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: br_scalar __cdecl GetYonFactor()
|
// IDA: br_scalar __cdecl GetYonFactor()
|
||||||
|
|
|
@ -27,7 +27,7 @@ void ExtractColumns(tTrack_spec* pTrack_spec);
|
||||||
|
|
||||||
void LollipopizeActor4(br_actor* pActor, br_matrix34* pRef_to_world, br_actor* pCamera);
|
void LollipopizeActor4(br_actor* pActor, br_matrix34* pRef_to_world, br_actor* pCamera);
|
||||||
|
|
||||||
br_uint_32 LollipopizeChildren(br_actor* pActor, void* pArg);
|
/*br_uint_32*/ intptr_t LollipopizeChildren(br_actor* pActor, void* pArg);
|
||||||
|
|
||||||
void DrawColumns(int pDraw_blends, tTrack_spec* pTrack_spec, int pMin_x, int pMax_x, int pMin_z, int pMax_z, br_matrix34* pCamera_to_world);
|
void DrawColumns(int pDraw_blends, tTrack_spec* pTrack_spec, int pMin_x, int pMax_x, int pMin_z, int pMax_z, br_matrix34* pCamera_to_world);
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -7,18 +7,22 @@
|
||||||
#include "flicplay.h"
|
#include "flicplay.h"
|
||||||
#include "globvars.h"
|
#include "globvars.h"
|
||||||
#include "globvrkm.h"
|
#include "globvrkm.h"
|
||||||
|
#include "globvrpb.h"
|
||||||
#include "graphics.h"
|
#include "graphics.h"
|
||||||
#include "harness.h"
|
#include "harness.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "loadsave.h"
|
#include "loadsave.h"
|
||||||
#include "mainloop.h"
|
#include "mainloop.h"
|
||||||
#include "netgame.h"
|
#include "netgame.h"
|
||||||
|
#include "network.h"
|
||||||
#include "pd/sys.h"
|
#include "pd/sys.h"
|
||||||
#include "pedestrn.h"
|
#include "pedestrn.h"
|
||||||
#include "pratcam.h"
|
#include "pratcam.h"
|
||||||
|
#include "replay.h"
|
||||||
#include "sound.h"
|
#include "sound.h"
|
||||||
#include "structur.h"
|
#include "structur.h"
|
||||||
#include "utility.h"
|
#include "utility.h"
|
||||||
|
#include "world.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
tCheat gKev_keys[44] = {
|
tCheat gKev_keys[44] = {
|
||||||
|
@ -60,10 +64,10 @@ tCheat gKev_keys[44] = {
|
||||||
{ .code = 0x2BA3F603, .code2 = 0x29F2425C, .action_proc = GetPowerup, .num = 38 },
|
{ .code = 0x2BA3F603, .code2 = 0x29F2425C, .action_proc = GetPowerup, .num = 38 },
|
||||||
{ .code = 0x416EFF61, .code2 = 0x2667DF4B, .action_proc = GetPowerup, .num = 39 },
|
{ .code = 0x416EFF61, .code2 = 0x2667DF4B, .action_proc = GetPowerup, .num = 39 },
|
||||||
{ .code = 0x2554125C, .code2 = 0x393CA35D, .action_proc = GetPowerup, .num = 41 },
|
{ .code = 0x2554125C, .code2 = 0x393CA35D, .action_proc = GetPowerup, .num = 41 },
|
||||||
{ .code = 0x3FFF84D5, .code2 = 0x84A42DF4, .action_proc = GetPowerup, .num = 41 },
|
{ .code = 0x3FFF84D5, .code2 = 0x84A42DF4, .action_proc = GetPowerup, .num = 42 },
|
||||||
{ .code = 0x37E83018, .code2 = 0xB609AEE6, .action_proc = GetPowerup, .num = 42 },
|
{ .code = 0x37E83018, .code2 = 0xB609AEE6, .action_proc = GetPowerup, .num = 43 },
|
||||||
{ .code = 0x2DB03B19, .code2 = 0x924A84B7, .action_proc = GetPowerup, .num = 43 },
|
{ .code = 0x2DB03B19, .code2 = 0x924A84B7, .action_proc = GetPowerup, .num = 44 },
|
||||||
{ .code = 0x30A19FAB, .code2 = 0x2B0C2782, .action_proc = GetPowerup, .num = 44 },
|
{ .code = 0x30A19FAB, .code2 = 0x2B0C2782, .action_proc = GetPowerup, .num = 45 },
|
||||||
{ .code = 0x0, .code2 = 0x0, .action_proc = 0x0, .num = 0x0 }
|
{ .code = 0x0, .code2 = 0x0, .action_proc = 0x0, .num = 0x0 }
|
||||||
};
|
};
|
||||||
char* gAbuse_text[10];
|
char* gAbuse_text[10];
|
||||||
|
@ -167,7 +171,9 @@ void EnsureSpecialVolumesHidden() {
|
||||||
void ShowSpecialVolumesIfRequ() {
|
void ShowSpecialVolumesIfRequ() {
|
||||||
LOG_TRACE("()");
|
LOG_TRACE("()");
|
||||||
|
|
||||||
STUB();
|
if (gWhich_edit_mode == eEdit_mode_spec_vol) {
|
||||||
|
ShowSpecialVolumes();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __usercall DoEditModeKey(int pIndex@<EAX>)
|
// IDA: void __usercall DoEditModeKey(int pIndex@<EAX>)
|
||||||
|
@ -797,10 +803,24 @@ void CheckKevKeys() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gKev_keys[i].action_proc == 0) {
|
if (gKev_keys[i].action_proc) {
|
||||||
return;
|
if (gNet_mode) {
|
||||||
|
if (gKev_keys[i].num == 0xA11EE75D) {
|
||||||
|
strcpy(s, gNet_players[gThis_net_player_index].player_name);
|
||||||
|
strcat(s, " ");
|
||||||
|
strcat(s, GetMiscString(225));
|
||||||
|
NetSendHeadupToEverybody(s);
|
||||||
|
gKev_keys[i].action_proc(gKev_keys[i].num);
|
||||||
|
} else {
|
||||||
|
strcpy(s, gNet_players[gThis_net_player_index].player_name);
|
||||||
|
strcat(s, " ");
|
||||||
|
strcat(s, GetMiscString(224));
|
||||||
|
NetSendHeadupToAllPlayers(s);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
gKev_keys[i].action_proc(gKev_keys[i].num);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
gKev_keys[i].action_proc(gKev_keys[i].num);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __cdecl BrakeInstantly()
|
// IDA: void __cdecl BrakeInstantly()
|
||||||
|
@ -822,7 +842,92 @@ void PollCarControls(tU32 pTime_difference) {
|
||||||
tCar_spec* c;
|
tCar_spec* c;
|
||||||
LOG_TRACE("(%d)", pTime_difference);
|
LOG_TRACE("(%d)", pTime_difference);
|
||||||
|
|
||||||
SILENT_STUB();
|
c = &gProgram_state.current_car;
|
||||||
|
|
||||||
|
memset(&keys, 0, sizeof(tCar_controls));
|
||||||
|
joystick.left = -1;
|
||||||
|
joystick.right = -1;
|
||||||
|
joystick.acc = -1;
|
||||||
|
joystick.dec = -1;
|
||||||
|
if (gEntering_message) {
|
||||||
|
memset(&c->keys, 0, sizeof(tCar_controls));
|
||||||
|
c->joystick.left = -1;
|
||||||
|
c->joystick.right = -1;
|
||||||
|
c->joystick.acc = -1;
|
||||||
|
c->joystick.dec = -1;
|
||||||
|
} else {
|
||||||
|
if (gKey_mapping[46] >= 115 || gKey_mapping[47] >= 115) {
|
||||||
|
joystick.left = gJoy_array[gKey_mapping[46] - 115];
|
||||||
|
joystick.right = gJoy_array[gKey_mapping[47] - 115];
|
||||||
|
if (joystick.left < 0 && joystick.right < 0) {
|
||||||
|
joystick.left = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (KeyIsDown(46)) {
|
||||||
|
keys.left = 1;
|
||||||
|
}
|
||||||
|
if (KeyIsDown(47)) {
|
||||||
|
keys.right = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (KeyIsDown(12)) {
|
||||||
|
keys.holdw = 1;
|
||||||
|
}
|
||||||
|
if (KeyIsDown(53) || gRace_finished) {
|
||||||
|
if (!gInstant_handbrake || gRace_finished) {
|
||||||
|
keys.brake = 1;
|
||||||
|
} else {
|
||||||
|
BrakeInstantly();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (gKey_mapping[48] < 115) {
|
||||||
|
if (KeyIsDown(48) && !gRace_finished && !c->knackered && !gWait_for_it) {
|
||||||
|
keys.acc = 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
joystick.acc = gJoy_array[gKey_mapping[48] - 115];
|
||||||
|
if (joystick.acc > 0xFFFF) {
|
||||||
|
joystick.acc = 0xFFFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (gKey_mapping[49] < 115) {
|
||||||
|
if (KeyIsDown(49) && !gRace_finished && !c->knackered && !gWait_for_it) {
|
||||||
|
keys.dec = 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
joystick.dec = gJoy_array[gKey_mapping[49] - 115];
|
||||||
|
if (joystick.dec > 0xFFFF) {
|
||||||
|
joystick.dec = 0xFFFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (KeyIsDown(55) && c->gear >= 0) {
|
||||||
|
keys.change_down = 1;
|
||||||
|
c->just_changed_gear = 1;
|
||||||
|
if (keys.acc || joystick.acc > 32000) {
|
||||||
|
c->traction_control = 0;
|
||||||
|
} else if (c->gear > 1 && !c->keys.change_down) {
|
||||||
|
--c->gear;
|
||||||
|
}
|
||||||
|
if (gCountdown && !c->keys.change_down) {
|
||||||
|
JumpTheStart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (gCar_flying) {
|
||||||
|
if (KeyIsDown(13)) {
|
||||||
|
keys.up = 1;
|
||||||
|
}
|
||||||
|
if (KeyIsDown(11)) {
|
||||||
|
keys.down = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (KeyIsDown(58)) {
|
||||||
|
if (!gEntering_message) {
|
||||||
|
keys.horn = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
c->keys = keys;
|
||||||
|
c->joystick = joystick;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __usercall PollCameraControls(tU32 pTime_difference@<EAX>)
|
// IDA: void __usercall PollCameraControls(tU32 pTime_difference@<EAX>)
|
||||||
|
@ -833,10 +938,68 @@ void PollCameraControls(tU32 pTime_difference) {
|
||||||
int swirl_mode;
|
int swirl_mode;
|
||||||
int up_and_down_mode;
|
int up_and_down_mode;
|
||||||
int going_up;
|
int going_up;
|
||||||
static int last_swirl_mode;
|
static int last_swirl_mode = 0;
|
||||||
LOG_TRACE("(%d)", pTime_difference);
|
LOG_TRACE("(%d)", pTime_difference);
|
||||||
|
|
||||||
SILENT_STUB();
|
flag = 0;
|
||||||
|
swirl_mode = gRace_finished && !gAction_replay_mode && (&gProgram_state.current_car == gCar_to_view || gCar_to_view->knackered);
|
||||||
|
up_and_down_mode = swirl_mode && !gCamera_has_collided;
|
||||||
|
going_up = gCamera_zoom > 1.0;
|
||||||
|
if (last_swirl_mode != swirl_mode) {
|
||||||
|
if (swirl_mode) {
|
||||||
|
SaveCameraPosition(0);
|
||||||
|
} else {
|
||||||
|
RestoreCameraPosition(0);
|
||||||
|
}
|
||||||
|
last_swirl_mode = swirl_mode;
|
||||||
|
}
|
||||||
|
if (!gMap_mode && !gProgram_state.cockpit_on && (!gAction_replay_mode || gAction_replay_camera_mode <= eAction_replay_standard)) {
|
||||||
|
if (KeyIsDown(31) || (up_and_down_mode && !going_up)) {
|
||||||
|
gCamera_zoom = (double)pTime_difference * TIME_CONV_THING / (double)(2 * swirl_mode + 1) + gCamera_zoom;
|
||||||
|
if (gCamera_zoom > 2.0) {
|
||||||
|
gCamera_zoom = 2.0;
|
||||||
|
}
|
||||||
|
if (up_and_down_mode && gCamera_zoom > 1.0) {
|
||||||
|
gCamera_zoom = 1.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (KeyIsDown(30) || (up_and_down_mode && going_up)) {
|
||||||
|
gCamera_zoom = gCamera_zoom - (double)pTime_difference * TIME_CONV_THING / (double)(2 * swirl_mode + 1);
|
||||||
|
if (gCamera_zoom < 0.1) {
|
||||||
|
gCamera_zoom = 0.1;
|
||||||
|
if (up_and_down_mode) {
|
||||||
|
if (gCamera_zoom < 1.0) {
|
||||||
|
gCamera_zoom = 1.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (swirl_mode && gProgram_state.current_car.speedo_speed < 0.001449275362318841) {
|
||||||
|
left = 1;
|
||||||
|
right = 0;
|
||||||
|
} else {
|
||||||
|
left = KeyIsDown(32);
|
||||||
|
right = KeyIsDown(33);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((gCamera_sign ? left : right)) {
|
||||||
|
if (!gCamera_reset) {
|
||||||
|
gCamera_yaw += BrDegreeToAngle(pTime_difference * 0.050000001);
|
||||||
|
}
|
||||||
|
flag = 1;
|
||||||
|
}
|
||||||
|
if ((gCamera_sign ? right : left)) {
|
||||||
|
if (!gCamera_reset) {
|
||||||
|
gCamera_yaw -= BrDegreeToAngle(pTime_difference * 0.050000001);
|
||||||
|
}
|
||||||
|
if (flag) {
|
||||||
|
gCamera_yaw = 0;
|
||||||
|
gCamera_reset = 1;
|
||||||
|
}
|
||||||
|
} else if (!flag) {
|
||||||
|
gCamera_reset = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __usercall SetFlag2(int i@<EAX>)
|
// IDA: void __usercall SetFlag2(int i@<EAX>)
|
||||||
|
@ -1051,7 +1214,7 @@ void DrawSomeText2(tDR_font* pFont) {
|
||||||
}
|
}
|
||||||
|
|
||||||
PDScreenBufferSwap(0);
|
PDScreenBufferSwap(0);
|
||||||
//PrintScreen();
|
PrintScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __cdecl DrawSomeText()
|
// IDA: void __cdecl DrawSomeText()
|
||||||
|
|
|
@ -248,7 +248,8 @@ void DamageUnit2(tCar_spec* pCar, int pUnit_type, int pDamage_amount) {
|
||||||
void RecordLastDamage(tCar_spec* pCar) {
|
void RecordLastDamage(tCar_spec* pCar) {
|
||||||
int i;
|
int i;
|
||||||
LOG_TRACE("(%p)", pCar);
|
LOG_TRACE("(%p)", pCar);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
STUB();
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __usercall DoDamage(tCar_spec *pCar@<EAX>, tDamage_type pDamage_type@<EDX>, float pMagnitude, float pNastiness)
|
// IDA: void __usercall DoDamage(tCar_spec *pCar@<EAX>, tDamage_type pDamage_type@<EDX>, float pMagnitude, float pNastiness)
|
||||||
|
@ -326,7 +327,8 @@ tImpact_location GetDirection(br_vector3* pVelocity) {
|
||||||
void SetSmokeLastDamageLevel(tCar_spec* pCar) {
|
void SetSmokeLastDamageLevel(tCar_spec* pCar) {
|
||||||
int i;
|
int i;
|
||||||
LOG_TRACE("(%p)", pCar);
|
LOG_TRACE("(%p)", pCar);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
STUB();
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __usercall SortOutSmoke(tCar_spec *pCar@<EAX>)
|
// IDA: void __usercall SortOutSmoke(tCar_spec *pCar@<EAX>)
|
||||||
|
|
|
@ -29,7 +29,6 @@ void DoSCILogo() {
|
||||||
// IDA: void __cdecl DoStainlessLogo()
|
// IDA: void __cdecl DoStainlessLogo()
|
||||||
void DoStainlessLogo() {
|
void DoStainlessLogo() {
|
||||||
LOG_TRACE("()");
|
LOG_TRACE("()");
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __usercall PlaySmackerFile(char *pSmack_name@<EAX>)
|
// IDA: void __usercall PlaySmackerFile(char *pSmack_name@<EAX>)
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
#include "displays.h"
|
#include "displays.h"
|
||||||
#include "brender.h"
|
#include "brender.h"
|
||||||
|
#include "constants.h"
|
||||||
#include "flicplay.h"
|
#include "flicplay.h"
|
||||||
#include "globvars.h"
|
#include "globvars.h"
|
||||||
|
#include "globvrkm.h"
|
||||||
#include "globvrpb.h"
|
#include "globvrpb.h"
|
||||||
#include "graphics.h"
|
#include "graphics.h"
|
||||||
#include "netgame.h"
|
#include "netgame.h"
|
||||||
|
@ -797,7 +799,25 @@ void DoFancyHeadup(int pIndex) {
|
||||||
tHeadup* the_headup;
|
tHeadup* the_headup;
|
||||||
int temp_ref;
|
int temp_ref;
|
||||||
LOG_TRACE("(%d)", pIndex);
|
LOG_TRACE("(%d)", pIndex);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
STUB();
|
||||||
|
return; // some bits are not implemented below
|
||||||
|
|
||||||
|
the_time = GetTotalTime();
|
||||||
|
if (!gMap_mode && (gLast_fancy_index < 0 || the_time - gLast_fancy_time > 2000 || gLast_fancy_index <= pIndex)) {
|
||||||
|
temp_ref = NewImageHeadupSlot(6, 0, 2000, pIndex + 10);
|
||||||
|
if (temp_ref >= 0) {
|
||||||
|
gLast_fancy_headup = temp_ref;
|
||||||
|
gLast_fancy_index = pIndex;
|
||||||
|
gLast_fancy_time = the_time;
|
||||||
|
the_headup = &gHeadups[temp_ref];
|
||||||
|
the_headup->type = eHeadup_fancy;
|
||||||
|
the_headup->data.fancy_info.offset = (the_headup->data.image_info.image->width + gBack_screen->width) / 2;
|
||||||
|
the_headup->data.fancy_info.end_offset = -the_headup->data.fancy_info.offset;
|
||||||
|
the_headup->data.fancy_info.fancy_stage = eFancy_stage_incoming;
|
||||||
|
the_headup->data.fancy_info.shear_amount = the_headup->data.image_info.image->height;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __cdecl AdjustHeadups()
|
// IDA: void __cdecl AdjustHeadups()
|
||||||
|
@ -876,7 +896,24 @@ void DoDamageScreen(tU32 pThe_time) {
|
||||||
// IDA: void __cdecl PoshDrawLine(float pAngle, br_pixelmap *pDestn, int pX1, int pY1, int pX2, int pY2, int pColour)
|
// IDA: void __cdecl PoshDrawLine(float pAngle, br_pixelmap *pDestn, int pX1, int pY1, int pX2, int pY2, int pColour)
|
||||||
void PoshDrawLine(float pAngle, br_pixelmap* pDestn, int pX1, int pY1, int pX2, int pY2, int pColour) {
|
void PoshDrawLine(float pAngle, br_pixelmap* pDestn, int pX1, int pY1, int pX2, int pY2, int pColour) {
|
||||||
LOG_TRACE("(%f, %p, %d, %d, %d, %d, %d)", pAngle, pDestn, pX1, pY1, pX2, pY2, pColour);
|
LOG_TRACE("(%f, %p, %d, %d, %d, %d, %d)", pAngle, pDestn, pX1, pY1, pX2, pY2, pColour);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
if (pColour < 0) {
|
||||||
|
if (pAngle >= 0.785 && pAngle <= 5.498 && (pAngle <= 2.356 || pAngle >= 3.926)) {
|
||||||
|
if ((pAngle <= 0.785 || pAngle >= 1.57) && (pAngle <= 3.926 || pAngle >= 4.712)) {
|
||||||
|
DRDrawLine(pDestn, pX1 - 1, pY1, pX2 - 1, pY2, -pColour - 1);
|
||||||
|
DRDrawLine(pDestn, pX1 + 1, pY1, pX2 + 1, pY2, 1 - pColour);
|
||||||
|
} else {
|
||||||
|
DRDrawLine(pDestn, pX1 - 1, pY1, pX2 - 1, pY2, 1 - pColour);
|
||||||
|
DRDrawLine(pDestn, pX1 + 1, pY1, pX2 + 1, pY2, -pColour - 1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
DRDrawLine(pDestn, pX1, pY1 + 1, pX2, pY2 + 1, -pColour - 1);
|
||||||
|
DRDrawLine(pDestn, pX1, pY1 - 1, pX2, pY2 - 1, 1 - pColour);
|
||||||
|
}
|
||||||
|
DRDrawLine(pDestn, pX1, pY1, pX2, pY2, -pColour);
|
||||||
|
} else {
|
||||||
|
DRDrawLine(pDestn, pX1, pY1, pX2, pY2, pColour);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __usercall DoInstruments(tU32 pThe_time@<EAX>)
|
// IDA: void __usercall DoInstruments(tU32 pThe_time@<EAX>)
|
||||||
|
@ -892,7 +929,217 @@ void DoInstruments(tU32 pThe_time) {
|
||||||
double cos_angle;
|
double cos_angle;
|
||||||
double speed_mph;
|
double speed_mph;
|
||||||
LOG_TRACE("(%d)", pThe_time);
|
LOG_TRACE("(%d)", pThe_time);
|
||||||
SILENT_STUB();
|
|
||||||
|
if (gProgram_state.current_car_index == gProgram_state.current_car.index) {
|
||||||
|
speed_mph = gCar_to_view->speedo_speed * 6.9000001 / 1600.0 * 3600000.0;
|
||||||
|
if (speed_mph < 0.0) {
|
||||||
|
speed_mph = 0.0;
|
||||||
|
}
|
||||||
|
if (gProgram_state.cockpit_on && gProgram_state.cockpit_image_index >= 0) {
|
||||||
|
if (gProgram_state.which_view != eView_forward) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
the_wobble_x = gScreen_wobble_x;
|
||||||
|
the_wobble_y = gScreen_wobble_y;
|
||||||
|
} else {
|
||||||
|
the_wobble_x = 0;
|
||||||
|
the_wobble_y = 0;
|
||||||
|
}
|
||||||
|
tacho_image = gProgram_state.current_car.tacho_image[gProgram_state.cockpit_on];
|
||||||
|
if (gProgram_state.current_car.tacho_radius_2[gProgram_state.cockpit_on] >= 0) {
|
||||||
|
if (gCar_to_view->red_line >= gCar_to_view->revs) {
|
||||||
|
the_angle = DEG_TO_RAD((double)(gProgram_state.current_car.tacho_end_angle[gProgram_state.cockpit_on] - gProgram_state.current_car.tacho_start_angle[gProgram_state.cockpit_on]) * gCar_to_view->revs / (double)gCar_to_view->red_line + (double)gProgram_state.current_car.tacho_start_angle[gProgram_state.cockpit_on]);
|
||||||
|
} else {
|
||||||
|
the_angle = DEG_TO_RAD((double)gProgram_state.current_car.tacho_end_angle[gProgram_state.cockpit_on]);
|
||||||
|
}
|
||||||
|
if (the_angle >= 0.0) {
|
||||||
|
if (the_angle >= 6.283185307179586) {
|
||||||
|
the_angle = the_angle - 6.283185307179586;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
the_angle = the_angle + 6.283185307179586;
|
||||||
|
}
|
||||||
|
the_angle2 = 1.570796326794897 - the_angle;
|
||||||
|
if (the_angle2 < 0) {
|
||||||
|
the_angle2 = the_angle2 + 6.283185307179586;
|
||||||
|
}
|
||||||
|
if (the_angle2 <= 4.71238898038469) {
|
||||||
|
if (the_angle2 <= DR_PI) {
|
||||||
|
if (the_angle2 <= 1.570796326794897) {
|
||||||
|
cos_angle = gCosine_array[(unsigned int)(the_angle2 / DR_PI * 128.0)];
|
||||||
|
} else {
|
||||||
|
cos_angle = -gCosine_array[(unsigned int)((DR_PI - the_angle2) / DR_PI * 128.0)];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cos_angle = -gCosine_array[(unsigned int)((the_angle2 - DR_PI) / DR_PI * 128.0)];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cos_angle = gCosine_array[(unsigned int)((6.283185307179586 - the_angle2) / DR_PI * 128.0)];
|
||||||
|
}
|
||||||
|
if (the_angle <= 4.71238898038469) {
|
||||||
|
if (the_angle <= DR_PI) {
|
||||||
|
if (the_angle <= 1.570796326794897) {
|
||||||
|
sin_angle = gCosine_array[(unsigned int)(the_angle / DR_PI * 128.0)];
|
||||||
|
} else {
|
||||||
|
sin_angle = -gCosine_array[(unsigned int)((DR_PI - the_angle) / DR_PI * 128.0)];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sin_angle = -gCosine_array[(unsigned int)((the_angle - DR_PI) / DR_PI * 128.0)];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sin_angle = gCosine_array[(unsigned int)((6.283185307179586 - the_angle) / DR_PI * 128.0)];
|
||||||
|
}
|
||||||
|
if (tacho_image) {
|
||||||
|
DRPixelmapRectangleMaskedCopy(
|
||||||
|
gBack_screen,
|
||||||
|
the_wobble_x + gProgram_state.current_car.tacho_x[gProgram_state.cockpit_on],
|
||||||
|
the_wobble_y + gProgram_state.current_car.tacho_y[gProgram_state.cockpit_on],
|
||||||
|
tacho_image,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
tacho_image->width,
|
||||||
|
tacho_image->height);
|
||||||
|
}
|
||||||
|
|
||||||
|
PoshDrawLine(
|
||||||
|
the_angle,
|
||||||
|
gBack_screen,
|
||||||
|
((double)gProgram_state.current_car.tacho_radius_1[gProgram_state.cockpit_on] * sin_angle
|
||||||
|
+ (double)gProgram_state.current_car.tacho_centre_x[gProgram_state.cockpit_on]
|
||||||
|
+ (double)the_wobble_x),
|
||||||
|
((double)gProgram_state.current_car.tacho_centre_y[gProgram_state.cockpit_on]
|
||||||
|
- (double)gProgram_state.current_car.tacho_radius_1[gProgram_state.cockpit_on] * cos_angle
|
||||||
|
+ (double)the_wobble_y),
|
||||||
|
((double)gProgram_state.current_car.tacho_radius_2[gProgram_state.cockpit_on] * sin_angle
|
||||||
|
+ (double)gProgram_state.current_car.tacho_centre_x[gProgram_state.cockpit_on]
|
||||||
|
+ (double)the_wobble_x),
|
||||||
|
((double)gProgram_state.current_car.tacho_centre_y[gProgram_state.cockpit_on]
|
||||||
|
- (double)gProgram_state.current_car.tacho_radius_2[gProgram_state.cockpit_on] * cos_angle
|
||||||
|
+ (double)the_wobble_y),
|
||||||
|
gProgram_state.current_car.tacho_needle_colour[gProgram_state.cockpit_on]);
|
||||||
|
} else if (tacho_image) {
|
||||||
|
BrPixelmapRectangleCopy(
|
||||||
|
gBack_screen,
|
||||||
|
the_wobble_x + gProgram_state.current_car.tacho_x[gProgram_state.cockpit_on],
|
||||||
|
the_wobble_y + gProgram_state.current_car.tacho_y[gProgram_state.cockpit_on],
|
||||||
|
gProgram_state.current_car.tacho_image[gProgram_state.cockpit_on],
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
((gCar_to_view->revs - 1.0) / (double)gCar_to_view->red_line * (double)gProgram_state.current_car.tacho_image[gProgram_state.cockpit_on]->width + 1.0),
|
||||||
|
gProgram_state.current_car.tacho_image[gProgram_state.cockpit_on]->height);
|
||||||
|
}
|
||||||
|
if (!gProgram_state.cockpit_on || gProgram_state.cockpit_image_index < 0 || gProgram_state.which_view == eView_forward) {
|
||||||
|
if (gCar_to_view->gear < 0) {
|
||||||
|
gear = -1;
|
||||||
|
} else {
|
||||||
|
gear = gCar_to_view->gear;
|
||||||
|
}
|
||||||
|
DRPixelmapRectangleMaskedCopy(
|
||||||
|
gBack_screen,
|
||||||
|
the_wobble_x + gProgram_state.current_car.gear_x[gProgram_state.cockpit_on],
|
||||||
|
the_wobble_y + gProgram_state.current_car.gear_y[gProgram_state.cockpit_on],
|
||||||
|
gProgram_state.current_car.gears_image,
|
||||||
|
0,
|
||||||
|
(gear + 1) * ((int)gProgram_state.current_car.gears_image->height >> 3),
|
||||||
|
gProgram_state.current_car.gears_image->width,
|
||||||
|
(int)gProgram_state.current_car.gears_image->height >> 3);
|
||||||
|
}
|
||||||
|
speedo_image = gProgram_state.current_car.speedo_image[gProgram_state.cockpit_on];
|
||||||
|
if (gProgram_state.current_car.speedo_radius_2[gProgram_state.cockpit_on] >= 0) {
|
||||||
|
if (speedo_image && (!gProgram_state.cockpit_on || gProgram_state.cockpit_image_index < 0)) {
|
||||||
|
DRPixelmapRectangleMaskedCopy(
|
||||||
|
gBack_screen,
|
||||||
|
the_wobble_x + gProgram_state.current_car.speedo_x[gProgram_state.cockpit_on],
|
||||||
|
the_wobble_y + gProgram_state.current_car.speedo_y[gProgram_state.cockpit_on],
|
||||||
|
speedo_image,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
speedo_image->width,
|
||||||
|
speedo_image->height);
|
||||||
|
}
|
||||||
|
if ((double)gProgram_state.current_car.max_speed >= speed_mph) {
|
||||||
|
the_angle = DEG_TO_RAD((double)(gProgram_state.current_car.speedo_end_angle[gProgram_state.cockpit_on] - gProgram_state.current_car.speedo_start_angle[gProgram_state.cockpit_on]) * speed_mph / (double)gProgram_state.current_car.max_speed + (double)gProgram_state.current_car.speedo_start_angle[gProgram_state.cockpit_on]);
|
||||||
|
} else {
|
||||||
|
the_angle = DEG_TO_RAD((double)gProgram_state.current_car.speedo_end_angle[gProgram_state.cockpit_on]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (the_angle >= 0.0) {
|
||||||
|
if (the_angle >= 6.283185307179586) {
|
||||||
|
the_angle = the_angle - 6.283185307179586;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
the_angle = the_angle + 6.283185307179586;
|
||||||
|
}
|
||||||
|
the_angle2 = 1.570796326794897 - the_angle;
|
||||||
|
if (the_angle2 < 0.0) {
|
||||||
|
the_angle2 = the_angle2 + 6.283185307179586;
|
||||||
|
}
|
||||||
|
if (the_angle2 <= 4.71238898038469) {
|
||||||
|
if (the_angle2 <= DR_PI) {
|
||||||
|
if (the_angle2 <= 1.570796326794897) {
|
||||||
|
cos_angle = gCosine_array[(unsigned int)(the_angle2 / DR_PI * 128.0)];
|
||||||
|
} else {
|
||||||
|
cos_angle = -gCosine_array[(unsigned int)((DR_PI - the_angle2) / DR_PI * 128.0)];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cos_angle = -gCosine_array[(unsigned int)((the_angle2 - DR_PI) / DR_PI * 128.0)];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cos_angle = gCosine_array[(unsigned int)((6.283185307179586 - the_angle2) / DR_PI * 128.0)];
|
||||||
|
}
|
||||||
|
if (the_angle <= 4.71238898038469) {
|
||||||
|
if (the_angle <= DR_PI) {
|
||||||
|
if (the_angle <= 1.570796326794897) {
|
||||||
|
sin_angle = gCosine_array[(unsigned int)(the_angle / DR_PI * 128.0)];
|
||||||
|
} else {
|
||||||
|
sin_angle = -gCosine_array[(unsigned int)((DR_PI - the_angle) / DR_PI * 128.0)];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sin_angle = -gCosine_array[(unsigned int)((the_angle - DR_PI) / DR_PI * 128.0)];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sin_angle = gCosine_array[(unsigned int)((6.283185307179586 - the_angle) / DR_PI * 128.0)];
|
||||||
|
}
|
||||||
|
|
||||||
|
PoshDrawLine(
|
||||||
|
the_angle,
|
||||||
|
gBack_screen,
|
||||||
|
((double)gProgram_state.current_car.speedo_radius_1[gProgram_state.cockpit_on] * sin_angle
|
||||||
|
+ (double)gProgram_state.current_car.speedo_centre_x[gProgram_state.cockpit_on]
|
||||||
|
+ (double)the_wobble_x),
|
||||||
|
((double)gProgram_state.current_car.speedo_centre_y[gProgram_state.cockpit_on]
|
||||||
|
- (double)gProgram_state.current_car.speedo_radius_1[gProgram_state.cockpit_on] * cos_angle
|
||||||
|
+ (double)the_wobble_y),
|
||||||
|
((double)gProgram_state.current_car.speedo_radius_2[gProgram_state.cockpit_on] * sin_angle
|
||||||
|
+ (double)gProgram_state.current_car.speedo_centre_x[gProgram_state.cockpit_on]
|
||||||
|
+ (double)the_wobble_x),
|
||||||
|
((double)gProgram_state.current_car.speedo_centre_y[gProgram_state.cockpit_on]
|
||||||
|
- (double)gProgram_state.current_car.speedo_radius_2[gProgram_state.cockpit_on] * cos_angle
|
||||||
|
+ (double)the_wobble_y),
|
||||||
|
gProgram_state.current_car.speedo_needle_colour[gProgram_state.cockpit_on]);
|
||||||
|
if (speedo_image && gProgram_state.cockpit_on && gProgram_state.cockpit_image_index >= 0) {
|
||||||
|
DRPixelmapRectangleMaskedCopy(
|
||||||
|
gBack_screen,
|
||||||
|
the_wobble_x + gProgram_state.current_car.speedo_x[gProgram_state.cockpit_on],
|
||||||
|
the_wobble_y + gProgram_state.current_car.speedo_y[gProgram_state.cockpit_on],
|
||||||
|
speedo_image,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
speedo_image->width,
|
||||||
|
speedo_image->height);
|
||||||
|
}
|
||||||
|
} else if (speedo_image) {
|
||||||
|
DrawNumberAt(
|
||||||
|
speedo_image,
|
||||||
|
the_wobble_x + gProgram_state.current_car.speedo_x[gProgram_state.cockpit_on],
|
||||||
|
the_wobble_y + gProgram_state.current_car.speedo_y[gProgram_state.cockpit_on],
|
||||||
|
gProgram_state.current_car.speedo_x_pitch[gProgram_state.cockpit_on],
|
||||||
|
gProgram_state.current_car.speedo_y_pitch[gProgram_state.cockpit_on],
|
||||||
|
speed_mph,
|
||||||
|
3,
|
||||||
|
1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __usercall DoSteeringWheel(tU32 pThe_time@<EAX>)
|
// IDA: void __usercall DoSteeringWheel(tU32 pThe_time@<EAX>)
|
||||||
|
@ -916,13 +1163,15 @@ void EarnCredits2(int pAmount, char* pPrefix_text) {
|
||||||
int original_amount;
|
int original_amount;
|
||||||
tU32 the_time;
|
tU32 the_time;
|
||||||
LOG_TRACE("(%d, \"%s\")", pAmount, pPrefix_text);
|
LOG_TRACE("(%d, \"%s\")", pAmount, pPrefix_text);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
STUB();
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __usercall EarnCredits(int pAmount@<EAX>)
|
// IDA: void __usercall EarnCredits(int pAmount@<EAX>)
|
||||||
void EarnCredits(int pAmount) {
|
void EarnCredits(int pAmount) {
|
||||||
LOG_TRACE("(%d)", pAmount);
|
LOG_TRACE("(%d)", pAmount);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
EarnCredits2(pAmount, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: int __usercall SpendCredits@<EAX>(int pAmount@<EAX>)
|
// IDA: int __usercall SpendCredits@<EAX>(int pAmount@<EAX>)
|
||||||
|
|
|
@ -446,7 +446,102 @@ void MultiRayCheckSingleFace(int pNum_rays, tFace_ref* pFace, br_vector3* ray_po
|
||||||
double f_numerator;
|
double f_numerator;
|
||||||
br_material* this_material;
|
br_material* this_material;
|
||||||
LOG_TRACE("(%d, %p, %p, %p, %p, %p)", pNum_rays, pFace, ray_pos, ray_dir, normal, rt);
|
LOG_TRACE("(%d, %p, %p, %p, %p, %p)", pNum_rays, pFace, ray_pos, ray_dir, normal, rt);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
this_material = pFace->material;
|
||||||
|
d = ray_dir->v[2] * pFace->normal.v[2] + ray_dir->v[1] * pFace->normal.v[1] + ray_dir->v[0] * pFace->normal.v[0];
|
||||||
|
for (i = 0; i < pNum_rays; ++i) {
|
||||||
|
rt[i] = 100.0;
|
||||||
|
}
|
||||||
|
if ((!this_material || (this_material->flags & 0x1800) != 0 || d <= 0.0)
|
||||||
|
&& (!this_material || !this_material->identifier || *this_material->identifier != '!' || !gPling_materials)
|
||||||
|
&& fabs(d) >= 0.00000023841858) {
|
||||||
|
for (i = 0;; ++i) {
|
||||||
|
if (i >= pNum_rays) {
|
||||||
|
axis_m = fabs(pFace->normal.v[0]) < fabs(pFace->normal.v[1]);
|
||||||
|
if (fabs(pFace->normal.v[2]) > fabs(pFace->normal.v[axis_m])) {
|
||||||
|
axis_m = 2;
|
||||||
|
}
|
||||||
|
if (axis_m) {
|
||||||
|
axis_0 = 0;
|
||||||
|
if (axis_m == 1) {
|
||||||
|
axis_1 = 2;
|
||||||
|
} else {
|
||||||
|
axis_1 = 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
axis_0 = 1;
|
||||||
|
axis_1 = 2;
|
||||||
|
}
|
||||||
|
v0i1 = pFace->v[0].v[axis_0];
|
||||||
|
v0i2 = pFace->v[0].v[axis_1];
|
||||||
|
u1 = pFace->v[1].v[axis_0] - v0i1;
|
||||||
|
v1 = pFace->v[1].v[axis_1] - v0i2;
|
||||||
|
u2 = pFace->v[2].v[axis_0] - v0i1;
|
||||||
|
v2 = pFace->v[2].v[axis_1] - v0i2;
|
||||||
|
i = 0;
|
||||||
|
while (1) {
|
||||||
|
if (i >= pNum_rays) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (t[i] != 100.0) {
|
||||||
|
u0[i] = p[i].v[axis_0] - v0i1;
|
||||||
|
v0[i] = p[i].v[axis_1] - v0i2;
|
||||||
|
if (fabs(u1) <= 0.0000002384185791015625) {
|
||||||
|
alpha = u0[i] / u2;
|
||||||
|
beta = v0[i] - alpha * v2;
|
||||||
|
f_d = beta / v1;
|
||||||
|
goto LABEL_43;
|
||||||
|
}
|
||||||
|
f_numerator = v0[i] * u1 - u0[i] * v1;
|
||||||
|
f_n = v2 * u1 - v1 * u2;
|
||||||
|
if (f_n != 0) {
|
||||||
|
alpha = f_numerator / f_n;
|
||||||
|
beta = u0[i] - alpha * u2;
|
||||||
|
f_d = beta / u1;
|
||||||
|
LABEL_43:
|
||||||
|
if (f_d >= -0.0001 && alpha >= -0.0001 && alpha + f_d <= 1.0001) {
|
||||||
|
rt[i] = t[i];
|
||||||
|
*normal = pFace->normal;
|
||||||
|
if (d > 0.0) {
|
||||||
|
normal->v[0] = -pFace->normal.v[0];
|
||||||
|
normal->v[1] = -pFace->normal.v[1];
|
||||||
|
normal->v[2] = -pFace->normal.v[2];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
++i;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tv.v[0] = ray_pos[i].v[0] - pFace->v[0].v[0];
|
||||||
|
tv.v[1] = ray_pos[i].v[1] - pFace->v[0].v[1];
|
||||||
|
tv.v[2] = ray_pos[i].v[2] - pFace->v[0].v[2];
|
||||||
|
numerator = pFace->normal.v[2] * tv.v[2] + pFace->normal.v[1] * tv.v[1] + pFace->normal.v[0] * tv.v[0];
|
||||||
|
if (BadDiv_finteray(numerator, d)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (d > 0.0) {
|
||||||
|
if (-numerator < -0.001 || -numerator > d + 0.003) {
|
||||||
|
t[i] = 100.0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
} else if (numerator < -0.001 || 0.003 - d < numerator) {
|
||||||
|
t[i] = 100.0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
t[i] = -(numerator / d);
|
||||||
|
if (t[i] > 1.0) {
|
||||||
|
t[i] = 1.0;
|
||||||
|
}
|
||||||
|
p[i].v[0] = t[i] * ray_dir->v[0];
|
||||||
|
p[i].v[1] = t[i] * ray_dir->v[1];
|
||||||
|
p[i].v[2] = t[i] * ray_dir->v[2];
|
||||||
|
p[i].v[0] = ray_pos[i].v[0] + p[i].v[0];
|
||||||
|
p[i].v[1] = ray_pos[i].v[1] + p[i].v[1];
|
||||||
|
p[i].v[2] = ray_pos[i].v[2] + p[i].v[2];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __usercall GetNewBoundingBox(br_bounds *b2@<EAX>, br_bounds *b1@<EDX>, br_matrix34 *m@<EBX>)
|
// IDA: void __usercall GetNewBoundingBox(br_bounds *b2@<EAX>, br_bounds *b1@<EDX>, br_matrix34 *m@<EBX>)
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
#include "br_types.h"
|
#include "br_types.h"
|
||||||
#include "dr_types.h"
|
#include "dr_types.h"
|
||||||
|
|
||||||
|
extern tFace_ref* gPling_face;
|
||||||
|
|
||||||
int BadDiv_finteray(br_scalar a, br_scalar b);
|
int BadDiv_finteray(br_scalar a, br_scalar b);
|
||||||
|
|
||||||
void DRVector2AccumulateScale_finteray(br_vector2* a, br_vector2* b, br_scalar s);
|
void DRVector2AccumulateScale_finteray(br_vector2* a, br_vector2* b, br_scalar s);
|
||||||
|
|
|
@ -130,7 +130,7 @@ int gCountdown;
|
||||||
int gFrame_rate;
|
int gFrame_rate;
|
||||||
int gNumber_of_racers;
|
int gNumber_of_racers;
|
||||||
int gSound_enabled;
|
int gSound_enabled;
|
||||||
int gInfo_on = 1;
|
int gInfo_on;
|
||||||
int gGraf_spec_index = 0;
|
int gGraf_spec_index = 0;
|
||||||
int gTyping;
|
int gTyping;
|
||||||
int gSound_available;
|
int gSound_available;
|
||||||
|
|
|
@ -213,13 +213,15 @@ void DRDrawLine(br_pixelmap* pDestn, int pX1, int pY1, int pX2, int pY2, int pCo
|
||||||
int y;
|
int y;
|
||||||
int the_diff;
|
int the_diff;
|
||||||
LOG_TRACE("(%p, %d, %d, %d, %d, %d)", pDestn, pX1, pY1, pX2, pY2, pColour);
|
LOG_TRACE("(%p, %d, %d, %d, %d, %d)", pDestn, pX1, pY1, pX2, pY2, pColour);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
BrPixelmapLine(pDestn, pX1, pY1, pX2, pY2, pColour);
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __usercall DrawDigitAt(br_pixelmap *gImage@<EAX>, int pX@<EDX>, int pY@<EBX>, int pY_pitch@<ECX>, int pValue)
|
// IDA: void __usercall DrawDigitAt(br_pixelmap *gImage@<EAX>, int pX@<EDX>, int pY@<EBX>, int pY_pitch@<ECX>, int pValue)
|
||||||
void DrawDigitAt(br_pixelmap* gImage, int pX, int pY, int pY_pitch, int pValue) {
|
void DrawDigitAt(br_pixelmap* gImage, int pX, int pY, int pY_pitch, int pValue) {
|
||||||
LOG_TRACE("(%p, %d, %d, %d, %d)", gImage, pX, pY, pY_pitch, pValue);
|
LOG_TRACE("(%p, %d, %d, %d, %d)", gImage, pX, pY, pY_pitch, pValue);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
DRPixelmapRectangleMaskedCopy(gBack_screen, pX, pY, gImage, 0, pY_pitch * pValue, gImage->width, pY_pitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __usercall DrawNumberAt(br_pixelmap *gImage@<EAX>, int pX@<EDX>, int pY@<EBX>, int pX_pitch@<ECX>, int pY_pitch, int pValue, int pDigit_count, int pLeading_zeroes)
|
// IDA: void __usercall DrawNumberAt(br_pixelmap *gImage@<EAX>, int pX@<EDX>, int pY@<EBX>, int pX_pitch@<ECX>, int pY_pitch, int pValue, int pDigit_count, int pLeading_zeroes)
|
||||||
|
@ -227,7 +229,14 @@ void DrawNumberAt(br_pixelmap* gImage, int pX, int pY, int pX_pitch, int pY_pitc
|
||||||
int i;
|
int i;
|
||||||
int the_value;
|
int the_value;
|
||||||
LOG_TRACE("(%p, %d, %d, %d, %d, %d, %d, %d)", gImage, pX, pY, pX_pitch, pY_pitch, pValue, pDigit_count, pLeading_zeroes);
|
LOG_TRACE("(%p, %d, %d, %d, %d, %d, %d, %d)", gImage, pX, pY, pX_pitch, pY_pitch, pValue, pDigit_count, pLeading_zeroes);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
for (i = pDigit_count - 1; i >= 0; i--) {
|
||||||
|
the_value = pValue % 10;
|
||||||
|
pValue /= 10;
|
||||||
|
if (pValue || pLeading_zeroes || pDigit_count - 1 == i) {
|
||||||
|
DrawDigitAt(gImage, pX + pX_pitch * i, pY, pY_pitch, the_value);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __usercall BuildColourTable(br_pixelmap *pPalette@<EAX>)
|
// IDA: void __usercall BuildColourTable(br_pixelmap *pPalette@<EAX>)
|
||||||
|
@ -851,6 +860,11 @@ void RenderAFrame(int pDepth_mask_on) {
|
||||||
tCar_spec* car;
|
tCar_spec* car;
|
||||||
LOG_TRACE("(%d)", pDepth_mask_on);
|
LOG_TRACE("(%d)", pDepth_mask_on);
|
||||||
|
|
||||||
|
static int frame_counter;
|
||||||
|
|
||||||
|
frame_counter++;
|
||||||
|
//LOG_DEBUG("%d", frame_counter);
|
||||||
|
|
||||||
gRender_screen->pixels = gBack_screen->pixels;
|
gRender_screen->pixels = gBack_screen->pixels;
|
||||||
the_time = GetTotalTime();
|
the_time = GetTotalTime();
|
||||||
old_pixels = gRender_screen->pixels;
|
old_pixels = gRender_screen->pixels;
|
||||||
|
|
|
@ -55,13 +55,10 @@ void PollKeys() {
|
||||||
void CyclePollKeys() {
|
void CyclePollKeys() {
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < 123; i++) {
|
for (i = 0; i < 123; i++) {
|
||||||
|
|
||||||
if (gKey_array[i] > gKey_poll_counter) {
|
if (gKey_array[i] > gKey_poll_counter) {
|
||||||
gKey_array[i] = 0;
|
gKey_array[i] = 0;
|
||||||
if (i > 115) {
|
if (i > 115) {
|
||||||
// TOOD: this does _something_, but we cannot figure out what..
|
gJoy_array[i - 115] = -1; // yes this is a little weird I know...
|
||||||
// eax+1361D4h = -1
|
|
||||||
// gFonts[20].width_table[v1 + 141] = -1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,14 +67,24 @@ void CyclePollKeys() {
|
||||||
|
|
||||||
// IDA: void __cdecl ResetPollKeys()
|
// IDA: void __cdecl ResetPollKeys()
|
||||||
void ResetPollKeys() {
|
void ResetPollKeys() {
|
||||||
memset(gKey_array, 0, sizeof(gKey_array));
|
int i;
|
||||||
memset(gJoy_array, 0, sizeof(gJoy_array));
|
for (i = 0; i < 123; i++) {
|
||||||
|
gKey_array[i] = 0;
|
||||||
|
}
|
||||||
|
for (i = 0; i < 8; i++) {
|
||||||
|
gJoy_array[i] = -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __cdecl CheckKeysForMouldiness()
|
// IDA: void __cdecl CheckKeysForMouldiness()
|
||||||
void CheckKeysForMouldiness() {
|
void CheckKeysForMouldiness() {
|
||||||
LOG_TRACE("()");
|
LOG_TRACE9("()");
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
if ((PDGetTotalTime() - gLast_poll_keys) > 500) {
|
||||||
|
ResetPollKeys();
|
||||||
|
CyclePollKeys();
|
||||||
|
PollKeys();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: int __cdecl EitherMouseButtonDown()
|
// IDA: int __cdecl EitherMouseButtonDown()
|
||||||
|
@ -89,20 +96,15 @@ int EitherMouseButtonDown() {
|
||||||
// IDA: tKey_down_result __usercall PDKeyDown2@<EAX>(int pKey_index@<EAX>)
|
// IDA: tKey_down_result __usercall PDKeyDown2@<EAX>(int pKey_index@<EAX>)
|
||||||
tKey_down_result PDKeyDown2(int pKey_index) {
|
tKey_down_result PDKeyDown2(int pKey_index) {
|
||||||
tU32 the_time;
|
tU32 the_time;
|
||||||
if (/*!s3_timer_started_maybe[0] ||*/ (PDGetTotalTime() - gLast_poll_keys) > 500) {
|
|
||||||
ResetPollKeys();
|
|
||||||
CyclePollKeys();
|
|
||||||
PollKeys();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
CheckKeysForMouldiness();
|
||||||
if (!gEdge_trigger_mode) {
|
if (!gEdge_trigger_mode) {
|
||||||
return gKey_array[pKey_index];
|
return gKey_array[pKey_index];
|
||||||
}
|
}
|
||||||
the_time = PDGetTotalTime();
|
the_time = PDGetTotalTime();
|
||||||
|
|
||||||
if (gKey_array[pKey_index]) {
|
if (gKey_array[pKey_index]) {
|
||||||
if (pKey_index == gLast_key_down) {
|
if (gLast_key_down == pKey_index) {
|
||||||
if ((the_time - gLast_key_down_time) < 300) {
|
if (the_time - gLast_key_down_time < 300) {
|
||||||
return tKey_down_still;
|
return tKey_down_still;
|
||||||
} else {
|
} else {
|
||||||
gLast_key_down_time = the_time;
|
gLast_key_down_time = the_time;
|
||||||
|
@ -113,13 +115,12 @@ tKey_down_result PDKeyDown2(int pKey_index) {
|
||||||
gLast_key_down = pKey_index;
|
gLast_key_down = pKey_index;
|
||||||
return tKey_down_yes;
|
return tKey_down_yes;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (pKey_index == gLast_key_down) {
|
|
||||||
gLast_key_down_time = 0;
|
|
||||||
gLast_key_down = -1;
|
|
||||||
}
|
|
||||||
return tKey_down_no;
|
|
||||||
}
|
}
|
||||||
|
if (gLast_key_down == pKey_index) {
|
||||||
|
gLast_key_down_time = 0;
|
||||||
|
gLast_key_down = -1;
|
||||||
|
}
|
||||||
|
return tKey_down_no;
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: int __usercall PDKeyDown@<EAX>(int pKey_index@<EAX>)
|
// IDA: int __usercall PDKeyDown@<EAX>(int pKey_index@<EAX>)
|
||||||
|
@ -155,12 +156,8 @@ int PDAnyKeyDown() {
|
||||||
int i;
|
int i;
|
||||||
tKey_down_result result;
|
tKey_down_result result;
|
||||||
|
|
||||||
if (/*!s3_timer_started_maybe[0] ||*/ (PDGetTotalTime() - gLast_poll_keys) > 500) {
|
CheckKeysForMouldiness();
|
||||||
ResetPollKeys();
|
for (i = 122; i >= 0; --i) {
|
||||||
CyclePollKeys();
|
|
||||||
PollKeys();
|
|
||||||
}
|
|
||||||
for (i = 122; i >= 0; i--) {
|
|
||||||
if (gKey_array[i]) {
|
if (gKey_array[i]) {
|
||||||
if (!gEdge_trigger_mode) {
|
if (!gEdge_trigger_mode) {
|
||||||
return i;
|
return i;
|
||||||
|
@ -170,18 +167,17 @@ int PDAnyKeyDown() {
|
||||||
case tKey_down_no:
|
case tKey_down_no:
|
||||||
case tKey_down_still:
|
case tKey_down_still:
|
||||||
return -1;
|
return -1;
|
||||||
|
break;
|
||||||
case tKey_down_yes:
|
case tKey_down_yes:
|
||||||
case tKey_down_repeat:
|
case tKey_down_repeat:
|
||||||
return i;
|
return i;
|
||||||
default:
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gEdge_trigger_mode) {
|
if (gEdge_trigger_mode) {
|
||||||
gLast_key_down = -1;
|
|
||||||
gLast_key_down_time = 0;
|
gLast_key_down_time = 0;
|
||||||
|
gLast_key_down = -1;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -266,24 +262,19 @@ int OldKeyIsDown(int pKey_index) {
|
||||||
int KeyIsDown(int pKey_index) {
|
int KeyIsDown(int pKey_index) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (PDGetTotalTime() - gLast_poll_keys > 500) {
|
CheckKeysForMouldiness();
|
||||||
ResetPollKeys();
|
|
||||||
CyclePollKeys();
|
|
||||||
PollKeys();
|
|
||||||
}
|
|
||||||
if (pKey_index == -2) {
|
if (pKey_index == -2) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (pKey_index != -1) {
|
if (pKey_index != -1) {
|
||||||
return gKey_array[gKey_mapping[pKey_index]];
|
return gKey_array[gKey_mapping[pKey_index]];
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
if (gKey_array[gGo_ahead_keys[i]]) {
|
if (gKey_array[gGo_ahead_keys[i]]) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -489,6 +489,8 @@ tRace_result MainGameLoop() {
|
||||||
ForceRebuildActiveCarList();
|
ForceRebuildActiveCarList();
|
||||||
PrintMemoryDump(0, "ABOUT TO ENTER MAINLOOP");
|
PrintMemoryDump(0, "ABOUT TO ENTER MAINLOOP");
|
||||||
|
|
||||||
|
double last_time = GetTotalTime() / 1000.0;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
frame_start_time = GetTotalTime();
|
frame_start_time = GetTotalTime();
|
||||||
CyclePollKeys();
|
CyclePollKeys();
|
||||||
|
@ -605,6 +607,16 @@ tRace_result MainGameLoop() {
|
||||||
gProgram_state.prog_status = eProg_idling;
|
gProgram_state.prog_status = eProg_idling;
|
||||||
gAbandon_game = 0;
|
gAbandon_game = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Added to lock framerate to 30fps. Seems to help physics be less twitchy...
|
||||||
|
double secs = GetTotalTime() / 1000.0;
|
||||||
|
//LOG_DEBUG("timediff %f", secs - (last_time + (1.0 / 30.0)));
|
||||||
|
while (secs < last_time + (1.0 / 30.0)) {
|
||||||
|
//LOG_DEBUG("skipping time...");
|
||||||
|
secs = GetTotalTime() / 1000.0;
|
||||||
|
}
|
||||||
|
last_time += 1.0 / 30.0;
|
||||||
|
|
||||||
} while (gProgram_state.prog_status == eProg_game_ongoing
|
} while (gProgram_state.prog_status == eProg_game_ongoing
|
||||||
&& !MungeRaceFinished()
|
&& !MungeRaceFinished()
|
||||||
&& !gAbandon_game
|
&& !gAbandon_game
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "netgame.h"
|
#include "netgame.h"
|
||||||
#include "globvars.h"
|
#include "globvars.h"
|
||||||
|
#include "globvrpb.h"
|
||||||
#include "network.h"
|
#include "network.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
@ -24,7 +25,10 @@ void SendCarData(tU32 pNext_frame_time) {
|
||||||
tU32 time;
|
tU32 time;
|
||||||
int damaged_wheels;
|
int damaged_wheels;
|
||||||
LOG_TRACE("(%d)", pNext_frame_time);
|
LOG_TRACE("(%d)", pNext_frame_time);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
if (gNet_mode) {
|
||||||
|
TELL_ME_IF_WE_PASS_THIS_WAY();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __usercall ReceivedRecover(tNet_contents *pContents@<EAX>)
|
// IDA: void __usercall ReceivedRecover(tNet_contents *pContents@<EAX>)
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
#include "oil.h"
|
#include "oil.h"
|
||||||
#include "brender.h"
|
#include "brender.h"
|
||||||
#include "common/globvars.h"
|
#include "globvars.h"
|
||||||
#include "common/loading.h"
|
#include "loading.h"
|
||||||
|
#include "utility.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
int gNext_oil_pixie;
|
int gNext_oil_pixie;
|
||||||
|
@ -18,8 +19,11 @@ void InitOilSpills() {
|
||||||
br_material* the_material;
|
br_material* the_material;
|
||||||
LOG_TRACE("()");
|
LOG_TRACE("()");
|
||||||
|
|
||||||
gOil_pixies[0] = LoadPixelmap(gOil_pixie_names[0]);
|
for (i = 0; i < 1; i++) {
|
||||||
BrMapAdd(gOil_pixies[0]);
|
gOil_pixies[i] = LoadPixelmap(gOil_pixie_names[i]);
|
||||||
|
BrMapAdd(gOil_pixies[i]);
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < 15; i++) {
|
for (i = 0; i < 15; i++) {
|
||||||
the_material = BrMaterialAllocate(NULL);
|
the_material = BrMaterialAllocate(NULL);
|
||||||
BrMaterialAdd(the_material);
|
BrMaterialAdd(the_material);
|
||||||
|
@ -28,8 +32,9 @@ void InitOilSpills() {
|
||||||
the_material->ks = 0.0;
|
the_material->ks = 0.0;
|
||||||
the_material->power = 0.0;
|
the_material->power = 0.0;
|
||||||
the_material->index_base = 0;
|
the_material->index_base = 0;
|
||||||
//LOBYTE(the_material->flags) = v2 | 0x25;
|
the_material->flags |= 1u;
|
||||||
the_material->flags |= 0x25;
|
the_material->flags |= 0x20u;
|
||||||
|
the_material->flags |= 4u;
|
||||||
the_material->index_range = 0;
|
the_material->index_range = 0;
|
||||||
the_material->colour_map = 0;
|
the_material->colour_map = 0;
|
||||||
BrMatrix23Identity(&the_material->map_transform);
|
BrMatrix23Identity(&the_material->map_transform);
|
||||||
|
@ -166,20 +171,29 @@ void ProcessOilSpills(tU32 pFrame_period) {
|
||||||
|
|
||||||
// IDA: int __cdecl GetOilSpillCount()
|
// IDA: int __cdecl GetOilSpillCount()
|
||||||
int GetOilSpillCount() {
|
int GetOilSpillCount() {
|
||||||
LOG_TRACE("()");
|
//LOG_TRACE("()");
|
||||||
NOT_IMPLEMENTED();
|
return 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __usercall GetOilSpillDetails(int pIndex@<EAX>, br_actor **pActor@<EDX>, br_scalar *pSize@<EBX>)
|
// IDA: void __usercall GetOilSpillDetails(int pIndex@<EAX>, br_actor **pActor@<EDX>, br_scalar *pSize@<EBX>)
|
||||||
void GetOilSpillDetails(int pIndex, br_actor** pActor, br_scalar* pSize) {
|
void GetOilSpillDetails(int pIndex, br_actor** pActor, br_scalar* pSize) {
|
||||||
LOG_TRACE("(%d, %p, %p)", pIndex, pActor, pSize);
|
LOG_TRACE("(%d, %p, %p)", pIndex, pActor, pSize);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
if (gOily_spills[pIndex].car) {
|
||||||
|
*pActor = gOily_spills[pIndex].actor;
|
||||||
|
*pSize = gOily_spills[pIndex].full_size;
|
||||||
|
} else {
|
||||||
|
*pActor = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: int __usercall PointInSpill@<EAX>(br_vector3 *pV@<EAX>, int pSpill@<EDX>)
|
// IDA: int __usercall PointInSpill@<EAX>(br_vector3 *pV@<EAX>, int pSpill@<EDX>)
|
||||||
int PointInSpill(br_vector3* pV, int pSpill) {
|
int PointInSpill(br_vector3* pV, int pSpill) {
|
||||||
LOG_TRACE("(%p, %d)", pV, pSpill);
|
LOG_TRACE("(%p, %d)", pV, pSpill);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
return gOily_spills[pSpill].current_size * gOily_spills[pSpill].current_size * 0.80000001 > (pV->v[0] / 6.9000001 - gOily_spills[pSpill].actor->t.t.mat.m[3][0]) * (pV->v[0] / 6.9000001 - gOily_spills[pSpill].actor->t.t.mat.m[3][0])
|
||||||
|
&& gOily_spills[pSpill].current_size * gOily_spills[pSpill].current_size * 0.80000001 > (pV->v[2] / 6.9000001 - gOily_spills[pSpill].actor->t.t.mat.m[3][2]) * (pV->v[2] / 6.9000001 - gOily_spills[pSpill].actor->t.t.mat.m[3][2])
|
||||||
|
&& fabs(pV->v[1] / 6.9000001 - gOily_spills[pSpill].actor->t.t.mat.m[3][1]) < 0.1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __usercall GetOilFrictionFactors(tCar_spec *pCar@<EAX>, br_scalar *pFl_factor@<EDX>, br_scalar *pFr_factor@<EBX>, br_scalar *pRl_factor@<ECX>, br_scalar *pRr_factor)
|
// IDA: void __usercall GetOilFrictionFactors(tCar_spec *pCar@<EAX>, br_scalar *pFl_factor@<EDX>, br_scalar *pFr_factor@<EBX>, br_scalar *pRl_factor@<ECX>, br_scalar *pRr_factor)
|
||||||
|
@ -187,7 +201,47 @@ void GetOilFrictionFactors(tCar_spec* pCar, br_scalar* pFl_factor, br_scalar* pF
|
||||||
int i;
|
int i;
|
||||||
br_vector3 wheel_world;
|
br_vector3 wheel_world;
|
||||||
LOG_TRACE("(%p, %p, %p, %p, %p)", pCar, pFl_factor, pFr_factor, pRl_factor, pRr_factor);
|
LOG_TRACE("(%p, %p, %p, %p, %p)", pCar, pFl_factor, pFr_factor, pRl_factor, pRr_factor);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
*pFl_factor = 1.0;
|
||||||
|
*pFr_factor = 1.0;
|
||||||
|
*pRl_factor = 1.0;
|
||||||
|
*pRr_factor = 1.0;
|
||||||
|
if (pCar->driver > eDriver_non_car) {
|
||||||
|
if (pCar->shadow_intersection_flags) {
|
||||||
|
for (i = 0; i < 15; i++) {
|
||||||
|
if (((1 << i) & pCar->shadow_intersection_flags) != 0 && gOily_spills[i].car) {
|
||||||
|
BrMatrix34ApplyP(&wheel_world, &pCar->wpos[2], &pCar->car_master_actor->t.t.mat);
|
||||||
|
if (PointInSpill(&wheel_world, i)) {
|
||||||
|
pCar->oil_remaining[2] = SRandomBetween(1.5, 2.5);
|
||||||
|
}
|
||||||
|
BrMatrix34ApplyP(&wheel_world, &pCar->wpos[3], &pCar->car_master_actor->t.t.mat);
|
||||||
|
if (PointInSpill(&wheel_world, i)) {
|
||||||
|
pCar->oil_remaining[3] = SRandomBetween(1.5, 2.5);
|
||||||
|
}
|
||||||
|
BrMatrix34ApplyP(&wheel_world, &pCar->wpos[0], &pCar->car_master_actor->t.t.mat);
|
||||||
|
if (PointInSpill(&wheel_world, i)) {
|
||||||
|
pCar->oil_remaining[0] = SRandomBetween(1.5, 2.5);
|
||||||
|
}
|
||||||
|
BrMatrix34ApplyP(&wheel_world, &pCar->wpos[1], &pCar->car_master_actor->t.t.mat);
|
||||||
|
if (PointInSpill(&wheel_world, i)) {
|
||||||
|
pCar->oil_remaining[1] = SRandomBetween(1.5, 2.5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (pCar->oil_remaining[2] != 0.0) {
|
||||||
|
*pFl_factor = SRandomBetween(0.0099999998, 0.15000001);
|
||||||
|
}
|
||||||
|
if (pCar->oil_remaining[3] != 0.0) {
|
||||||
|
*pFr_factor = SRandomBetween(0.0099999998, 0.15000001);
|
||||||
|
}
|
||||||
|
if (pCar->oil_remaining[0] != 0.0) {
|
||||||
|
*pRl_factor = SRandomBetween(0.0099999998, 0.15000001);
|
||||||
|
}
|
||||||
|
if (pCar->oil_remaining[1] != 0.0) {
|
||||||
|
*pRr_factor = SRandomBetween(0.0099999998, 0.15000001);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __usercall AdjustOilSpill(int pIndex@<EAX>, br_matrix34 *pMat@<EDX>, br_scalar pFull_size, br_scalar pGrow_rate, tU32 pSpill_time, tU32 pStop_time, tCar_spec *pCar, br_vector3 *pOriginal_pos, br_pixelmap *pPixelmap)
|
// IDA: void __usercall AdjustOilSpill(int pIndex@<EAX>, br_matrix34 *pMat@<EDX>, br_scalar pFull_size, br_scalar pGrow_rate, tU32 pSpill_time, tU32 pStop_time, tCar_spec *pCar, br_vector3 *pOriginal_pos, br_pixelmap *pPixelmap)
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "car.h"
|
#include "car.h"
|
||||||
#include "errors.h"
|
#include "errors.h"
|
||||||
#include "globvars.h"
|
#include "globvars.h"
|
||||||
|
#include "globvrkm.h"
|
||||||
#include "globvrpb.h"
|
#include "globvrpb.h"
|
||||||
#include "loading.h"
|
#include "loading.h"
|
||||||
#include "pd/sys.h"
|
#include "pd/sys.h"
|
||||||
|
@ -528,13 +529,64 @@ void RebuildActiveCarList() {
|
||||||
int i;
|
int i;
|
||||||
tCar_spec* car_spec;
|
tCar_spec* car_spec;
|
||||||
LOG_TRACE("()");
|
LOG_TRACE("()");
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
if (gActive_car_list_rebuild_required) {
|
||||||
|
gActive_car_list_rebuild_required = 0;
|
||||||
|
gNum_active_cars = 0;
|
||||||
|
|
||||||
|
if (!gProgram_state.current_car.disabled || gAction_replay_mode) {
|
||||||
|
gActive_car_list[gNum_active_cars++] = &gProgram_state.current_car;
|
||||||
|
gProgram_state.current_car.active = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gNet_mode == eNet_mode_host) {
|
||||||
|
for (i = 0; i < GetCarCount(eVehicle_net_player); i++) {
|
||||||
|
car_spec = GetCarSpec(eVehicle_net_player, i);
|
||||||
|
if (car_spec->disabled) {
|
||||||
|
car_spec->active = 0;
|
||||||
|
} else {
|
||||||
|
gActive_car_list[gNum_active_cars++] = car_spec;
|
||||||
|
car_spec->active = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (gNet_mode == eNet_mode_client) {
|
||||||
|
for (i = 0; i < GetCarCount(eVehicle_net_player); i++) {
|
||||||
|
car_spec = GetCarSpec(eVehicle_net_player, i);
|
||||||
|
if (car_spec->disabled || !IsNetCarActive(&car_spec->car_master_actor->t.t.translate.t)) {
|
||||||
|
car_spec->active = 0;
|
||||||
|
} else {
|
||||||
|
gActive_car_list[gNum_active_cars++] = car_spec;
|
||||||
|
car_spec->active = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (i = 0; i < gProgram_state.AI_vehicles.number_of_opponents; i++) {
|
||||||
|
car_spec = GetCarSpec(eVehicle_opponent, i);
|
||||||
|
if (gProgram_state.AI_vehicles.opponents[i].physics_me || gAction_replay_mode) {
|
||||||
|
gActive_car_list[gNum_active_cars++] = car_spec;
|
||||||
|
car_spec->active = 1;
|
||||||
|
} else {
|
||||||
|
car_spec->active = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (i = 0; gNumber_of_cops_before_faffage > i; ++i) {
|
||||||
|
car_spec = GetCarSpec(eVehicle_rozzer, i);
|
||||||
|
if (gProgram_state.AI_vehicles.cops[i].physics_me || gAction_replay_mode) {
|
||||||
|
gActive_car_list[gNum_active_cars++] = car_spec;
|
||||||
|
car_spec->active = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __cdecl ForceRebuildActiveCarList()
|
// IDA: void __cdecl ForceRebuildActiveCarList()
|
||||||
void ForceRebuildActiveCarList() {
|
void ForceRebuildActiveCarList() {
|
||||||
LOG_TRACE("()");
|
LOG_TRACE("()");
|
||||||
STUB();
|
|
||||||
|
gActive_car_list_rebuild_required = 1;
|
||||||
|
if (gProgram_state.racing) {
|
||||||
|
RebuildActiveCarList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __usercall StartToCheat(tOpponent_spec *pOpponent_spec@<EAX>)
|
// IDA: void __usercall StartToCheat(tOpponent_spec *pOpponent_spec@<EAX>)
|
||||||
|
|
|
@ -100,7 +100,8 @@ void StartPipingSession2(tPipe_chunk_type pThe_type, int pMunge_reentrancy) {
|
||||||
// IDA: void __usercall StartPipingSession(tPipe_chunk_type pThe_type@<EAX>)
|
// IDA: void __usercall StartPipingSession(tPipe_chunk_type pThe_type@<EAX>)
|
||||||
void StartPipingSession(tPipe_chunk_type pThe_type) {
|
void StartPipingSession(tPipe_chunk_type pThe_type) {
|
||||||
LOG_TRACE("(%d)", pThe_type);
|
LOG_TRACE("(%d)", pThe_type);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
SILENT_STUB();
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __usercall EndPipingSession2(int pMunge_reentrancy@<EAX>)
|
// IDA: void __usercall EndPipingSession2(int pMunge_reentrancy@<EAX>)
|
||||||
|
@ -113,7 +114,8 @@ void EndPipingSession2(int pMunge_reentrancy) {
|
||||||
// IDA: void __cdecl EndPipingSession()
|
// IDA: void __cdecl EndPipingSession()
|
||||||
void EndPipingSession() {
|
void EndPipingSession() {
|
||||||
LOG_TRACE("()");
|
LOG_TRACE("()");
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
SILENT_STUB();
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __usercall AddDataToSession(int pSubject_index@<EAX>, void *pData@<EDX>, tU32 pData_length@<EBX>)
|
// IDA: void __usercall AddDataToSession(int pSubject_index@<EAX>, void *pData@<EDX>, tU32 pData_length@<EBX>)
|
||||||
|
@ -207,7 +209,8 @@ void AddFlameToPipingSession(int pIndex, int pFrame_count, br_scalar pScale_x, b
|
||||||
void AddSplashToPipingSession(tCollision_info* pCar) {
|
void AddSplashToPipingSession(tCollision_info* pCar) {
|
||||||
tPipe_splash_data data;
|
tPipe_splash_data data;
|
||||||
LOG_TRACE("(%p)", pCar);
|
LOG_TRACE("(%p)", pCar);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
SILENT_STUB();
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __usercall AddOilSpillToPipingSession(int pIndex@<EAX>, br_matrix34 *pMat@<EDX>, br_scalar pFull_size, br_scalar pGrow_rate, tU32 pSpill_time, tU32 pStop_time, tCar_spec *pCar, br_vector3 *pOriginal_pos, br_pixelmap *pPixelmap)
|
// IDA: void __usercall AddOilSpillToPipingSession(int pIndex@<EAX>, br_matrix34 *pMat@<EDX>, br_scalar pFull_size, br_scalar pGrow_rate, tU32 pSpill_time, tU32 pStop_time, tCar_spec *pCar, br_vector3 *pOriginal_pos, br_pixelmap *pPixelmap)
|
||||||
|
|
|
@ -19,19 +19,25 @@ int gCurrent_pratcam_alternative;
|
||||||
// IDA: int __cdecl PratcamGetCurrent()
|
// IDA: int __cdecl PratcamGetCurrent()
|
||||||
int PratcamGetCurrent() {
|
int PratcamGetCurrent() {
|
||||||
LOG_TRACE("()");
|
LOG_TRACE("()");
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
SILENT_STUB();
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: int __cdecl PratcamGetAmbient()
|
// IDA: int __cdecl PratcamGetAmbient()
|
||||||
int PratcamGetAmbient() {
|
int PratcamGetAmbient() {
|
||||||
LOG_TRACE("()");
|
LOG_TRACE("()");
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
SILENT_STUB();
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: int __cdecl PratcamGetPending()
|
// IDA: int __cdecl PratcamGetPending()
|
||||||
int PratcamGetPending() {
|
int PratcamGetPending() {
|
||||||
LOG_TRACE("()");
|
LOG_TRACE("()");
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
SILENT_STUB();
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __cdecl TogglePratcam()
|
// IDA: void __cdecl TogglePratcam()
|
||||||
|
|
|
@ -40,8 +40,9 @@ tAction_replay_camera_type gAction_replay_camera_mode;
|
||||||
|
|
||||||
// IDA: int __cdecl ReplayIsPaused()
|
// IDA: int __cdecl ReplayIsPaused()
|
||||||
int ReplayIsPaused() {
|
int ReplayIsPaused() {
|
||||||
LOG_TRACE("()");
|
LOG_TRACE8("()");
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
return gReplay_rate == 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: float __cdecl GetReplayRate()
|
// IDA: float __cdecl GetReplayRate()
|
||||||
|
|
|
@ -165,7 +165,8 @@ void SkidMark(tCar_spec* pCar, int pWheel_num) {
|
||||||
int on_ground;
|
int on_ground;
|
||||||
br_material* material;
|
br_material* material;
|
||||||
LOG_TRACE("(%p, %d)", pCar, pWheel_num);
|
LOG_TRACE("(%p, %d)", pCar, pWheel_num);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
SILENT_STUB();
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __usercall InitCarSkidStuff(tCar_spec *pCar@<EAX>)
|
// IDA: void __usercall InitCarSkidStuff(tCar_spec *pCar@<EAX>)
|
||||||
|
|
|
@ -379,7 +379,8 @@ void GenerateContinuousSmoke(tCar_spec* pCar, int wheel, tU32 pTime) {
|
||||||
br_scalar beta;
|
br_scalar beta;
|
||||||
int colour;
|
int colour;
|
||||||
LOG_TRACE("(%p, %d, %d)", pCar, wheel, pTime);
|
LOG_TRACE("(%p, %d, %d)", pCar, wheel, pTime);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
SILENT_STUB();
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __cdecl DustRotate()
|
// IDA: void __cdecl DustRotate()
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#include "car.h"
|
#include "car.h"
|
||||||
#include "crush.h"
|
#include "crush.h"
|
||||||
#include "cutscene.h"
|
#include "cutscene.h"
|
||||||
|
#include "displays.h"
|
||||||
#include "drmem.h"
|
#include "drmem.h"
|
||||||
#include "flicplay.h"
|
#include "flicplay.h"
|
||||||
#include "globvars.h"
|
#include "globvars.h"
|
||||||
|
@ -126,7 +127,7 @@ void DoLogos() {
|
||||||
ClearEntireScreen();
|
ClearEntireScreen();
|
||||||
DoSCILogo();
|
DoSCILogo();
|
||||||
DoOpeningAnimation();
|
DoOpeningAnimation();
|
||||||
DoSCILogo();
|
DoStainlessLogo();
|
||||||
gProgram_state.prog_status = eProg_opening;
|
gProgram_state.prog_status = eProg_opening;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,7 +142,10 @@ void DoProgOpeningAnimation() {
|
||||||
// IDA: void __cdecl DoProgramDemo()
|
// IDA: void __cdecl DoProgramDemo()
|
||||||
void DoProgramDemo() {
|
void DoProgramDemo() {
|
||||||
LOG_TRACE("()");
|
LOG_TRACE("()");
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
DoLogos();
|
||||||
|
gProgram_state.prog_status = eProg_idling;
|
||||||
|
DRS3StopOutletSound(gIndexed_outlets[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: int __usercall ChooseOpponent@<EAX>(int pNastiness@<EAX>, int *pHad_scum@<EDX>)
|
// IDA: int __usercall ChooseOpponent@<EAX>(int pNastiness@<EAX>, int *pHad_scum@<EDX>)
|
||||||
|
@ -443,7 +447,17 @@ void DoProgram() {
|
||||||
void JumpTheStart() {
|
void JumpTheStart() {
|
||||||
char s[256];
|
char s[256];
|
||||||
LOG_TRACE("()");
|
LOG_TRACE("()");
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
if (gNet_mode == eNet_mode_none
|
||||||
|
|| gProgram_state.credits_earned - gProgram_state.credits_lost >= gJump_start_fine[gProgram_state.skill_level]) {
|
||||||
|
WakeUpOpponentsToTheFactThatTheStartHasBeenJumped(gCountdown);
|
||||||
|
gCountdown = 0;
|
||||||
|
DRS3StopOutletSound(gIndexed_outlets[4]);
|
||||||
|
DRS3StartSound(gIndexed_outlets[4], 8016);
|
||||||
|
SpendCredits(gJump_start_fine[gProgram_state.skill_level]);
|
||||||
|
sprintf(s, "%s %d %s", GetMiscString(gProgram_state.frank_or_anniness == eFrankie ? 44 : 49), gJump_start_fine[gProgram_state.skill_level], GetMiscString(45));
|
||||||
|
NewTextHeadupSlot(4, 0, 1000, -4, s);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __cdecl GoingToInterfaceFromRace()
|
// IDA: void __cdecl GoingToInterfaceFromRace()
|
||||||
|
|
|
@ -272,7 +272,7 @@ int Chance(float pChance_per_second, int pPeriod) {
|
||||||
// IDA: float __cdecl tandeg(float pAngle)
|
// IDA: float __cdecl tandeg(float pAngle)
|
||||||
float tandeg(float pAngle) {
|
float tandeg(float pAngle) {
|
||||||
LOG_TRACE("(%f)", pAngle);
|
LOG_TRACE("(%f)", pAngle);
|
||||||
pAngle = sin(pAngle * 3.141592653589793 / 180.0);
|
pAngle = sin(DEG_TO_RAD(pAngle));
|
||||||
return pAngle / cos(pAngle);
|
return pAngle / cos(pAngle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -539,7 +539,7 @@ void PrintScreenFile16(FILE* pF) {
|
||||||
void PrintScreen() {
|
void PrintScreen() {
|
||||||
FILE* f;
|
FILE* f;
|
||||||
LOG_TRACE("()");
|
LOG_TRACE("()");
|
||||||
NOT_IMPLEMENTED();
|
STUB();
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: tU32 __cdecl GetTotalTime()
|
// IDA: tU32 __cdecl GetTotalTime()
|
||||||
|
|
|
@ -735,6 +735,7 @@ void AddFunkGrooveBinding(int pSlot_number, float* pPeriod_address) {
|
||||||
if (pSlot_number < 0 || pSlot_number >= COUNT_OF(gGroove_funk_bindings)) {
|
if (pSlot_number < 0 || pSlot_number >= COUNT_OF(gGroove_funk_bindings)) {
|
||||||
FatalError(72);
|
FatalError(72);
|
||||||
}
|
}
|
||||||
|
|
||||||
gGroove_funk_bindings[pSlot_number] = pPeriod_address;
|
gGroove_funk_bindings[pSlot_number] = pPeriod_address;
|
||||||
*pPeriod_address = 0.0;
|
*pPeriod_address = 0.0;
|
||||||
}
|
}
|
||||||
|
@ -742,13 +743,27 @@ void AddFunkGrooveBinding(int pSlot_number, float* pPeriod_address) {
|
||||||
// IDA: void __usercall ControlBoundFunkGroove(int pSlot_number@<EAX>, float pValue)
|
// IDA: void __usercall ControlBoundFunkGroove(int pSlot_number@<EAX>, float pValue)
|
||||||
void ControlBoundFunkGroove(int pSlot_number, float pValue) {
|
void ControlBoundFunkGroove(int pSlot_number, float pValue) {
|
||||||
LOG_TRACE("(%d, %f)", pSlot_number, pValue);
|
LOG_TRACE("(%d, %f)", pSlot_number, pValue);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
if (pSlot_number >= 0) {
|
||||||
|
if (pSlot_number >= 960) {
|
||||||
|
FatalError(73);
|
||||||
|
}
|
||||||
|
*gGroove_funk_bindings[pSlot_number] = pValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: float __usercall ControlBoundFunkGroovePlus@<ST0>(int pSlot_number@<EAX>, float pValue)
|
// IDA: float __usercall ControlBoundFunkGroovePlus@<ST0>(int pSlot_number@<EAX>, float pValue)
|
||||||
float ControlBoundFunkGroovePlus(int pSlot_number, float pValue) {
|
float ControlBoundFunkGroovePlus(int pSlot_number, float pValue) {
|
||||||
LOG_TRACE("(%d, %f)", pSlot_number, pValue);
|
LOG_TRACE("(%d, %f)", pSlot_number, pValue);
|
||||||
NOT_IMPLEMENTED();
|
|
||||||
|
if (pSlot_number < 0) {
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
if (pSlot_number >= 960) {
|
||||||
|
FatalError(73);
|
||||||
|
}
|
||||||
|
*gGroove_funk_bindings[pSlot_number] = fmod(*gGroove_funk_bindings[pSlot_number] + pValue, 1.0);
|
||||||
|
return *gGroove_funk_bindings[pSlot_number];
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDA: void __usercall ShiftBoundGrooveFunks(char *pStart@<EAX>, char *pEnd@<EDX>, int pDelta@<EBX>)
|
// IDA: void __usercall ShiftBoundGrooveFunks(char *pStart@<EAX>, char *pEnd@<EDX>, int pDelta@<EBX>)
|
||||||
|
@ -757,9 +772,8 @@ void ShiftBoundGrooveFunks(char* pStart, char* pEnd, int pDelta) {
|
||||||
LOG_TRACE("(\"%s\", \"%s\", %d)", pStart, pEnd, pDelta);
|
LOG_TRACE("(\"%s\", \"%s\", %d)", pStart, pEnd, pDelta);
|
||||||
|
|
||||||
for (i = 0; i < COUNT_OF(gGroove_funk_bindings); i++) {
|
for (i = 0; i < COUNT_OF(gGroove_funk_bindings); i++) {
|
||||||
if ((intptr_t)gGroove_funk_bindings[i] >= (intptr_t)pStart
|
if ((char*)gGroove_funk_bindings[i] >= (char*)pStart && (char*)gGroove_funk_bindings[i] < (char*)pEnd) {
|
||||||
&& (intptr_t)gGroove_funk_bindings[i] < (intptr_t)pEnd) {
|
gGroove_funk_bindings[i] = (float*)((char*)gGroove_funk_bindings[i] + pDelta); // original code is (pDelta & 0xFFFFFFFC) but this caused problems;
|
||||||
gGroove_funk_bindings[i] = (float*)((char*)gGroove_funk_bindings[i] + (pDelta & 0xFFFFFFFC));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -243,6 +243,8 @@ typedef enum keymapcodes {
|
||||||
KEYMAP_LCTRL = 7,
|
KEYMAP_LCTRL = 7,
|
||||||
KEYMAP_F2 = 28,
|
KEYMAP_F2 = 28,
|
||||||
KEYMAP_F3 = 29,
|
KEYMAP_F3 = 29,
|
||||||
|
KEYMAP_LEFT = 46,
|
||||||
|
KEYMAP_RIGHT = 46,
|
||||||
} keymapcodes;
|
} keymapcodes;
|
||||||
|
|
||||||
#define FONT_TYPEABLE 0
|
#define FONT_TYPEABLE 0
|
||||||
|
@ -280,6 +282,14 @@ typedef enum keymapcodes {
|
||||||
#define MAX(a, b) ((a) > (b) ? a : b)
|
#define MAX(a, b) ((a) > (b) ? a : b)
|
||||||
#define COUNT_OF(array) (sizeof((array)) / sizeof((array)[0]))
|
#define COUNT_OF(array) (sizeof((array)) / sizeof((array)[0]))
|
||||||
|
|
||||||
|
#define DEG_TO_RAD(degrees) ((degrees)*3.141592653589793 / 180.0)
|
||||||
|
|
||||||
#define ONEEIGHTTWO 182.0444444444444
|
#define ONEEIGHTTWO 182.0444444444444
|
||||||
|
|
||||||
|
#define PHYSICS_STEP_TIME 40.0
|
||||||
|
|
||||||
|
#define DR_PI 3.141592653589793
|
||||||
|
|
||||||
|
#define TIME_CONV_THING 0.00050000002
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -771,18 +771,18 @@ typedef struct tReduced_matrix {
|
||||||
typedef struct tCar_controls {
|
typedef struct tCar_controls {
|
||||||
int joystick_acc : 8;
|
int joystick_acc : 8;
|
||||||
int joystick_dec : 8;
|
int joystick_dec : 8;
|
||||||
unsigned int left : 1;
|
unsigned int left : 1; // 0x10000 bit 17
|
||||||
unsigned int right : 1;
|
unsigned int right : 1; // 0x20000 bit 18
|
||||||
unsigned int acc : 1;
|
unsigned int acc : 1; // 0x40000 bit 19
|
||||||
unsigned int dec : 1;
|
unsigned int dec : 1; // 0x80000 bit 20
|
||||||
unsigned int brake : 1;
|
unsigned int brake : 1; //0x100000 bit 21
|
||||||
unsigned int up : 1;
|
unsigned int up : 1; // 0x200000 bit 22
|
||||||
unsigned int down : 1;
|
unsigned int down : 1; // 0x400000 bit 23
|
||||||
unsigned int holdw : 1;
|
unsigned int holdw : 1; // 0x800000 bit 24
|
||||||
unsigned int backwards : 1;
|
unsigned int backwards : 1; // 0x1000000 bit 25
|
||||||
unsigned int change_up : 1;
|
unsigned int change_up : 1; // 0x2000000 bit 26
|
||||||
unsigned int change_down : 1;
|
unsigned int change_down : 1; // 0x4000000 bit 27
|
||||||
unsigned int horn : 1;
|
unsigned int horn : 1; // 0x8000000 bit 28
|
||||||
} tCar_controls;
|
} tCar_controls;
|
||||||
|
|
||||||
typedef struct tNet_message_mechanics_info {
|
typedef struct tNet_message_mechanics_info {
|
||||||
|
|
|
@ -82,8 +82,6 @@ int gReal_back_screen_locked;
|
||||||
void (*gPrev_keyboard_handler)();
|
void (*gPrev_keyboard_handler)();
|
||||||
tU8 gScan_code[123][2];
|
tU8 gScan_code[123][2];
|
||||||
|
|
||||||
const double NANOSECONDS_TO_MILLISECONDS = 1.0 / 1000000.0;
|
|
||||||
|
|
||||||
int _unittest_do_not_exit = 0;
|
int _unittest_do_not_exit = 0;
|
||||||
char* _unittest_last_fatal_error;
|
char* _unittest_last_fatal_error;
|
||||||
|
|
||||||
|
|
|
@ -54,8 +54,10 @@ void debug_print_matrix34(const char* fmt, const char* fn, char* name, br_matrix
|
||||||
debug_printf("\033[0;31m[PANIC] %s ", __FUNCTION__, "%s", "code path not expected"); \
|
debug_printf("\033[0;31m[PANIC] %s ", __FUNCTION__, "%s", "code path not expected"); \
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
||||||
#define STUB() \
|
#define STUB() \
|
||||||
debug_printf("\033[0;31m[WARN] %s ", __FUNCTION__, "%s", "stubbed");
|
if (harness_debug_level >= 5) { \
|
||||||
|
debug_printf("\033[0;31m[WARN] %s ", __FUNCTION__, "%s", "stubbed"); \
|
||||||
|
}
|
||||||
|
|
||||||
#define SILENT_STUB() \
|
#define SILENT_STUB() \
|
||||||
static int stub_printed = 0; \
|
static int stub_printed = 0; \
|
||||||
|
|
|
@ -369,6 +369,13 @@ void Harness_GLRenderer_RenderModel(br_model* model, br_matrix34 model_matrix) {
|
||||||
element_index += v11->groups[g].nfaces * 3;
|
element_index += v11->groups[g].nfaces * 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// glPolygonMode(GL_FRONT_AND_BACK, GL_LINES);
|
||||||
|
// element_index = 0;
|
||||||
|
// for (int g = 0; g < v11->ngroups; g++) {
|
||||||
|
// glDrawElements(GL_TRIANGLES, v11->groups[g].nfaces * 3, GL_UNSIGNED_INT, (void*)(element_index * sizeof(int)));
|
||||||
|
// element_index += v11->groups[g].nfaces * 3;
|
||||||
|
// }
|
||||||
|
|
||||||
glBindVertexArray(0);
|
glBindVertexArray(0);
|
||||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
|
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
# exedump: https://github.com/jeff-1amstudios/open-watcom-v2/tree/master/bld/exedump
|
# exedump: https://github.com/jeff-1amstudios/open-watcom-v2/tree/master/bld/exedump
|
||||||
#
|
#
|
||||||
# Usage: codegen.py <path to dump file> <path to write generated code>
|
# Usage: codegen.py <path to dump file> <path to write generated code>
|
||||||
|
# Note: for some hacky reason <path to write generated code> must end with a slash
|
||||||
#######################################################
|
#######################################################
|
||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
|
@ -193,6 +194,7 @@ def process_global_var():
|
||||||
match = re.match(GLOBAL_VAR_REGEX, line)
|
match = re.match(GLOBAL_VAR_REGEX, line)
|
||||||
glob['name'] = match.group(1)
|
glob['name'] = match.group(1)
|
||||||
glob['addr'] = match.group(2)
|
glob['addr'] = match.group(2)
|
||||||
|
glob['addr_decimal'] = int(glob['addr'].split(':')[1], 16)
|
||||||
glob['type'] = match.group(3)
|
glob['type'] = match.group(3)
|
||||||
return glob
|
return glob
|
||||||
|
|
||||||
|
@ -627,6 +629,15 @@ def generate_h_file(module):
|
||||||
|
|
||||||
h_file.write('#include \"dr_types.h\"\n')
|
h_file.write('#include \"dr_types.h\"\n')
|
||||||
h_file.write('#include \"br_types.h\"\n\n')
|
h_file.write('#include \"br_types.h\"\n\n')
|
||||||
|
|
||||||
|
# global variables
|
||||||
|
for gv in sorted(module['global_vars'], key=lambda x: x['addr_decimal']):
|
||||||
|
# print('gv:', gv)
|
||||||
|
s = resolve_type_str(module, gv['type'], gv['name'])
|
||||||
|
h_file.write('extern ' + s)
|
||||||
|
h_file.write(';\n')
|
||||||
|
h_file.write('\n')
|
||||||
|
|
||||||
for fn in module['functions']:
|
for fn in module['functions']:
|
||||||
h_file.write(resolve_function_header(module, fn))
|
h_file.write(resolve_function_header(module, fn))
|
||||||
h_file.write('\n')
|
h_file.write('\n')
|
||||||
|
@ -643,7 +654,7 @@ def generate_c_file(module):
|
||||||
c_file.write('\"\n\n')
|
c_file.write('\"\n\n')
|
||||||
|
|
||||||
# global variables
|
# global variables
|
||||||
for gv in module['global_vars']:
|
for gv in sorted(module['global_vars'], key=lambda x: x['addr_decimal']):
|
||||||
# print('gv:', gv)
|
# print('gv:', gv)
|
||||||
s = resolve_type_str(module, gv['type'], gv['name'])
|
s = resolve_type_str(module, gv['type'], gv['name'])
|
||||||
c_file.write(s)
|
c_file.write(s)
|
||||||
|
|
Loading…
Reference in New Issue