Skip to content

Commit d3f6fef

Browse files
committed
ci: generate message in pull requests
1 parent 5ad031a commit d3f6fef

7 files changed

Lines changed: 52 additions & 29 deletions

File tree

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ tab_width = 4
1212
insert_final_newline = true
1313
trim_trailing_whitespace = true
1414

15-
[{CMakeLists.txt,*.cmake}]
15+
[{CMakeLists.txt,*.cmake,*.yml}]
1616
indent_size = 2

.github/workflows/build.yml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,11 @@ jobs:
121121
curl -fLSs -o LEGORACERSPROGRESS-old.json $RELEASE_URL/LEGORACERSPROGRESS.json || echo "" >LEGORACERSPROGRESS-old.json
122122
curl -fLSs -o GOLDPPROGRESS-old.json $RELEASE_URL/GOLDPPROGRESS.json || echo "" >GOLDPPROGRESS-old.json
123123
124-
reccmp-reccmp --target LEGORACERS --nolib --diff LEGORACERSPROGRESS-old.json || echo "Current master not found"
125-
reccmp-reccmp --target GOLDP --nolib --diff GOLDPPROGRESS-old.json || echo "Current master not found"
124+
(reccmp-reccmp --target LEGORACERS --nolib --diff LEGORACERSPROGRESS-old.json || echo "Current master not found")>"LEGORACERS-diff.txt"
125+
(reccmp-reccmp --target GOLDP --nolib --diff GOLDPPROGRESS-old.json || echo "Current master not found")>"GOLDP-diff.txt"
126+
127+
cat LEGORACERS-diff.txt
128+
cat GOLDP-diff.txt
126129
127130
- name: Check Vtables
128131
if: ${{ steps.detection.conclusion == 'success' && always() }}
@@ -145,6 +148,30 @@ jobs:
145148
python tools/check_folded.py --target LEGORACERS
146149
python tools/check_folded.py --target GOLDP
147150
151+
- name: 'Create comment on PR'
152+
if: ${{ github.event_name == 'pull_request' }}
153+
shell: sh
154+
env:
155+
GH_TOKEN: ${{ github.token }}
156+
run: |
157+
cat <<EOF >reccmp-pr-message.txt
158+
# reccmp report
159+
## LEGORACERS (LEGORacers.exe)
160+
\`\`\`
161+
$(cat LEGORACERS-diff.txt | sed 's/\x1b\[[0-9;]*m//g')
162+
\`\`\`
163+
## GOLDP (GolDP.dll)
164+
\`\`\`
165+
$(cat GOLDP-diff.txt | sed 's/\x1b\[[0-9;]*m//g')
166+
\`\`\`
167+
EOF
168+
169+
gh pr comment ${{ github.event.number }} \
170+
--repo "${{ github.repository }}" \
171+
--create-if-none \
172+
--edit-last \
173+
--body-file "reccmp-pr-message.txt"
174+
148175
- name: Upload Artifact
149176
uses: actions/upload-artifact@main
150177
with:

GolDP/src/scene/golbillboardex.cpp

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ extern const LegoFloat g_unk0x1005675c = 1.0f;
2323
GolBillboardInitializerFunction g_unk0x1005c010 = &GolBillboard::FUN_10014e20;
2424
#pragma data_seg()
2525

26-
// STUB: GOLDP 0x10014e20
26+
// FUNCTION: GOLDP 0x10014e20
2727
void GolBillboard::FUN_10014e20()
2828
{
29-
g_billboardTexCoords[2].m_y = 0.0f;
3029
g_billboardTexCoords[1].m_y = g_unk0x1005675c;
3130
g_billboardTexCoords[2].m_x = g_unk0x1005675c;
31+
g_billboardTexCoords[2].m_y = 0.0f;
3232
g_billboardTexCoords[3].m_x = g_unk0x1005675c;
3333
g_billboardTexCoords[3].m_y = g_unk0x1005675c;
3434
}
@@ -49,22 +49,20 @@ LegoBool32 GolBillboard::FUN_10014e50(const GolVec3* p_arg1, const GolVec3* p_ar
4949

5050
if (m_flags & c_flagBit1) {
5151
row2 = &m_unk0x30;
52-
LegoFloat dot = row2->m_z * row0.m_z;
53-
dot += row0.m_y * row2->m_y;
54-
dot += row0.m_x * row2->m_x;
55-
row0.m_x -= dot * row2->m_x;
56-
row0.m_y -= row2->m_y * dot;
57-
row0.m_z -= row2->m_z * dot;
52+
LegoFloat dot = row0.m_x * row2->m_x + row0.m_y * row2->m_y + row2->m_z * row0.m_z;
53+
row0.m_x -= dot * m_unk0x30.m_x;
54+
row0.m_y -= dot * m_unk0x30.m_y;
55+
row0.m_z -= dot * m_unk0x30.m_z;
5856
}
5957
else {
6058
row2 = p_arg2;
6159
}
6260

6361
GolMath::NormalizeVector3(row0, &row0);
6462

65-
row1.m_x = row0.m_z * row2->m_y - row2->m_z * row0.m_y;
66-
row1.m_y = row2->m_z * row0.m_x - row0.m_z * row2->m_x;
67-
row1.m_z = row0.m_y * row2->m_x - row2->m_y * row0.m_x;
63+
row1.m_x = row2->m_y * row0.m_z - row2->m_z * row0.m_y;
64+
row1.m_y = row2->m_z * row0.m_x - row2->m_x * row0.m_z;
65+
row1.m_z = row2->m_x * row0.m_y - row2->m_y * row0.m_x;
6866

6967
p_matrix->m_m[0][0] = row0.m_x;
7068
p_matrix->m_m[0][1] = row0.m_y;
@@ -81,8 +79,8 @@ LegoBool32 GolBillboard::FUN_10014e50(const GolVec3* p_arg1, const GolVec3* p_ar
8179
p_matrix->m_m[2][2] = row2->m_z;
8280
p_matrix->m_m[2][3] = 0.0f;
8381

84-
LegoFloat halfWidth = m_width * 0.5f;
85-
LegoFloat halfHeight = m_height * 0.5f;
82+
LegoFloat halfWidth = m_width / 2.0f;
83+
LegoFloat halfHeight = m_height / 2.0f;
8684
p_matrix->m_m[3][0] = position.m_x - halfWidth * row1.m_x - halfHeight * row2->m_x;
8785
p_matrix->m_m[3][1] = position.m_y - halfWidth * row1.m_y - halfHeight * row2->m_y;
8886
p_matrix->m_m[3][2] = position.m_z - halfWidth * row1.m_z - halfHeight * row2->m_z;

LEGORacers/include/menu/widgets/menuwidget.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ class MenuWidget {
7373
Rect* GetGlobalRect();
7474
Rect* GetRect() { return &m_unk0x34; }
7575
LegoBool32 ClipRect(Rect*, Rect*);
76-
Rect* FUN_00472c80(Rect*, Rect*);
77-
Rect* MeasureText(GolFontBase*, GolString*, Rect*, Rect*, LegoS32);
76+
void FUN_00472c80(const Rect*, Rect*) const;
77+
void MeasureText(GolFontBase*, GolString*, Rect*, Rect*, LegoS32);
7878
void DrawImage(Rect*, Rect*, UtopianPan0xa4*);
7979
void DrawString(Rect*, Rect*, GolFontBase*, GolString*, LegoS32, LegoS32);
8080
Rect* TranslateRectByOffset(Rect*);

LEGORacers/src/menu/widgets/menuwidget.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,9 @@ undefined4 MenuWidget::HitTest(LegoS32 p_x, LegoS32 p_y)
211211
}
212212

213213
// STUB: LEGORACERS 0x00472c80
214-
Rect* MenuWidget::FUN_00472c80(Rect* p_source, Rect* p_dest)
214+
void MenuWidget::FUN_00472c80(const Rect* p_source, Rect* p_dest) const
215215
{
216-
Rect* source = p_source;
216+
const Rect* source = p_source;
217217
LegoU32 sourceTop = source->m_top;
218218
LegoU32 sourceHeight = source->m_bottom;
219219
LegoS32 sourceLeft = source->m_left;
@@ -248,12 +248,10 @@ Rect* MenuWidget::FUN_00472c80(Rect* p_source, Rect* p_dest)
248248
dest->m_top = source->m_top;
249249
dest->m_bottom = source->m_bottom;
250250
}
251-
252-
return dest;
253251
}
254252

255253
// FUNCTION: LEGORACERS 0x00472d00
256-
Rect* MenuWidget::MeasureText(
254+
void MenuWidget::MeasureText(
257255
GolFontBase* p_font,
258256
GolString* p_string,
259257
Rect* p_source,
@@ -275,7 +273,7 @@ Rect* MenuWidget::MeasureText(
275273
p_dest->m_top = 0;
276274
p_dest->m_right = width;
277275
p_dest->m_bottom = height;
278-
return FUN_00472c80(p_source, p_dest);
276+
FUN_00472c80(p_source, p_dest);
279277
}
280278

281279
// FUNCTION: LEGORACERS 0x00472d70

common/include/golfontbase.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class GolFontBase {
5757
LegoBool32 ComputeClipRect(GolRenderDevice*, Rect*, Rect*);
5858
void ClipRects(Rect*, Rect*, Rect*, LegoFloat, LegoFloat);
5959
static LegoS32 __cdecl CompareGlyphChars(const void* p_left, const void* p_right);
60-
void MeasureString(GolString* p_string, LegoS32* p_width, LegoS32* p_height);
60+
void MeasureString(GolString* p_string, LegoS32* p_width, LegoS32* p_height) const;
6161
void MeasureString(const LegoChar* p_string, LegoS32* p_width, LegoS32* p_height);
6262
void FUN_00408d50(
6363
GolString* p_string,
@@ -81,7 +81,7 @@ class GolFontBase {
8181
ColorRGBA* p_color,
8282
LegoS32 p_unk0x2c
8383
);
84-
LegoU32 FindGlyphIndex(LegoU16 p_char);
84+
LegoU32 FindGlyphIndex(LegoU16 p_char) const;
8585

8686
LegoBool32 HasLoadedData() const { return m_glyphs != NULL; }
8787
void SetColor(LegoU8 p_red, LegoU8 p_green, LegoU8 p_blue, LegoU8 p_alpha)

common/src/golfontbase.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,9 +458,9 @@ void GolFontBase::CopyGlyphsToTextures()
458458

459459
// FUNCTION: GOLDP 0x1001e970
460460
// FUNCTION: LEGORACERS 0x00408be0
461-
void GolFontBase::MeasureString(GolString* p_string, LegoS32* p_width, LegoS32* p_height)
461+
void GolFontBase::MeasureString(GolString* p_string, LegoS32* p_width, LegoS32* p_height) const
462462
{
463-
GolFontBase* font = this;
463+
const GolFontBase* font = this;
464464

465465
if (p_string == NULL) {
466466
if (p_width != NULL) {
@@ -824,7 +824,7 @@ void GolFontBase::FUN_00408fe0(
824824
}
825825

826826
// FUNCTION: LEGORACERS 0x004092b0
827-
LegoU32 GolFontBase::FindGlyphIndex(LegoU16 p_char)
827+
LegoU32 GolFontBase::FindGlyphIndex(LegoU16 p_char) const
828828
{
829829
LegoS32 low = 0;
830830
LegoS32 high = m_glyphCount - 1;

0 commit comments

Comments
 (0)