diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index f2517f8d62..a1c1a10b7a 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -93,6 +93,9 @@ * `Force Touch GUI Button Behavior` To `Force Touch UI Button Behavior` * `Remove Forced GUI Lag (Can Break Joining Servers)` To `Remove Forced UI Lag (Can Break Joining Servers)` * `Hide Block Outline When GUI Is Hidden` To `Hide Block Outline When UI Is Hidden` + * `Fix Camera Functionality` To `Add Camera Functionality` + * `Fix Camera Rendering` To `Enable Camera Rendering` + * `Fix Camera Legs` To `Render Camera Legs` * Add Milk Buckets * Included In The `Add Buckets` Feature Flag * Removed `Property Scale Animated Textures` Feature Flag diff --git a/launcher/src/main.cpp b/launcher/src/main.cpp index c24a0cf790..3f70320c0a 100644 --- a/launcher/src/main.cpp +++ b/launcher/src/main.cpp @@ -33,7 +33,7 @@ static void setup_environment(const options_t &options) { // Setup MCPI_HOME setup_home(); // Create If Needed - const std::string minecraft_folder = std::string(getenv(_MCPI_HOME_ENV)) + get_home_subdirectory_for_game_data(); + const std::string minecraft_folder = home_get(); ensure_directory(minecraft_folder.c_str()); } diff --git a/libreborn/src/util/flags/available-feature-flags b/libreborn/src/util/flags/available-feature-flags index be39b048f3..3cedc4b29c 100644 --- a/libreborn/src/util/flags/available-feature-flags +++ b/libreborn/src/util/flags/available-feature-flags @@ -50,8 +50,8 @@ CATEGORY Rendering TRUE Multidraw Rendering TRUE Increase Render Chunk Size CATEGORY Camera - TRUE Fix Camera Rendering - TRUE Fix Camera Legs + TRUE Enable Camera Rendering + TRUE Render Camera Legs CATEGORY Block Outline TRUE Show Block Outlines TRUE Replace Block Highlight With Outline @@ -141,5 +141,5 @@ CATEGORY Miscellaneous TRUE Fullscreen Support TRUE Always Save Chest Tile Entities TRUE Screenshot Support - TRUE Fix Camera Functionality + TRUE Add Camera Functionality TRUE Update Default Options \ No newline at end of file diff --git a/media-layer/core/src/window/media.cpp b/media-layer/core/src/window/media.cpp index 1d4d0db5ce..c742e2cf7e 100644 --- a/media-layer/core/src/window/media.cpp +++ b/media-layer/core/src/window/media.cpp @@ -33,6 +33,7 @@ void media_SDL_WM_SetCaption(const char *title, __attribute__((unused)) const ch glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 5); // Extra Settings glfwWindowHint(GLFW_AUTO_ICONIFY, GLFW_FALSE); + glfwWindowHint(GLFW_ALPHA_BITS, 0); // Create Window glfw_window = create_glfw_window(title, DEFAULT_WIDTH, DEFAULT_HEIGHT); diff --git a/media-layer/core/src/window/offscreen.cpp b/media-layer/core/src/window/offscreen.cpp index c294127bcf..4d6d24a41a 100644 --- a/media-layer/core/src/window/offscreen.cpp +++ b/media-layer/core/src/window/offscreen.cpp @@ -14,6 +14,7 @@ void media_begin_offscreen_render(const int width, const int height) { glfwWindowHint(GLFW_ALPHA_BITS, 8); glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE); glfwWindowHint(GLFW_DECORATED, GLFW_FALSE); + glfwWindowHint(GLFW_ALPHA_BITS, 8); // Open Window offscreen_window = glfwCreateWindow(width, height, "Offscreen Rendering", nullptr, nullptr); if (!offscreen_window) { diff --git a/mods/src/camera/camera.cpp b/mods/src/camera/camera.cpp index 624a952987..6383db69c6 100644 --- a/mods/src/camera/camera.cpp +++ b/mods/src/camera/camera.cpp @@ -1,6 +1,9 @@ #include + #include +#include + #include #include #include @@ -20,6 +23,7 @@ static EntityRenderDispatcher *EntityRenderDispatcher_injection(EntityRenderDisp renderer->constructor(); dispatcher->assign((unsigned char) 0x5, (EntityRenderer *) renderer); + // Return return dispatcher; } @@ -49,19 +53,19 @@ static void TripodCameraRenderer_render_TileRenderer_tesselateCrossTexture_injec // Init void init_camera() { // Implement AppPlatform_linux::saveScreenshot So Cameras Work - if (feature_has("Fix Camera Functionality", server_disabled)) { + if (feature_has("Add Camera Functionality", server_disabled)) { overwrite_calls(AppPlatform_saveScreenshot, AppPlatform_saveScreenshot_injection); } // Fix Camera Rendering - if (feature_has("Fix Camera Rendering", server_disabled)) { + if (feature_has("Enable Camera Rendering", server_disabled)) { // Enable TripodCameraRenderer overwrite_calls(EntityRenderDispatcher_constructor, EntityRenderDispatcher_injection); // Display Smoke From TripodCamera Higher overwrite_call((void *) 0x87dc4, (void *) TripodCamera_tick_Level_addParticle_call_injection); } // Camera Legs - if (feature_has("Fix Camera Legs", server_disabled)) { + if (feature_has("Render Camera Legs", server_disabled)) { overwrite_call((void *) 0x659dc, (void *) TripodCameraRenderer_render_EntityRenderer_bindTexture_injection); overwrite_call((void *) 0x65a08, (void *) TripodCameraRenderer_render_TileRenderer_tesselateCrossTexture_injection); } diff --git a/mods/src/shading/lighting.cpp b/mods/src/shading/lighting.cpp index 31b7941da0..a16e8a5a7b 100644 --- a/mods/src/shading/lighting.cpp +++ b/mods/src/shading/lighting.cpp @@ -106,6 +106,13 @@ static void ArmorScreen_renderPlayer_glRotatef_injection(float angle, float x, f media_glRotatef(angle, x, y, z); } +// Fix Camera +static void TripodCameraRenderer_render_Tesselator_draw_injection(Tesselator *self) { + media_glDisable(GL_LIGHTING); + self->draw(); + media_glEnable(GL_LIGHTING); +} + // Init void _init_lighting() { overwrite_calls(LevelRenderer_renderEntities, LevelRenderer_renderEntities_injection); @@ -124,4 +131,5 @@ void _init_lighting() { overwrite_calls(MobRenderer_renderNameTag, MobRenderer_renderNameTag_injection); overwrite_calls(ArmorScreen_renderPlayer, ArmorScreen_renderPlayer_injection); overwrite_call((void *) 0x29d88, (void *) ArmorScreen_renderPlayer_glRotatef_injection); + overwrite_call((void *) 0x65a10, (void *) TripodCameraRenderer_render_Tesselator_draw_injection); } \ No newline at end of file