This commit is contained in:
TheBrokenRail 2024-10-15 13:38:22 -04:00
parent 463ede508e
commit 73b3cd10af
9 changed files with 28 additions and 8 deletions

View File

@ -13,15 +13,13 @@ install(
RENAME "titleBG.png" RENAME "titleBG.png"
) )
# Chest Model # Mojang Textures
install( install(
FILES "chest.png" FILES "mojang/chest.png"
DESTINATION "${MCPI_INSTALL_DIR}/data/images/item" DESTINATION "${MCPI_INSTALL_DIR}/data/images/item"
) )
# Entity Shadow
install( install(
FILES "shadow.png" FILES "mojang/shadow.png" "mojang/vignette.png"
DESTINATION "${MCPI_INSTALL_DIR}/data/images/misc" DESTINATION "${MCPI_INSTALL_DIR}/data/images/misc"
) )

View File

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

Before

Width:  |  Height:  |  Size: 868 B

After

Width:  |  Height:  |  Size: 868 B

BIN
images/mojang/vignette.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -110,4 +110,5 @@ TRUE Hide Block Outline When GUI Is Hidden
TRUE Fix Crash When Generating Certain Seeds TRUE Fix Crash When Generating Certain Seeds
TRUE Click Buttons On Mouse Down TRUE Click Buttons On Mouse Down
TRUE 3D Dropped Items TRUE 3D Dropped Items
TRUE Render Entity Shadows TRUE Render Entity Shadows
TRUE Render Vignette

View File

@ -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) { \ static uint32_t _run_##name(__attribute__((unused)) trampoline_writer_t writer, const unsigned char *raw_args) { \
__attribute__((unused)) TrampolineArguments args(raw_args); \ __attribute__((unused)) TrampolineArguments args(raw_args); \
static typeof(name) *func = name; static constexpr typeof(name) *func = name;
// Arguments // Arguments
struct TrampolineArguments { struct TrampolineArguments {

View File

@ -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 // Init
void _init_misc_graphics() { void _init_misc_graphics() {
// Disable V-Sync // Disable V-Sync
@ -554,6 +566,11 @@ void _init_misc_graphics() {
overwrite_call((void *) 0x4bf34, (void *) ItemInHandRenderer_renderItem_glTranslatef_injection); 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 // Don't Render Game In Headless Mode
if (reborn_is_headless()) { if (reborn_is_headless()) {
overwrite_calls(GameRenderer_render, nop<GameRenderer_render_t, GameRenderer *, float>); overwrite_calls(GameRenderer_render, nop<GameRenderer_render_t, GameRenderer *, float>);

View File

@ -15,6 +15,8 @@ method void renderSlotText(const ItemInstance *item, float x, float y, bool fini
method void handleKeyPressed(int key) = 0x25a08; method void handleKeyPressed(int key) = 0x25a08;
method void renderHearts() = 0x2641c; method void renderHearts() = 0x2641c;
method void renderDebugInfo() = 0x26958; 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 Minecraft *minecraft = 0x9f4;
property float selected_item_text_timer = 0x9fc; property float selected_item_text_timer = 0x9fc;

View File

@ -2,4 +2,6 @@ method void tick(bool param_1) = 0x531c4;
method int loadAndBindTexture(const std::string &name) = 0x539cc; method int loadAndBindTexture(const std::string &name) = 0x539cc;
method int assignTexture(const std::string &name, uchar *data) = 0x5354c; method int assignTexture(const std::string &name, uchar *data) = 0x5354c;
method void addDynamicTexture(DynamicTexture *texture) = 0x534f8; method void addDynamicTexture(DynamicTexture *texture) = 0x534f8;
method Texture *getTemporaryTextureData(uint id) = 0x53168; method Texture *getTemporaryTextureData(uint id) = 0x53168;
property bool blur = 0x39;