diff --git a/images/CMakeLists.txt b/images/CMakeLists.txt index d0fc577e8c..27aab7e306 100644 --- a/images/CMakeLists.txt +++ b/images/CMakeLists.txt @@ -13,15 +13,13 @@ install( RENAME "titleBG.png" ) -# Chest Model +# Mojang Textures install( - FILES "chest.png" + FILES "mojang/chest.png" DESTINATION "${MCPI_INSTALL_DIR}/data/images/item" ) - -# Entity Shadow install( - FILES "shadow.png" + FILES "mojang/shadow.png" "mojang/vignette.png" DESTINATION "${MCPI_INSTALL_DIR}/data/images/misc" ) diff --git a/images/chest.png b/images/mojang/chest.png similarity index 100% rename from images/chest.png rename to images/mojang/chest.png diff --git a/images/shadow.png b/images/mojang/shadow.png similarity index 100% rename from images/shadow.png rename to images/mojang/shadow.png diff --git a/images/mojang/vignette.png b/images/mojang/vignette.png new file mode 100644 index 0000000000..f236acb3c8 Binary files /dev/null and b/images/mojang/vignette.png differ diff --git a/launcher/src/client/available-feature-flags b/launcher/src/client/available-feature-flags index 215b21d51d..38fa8827b3 100644 --- a/launcher/src/client/available-feature-flags +++ b/launcher/src/client/available-feature-flags @@ -110,4 +110,5 @@ TRUE Hide Block Outline When GUI Is Hidden TRUE Fix Crash When Generating Certain Seeds TRUE Click Buttons On Mouse Down TRUE 3D Dropped Items -TRUE Render Entity Shadows \ No newline at end of file +TRUE Render Entity Shadows +TRUE Render Vignette \ No newline at end of file diff --git a/media-layer/trampoline/src/host/host.h b/media-layer/trampoline/src/host/host.h index 6edc79fb1b..2ebefbffce 100644 --- a/media-layer/trampoline/src/host/host.h +++ b/media-layer/trampoline/src/host/host.h @@ -15,7 +15,7 @@ __attribute__((visibility("internal"))) void _add_handler(unsigned char id, hand } \ static uint32_t _run_##name(__attribute__((unused)) trampoline_writer_t writer, const unsigned char *raw_args) { \ __attribute__((unused)) TrampolineArguments args(raw_args); \ - static typeof(name) *func = name; + static constexpr typeof(name) *func = name; // Arguments struct TrampolineArguments { diff --git a/mods/src/misc/graphics.cpp b/mods/src/misc/graphics.cpp index db91d75166..e6a5cee2cd 100644 --- a/mods/src/misc/graphics.cpp +++ b/mods/src/misc/graphics.cpp @@ -455,6 +455,18 @@ static void ItemRenderer_render_injection(ItemRenderer_render_t original, ItemRe } } +// Vignette +static void Gui_renderProgressIndicator_injection(Gui_renderProgressIndicator_t original, Gui *self, const bool is_touch, int width, int height, float a) { + // Render + glEnable(GL_BLEND); + self->minecraft->textures->blur = true; + self->renderVignette(self->minecraft->player->getBrightness(a), width, height); + self->minecraft->textures->blur = false; + glDisable(GL_BLEND); + // Call Original Method + original(self, is_touch, width, height, a); +} + // Init void _init_misc_graphics() { // Disable V-Sync @@ -554,6 +566,11 @@ void _init_misc_graphics() { overwrite_call((void *) 0x4bf34, (void *) ItemInHandRenderer_renderItem_glTranslatef_injection); } + // Vignette + if (feature_has("Render Vignette", server_disabled)) { + overwrite_calls(Gui_renderProgressIndicator, Gui_renderProgressIndicator_injection); + } + // Don't Render Game In Headless Mode if (reborn_is_headless()) { overwrite_calls(GameRenderer_render, nop); diff --git a/symbols/src/gui/Gui.def b/symbols/src/gui/Gui.def index e931fc46c9..af94bfd19e 100644 --- a/symbols/src/gui/Gui.def +++ b/symbols/src/gui/Gui.def @@ -15,6 +15,8 @@ method void renderSlotText(const ItemInstance *item, float x, float y, bool fini method void handleKeyPressed(int key) = 0x25a08; method void renderHearts() = 0x2641c; method void renderDebugInfo() = 0x26958; +method void renderProgressIndicator(bool is_touch, int width, int height, float a) = 0x26098; +method void renderVignette(float param_1, int width, int height) = 0x25b0c; property Minecraft *minecraft = 0x9f4; property float selected_item_text_timer = 0x9fc; diff --git a/symbols/src/textures/Textures.def b/symbols/src/textures/Textures.def index 704627a7ee..01a8312b4e 100644 --- a/symbols/src/textures/Textures.def +++ b/symbols/src/textures/Textures.def @@ -2,4 +2,6 @@ method void tick(bool param_1) = 0x531c4; method int loadAndBindTexture(const std::string &name) = 0x539cc; method int assignTexture(const std::string &name, uchar *data) = 0x5354c; method void addDynamicTexture(DynamicTexture *texture) = 0x534f8; -method Texture *getTemporaryTextureData(uint id) = 0x53168; \ No newline at end of file +method Texture *getTemporaryTextureData(uint id) = 0x53168; + +property bool blur = 0x39; \ No newline at end of file