Skip to content

Commit 387a507

Browse files
authored
Merge pull request FoxdieTeam#2132 from GirianSeed/unsuffix
Unsuffix work & next batch of changes (Vol.11)
2 parents 58d582a + 875039c commit 387a507

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+646
-565
lines changed

source/chara/snake/afterse.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
#include "libgv/libgv.h"
55
#include "game/game.h"
66

7-
typedef struct AfterseWork
7+
typedef struct _Work
88
{
99
GV_ACT actor;
1010
short sound;
1111
short time;
12-
} AfterseWork;
12+
} Work;
1313

1414
#define EXEC_LEVEL GV_ACTOR_AFTER
1515

16-
STATIC void AfterseAct_800603EC(AfterseWork *work)
16+
static void Act(Work *work)
1717
{
1818
if ( --work->time == 0 )
1919
{
@@ -28,16 +28,16 @@ STATIC void AfterseAct_800603EC(AfterseWork *work)
2828
}
2929
}
3030

31-
void *NewAfterse_800604C0(short sound, short time)
31+
void *NewAfterSe(short sound, short time)
3232
{
33-
AfterseWork *work;
33+
Work *work;
3434

3535
if (sound != 0 && time != 0)
3636
{
37-
work = GV_NewActor(EXEC_LEVEL, sizeof(AfterseWork));
37+
work = GV_NewActor(EXEC_LEVEL, sizeof(Work));
3838
if (work)
3939
{
40-
GV_SetNamedActor(&work->actor, AfterseAct_800603EC, NULL, "afterse.c");
40+
GV_SetNamedActor(&work->actor, Act, NULL, "afterse.c");
4141
work->sound = sound;
4242
work->time = time;
4343
return (void *)work;

source/chara/snake/afterse.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifndef __MGS_CHARA_AFTERSE_H__
22
#define __MGS_CHARA_AFTERSE_H__
33

4-
void *NewAfterse_800604C0(short sound, short time);
4+
void *NewAfterSe(short sound, short time);
55

66
#endif // __MGS_CHARA_AFTERSE_H__

source/chara/snake/shadow.c

Lines changed: 47 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,44 @@
11
#include "shadow.h"
22

3+
#include <sys/types.h>
4+
#include <libgte.h>
5+
#include <libgpu.h>
6+
37
#include "common.h"
8+
#include "libgv/libgv.h"
9+
#include "libdg/libdg.h"
410
#include "game/game.h"
511

6-
typedef struct ShadowWork
12+
/*---------------------------------------------------------------------------*/
13+
14+
#define EXEC_LEVEL GV_ACTOR_LEVEL5
15+
16+
#define SHADOW_FLAG ( DG_FLAG_TEXT | DG_FLAG_TRANS | DG_FLAG_SHADE \
17+
| DG_FLAG_GBOUND | DG_FLAG_ONEPIECE | DG_FLAG_AMBIENT )
18+
19+
typedef struct _Work
720
{
821
GV_ACT actor;
922
CONTROL *control;
1023
OBJECT *parent;
1124
OBJECT_NO_ROTS object;
1225
MATRIX light[2];
13-
int field_8C;
26+
int color; // Unused
1427
int enabled;
1528
SVECTOR indices;
16-
} ShadowWork;
29+
} Work;
1730

18-
typedef struct _Shadow_Scratch
31+
typedef struct _SCRPAD_DATA
1932
{
2033
SVECTOR iter[4];
2134
SVECTOR rot_in;
2235
VECTOR rot_out;
2336
MATRIX mtx;
24-
} Shadow_Scratch;
37+
} SCRPAD_DATA;
2538

26-
#define EXEC_LEVEL GV_ACTOR_LEVEL5
27-
#define SHADOW_FLAG ( DG_FLAG_TEXT | DG_FLAG_TRANS | DG_FLAG_GBOUND | DG_FLAG_SHADE | DG_FLAG_ONEPIECE | DG_FLAG_AMBIENT )
39+
/*---------------------------------------------------------------------------*/
2840

