1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-03 06:24:30 +00:00

Extract the assets from most of the overlays (#985)

* remove fake match

* Fire and Ice arrows

* Light arrows

* Ganon otyuka and end title

* Oceff_Spot

* Add missing Vtx to arrows

* Update assets/xml/overlays/ovl_Arrow_Ice.xml

Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com>

* Update assets/xml/overlays/ovl_Arrow_Light.xml

Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com>

* Fix fire arrows

* Update assets/xml/overlays/ovl_Arrow_Fire.xml

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* Update ovl_Bg_Ganon_Otyuka.xml

* Update src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* Change a comment and rename a DList

* rename DList

* Jya cobra

* shd and elf_msg

* elf msg 2

* En Bili

* Remove extern form ice piece

* remove some externs

* en holl

* kanban

* make

* sda

* ssh and some cleanup

* replace undefined sym in en_kusa

* st

* oceff wipe 3

* oceff wipe

* oceff spot

* oceff spot

* oceff wipe 4

* Update VTXDIS

* update VTXDIS again

* fix sun song

* magic dark

* magic wind and oceff wipe 2

* magic fire and oceff storm

* Update src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* Update assets/xml/overlays/ovl_En_Sth.xml.ignore

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* Update assets/xml/overlays/ovl_Elf_Msg.xml

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* Update assets/xml/overlays/ovl_Magic_Wind.xml

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* fix emptyDL, run formatter on en_ssh

* run formatter

* Update format.sh

* update to VTXDIS

* small change

* textureDL -> materialDL, vtxDL -> modelDL

* upper CASE

* setupDL -> materialDL

* GeometryDL->ModelDL and VisualDL->MaterialDL

* revert rcp.c

* revert holl.c

* another revert in rcp.c

* some u32 DL -> Gfx* DL

* the rest of dragorns comments

* git subrepo pull --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "3e9ed72e2"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "3e9ed72e2"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* start updating overlays with static

* en sth OK

* git subrepo pull --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "d0cd6b397"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "d0cd6b397"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* fix names of the overlays

* remove segment 128, add gameplay keep to global config file

* Fix end title and remove hex mode from VTXdis.c

* add code assets

Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com>
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
This commit is contained in:
louist103 2021-11-08 20:51:45 -05:00 committed by GitHub
parent fd512f02e9
commit 781d497264
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
105 changed files with 737 additions and 4801 deletions

View file

@ -7,7 +7,7 @@
#include <sys/stat.h>
#include <errno.h>
#define VTXDIS_VER "0.1"
#define VTXDIS_VER "0.2"
#define SWAP16(x) (((x & 0xFF00) >> 8) | ((x & 0x00FF) << 8))
@ -20,11 +20,11 @@ typedef struct {
static char *filename = NULL;
static char *data = NULL;
static int offset = 0;
static int data_len = 0;
static int count = 0;
static int32_t offset = 0;
static int32_t data_len = 0;
static int16_t count = 0;
const struct option cmdline_opts[] = {
static const struct option cmdline_opts[] = {
{ "offset", required_argument, NULL, 'o', },
{ "length", required_argument, NULL, 'l', },
{ "file" , required_argument, NULL, 'f', },
@ -35,8 +35,9 @@ const struct option cmdline_opts[] = {
};
static uint32_t parse_int(const char *num){
uint32_t ret = 0;
uint32_t ret;
char outnum[21];
if(strlen(num) > 2 && num[0] == '0' && (num[1] == 'x' || num[1] == 'X')) {
strncpy(outnum, &num[2], 20);
sscanf(outnum, "%"SCNx32, &ret);
@ -50,7 +51,7 @@ static uint32_t parse_int(const char *num){
}
static void print_usage(void)
static inline void print_usage(void)
{
puts("vtxdis version " VTXDIS_VER "\n"
"Usage:\n"
@ -67,25 +68,25 @@ static void print_usage(void)
);
}
static void print_version(void){
static inline void print_version(void){
puts("Version: " VTXDIS_VER);
}
static void print_vtx_data(Vtx *vtx, int vtx_cnt)
{
printf("{\n");
puts("{");
for(int i = 0; i < vtx_cnt; i++)
{
Vtx *v = &vtx[i];
printf(" VTX(%d, %d, %d, %d, %d, %d, %d, %d, %d),\n", v->pos[0], v->pos[1], v->pos[2], v->tpos[0], v->tpos[1], v->cn[0], v->cn[1], v->cn[2], v->cn[3]);
printf(" VTX(%d, %d, %d, %d, %d, 0x%02X, 0x%02X, 0x%02X, 0x%02X),\n", v->pos[0], v->pos[1], v->pos[2], v->tpos[0], v->tpos[1], v->cn[0], v->cn[1], v->cn[2], v->cn[3]);
}
printf("}\n");
puts("}");
}
static void parse_file(void)
{
int alloc_size = 0;
unsigned int alloc_size = 0;
struct stat sbuffer;
stat(filename, &sbuffer);
if(errno != 0){
@ -99,7 +100,7 @@ static void parse_file(void)
alloc_size = sizeof(Vtx) * count;
if((offset > 0 && (offset + alloc_size) > sbuffer.st_size) || alloc_size > sbuffer.st_size)
{
printf("Requested data is beyond file boundaries.");
puts("Requested data is beyond file boundaries.");
exit(1);
}
}
@ -109,7 +110,7 @@ static void parse_file(void)
if((offset > 0 && (offset + alloc_size) > sbuffer.st_size) || alloc_size > sbuffer.st_size)
{
printf("Requested data is beyond file boundaries.");
puts("Requested data is beyond file boundaries.");
exit(1);
}
}
@ -145,8 +146,7 @@ static void parse_file(void)
}
}
Vtx *data = NULL;
data = malloc(alloc_size);
Vtx *data = malloc(alloc_size);
if(!data){
fclose(file);
perror("Could not allocate vtx data");
@ -162,8 +162,8 @@ static void parse_file(void)
fclose(file);
int vtx_cnt = alloc_size / sizeof(Vtx);
for(int i = 0; i < vtx_cnt; i++){
unsigned int vtx_cnt = alloc_size / sizeof(Vtx);
for(unsigned int i = 0; i < vtx_cnt; i++){
Vtx *v = &data[i];
v->pos[0] = SWAP16(v->pos[0]);
@ -181,9 +181,8 @@ static void parse_file(void)
int main(int argc, char **argv)
{
int opt;
int argv_idx = 0;
while(1){
argv_idx++;
opt = getopt_long(argc, argv, "o:l:f:c:v?", cmdline_opts, NULL);
if(opt == -1){
break;
@ -215,35 +214,35 @@ int main(int argc, char **argv)
if (filename == NULL && data == NULL)
{
printf("Must specify -f or -d\n");
puts("Must specify -f or -d");
print_usage();
exit(1);
}
if(data_len < 0)
{
printf("Invalid -l/--length parameter passed.");
puts("Invalid -l/--length parameter passed.");
print_usage();
exit(1);
}
if(offset < 0)
{
printf("Invalid -o/--offset parameter passed.");
puts("Invalid -o/--offset parameter passed.");
print_usage();
exit(1);
}
if(count < 0)
{
printf("Invalid -c/--count parameter passed.");
puts("Invalid -c/--count parameter passed.");
print_usage();
exit(1);
}
if(count > 0 && data_len > 0)
{
printf("Cannot specify both -c/--count and -l/--length.");
puts("Cannot specify both -c/--count and -l/--length.");
print_usage();
exit(1);
}