Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dispose track after race + get german localization running #107

Merged
merged 6 commits into from
Mar 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/BRSRC13/CORE/FW/genfile.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "genfile.h"
#include "datafile.h"
#include "harness/trace.h"

#include "CORE/V1DB/chunkids.h"
Expand All @@ -20,8 +21,8 @@ br_file_enum_member file_type_FM[10] = {
br_file_enum file_type_F = { BR_ASIZE(file_type_FM), file_type_FM };

br_file_struct_member file_info_FM[2] = {
{ 15, offsetof(file_info, type), "type", &file_type_F },
{ 5, offsetof(file_info, version), "version", NULL },
{ DF_TYPE_ENUM_32, offsetof(file_info, type), "type", &file_type_F },
{ DF_TYPE_BR_UINT_32, offsetof(file_info, version), "version", NULL },
};
br_file_struct file_info_F = { "file_info", BR_ASIZE(file_info_FM), file_info_FM, sizeof(file_info) };

Expand Down
4 changes: 2 additions & 2 deletions src/DETHRACE/common/car.c
Original file line number Diff line number Diff line change
Expand Up @@ -3153,9 +3153,9 @@ void MultiFindFloorInBoxBU(int pNum_rays, br_vector3* a, br_vector3* b, br_vecto
tFace_ref* face_ref;
LOG_TRACE("(%d, %p, %p, %p, %p, %p, %p)", pNum_rays, a, b, nor, d, c, mat_ref);

for (i = 0; i < c->box_face_end; i++) {
for (i = c->box_face_start; i < c->box_face_end; i++) {
face_ref = &gFace_list__car[i];
if (!gEliminate_faces || SLOBYTE(face_ref->flags) == 0) {
if (!gEliminate_faces || (face_ref->flags & 0x80) == 0x0) {
MultiRayCheckSingleFace(pNum_rays, face_ref, a, b, &nor2, dist);
for (j = 0; j < pNum_rays; ++j) {
if (d[j] > dist[j]) {
Expand Down
4 changes: 2 additions & 2 deletions src/DETHRACE/common/cutscene.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void PlaySmackerFile(char* pSmack_name) {

dr_dprintf("Trying to open smack file '%s'", the_path);
s = smk_open_file(the_path, SMK_MODE_MEMORY);
if (!s) {
if (s == NULL) {
dr_dprintf("Unable to open smack file - attempt to load smack from CD...");
if (GetCDPathFromPathsTxtFile(the_path)) {
strcat(the_path, gDir_separator);
Expand All @@ -77,7 +77,7 @@ void PlaySmackerFile(char* pSmack_name) {
dr_dprintf("Can't get CD directory name");
}
}
if (s) {
if (s != NULL) {
dr_dprintf("Smack file opened OK");
smk_info_all(s, NULL, &f, &usf);
smk_info_video(s, &w, &h, NULL);
Expand Down
10 changes: 5 additions & 5 deletions src/DETHRACE/common/displays.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,11 @@ void DRPixelmapText(br_pixelmap* pPixelmap, int pX, int pY, tDR_font* pFont, cha
LOG_TRACE9("(%p, %d, %d, %p, \"%s\", %d)", pPixelmap, pX, pY, pFont, pText, pRight_edge);

len = strlen(pText);
ch = (unsigned char*)pText;
if (pX >= 0 && pPixelmap->width >= pRight_edge && pY >= 0 && (pY + pFont->height) <= pPixelmap->height) {
x = pX;
for (i = 0; i < len; i++) {
chr = pText[i] - pFont->offset;
chr = ch[i] - pFont->offset;
ch_width = pFont->width_table[chr];
DRPixelmapRectangleOnscreenCopy(
gBack_screen,
Expand All @@ -148,7 +149,7 @@ void DRPixelmapText(br_pixelmap* pPixelmap, int pX, int pY, tDR_font* pFont, cha
} else {
x = pX;
for (i = 0; i < len; i++) {
chr = pText[i] - pFont->offset;
chr = ch[i] - pFont->offset;
ch_width = pFont->width_table[chr];
DRPixelmapRectangleMaskedCopy(
gBack_screen,
Expand Down Expand Up @@ -1445,11 +1446,10 @@ void OoerrIveGotTextInMeBoxMissus(int pFont_index, char* pText, br_pixelmap* pPi

// IDA: void __usercall TransBrPixelmapText(br_pixelmap *pPixelmap@<EAX>, int pX@<EDX>, int pY@<EBX>, br_uint_32 pColour@<ECX>, br_font *pFont, signed char *pText)
void TransBrPixelmapText(br_pixelmap* pPixelmap, int pX, int pY, br_uint_32 pColour, br_font* pFont, signed char* pText) {
int i;
int len;
LOG_TRACE("(%p, %d, %d, %d, %p, %p)", pPixelmap, pX, pY, pColour, pFont, pText);

len = (TranslationMode() == 0 ? 0 : 2);
len = TranslationMode() ? 2 : 0;
BrPixelmapText(pPixelmap, pX, pY - len, pColour, pFont, (char*)pText);
}

Expand All @@ -1458,7 +1458,7 @@ void TransDRPixelmapText(br_pixelmap* pPixelmap, int pX, int pY, tDR_font* pFont
LOG_TRACE("(%p, %d, %d, %p, \"%s\", %d)", pPixelmap, pX, pY, pFont, pText, pRight_edge);

if (gAusterity_mode && FlicsPlayedFromDisk() && pFont != gCached_font) {
if (gCached_font && gCached_font - gFonts > 13) {
if (gCached_font != NULL && gCached_font - gFonts > 13) {
DisposeFont(gCached_font - gFonts);
}
gCached_font = pFont;
Expand Down
5 changes: 1 addition & 4 deletions src/DETHRACE/common/drfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ br_filesystem gFilesystem = {
};
br_filesystem* gOld_file_system;

// Added by Jeff
#define DR_MEMORY_FILESYSTEM 140

// IDA: void* __cdecl DRStdioOpenRead(char *name, br_size_t n_magics, br_mode_test_cbfn *identify, int *mode_result)
void* DRStdioOpenRead(char* name, br_size_t n_magics, br_mode_test_cbfn* identify, int* mode_result) {
if (mode_result != NULL) {
Expand Down Expand Up @@ -58,7 +55,7 @@ br_size_t DRStdioWrite(void* buf, br_size_t size, unsigned int n, void* f) {
void InstallDRFileCalls() {
br_filesystem* temp_system;
LOG_TRACE("()");
temp_system = BrMemAllocate(sizeof(br_filesystem), DR_MEMORY_FILESYSTEM);
temp_system = BrMemAllocate(sizeof(br_filesystem), kMem_temp_fs);
gOld_file_system = BrFilesystemSet(temp_system);
gFilesystem.attributes = gOld_file_system->attributes;
gFilesystem.eof = gOld_file_system->eof;
Expand Down
Loading