29-
void ShadowRotate_8005FD28(ShadowWork *work)
41+
static void RotateShadow(Work *work)
3042
{
3143
MATRIX *pWorld;
3244
MATRIX *pMatrix;
@@ -46,14 +58,14 @@ void ShadowRotate_8005FD28(ShadowWork *work)
4658
int iVar16;
4759
int iVar17;
4860

49-
Shadow_Scratch *pScratch = (Shadow_Scratch *)getScratchAddr(0);
61+
SCRPAD_DATA *pScratch = (SCRPAD_DATA *)getScratchAddr(0);
5062

5163
SVECTOR *iter1 = pScratch->iter;
5264
short *iter2 = (short *)&work->indices;
5365

54-
int iters = 4;
66+
int i;
5567

56-
do
68+
for (i = 4; i > 0; i--, iter1++, iter2++)
5769
{
5870
pMatrix = &work->parent->objs->objs[*iter2].world;
5971
iter1->vx = pMatrix->t[0];
@@ -63,11 +75,7 @@ void ShadowRotate_8005FD28(ShadowWork *work)
6375

6476
pMatrix = &work->parent->objs->objs[*iter2].world;
6577
iter1->vz = pMatrix->t[2];
66-
67-
iters--;
68-
iter1++;
69-
iter2++;
70-
} while (0 < iters);
78+
}
7179

7280
pScratch->mtx = work->parent->objs->world;
7381

@@ -90,9 +98,7 @@ void ShadowRotate_8005FD28(ShadowWork *work)
9098
iVar16 = 32000;
9199
iVar12 = 32000;
92100

93-
iters = 4;
94-
95-
do
101+
for (i = 4; i > 0; i--)
96102
{
97103
pScratch->rot_in.vx = psVar14->vx - lVar9;
98104
pScratch->rot_in.vy = psVar14->vy - lVar5;
@@ -121,8 +127,7 @@ void ShadowRotate_8005FD28(ShadowWork *work)
121127
}
122128

123129
psVar14++;
124-
iters--;
125-
} while (iters > 0);
130+
}
126131

127132
sVar6 = (iVar15 - iVar12) / 2;
128133
sVar7 = (iVar17 - iVar16) / 2;
@@ -144,9 +149,10 @@ void ShadowRotate_8005FD28(ShadowWork *work)
144149
pWorld->m[2][2] = sVar7;
145150
}
146151

147-
void ShadowMove_80060028(ShadowWork *work)
152+
static void MoveShadow(Work *work)
148153
{
149154
DG_OBJS *objs = work->object.objs;
155+
150156
RotMatrixY(work->control->rot.vy, &objs->world);
151157
objs->world.t[0] = work->parent->objs->world.t[0];
152158
objs->world.t[2] = work->parent->objs->world.t[2];
@@ -162,7 +168,7 @@ void ShadowMove_80060028(ShadowWork *work)
162168
}
163169
}
164170

