diff --git a/dependencies/symbol-processor/src b/dependencies/symbol-processor/src index eca52455..603010e3 160000 --- a/dependencies/symbol-processor/src +++ b/dependencies/symbol-processor/src @@ -1 +1 @@ -Subproject commit eca52455c3d8a520aba30b81d17031340b76ff88 +Subproject commit 603010e3cce7a7cce90b87da43e4c918047d14a2 diff --git a/mods/src/benchmark/benchmark.cpp b/mods/src/benchmark/benchmark.cpp index af59ff1c..193ce54e 100644 --- a/mods/src/benchmark/benchmark.cpp +++ b/mods/src/benchmark/benchmark.cpp @@ -40,7 +40,7 @@ static void start_world(Minecraft *minecraft) { minecraft->selectLevel(&name, &name, &settings); // Open ProgressScreen - ProgressScreen *screen = alloc_ProgressScreen(); + ProgressScreen *screen = new ProgressScreen; ALLOC_CHECK(screen); screen = screen->constructor(); minecraft->setScreen((Screen *) screen); diff --git a/mods/src/bucket/bucket.cpp b/mods/src/bucket/bucket.cpp index 8df8f724..5f6bf11a 100644 --- a/mods/src/bucket/bucket.cpp +++ b/mods/src/bucket/bucket.cpp @@ -163,7 +163,7 @@ static ItemInstance *BucketItem_getCraftingRemainingItem(FoodItem *item, ItemIns if (item_instance->auxiliary == 0) { return nullptr; } - ItemInstance *ret = alloc_ItemInstance(); + ItemInstance *ret = new ItemInstance; ret->id = item->id; ret->count = item_instance->count; ret->auxiliary = 0; @@ -186,7 +186,7 @@ CUSTOM_VTABLE(bucket, FoodItem) { // Create Items static FoodItem *create_bucket(int32_t id, int32_t texture_x, int32_t texture_y, std::string name) { // Construct - FoodItem *item = alloc_FoodItem(); + FoodItem *item = new FoodItem; ALLOC_CHECK(item); Item_constructor((Item *) item, id); // FoodItem's Constructor Was Inlined diff --git a/mods/src/cake/cake.cpp b/mods/src/cake/cake.cpp index ad358548..5af9af75 100644 --- a/mods/src/cake/cake.cpp +++ b/mods/src/cake/cake.cpp @@ -116,7 +116,7 @@ static int Cake_use(__attribute__((unused)) Tile *tile, Level *level, int x, int // Makes the cakes static void make_cake() { // Construct - cake = alloc_Tile(); + cake = new Tile; ALLOC_CHECK(cake); int texture = 122; cake->constructor(92, texture, Material_dirt); diff --git a/mods/src/camera/camera.cpp b/mods/src/camera/camera.cpp index 45eb1300..c1a76984 100644 --- a/mods/src/camera/camera.cpp +++ b/mods/src/camera/camera.cpp @@ -19,7 +19,7 @@ static EntityRenderDispatcher *EntityRenderDispatcher_injection(EntityRenderDisp original(dispatcher); // Register TripodCameraRenderer - TripodCameraRenderer *renderer = alloc_TripodCameraRenderer(); + TripodCameraRenderer *renderer = new TripodCameraRenderer; ALLOC_CHECK(renderer); renderer->constructor(); dispatcher->assign((unsigned char) 0x5, (EntityRenderer *) renderer); diff --git a/mods/src/game-mode/ui.cpp b/mods/src/game-mode/ui.cpp index 2e8828bf..a3a7d4a2 100644 --- a/mods/src/game-mode/ui.cpp +++ b/mods/src/game-mode/ui.cpp @@ -227,7 +227,7 @@ static void create_world(Minecraft *minecraft, std::string name, bool is_creativ minecraft->hostMultiplayer(19132); // Open ProgressScreen - ProgressScreen *screen = alloc_ProgressScreen(); + ProgressScreen *screen = new ProgressScreen; ALLOC_CHECK(screen); screen = screen->constructor(); minecraft->setScreen((Screen *) screen); diff --git a/mods/src/input/crafting.cpp b/mods/src/input/crafting.cpp index b6976251..30f7219b 100644 --- a/mods/src/input/crafting.cpp +++ b/mods/src/input/crafting.cpp @@ -16,7 +16,7 @@ static void _handle_open_crafting(Minecraft *minecraft) { // Set Screen if (!creative_is_restricted() || !Minecraft_isCreativeMode(minecraft)) { - WorkbenchScreen *screen = alloc_WorkbenchScreen(); + WorkbenchScreen *screen = new WorkbenchScreen; ALLOC_CHECK(screen); screen = screen->constructor(0); minecraft->setScreen((Screen *) screen); diff --git a/mods/src/misc/misc.cpp b/mods/src/misc/misc.cpp index ae5aaab9..2fdbb47f 100644 --- a/mods/src/misc/misc.cpp +++ b/mods/src/misc/misc.cpp @@ -703,7 +703,7 @@ void PaneCraftingScreen_craftSelectedItem_PaneCraftingScreen_recheckRecipes_inje ItemInstance *Item_getCraftingRemainingItem_injection(__attribute__((unused)) Item_getCraftingRemainingItem_t original, Item *self, ItemInstance *item_instance) { if (self->craftingRemainingItem != nullptr) { - ItemInstance *ret = alloc_ItemInstance(); + ItemInstance *ret = new ItemInstance; ret->id = self->craftingRemainingItem->id; ret->count = item_instance->count; ret->auxiliary = 0; diff --git a/mods/src/options/info.cpp b/mods/src/options/info.cpp index ca227b39..ef801ed0 100644 --- a/mods/src/options/info.cpp +++ b/mods/src/options/info.cpp @@ -187,7 +187,7 @@ CUSTOM_VTABLE(info_screen, Screen) { // Handle Back vtable->handleBackEvent = [](Screen *self, bool do_nothing) { if (!do_nothing) { - OptionsScreen *screen = alloc_OptionsScreen(); + OptionsScreen *screen = new OptionsScreen; ALLOC_CHECK(screen); screen->constructor(); self->minecraft->setScreen((Screen *) screen); @@ -256,7 +256,7 @@ CUSTOM_VTABLE(info_screen, Screen) { // Create Screen Screen *_create_options_info_screen() { // Allocate - Screen *screen = alloc_Screen(); + Screen *screen = new Screen; ALLOC_CHECK(screen); screen->constructor(); diff --git a/mods/src/options/ui.cpp b/mods/src/options/ui.cpp index 447eb64e..1fa1de89 100644 --- a/mods/src/options/ui.cpp +++ b/mods/src/options/ui.cpp @@ -97,7 +97,7 @@ static void OptionsScreen_init_injection(OptionsScreen_init_t original, OptionsS original(self); // Add Button - Touch_TButton *button = alloc_Touch_TButton(); + Touch_TButton *button = new Touch_TButton; ALLOC_CHECK(button); std::string name = "Reborn"; button->constructor(INFO_BUTTON_ID, &name); diff --git a/mods/src/server/server.cpp b/mods/src/server/server.cpp index 6ea33bb4..9de78e9b 100644 --- a/mods/src/server/server.cpp +++ b/mods/src/server/server.cpp @@ -95,7 +95,7 @@ static void start_world(Minecraft *minecraft) { } // Open ProgressScreen - ProgressScreen *screen = alloc_ProgressScreen(); + ProgressScreen *screen = new ProgressScreen; ALLOC_CHECK(screen); screen = screen->constructor(); minecraft->setScreen((Screen *) screen); diff --git a/mods/src/sign/sign.cpp b/mods/src/sign/sign.cpp index 303f1d33..bd36fe64 100644 --- a/mods/src/sign/sign.cpp +++ b/mods/src/sign/sign.cpp @@ -33,7 +33,7 @@ static int32_t sdl_key_to_minecraft_key_injection(Common_sdl_key_to_minecraft_ke static void LocalPlayer_openTextEdit_injection(LocalPlayer *local_player, TileEntity *sign) { if (sign->type == 4) { Minecraft *minecraft = local_player->minecraft; - TextEditScreen *screen = alloc_TextEditScreen(); + TextEditScreen *screen = new TextEditScreen; ALLOC_CHECK(screen); screen = screen->constructor((SignTileEntity *) sign); minecraft->setScreen((Screen *) screen); diff --git a/mods/src/touch/touch.cpp b/mods/src/touch/touch.cpp index 0791b069..e624772d 100644 --- a/mods/src/touch/touch.cpp +++ b/mods/src/touch/touch.cpp @@ -44,17 +44,17 @@ static void LargeImageButton_render_GuiComponent_drawCenteredString_injection(Gu // Create Button int touch_gui = 0; template -static Button *create_button(T *(*allocator)(), int id, std::string text) { - T *button = allocator(); +static Button *create_button(int id, std::string text) { + T *button = new T; ALLOC_CHECK(button); button->constructor(id, &text); return (Button *) button; } Button *touch_create_button(int id, std::string text) { if (touch_gui) { - return create_button(alloc_Touch_TButton, id, text); + return create_button(id, text); } else { - return create_button(alloc_Button, id, text); + return create_button