• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Tool: ds texture converter

knizz

  • 192
    Posts
    17
    Years
    • Seen Oct 28, 2020
    ds texture converter & map converter

    Actually this isn't a tool but a patch for nsbmd. Maybe someone with a windows-machine can compile this because I don't have one.

    Open the file "texture.cpp" and look for the line
    Code:
    glBindTexture( GL_TEXTURE_2D, i+1 );
    Before this line insert:
    Code:
    	{
    			char name[22];
    			strcpy(name,mat->texname);
    			strcat(name,".ppm");
    			FILE *f=fopen(name,"w");
    			printf("%d\n",f);
    			fprintf(f,"P6\n%d\n%d\n255\n",mat->width, mat->height);
    	
    			int ax,ay;
    			for(ay=0;ay<mat->height;ay++)
    				for(ax=0;ax<mat->width;ax++)
    					fwrite(image+(ax+ay*mat->width),3,1,f);
    			fclose(f);
    		}

    After you compile nsbmd it will dump every texture in the directory it was started in. If you can't open the textures (PPM-Format) try a software like GIMP.

    I attached the result of nsbmd and the 3rd entry of land_data.
     
    Last edited:
    Here is another useful snippet that "converts" land_data files to bmd format. You need Python to run this.

    Code:
    #!/usr/bin/python
    import sys
    for a in sys.argv[1:]:
    	b=open(a,"r").read()
    	c=b.find("BMD0")
    	d=256*(256*(256*ord(b[c+11])+ord(b[c+10]))+ord(b[c+9]))+ord(b[c+8])
    	open(a,"w").write(b[c:c+d])
     
    Back
    Top