| 1 | #pragma once |
| 2 | |
| 3 | #include <basis/seadTypes.h> |
| 4 | #include <common/aglRenderBuffer.h> |
| 5 | #include <container/seadPtrArray.h> |
| 6 | #include <gfx/seadCamera.h> |
| 7 | #include <math/seadMatrix.h> |
| 8 | #include <math/seadVector.h> |
| 9 | |
| 10 | #include "Library/Camera/IUseCamera.h" |
| 11 | #include "Library/HostIO/HioNode.h" |
| 12 | |
| 13 | namespace al { |
| 14 | |
| 15 | class SceneCameraInfo; |
| 16 | class ScreenCapture; |
| 17 | |
| 18 | class ScreenCaptureExecutor : public IUseHioNode { |
| 19 | public: |
| 20 | ScreenCaptureExecutor(s32); |
| 21 | ~ScreenCaptureExecutor(); |
| 22 | |
| 23 | void createScreenCapture(s32, s32, s32); |
| 24 | void draw(agl::DrawContext*, const agl::RenderBuffer*, s32) const; |
| 25 | void tryCapture(agl::DrawContext*, const agl::RenderBuffer*, s32); |
| 26 | void tryCaptureAndDraw(agl::DrawContext*, const agl::RenderBuffer*, s32); |
| 27 | |
| 28 | void requestCapture(bool, s32); |
| 29 | void onDraw(s32 screenCaptureIndex); |
| 30 | void offDraw(s32 screenCaptureIndex); |
| 31 | void offDraw(); |
| 32 | |
| 33 | bool isDraw(s32) const; |
| 34 | |
| 35 | private: |
| 36 | sead::PtrArray<ScreenCapture> mArray; |
| 37 | bool mIsCaptured; |
| 38 | }; |
| 39 | |
| 40 | u32 getDisplayWidth(); |
| 41 | u32 getDisplayHeight(); |
| 42 | u32 getLayoutDisplayWidth(); |
| 43 | u32 getLayoutDisplayHeight(); |
| 44 | u32 getVirtualDisplayWidth(); |
| 45 | u32 getVirtualDisplayHeight(); |
| 46 | u32 getSubDisplayWidth(); |
| 47 | u32 getSubDisplayHeight(); |
| 48 | |
| 49 | bool isInScreen(const sead::Vector2f&, f32); |
| 50 | |
| 51 | bool calcWorldPosFromScreen(sead::Vector3f* output, const sead::Vector2f&, const sead::Matrix34f&, |
| 52 | f32); // Always returns true |
| 53 | void calcWorldPosFromScreenPos(sead::Vector3f* output, const IUseCamera*, const sead::Vector2f&, |
| 54 | f32); |
| 55 | void calcWorldPosFromScreenPos(sead::Vector3f* output, const IUseCamera*, const sead::Vector2f&, |
| 56 | const sead::Vector3f&); |
| 57 | void calcWorldPosFromScreenPos(sead::Vector3f* output, const SceneCameraInfo*, |
| 58 | const sead::Vector2f&, f32, s32); |
| 59 | void calcWorldPosFromScreenPos(sead::Vector3f* output, const SceneCameraInfo*, |
| 60 | const sead::Vector2f&, const sead::Vector3f&, s32); |
| 61 | void calcWorldPosFromScreenPosSub(sead::Vector3f* output, const IUseCamera*, const sead::Vector2f&, |
| 62 | f32); |
| 63 | void calcWorldPosFromScreenPosSub(sead::Vector3f* output, const IUseCamera*, const sead::Vector2f&, |
| 64 | const sead::Vector3f&); |
| 65 | void calcWorldPosFromLayoutPos(sead::Vector3f* output, const IUseCamera*, const sead::Vector2f&, |
| 66 | f32); |
| 67 | void calcWorldPosFromLayoutPos(sead::Vector3f* output, const IUseCamera*, const sead::Vector2f&, |
| 68 | const sead::Vector3f&); |
| 69 | void calcWorldPosFromLayoutPos(sead::Vector3f* output, const SceneCameraInfo*, |
| 70 | const sead::Vector2f&, s32, s32); |
| 71 | void calcWorldPosFromLayoutPos(sead::Vector3f* output, const SceneCameraInfo*, |
| 72 | const sead::Vector2f&, const sead::Vector3f&, s32); |
| 73 | void calcWorldPosFromLayoutPosSub(sead::Vector3f* output, const IUseCamera*, const sead::Vector2f&, |
| 74 | f32); |
| 75 | void calcWorldPosFromLayoutPosSub(sead::Vector3f* output, const IUseCamera*, const sead::Vector2f&, |
| 76 | const sead::Vector3f&); |
| 77 | |
| 78 | void calcScreenPosFromWorldPos(sead::Vector2f* output, const IUseCamera*, const sead::Vector3f&); |
| 79 | void calcScreenPosFromWorldPosSub(sead::Vector2f* output, const IUseCamera*, const sead::Vector3f&); |
| 80 | void calcScreenPosFromLayoutPos(sead::Vector2f* output, const sead::Vector2f&); |
| 81 | f32 calcScreenRadiusFromWorldRadius(const sead::Vector3f&, const IUseCamera*, f32); |
| 82 | f32 calcScreenRadiusFromWorldRadiusSub(const sead::Vector3f&, const IUseCamera*, f32); |
| 83 | |
| 84 | void calcLayoutPosFromScreenPos(sead::Vector2f* output, const sead::Vector2f&); |
| 85 | void calcLayoutPosFromWorldPos(sead::Vector2f* output, const IUseCamera*, const sead::Vector3f&); |
| 86 | void calcLayoutPosFromWorldPos(sead::Vector3f* output, const IUseCamera*, const sead::Vector3f&); |
| 87 | void calcLayoutPosFromWorldPos(sead::Vector2f* output, const SceneCameraInfo*, |
| 88 | const sead::Vector3f&, s32); |
| 89 | void calcLayoutPosFromWorldPos(sead::Vector3f* output, const SceneCameraInfo*, |
| 90 | const sead::Vector3f&, s32); |
| 91 | void calcLayoutPosFromWorldPosSub(sead::Vector2f* output, const IUseCamera*, const sead::Vector3f&); |
| 92 | void calcLayoutPosFromWorldPosWithClampOutRange(sead::Vector3f* output, const IUseCamera*, |
| 93 | const sead::Vector3f&, f32, s32); |
| 94 | void calcLayoutPosFromWorldPosWithClampOutRange(sead::Vector3f* output, const SceneCameraInfo*, |
| 95 | const sead::Vector3f&, f32, s32); |
| 96 | void calcLayoutPosFromWorldPosWithClampByScreen(sead::Vector3f* output, const IUseCamera*, |
| 97 | const sead::Vector3f&); |
| 98 | f32 calcLayoutRadiusFromWorldRadius(const sead::Vector3f&, const IUseCamera*, f32); |
| 99 | |
| 100 | bool calcCameraPosToWorldPosDirFromScreenPos(sead::Vector3f* output, const IUseCamera*, |
| 101 | const sead::Vector2f&, f32); |
| 102 | bool calcCameraPosToWorldPosDirFromScreenPos(sead::Vector3f* output, const IUseCamera*, |
| 103 | const sead::Vector2f&, const sead::Vector3f&); |
| 104 | bool calcCameraPosToWorldPosDirFromScreenPos(sead::Vector3f* output, const SceneCameraInfo*, |
| 105 | const sead::Vector2f&, f32, s32); |
| 106 | bool calcCameraPosToWorldPosDirFromScreenPos(sead::Vector3f* output, const SceneCameraInfo*, |
| 107 | const sead::Vector2f&, const sead::Vector3f&, s32); |
| 108 | void calcCameraPosToWorldPosDirFromScreenPosSub(sead::Vector3f* output, const IUseCamera*, |
| 109 | const sead::Vector2f&, f32); |
| 110 | void calcCameraPosToWorldPosDirFromScreenPosSub(sead::Vector3f* output, const IUseCamera*, |
| 111 | const sead::Vector2f&, const sead::Vector3f&); |
| 112 | |
| 113 | void calcLineCameraToWorldPosFromScreenPos(sead::Vector3f* output1, sead::Vector3f* output2, |
| 114 | const IUseCamera*, const sead::Vector2f&); |
| 115 | void calcLineCameraToWorldPosFromScreenPos(sead::Vector3f* output1, sead::Vector3f* output2, |
| 116 | const IUseCamera*, const sead::Vector2f&, f32, f32); |
| 117 | void calcLineCameraToWorldPosFromScreenPos(sead::Vector3f* output1, sead::Vector3f* output2, |
| 118 | const SceneCameraInfo*, const sead::Vector2f&, s32); |
| 119 | void calcLineCameraToWorldPosFromScreenPos(sead::Vector3f* output1, sead::Vector3f* output2, |
| 120 | const SceneCameraInfo*, const sead::Vector2f&, f32, f32, |
| 121 | s32); |
| 122 | void calcLineCameraToWorldPosFromScreenPosSub(sead::Vector3f* output1, sead::Vector3f* output2, |
| 123 | const IUseCamera*, const sead::Vector2f&); |
| 124 | void calcLineCameraToWorldPosFromScreenPosSub(sead::Vector3f* output1, sead::Vector3f* output2, |
| 125 | const IUseCamera*, const sead::Vector2f&, f32, f32); |
| 126 | } // namespace al |
| 127 | |
| 128 | namespace ScreenFunction { |
| 129 | void calcWorldPositionFromCenterScreen(sead::Vector3f*, const sead::Vector2f&, |
| 130 | const sead::Vector3f&, const sead::Camera&, |
| 131 | const sead::Projection&, const sead::Viewport&); |
| 132 | } // namespace ScreenFunction |
| 133 | |