link a bunch of tools

This commit is contained in:
Prakxo
2023-09-27 22:32:44 +02:00
parent 81804c5395
commit c845e2916e
10 changed files with 426 additions and 13 deletions
+13 -13
View File
@@ -39,42 +39,42 @@ static void aTCB1_destruct(ACTOR* actor){
static void aTCB1_setupAction(ACTOR*actor, int action){
COBRA1_ACTOR* biscus = (COBRA1_ACTOR*)actor;
COBRA1_ACTOR* cobra = (COBRA1_ACTOR*)actor;
static COBRA1_PROC process[] = {
(COBRA1_PROC)none_proc1,(COBRA1_PROC)none_proc1,(COBRA1_PROC)none_proc1,aTCB1_destruct,(COBRA1_PROC)none_proc1,NULL
};
biscus->proc = process[action];
biscus->current_id = action;
biscus->tools_class.process_id = action;
cobra->proc = process[action];
cobra->current_id = action;
cobra->tools_class.process_id = action;
}
static void aTCB1_actor_move(ACTOR* actor, GAME*){
COBRA1_ACTOR* biscus = (COBRA1_ACTOR*)actor;
COBRA1_ACTOR* cobra = (COBRA1_ACTOR*)actor;
if(biscus->tools_class.process_id != biscus->current_id){
aTCB1_setupAction(actor, biscus->tools_class.process_id);
if(cobra->tools_class.process_id != cobra->current_id){
aTCB1_setupAction(actor, cobra->tools_class.process_id);
}
biscus->proc(actor);
cobra->proc(actor);
}
static void aTCB1_actor_draw(ACTOR* actor, GAME* game){
COBRA1_ACTOR* biscus = (COBRA1_ACTOR*)actor;
COBRA1_ACTOR* cobra = (COBRA1_ACTOR*)actor;
GRAPH* graph;
Gfx* gfxp;
if(biscus->tools_class.enable == 1){
if(cobra->tools_class.enable == 1){
graph = game->graph;
OPEN_DISP(graph);
Matrix_put(&biscus->tools_class.matrix_work);
Matrix_Position_Zero(&biscus->tools_class.actor_class.world.position);
Matrix_put(&cobra->tools_class.matrix_work);
Matrix_Position_Zero(&cobra->tools_class.actor_class.world.position);
biscus->tools_class.enable = 0;
cobra->tools_class.enable = 0;
_texture_z_light_fog_prim_npc(graph);
+90
View File
@@ -0,0 +1,90 @@
#include "ac_t_hasu1.h"
#include "m_name_table.h"
#include "sys_matrix.h"
#include "m_lib.h"
#include "m_rcp.h"
static void aTHS1_actor_ct(ACTOR* actor, GAME*);
static void aTHS1_actor_move(ACTOR* actor, GAME*);
static void aTHS1_actor_draw(ACTOR* actor, GAME*);
static void aTHS1_setupAction(ACTOR*, int);
ACTOR_PROFILE T_Hasu1_Profile = {
mAc_PROFILE_T_HASU1,
ACTOR_PART_BG,
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_16,
sizeof(HASU1_ACTOR),
&aTHS1_actor_ct,
NONE_ACTOR_PROC,
&aTHS1_actor_move,
&aTHS1_actor_draw,
NULL
};
extern Gfx crw_hasu1_body_model[];
static void aTHS1_actor_ct(ACTOR* actor, GAME*){
aTHS1_setupAction(actor,4);
}
static void aTHS1_destruct(ACTOR* actor){
Actor_delete(actor);
}
static void aTHS1_setupAction(ACTOR*actor, int action){
HASU1_ACTOR* hasu = (HASU1_ACTOR*)actor;
static HASU1_PROC process[] = {
(HASU1_PROC)none_proc1,(HASU1_PROC)none_proc1,(HASU1_PROC)none_proc1,aTHS1_destruct,(HASU1_PROC)none_proc1,NULL
};
hasu->proc = process[action];
hasu->current_id = action;
hasu->tools_class.process_id = action;
}
static void aTHS1_actor_move(ACTOR* actor, GAME*){
HASU1_ACTOR* hasu = (HASU1_ACTOR*)actor;
if(hasu->tools_class.process_id != hasu->current_id){
aTHS1_setupAction(actor, hasu->tools_class.process_id);
}
hasu->proc(actor);
}
static void aTHS1_actor_draw(ACTOR* actor, GAME* game){
HASU1_ACTOR* hasu = (HASU1_ACTOR*)actor;
GRAPH* graph;
Gfx* gfxp;
if(hasu->tools_class.enable == 1){
graph = game->graph;
OPEN_DISP(graph);
Matrix_put(&hasu->tools_class.matrix_work);
Matrix_Position_Zero(&hasu->tools_class.actor_class.world.position);
hasu->tools_class.enable = 0;
_texture_z_light_fog_prim_npc(graph);
gfxp = NOW_POLY_OPA_DISP;
gSPMatrix(gfxp++, _Matrix_to_Mtx_new(graph),G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxp++, crw_hasu1_body_model);
SET_POLY_OPA_DISP(gfxp);
CLOSE_DISP(graph);
}
}
+90
View File
@@ -0,0 +1,90 @@
#include "ac_t_hat1.h"
#include "m_name_table.h"
#include "sys_matrix.h"
#include "m_lib.h"
#include "m_rcp.h"
static void aTHT1_actor_ct(ACTOR* actor, GAME*);
static void aTHT1_actor_move(ACTOR* actor, GAME*);
static void aTHT1_actor_draw(ACTOR* actor, GAME*);
static void aTHT1_setupAction(ACTOR*, int);
ACTOR_PROFILE T_Hat1_Profile = {
mAc_PROFILE_T_HAT1,
ACTOR_PART_BG,
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_16,
sizeof(HAT1_ACTOR),
&aTHT1_actor_ct,
NONE_ACTOR_PROC,
&aTHT1_actor_move,
&aTHT1_actor_draw,
NULL
};
extern Gfx crw_hat1_body_model[];
static void aTHT1_actor_ct(ACTOR* actor, GAME*){
aTHT1_setupAction(actor,4);
}
static void aTHT1_destruct(ACTOR* actor){
Actor_delete(actor);
}
static void aTHT1_setupAction(ACTOR*actor, int action){
HAT1_ACTOR* hat = (HAT1_ACTOR*)actor;
static HAT1_PROC process[] = {
(HAT1_PROC)none_proc1,(HAT1_PROC)none_proc1,(HAT1_PROC)none_proc1,aTHT1_destruct,(HAT1_PROC)none_proc1,NULL
};
hat->proc = process[action];
hat->current_id = action;
hat->tools_class.process_id = action;
}
static void aTHT1_actor_move(ACTOR* actor, GAME*){
HAT1_ACTOR* hat = (HAT1_ACTOR*)actor;
if(hat->tools_class.process_id != hat->current_id){
aTHT1_setupAction(actor, hat->tools_class.process_id);
}
hat->proc(actor);
}
static void aTHT1_actor_draw(ACTOR* actor, GAME* game){
HAT1_ACTOR* hat = (HAT1_ACTOR*)actor;
GRAPH* graph;
Gfx* gfxp;
if(hat->tools_class.enable == 1){
graph = game->graph;
OPEN_DISP(graph);
Matrix_put(&hat->tools_class.matrix_work);
Matrix_Position_Zero(&hat->tools_class.actor_class.world.position);
hat->tools_class.enable = 0;
_texture_z_light_fog_prim_npc(graph);
gfxp = NOW_POLY_OPA_DISP;
gSPMatrix(gfxp++, _Matrix_to_Mtx_new(graph),G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxp++, crw_hat1_body_model);
SET_POLY_OPA_DISP(gfxp);
CLOSE_DISP(graph);
}
}
+90
View File
@@ -0,0 +1,90 @@
#include "ac_t_hat2.h"
#include "m_name_table.h"
#include "sys_matrix.h"
#include "m_lib.h"
#include "m_rcp.h"
static void aTHT2_actor_ct(ACTOR* actor, GAME*);
static void aTHT2_actor_move(ACTOR* actor, GAME*);
static void aTHT2_actor_draw(ACTOR* actor, GAME*);
static void aTHT2_setupAction(ACTOR*, int);
ACTOR_PROFILE T_Hat2_Profile = {
mAc_PROFILE_T_HAT2,
ACTOR_PART_BG,
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_16,
sizeof(HAT2_ACTOR),
&aTHT2_actor_ct,
NONE_ACTOR_PROC,
&aTHT2_actor_move,
&aTHT2_actor_draw,
NULL
};
extern Gfx crw_hat2_body_model[];
static void aTHT2_actor_ct(ACTOR* actor, GAME*){
aTHT2_setupAction(actor,4);
}
static void aTHT2_destruct(ACTOR* actor){
Actor_delete(actor);
}
static void aTHT2_setupAction(ACTOR*actor, int action){
HAT2_ACTOR* hat = (HAT2_ACTOR*)actor;
static HAT2_PROC process[] = {
(HAT2_PROC)none_proc1,(HAT2_PROC)none_proc1,(HAT2_PROC)none_proc1,aTHT2_destruct,(HAT2_PROC)none_proc1,NULL
};
hat->proc = process[action];
hat->current_id = action;
hat->tools_class.process_id = action;
}
static void aTHT2_actor_move(ACTOR* actor, GAME*){
HAT2_ACTOR* hat = (HAT2_ACTOR*)actor;
if(hat->tools_class.process_id != hat->current_id){
aTHT2_setupAction(actor, hat->tools_class.process_id);
}
hat->proc(actor);
}
static void aTHT2_actor_draw(ACTOR* actor, GAME* game){
HAT2_ACTOR* hat = (HAT2_ACTOR*)actor;
GRAPH* graph;
Gfx* gfxp;
if(hat->tools_class.enable == 1){
graph = game->graph;
OPEN_DISP(graph);
Matrix_put(&hat->tools_class.matrix_work);
Matrix_Position_Zero(&hat->tools_class.actor_class.world.position);
hat->tools_class.enable = 0;
_texture_z_light_fog_prim_npc(graph);
gfxp = NOW_POLY_OPA_DISP;
gSPMatrix(gfxp++, _Matrix_to_Mtx_new(graph),G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxp++, crw_hat2_body_model);
SET_POLY_OPA_DISP(gfxp);
CLOSE_DISP(graph);
}
}
+90
View File
@@ -0,0 +1,90 @@
#include "ac_t_hat3.h"
#include "m_name_table.h"
#include "sys_matrix.h"
#include "m_lib.h"
#include "m_rcp.h"
static void aTHT3_actor_ct(ACTOR* actor, GAME*);
static void aTHT3_actor_move(ACTOR* actor, GAME*);
static void aTHT3_actor_draw(ACTOR* actor, GAME*);
static void aTHT3_setupAction(ACTOR*, int);
ACTOR_PROFILE T_Hat3_Profile = {
mAc_PROFILE_T_HAT3,
ACTOR_PART_BG,
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
EMPTY_NO,
ACTOR_OBJ_BANK_16,
sizeof(HAT3_ACTOR),
&aTHT3_actor_ct,
NONE_ACTOR_PROC,
&aTHT3_actor_move,
&aTHT3_actor_draw,
NULL
};
extern Gfx crw_hat3_body_model[];
static void aTHT3_actor_ct(ACTOR* actor, GAME*){
aTHT3_setupAction(actor,4);
}
static void aTHT3_destruct(ACTOR* actor){
Actor_delete(actor);
}
static void aTHT3_setupAction(ACTOR*actor, int action){
HAT3_ACTOR* hat = (HAT3_ACTOR*)actor;
static HAT3_PROC process[] = {
(HAT3_PROC)none_proc1,(HAT3_PROC)none_proc1,(HAT3_PROC)none_proc1,aTHT3_destruct,(HAT3_PROC)none_proc1,NULL
};
hat->proc = process[action];
hat->current_id = action;
hat->tools_class.process_id = action;
}
static void aTHT3_actor_move(ACTOR* actor, GAME*){
HAT3_ACTOR* hat = (HAT3_ACTOR*)actor;
if(hat->tools_class.process_id != hat->current_id){
aTHT3_setupAction(actor, hat->tools_class.process_id);
}
hat->proc(actor);
}
static void aTHT3_actor_draw(ACTOR* actor, GAME* game){
HAT3_ACTOR* hat = (HAT3_ACTOR*)actor;
GRAPH* graph;
Gfx* gfxp;
if(hat->tools_class.enable == 1){
graph = game->graph;
OPEN_DISP(graph);
Matrix_put(&hat->tools_class.matrix_work);
Matrix_Position_Zero(&hat->tools_class.actor_class.world.position);
hat->tools_class.enable = 0;
_texture_z_light_fog_prim_npc(graph);
gfxp = NOW_POLY_OPA_DISP;
gSPMatrix(gfxp++, _Matrix_to_Mtx_new(graph),G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxp++, crw_hat3_body_model);
SET_POLY_OPA_DISP(gfxp);
CLOSE_DISP(graph);
}
}