sm64ex-coop/data/dynos_c.cpp

143 lines
3.3 KiB
C++
Raw Normal View History

#include "dynos.cpp.h"
extern "C" {
#include "src/game/moving_texture.h"
void *dynos_swap_cmd(void *cmd) {
return DynOS_SwapCmd(cmd);
}
2022-03-31 08:04:41 +02:00
// -- built in -- //
void *dynos_update_cmd(void *cmd) {
return DynOS_UpdateCmd(cmd);
}
void dynos_update_gfx() {
return DynOS_UpdateGfx();
}
void dynos_update_opt(void *pad) {
return DynOS_UpdateOpt(pad);
}
s32 dynos_gfx_import_texture(void **output, void *ptr, s32 tile, void *grapi, void **hashmap, void *pool, s32 *poolpos, s32 poolsize) {
return DynOS_Gfx_ImportTexture(output, ptr, tile, grapi, hashmap, pool, (u32 *) poolpos, (u32) poolsize);
}
void dynos_gfx_swap_animations(void *ptr) {
return DynOS_Gfx_SwapAnimations(ptr);
}
2022-03-31 08:04:41 +02:00
// -- warps -- //
bool dynos_warp_to_level(s32 aLevel, s32 aArea, s32 aAct) {
return DynOS_Warp_ToLevel(aLevel, aArea, aAct);
}
bool dynos_warp_restart_level(void) {
return DynOS_Warp_RestartLevel();
}
bool dynos_warp_exit_level(s32 aDelay) {
return DynOS_Warp_ExitLevel(aDelay);
}
bool dynos_warp_to_castle(s32 aLevel) {
return DynOS_Warp_ToCastle(aLevel);
}
// -- dynos packs -- //
int dynos_packs_get_count(void) {
return DynOS_Gfx_GetPacks().Count();
}
const char* dynos_packs_get(s32 index) {
const char* path = DynOS_Gfx_GetPacks()[index]->mPath.c_str();
2022-03-31 08:04:41 +02:00
// extract basename
const char* cpath = path;
2022-03-31 08:04:41 +02:00
const char* ctoken = cpath;
while (*ctoken != '\0') {
if (*ctoken == '/' || *ctoken == '\\') {
if (*(ctoken + 1) != '\0') {
cpath = (ctoken + 1);
}
}
ctoken++;
}
return cpath;
}
bool dynos_packs_get_enabled(s32 index) {
return DynOS_Gfx_GetPacksEnabled()[index];
}
void dynos_packs_set_enabled(s32 index, bool value) {
DynOS_Gfx_GetPacksEnabled()[index] = value;
}
void dynos_generate_packs(const char* directory) {
DynOS_Gfx_GeneratePacks(directory);
}
// -- geos -- //
2022-04-16 22:05:10 +02:00
void dynos_add_actor_custom(const char *filePath, const char* geoName) {
DynOS_Actor_AddCustom(filePath, geoName);
2022-03-31 08:04:41 +02:00
}
const void* dynos_geolayout_get(const char *name) {
2022-04-09 03:56:22 +02:00
return DynOS_Actor_GetLayoutFromName(name);
2022-03-31 08:04:41 +02:00
}
// -- collisions -- //
2022-04-16 22:05:10 +02:00
void dynos_add_collision(const char *filePath, const char* collisionName) {
DynOS_Col_Activate(filePath, collisionName);
2022-03-31 08:04:41 +02:00
}
Collision* dynos_collision_get(const char* collisionName) {
return DynOS_Col_Get(collisionName);
}
// -- movtexqcs -- //
void dynos_movtexqc_register(const char* name, s16 level, s16 area, s16 type) {
DynOS_MovtexQC_Register(name, level, area, type);
}
struct MovtexQuadCollection* dynos_movtexqc_get_from_id(u32 id) {
DataNode<MovtexQC> *node = DynOS_MovtexQC_GetFromId(id);
if (node == NULL) { return NULL; }
return node->mData;
}
struct MovtexQuadCollection* dynos_movtexqc_get_from_index(s32 index) {
DataNode<MovtexQC> *node = DynOS_MovtexQC_GetFromIndex(index);
if (node == NULL) { return NULL; }
return node->mData;
}
// -- levels -- //
2022-04-16 22:05:10 +02:00
void dynos_add_level(s32 modIndex, const char *filePath, const char* levelName) {
DynOS_Lvl_Activate(modIndex, filePath, levelName);
}
const char* dynos_level_get_token(u32 index) {
2022-04-08 17:18:06 +02:00
return DynOS_Lvl_GetToken(index);
}
2022-04-09 08:01:41 +02:00
Trajectory* dynos_level_get_trajectory(const char* name) {
return DynOS_Lvl_GetTrajectory(name);
}
void dynos_level_load_background(void *ptr) {
2022-04-08 17:18:06 +02:00
DynOS_Lvl_LoadBackground(ptr);
}
2022-04-06 08:10:39 +02:00
}