Rev 11 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 11 | Rev 18 | ||
---|---|---|---|
Line 2... | Line 2... | ||
2 | #include <stdlib.h> |
2 | #include <stdlib.h> |
3 | 3 | ||
4 | #include " |
4 | #include "brender.h" |
5 | #include "constants.h" |
5 | #include "constants.h" |
6 | #include "errors.h" |
6 | #include "errors.h" |
7 | #include "globvars.h" |
7 | #include "globvars.h" |
8 | #include "globvrpb.h" |
8 | #include "globvrpb.h" |
9 | #include "graphics.h" |
9 | #include "graphics.h" |
Line 478... | Line 478... | ||
478 | 478 | ||
479 | the_map = BrPixelmapLoad(pFile_name); |
479 | the_map = BrPixelmapLoad(pFile_name); |
480 | if (the_map != NULL) { |
480 | if (the_map != NULL) { |
481 | the_map->origin_x = 0; |
481 | the_map->origin_x = 0; |
482 | the_map->origin_y = 0; |
482 | the_map->origin_y = 0; |
483 | #if !defined(DETHRACE_FIX_BUGS) |
- | |
484 | the_map->row_bytes = (the_map->row_bytes + sizeof(int32_t) - 1) & ~(sizeof(int32_t) - 1); |
483 | the_map->row_bytes = (the_map->row_bytes + sizeof(int32_t) - 1) & ~(sizeof(int32_t) - 1); |
485 | #endif |
- | |
486 | } |
484 | } |
487 | return the_map; |
485 | return the_map; |
488 | } |
486 | } |
489 | 487 | ||
490 | // IDA: br_uint_32 __usercall DRPixelmapLoadMany@<EAX>(char *pFile_name@<EAX>, br_pixelmap **pPixelmaps@<EDX>, br_uint_16 pNum@<EBX>) |
488 | // IDA: br_uint_32 __usercall DRPixelmapLoadMany@<EAX>(char *pFile_name@<EAX>, br_pixelmap **pPixelmaps@<EDX>, br_uint_16 pNum@<EBX>) |
Line 495... | Line 493... | ||
495 | //br_uint_8 lobyte; // Pierre-Marie Baty -- unused variable |
493 | //br_uint_8 lobyte; // Pierre-Marie Baty -- unused variable |
496 | LOG_TRACE("(\"%s\", %p, %d)", pFile_name, pPixelmaps, pNum); |
494 | LOG_TRACE("(\"%s\", %p, %d)", pFile_name, pPixelmaps, pNum); |
497 | number_loaded = BrPixelmapLoadMany(pFile_name, pPixelmaps, pNum); |
495 | number_loaded = BrPixelmapLoadMany(pFile_name, pPixelmaps, pNum); |
498 | for (i = 0; i < number_loaded; i++) { |
496 | for (i = 0; i < number_loaded; i++) { |
499 | the_map = pPixelmaps[i]; |
497 | the_map = pPixelmaps[i]; |
500 | #if !defined(DETHRACE_FIX_BUGS) |
- | |
501 | the_map->row_bytes = (the_map->row_bytes + sizeof(int32_t) - 1) & ~(sizeof(int32_t) - 1); |
498 | the_map->row_bytes = (the_map->row_bytes + sizeof(int32_t) - 1) & ~(sizeof(int32_t) - 1); |
502 | #endif |
- | |
503 | the_map->base_x = 0; |
499 | the_map->base_x = 0; |
504 | the_map->base_y = 0; |
500 | the_map->base_y = 0; |
505 | } |
501 | } |
506 | return number_loaded; |
502 | return number_loaded; |
507 | } |
503 | } |
Line 516... | Line 512... | ||
516 | SoundService(); |
512 | SoundService(); |
517 | } |
513 | } |
518 | } |
514 | } |
519 | 515 | ||
520 | // IDA: br_uint_32 __usercall DRActorEnumRecurse@<EAX>(br_actor *pActor@<EAX>, br_actor_enum_cbfn *callback@<EDX>, void *arg@<EBX>) |
516 | // IDA: br_uint_32 __usercall DRActorEnumRecurse@<EAX>(br_actor *pActor@<EAX>, br_actor_enum_cbfn *callback@<EDX>, void *arg@<EBX>) |
521 |
|
517 | br_uintptr_t DRActorEnumRecurse(br_actor* pActor, br_actor_enum_cbfn* callback, void* arg) { |
522 |
|
518 | br_uintptr_t result; |
523 | 519 | ||
524 | result = callback(pActor, arg); |
520 | result = callback(pActor, arg); |
525 | if (result != 0) { |
521 | if (result != 0) { |
526 | return result; |
522 | return result; |
527 | } |
523 | } |
Line 533... | Line 529... | ||
533 | } |
529 | } |
534 | return 0; |
530 | return 0; |
535 | } |
531 | } |
536 | 532 | ||
537 | // IDA: br_uint_32 __cdecl CompareActorID(br_actor *pActor, void *pArg) |
533 | // IDA: br_uint_32 __cdecl CompareActorID(br_actor *pActor, void *pArg) |
538 |
|
534 | br_uintptr_t CompareActorID(br_actor* pActor, void* pArg) { |
539 | LOG_TRACE("(%p, %p)", pActor, pArg); |
535 | LOG_TRACE("(%p, %p)", pActor, pArg); |
540 | 536 | ||
541 | if (pActor->identifier && !strcmp(pActor->identifier, (const char*)pArg)) { |
537 | if (pActor->identifier && !strcmp(pActor->identifier, (const char*)pArg)) { |
542 | return (intptr_t)pActor; |
538 | return (intptr_t)pActor; |
543 | } else { |
539 | } else { |
Line 1155... | Line 1151... | ||
1155 | } |
1151 | } |
1156 | } |
1152 | } |
1157 | 1153 | ||
1158 | // IDA: void __cdecl SubsStringJob(char *pStr, ...) |
1154 | // IDA: void __cdecl SubsStringJob(char *pStr, ...) |
1159 | void SubsStringJob(char* pStr, ...) { |
1155 | void SubsStringJob(char* pStr, ...) { |
1160 |
|
1156 | char* sub_str; |
1161 |
|
1157 | char temp_str[256]; |
1162 |
|
1158 | char* sub_pt; |
1163 |
|
1159 | va_list ap; |
1164 | LOG_TRACE("(\"%s\")", pStr); |
1160 | LOG_TRACE("(\"%s\")", pStr); |
- | 1161 | ||
- | 1162 | va_start(ap, pStr); |
|
- | 1163 | for (;;) { |
|
- | 1164 | sub_pt = strchr(pStr, '%'); |
|
- | 1165 | if (sub_pt == NULL) { |
|
1165 |
|
1166 | va_end(ap); |
- | 1167 | return; |
|
- | 1168 | } |
|
- | 1169 | sub_str = va_arg(ap, char *); |
|
- | 1170 | StripCR(sub_str); |
|
- | 1171 | strcpy(temp_str, &sub_pt[1]); |
|
- | 1172 | strcpy(sub_pt, sub_str); |
|
- | 1173 | strcat(pStr, temp_str); |
|
- | 1174 | } |
|
1166 | } |
1175 | } |
1167 | 1176 | ||
1168 | // IDA: void __usercall DecodeLine2(char *pS@<EAX>) |
1177 | // IDA: void __usercall DecodeLine2(char *pS@<EAX>) |
1169 | void DecodeLine2(char* pS) { |
1178 | void DecodeLine2(char* pS) { |
1170 | int len; |
1179 | int len; |