Skip to content

gfx: fill out seadProjection.h#167

Merged
MonsterDruide1 merged 6 commits intoopen-ead:masterfrom
tetraxile:ortho-projection
Apr 3, 2025
Merged

gfx: fill out seadProjection.h#167
MonsterDruide1 merged 6 commits intoopen-ead:masterfrom
tetraxile:ortho-projection

Conversation

@tetraxile
Copy link
Contributor

@tetraxile tetraxile commented Mar 15, 2025

This change is Reviewable

@aboood40091
Copy link
Contributor

#129 (comment)

@MonsterDruide1
Copy link
Contributor

@aboood40091 Where do you get that information from?

@MonsterDruide1
Copy link
Contributor

@aboood40091 Any news on this?

@aboood40091
Copy link
Contributor

@aboood40091 Where do you get that information from?

An information source I'd rather not disclose for the time being.

Anyway, feel free to not trust me on that because there is another justification which IMO is convincing enough: sead is pretty consistent with its equivalence between cpp files and headers (i.e., cpp file name == header file name), and ALL projection classes are implemented in seadProjection.cpp. (Similarly, ALL camera classes are implemented in seadCamera.cpp)

@MonsterDruide1
Copy link
Contributor

Hmm, undisclosed information is hard to verify. I can confirm the second statement though - for example, the OrthoProjection constructor has an assert in line 461 within seadProjection.cpp in Labo, so that would confirm that side - and splitting up the headers when the cpp is merged makes no sense, so I agree with your conclusion, despite not liking your way to get there.

@tetraxile Seems like the order is Projection, OrthoProjection, FrustumProjection, DirectionProjection, all behind each other in seadProjection.*. Please adjust this PR accordingly.

@aboood40091
Copy link
Contributor

I can confirm the second statement though - for example, the OrthoProjection constructor has an assert in line 461 within seadProjection.cpp in Labo

For reference, this can also be seen in the MK8 symbol map.

I agree with your conclusion, despite not liking your way to get there.

Fair enough, although I did give you an alternative justification, as you also confirmed.

@tetraxile tetraxile changed the title gfx: add OrthoProjection header gfx: fill out seadProjection.h Apr 2, 2025
Copy link
Contributor

@MonsterDruide1 MonsterDruide1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 2 files at r4, 1 of 1 files at r5, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @tetraxile)


include/gfx/seadProjection.h line 135 at r5 (raw file):

    void setBoundBox(const BoundBox2f& boundBox);
    void setByViewport(const Viewport& viewport);
    void setTBLR(f32 top, f32 left, f32 bottom, f32 right);

Suggestion:

void setTBLR(f32 top, f32 bottom, f32 left, f32 right);

include/gfx/seadProjection.h line 162 at r5 (raw file):

    void getOffset(Vector2f* offset) const override;
    f32 getOffsetX() const override;
    f32 getOffsetY() const override;

Suggestion:

    u32 getProjectionType() const override;

include/gfx/seadProjection.h line 168 at r5 (raw file):

    void setTBLR(f32 top, f32 bottom, f32 left, f32 right) override;
    void setBoundBox(BoundBox2f& boundBox);
    void createDividedProjection(FrustumProjection* out, s32, s32, s32, s32);

Suggestion:

void createDividedProjection(FrustumProjection* out, s32, s32, s32, s32) const;

include/gfx/seadProjection.h line 169 at r5 (raw file):

    void setBoundBox(BoundBox2f& boundBox);
    void createDividedProjection(FrustumProjection* out, s32, s32, s32, s32);
    void setFovyAspectOffset(f32 fovy, f32 aspect, const Vector2f& offset);

Suggestion:

    void createDividedProjection(FrustumProjection* out, s32, s32, s32, s32);
    f32 getOffsetX() const;
    f32 getOffsetY() const;
    void setFovyAspectOffset(f32 fovy, f32 aspect, const Vector2f& offset);

include/gfx/seadProjection.h line 195 at r5 (raw file):

    f32 getAspect() const override;
    void getOffset(Vector2f* offset) const override;
    void updateAttributesForDirectProjection();

Suggestion:

    void getOffset(Vector2f* offset) const override;
    u32 getProjectionType() const override;
    void updateAttributesForDirectProjection();

Copy link
Contributor Author

@tetraxile tetraxile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 of 2 files reviewed, 5 unresolved discussions (waiting on @MonsterDruide1)


include/gfx/seadProjection.h line 135 at r5 (raw file):

    void setBoundBox(const BoundBox2f& boundBox);
    void setByViewport(const Viewport& viewport);
    void setTBLR(f32 top, f32 left, f32 bottom, f32 right);

done


include/gfx/seadProjection.h line 162 at r5 (raw file):

    void getOffset(Vector2f* offset) const override;
    f32 getOffsetX() const override;
    f32 getOffsetY() const override;

done


include/gfx/seadProjection.h line 168 at r5 (raw file):

    void setTBLR(f32 top, f32 bottom, f32 left, f32 right) override;
    void setBoundBox(BoundBox2f& boundBox);
    void createDividedProjection(FrustumProjection* out, s32, s32, s32, s32);

done


include/gfx/seadProjection.h line 169 at r5 (raw file):

    void setBoundBox(BoundBox2f& boundBox);
    void createDividedProjection(FrustumProjection* out, s32, s32, s32, s32);
    void setFovyAspectOffset(f32 fovy, f32 aspect, const Vector2f& offset);

done


include/gfx/seadProjection.h line 195 at r5 (raw file):

    f32 getAspect() const override;
    void getOffset(Vector2f* offset) const override;
    void updateAttributesForDirectProjection();

done

Copy link
Contributor

@MonsterDruide1 MonsterDruide1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r6, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @tetraxile)

@MonsterDruide1 MonsterDruide1 merged commit 4660452 into open-ead:master Apr 3, 2025
2 checks passed
@Esras Esras mentioned this pull request Jul 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants