Compare commits
20 Commits
skmp/compa
...
pGta-Menu-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2d7ce9132 | ||
|
|
3188550311 | ||
|
|
9a1ea298d9 | ||
|
|
383442c6aa | ||
|
|
9b775dff3f | ||
|
|
353b7cc56d | ||
|
|
52c4946111 | ||
|
|
77b40f3004 | ||
|
|
ff2368da21 | ||
|
|
4ac38c0d64 | ||
|
|
ed2898ae2a | ||
|
|
a14f51246d | ||
|
|
19f22e8edb | ||
|
|
354b1ae92c | ||
|
|
a6a1fdb9cb | ||
|
|
309232c221 | ||
|
|
70df292c7a | ||
|
|
554a668897 | ||
|
|
3998368791 | ||
|
|
730302180a |
@@ -286,7 +286,17 @@ texconv: $(OBJS_TEXCONV) | pvrtex # You'll have to rebuild pvrtex manually if yo
|
||||
|
||||
TXD_OPTS_fonts = 256 256
|
||||
TXD_OPTS_hud = 128 128
|
||||
TXD_OPTS_menu = 512 512
|
||||
TXD_OPTS_menu = 512 512 \
|
||||
--include-tex assets/mapBot01.png mapBot01 \
|
||||
--include-tex assets/mapBot02.png mapBot02 \
|
||||
--include-tex assets/mapBot03.png mapBot03 \
|
||||
--include-tex assets/mapMid01.png mapMid01 \
|
||||
--include-tex assets/mapMid02.png mapMid02 \
|
||||
--include-tex assets/mapMid03.png mapMid03 \
|
||||
--include-tex assets/mapTop01.png mapTop01 \
|
||||
--include-tex assets/mapTop02.png mapTop02 \
|
||||
--include-tex assets/mapTop03.png mapTop03
|
||||
|
||||
TXD_OPTS_LOADSC0 = 512 512
|
||||
TXD_OPTS_LOADSC1 = 512 512
|
||||
TXD_OPTS_LOADSC10 = 512 512
|
||||
|
||||
@@ -1012,14 +1012,8 @@ void CGame::InitialiseWhenRestarting(void)
|
||||
DMAudio.ChangeMusicMode(MUSICMODE_GAME);
|
||||
}
|
||||
|
||||
namespace rw::dc {
|
||||
void relocate_objects();
|
||||
}
|
||||
|
||||
void CGame::Process(void)
|
||||
{
|
||||
rw::dc::relocate_objects();
|
||||
|
||||
CPad::UpdatePads();
|
||||
#ifdef USE_CUSTOM_ALLOCATOR
|
||||
ProcessTidyUpMemory();
|
||||
|
||||
@@ -379,7 +379,7 @@ enum Config {
|
||||
# define CUSTOM_FRONTEND_OPTIONS
|
||||
|
||||
# ifdef CUSTOM_FRONTEND_OPTIONS
|
||||
# define MENU_MAP // VC-like menu map. Won't appear if you don't have our menu.txd
|
||||
# define MENU_MAP // Enabled on Dca3 now, but could use some controller mapping**
|
||||
# define GRAPHICS_MENU_OPTIONS // otherwise Display settings will be scrollable
|
||||
# define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU
|
||||
# define CUTSCENE_BORDERS_SWITCH
|
||||
|
||||
24
vendor/librw/src/dc/rwdc.cpp
vendored
24
vendor/librw/src/dc/rwdc.cpp
vendored
@@ -5,10 +5,6 @@
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
extern "C" size_t malloc_usable_size(void* m);
|
||||
|
||||
#include <list>
|
||||
|
||||
#if !defined(DC_TEXCONV) && !defined(MACOS64)
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
@@ -4603,31 +4599,12 @@ writeNativeTexture(Texture *tex, Stream *stream)
|
||||
|
||||
#define DC_MODEL_VERSION 5
|
||||
|
||||
std::list<void**> allocations;
|
||||
|
||||
void relocate_objects() {
|
||||
for (auto allocation: allocations) {
|
||||
auto size = malloc_usable_size(*allocation);
|
||||
void* candidate = rwMalloc(size, MEMDUR_EVENT | ID_GEOMETRY);
|
||||
if (!candidate)
|
||||
continue;
|
||||
if ((uintptr_t&)candidate < (uintptr_t&)*allocation) {
|
||||
// fprintf(stderr, "Moving memory %p to %p\n", *allocation, candidate);
|
||||
memcpy(candidate, *allocation, size);
|
||||
free(*allocation);
|
||||
*allocation = candidate;
|
||||
} else {
|
||||
free(candidate);
|
||||
}
|
||||
}
|
||||
}
|
||||
void*
|
||||
destroyNativeData(void *object, int32, int32)
|
||||
{
|
||||
auto geo = (Geometry*)object;
|
||||
rwFree(geo->instData);
|
||||
geo->instData = nil;
|
||||
allocations.remove(&(void*&)geo->instData);
|
||||
|
||||
return object;
|
||||
}
|
||||
@@ -4645,7 +4622,6 @@ readNativeData(Stream *stream, int32 length, void *object, int32, int32)
|
||||
|
||||
DCModelDataHeader *header = (DCModelDataHeader *)rwNew(sizeof(DCModelDataHeader) + chunkLen - 8, MEMDUR_EVENT | ID_GEOMETRY);
|
||||
geo->instData = header;
|
||||
allocations.insert(allocations.begin(), &(void*&)geo->instData);
|
||||
stream->read32(&header->platform, 4);
|
||||
uint32_t version;
|
||||
stream->read32(&version, 4);
|
||||
|
||||
Reference in New Issue
Block a user