Remove Some Magic Numbers
This commit is contained in:
parent
4d8c8ae3c1
commit
b81d29095b
@ -183,6 +183,8 @@ static void *TextEditScreen_updateEvents_vtable_addr = (void *) 0x10531c;
|
|||||||
|
|
||||||
// ProgressScreen
|
// ProgressScreen
|
||||||
|
|
||||||
|
#define PROGRESS_SCREEN_SIZE 0x4c
|
||||||
|
|
||||||
typedef void *(*ProgressScreen_t)(unsigned char *obj);
|
typedef void *(*ProgressScreen_t)(unsigned char *obj);
|
||||||
static ProgressScreen_t ProgressScreen = (ProgressScreen_t) 0x37044;
|
static ProgressScreen_t ProgressScreen = (ProgressScreen_t) 0x37044;
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ static int32_t Inventory_setupDefault_FillingContainer_addItem_call_injection(un
|
|||||||
// Bonemeal Is Already In The Creative Inventory
|
// Bonemeal Is Already In The Creative Inventory
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
unsigned char *item_instance = (unsigned char *) ::operator new(0xc);
|
unsigned char *item_instance = (unsigned char *) ::operator new(ITEM_INSTANCE_SIZE);
|
||||||
item_instance = (*ItemInstance_constructor_item_extra)(item_instance, *Item_dye_powder, 1, i);
|
item_instance = (*ItemInstance_constructor_item_extra)(item_instance, *Item_dye_powder, 1, i);
|
||||||
(*FillingContainer_addItem)(filling_container, item_instance);
|
(*FillingContainer_addItem)(filling_container, item_instance);
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ static void start_world(unsigned char *minecraft) {
|
|||||||
(*Minecraft_hostMultiplayer)(minecraft, port);
|
(*Minecraft_hostMultiplayer)(minecraft, port);
|
||||||
INFO("Listening On: %i", port);
|
INFO("Listening On: %i", port);
|
||||||
|
|
||||||
void *screen = ::operator new(0x4c);
|
void *screen = ::operator new(PROGRESS_SCREEN_SIZE);
|
||||||
screen = (*ProgressScreen)((unsigned char *) screen);
|
screen = (*ProgressScreen)((unsigned char *) screen);
|
||||||
(*Minecraft_setScreen)(minecraft, (unsigned char *) screen);
|
(*Minecraft_setScreen)(minecraft, (unsigned char *) screen);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user