165-
void ShadowAct_800600E4(ShadowWork *work)
171+
static void Act(Work *work)
166172
{
167173
if ((work->parent->objs->flag & DG_FLAG_INVISIBLE) || !work->enabled)
168174
{
@@ -171,18 +177,18 @@ void ShadowAct_800600E4(ShadowWork *work)
171177
else
172178
{
173179
DG_VisibleObjs(work->object.objs);
174-
ShadowRotate_8005FD28(work);
175-
ShadowMove_80060028(work);
180+
RotateShadow(work);
181+
MoveShadow(work);
176182
DG_GroupObjs(work->object.objs, work->parent->map_name);
177183
}
178184
}
179185

180-
void ShadowDie_80060190(ShadowWork *work)
186+
static void Die(Work *work)
181187
{
182188
GM_FreeObject((OBJECT *)&work->object);
183189
}
184190

185-
int ShadowGetResources_800601B0(ShadowWork *work, CONTROL *control, OBJECT *parent, SVECTOR indices)
191+
static int GetResources(Work *work, CONTROL *control, OBJECT *parent, SVECTOR indices)
186192
{
187193
GM_InitObjectNoRots(&work->object, GV_StrCode("kage"), SHADOW_FLAG, 0);
188194
GM_ConfigObjectLight((OBJECT *)&work->object, work->light);
@@ -203,21 +209,23 @@ int ShadowGetResources_800601B0(ShadowWork *work, CONTROL *control, OBJECT *pare
203209
work->control = control;
204210
work->parent = parent;
205211
work->indices = indices;
206-
work->field_8C = 0x2c484848;
207-
work->enabled = 1;
212+
work->color = MAKE_RGBA(72,72,72,0x2C); // POLY_FT4
213+
work->enabled = TRUE;
208214

209215
return 0;
210216
}
211217

212-
void *NewShadow_800602CC(CONTROL *control, OBJECT *parent, SVECTOR indices)
218+
/*---------------------------------------------------------------------------*/
219+
220+
void *NewShadow(CONTROL *control, OBJECT *parent, SVECTOR indices)
213221
{
214-
ShadowWork *work;
222+
Work *work;
215223

216-
work = GV_NewActor(EXEC_LEVEL, sizeof(ShadowWork));
217-
if (work)
224+
work = GV_NewActor(EXEC_LEVEL, sizeof(Work));
225+
if (work != NULL)
218226
{
219-
GV_SetNamedActor(&work->actor, ShadowAct_800600E4, ShadowDie_80060190, "shadow.c");
220-
if (ShadowGetResources_800601B0(work, control, parent, indices) >= 0)
227+
GV_SetNamedActor(&work->actor, Act, Die, "shadow.c");
228+
if (GetResources(work, control, parent, indices) >= 0)
221229
{
222230
return (void *)work;
223231
}
@@ -226,15 +234,14 @@ void *NewShadow_800602CC(CONTROL *control, OBJECT *parent, SVECTOR indices)
226234
return NULL;
227235
}
228236

229-
void *NewShadow2_80060384(CONTROL *control, OBJECT *pObj, SVECTOR indices, int **enabled)
237+
void *NewShadow2(CONTROL *control, OBJECT *parent, SVECTOR indices, int **enabled)
230238
{
231-
ShadowWork *work;
239+
Work *work;
232240

233-
work = (ShadowWork *)NewShadow_800602CC(control, pObj, indices);
234-
if (work && enabled)
241+
work = (Work *)NewShadow(control, parent, indices);
242+
if (work != NULL && enabled != NULL)
235243
{
236244
*enabled = &work->enabled;
237245
}
238-
239246
return (void *)work;
240247
}

source/chara/snake/shadow.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include "game/game.h"
55

6-
void *NewShadow_800602CC(CONTROL *control, OBJECT *parent, SVECTOR indices);
7-
void *NewShadow2_80060384(CONTROL *control, OBJECT *parent, SVECTOR indices, int **enabled);
6+
void *NewShadow(CONTROL *control, OBJECT *parent, SVECTOR indices);
7+
void *NewShadow2(CONTROL *control, OBJECT *parent, SVECTOR indices, int **enabled);
88

99
#endif // __MGS_CHARA_SHADOW_H__

source/chara/snake/sna_init.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include "libgv/libgv.h"
1212
#include "libdg/libdg.h"
1313
#include "libgcl/libgcl.h"
14-
#include "kojo/demothrd.h"
1514
#include "game/game.h"
1615
#include "linkvar.h"
1716
#include "okajima/blood.h"
@@ -4134,7 +4133,7 @@ void sna_knock_80054D68(SnaInitWork *work, int time)
41344133
{
41354134
temp_v0 = GM_GetNoiseSound(temp_v0, 0);
41364135
noise = temp_v0;
4137-
NewAfterse_800604C0(noise, 6);
4136+
NewAfterSe(noise, 6);
41384137
}
41394138
}
41404139
}
@@ -8537,7 +8536,7 @@ static inline int sna_LoadSnake(SnaInitWork *work, int scriptData, int scriptBin
85378536
shadow.vz = 12;
85388537
shadow.pad = 15;
85398538

8540-
work->field_888_pShadow = NewShadow2_80060384(pCtrl, pObject, shadow, &work->field_88C);
8539+
work->field_888_pShadow = NewShadow2(pCtrl, pObject, shadow, &work->field_88C);
85418540

85428541
dword_800ABA1C = 0;
85438542
GM_BombSeg = 0;

source/chara/snake_vr/sna_init.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include "libgv/libgv.h"
1414
#include "libdg/libdg.h"
1515
#include "libgcl/libgcl.h"
16-
#include "kojo/demothrd.h"
1716
#include "game/game.h"
1817
#include "linkvar.h"
1918
#include "okajima/blood.h"
@@ -3461,7 +3460,7 @@ void sna_knock_80054D68(SnaInitWork *work, int time)
34613460

34623461
temp_v0 = GM_GetNoiseSound(temp_v0, 0);
34633462
noise = temp_v0;
3464-
NewAfterse_800604C0(noise, 6);
3463+
NewAfterSe(noise, 6);
34653464
}
34663465
}
34673466
}
@@ -8102,7 +8101,7 @@ static inline int sna_LoadSnake(SnaInitWork *work, int scriptData, int scriptBin
81028101
shadow.vz = 12;
81038102
shadow.pad = 15;
81048103

8105-
work->field_888_pShadow = NewShadow2_80060384(pCtrl, body, shadow, &work->field_88C);
8104+
work->field_888_pShadow = NewShadow2(pCtrl, body, shadow, &work->field_88C);
81068105

81078106
dword_800ABA1C = 0;
81088107
GM_BombSeg = 0;

source/contrib/everything.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
#include "bullet/bullet.h"
5555
#include "equip/equip.h"
5656
#include "weapon/weapon.h"
57-
#include "kojo/demothrd.h"
57+
#include "kojo/demo.h"
5858
#include "menu/menuman.h"
5959
#include "menu/radar.h"
6060
#include "menu/radio.h"

source/equip/kogaku2.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,8 @@ void *NewKogaku3(CONTROL *control, OBJECT *parent, int num_parent)
388388
Work *work;
389389
DG_OBJS *objs;
390390
DG_DEF *def;
391-
int maxx, maxy, maxz;
392391
int minx, miny, minz;
392+
int maxx, maxy, maxz;
393393
int i;
394394
SVECTOR *vec_iter;
395395
int max, min;
@@ -411,43 +411,43 @@ void *NewKogaku3(CONTROL *control, OBJECT *parent, int num_parent)
411411
DG_UnShadeObjs(objs);
412412
DG_SetPos(&objs->objs[0].screen);
413413

414-
maxx = def->max.vx;
415-
maxy = def->max.vy;
416-
maxz = def->max.vz;
417-
418414
minx = def->min.vx;
419415
miny = def->min.vy;
420416
minz = def->min.vz;
421417

418+
maxx = def->max.vx;
419+
maxy = def->max.vy;
420+
maxz = def->max.vz;
421+
422422
vec_iter = vecs;
423423

424424
for (i = 9; i > 0; i--)
425425
{
426426
if (i & 1)
427427
{
428-
vec_iter->vx = maxx;
428+
vec_iter->vx = minx;
429429
}
430430
else
431431
{
432-
vec_iter->vx = minx;
432+
vec_iter->vx = maxx;
433433
}
434434

435435
if (i & 2)
436436
{
437-
vec_iter->vy = maxy;
437+
vec_iter->vy = miny;
438438
}
439439
else
440440
{
441-
vec_iter->vy = miny;
441+
vec_iter->vy = maxy;
442442
}
443443

444444
if (i & 4)
445445
{
446-
vec_iter->vz = maxz;
446+
vec_iter->vz = minz;
447447
}
448448
else
449449
{
450-
vec_iter->vz = minz;
450+
vec_iter->vz = maxz;
451451
}
452452

453453
vec_iter++;

source/game/script.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include "game/item.h"
1212
#include "game/delay.h"
1313
#include "menu/menuman.h"
14-
#include "kojo/demothrd.h"
14+
#include "kojo/demo.h"
1515
#include "strcode.h"
1616

1717
extern CAMERA GM_CameraList[8];

0 commit comments

Comments
 (0)