• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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
    16
    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:

    knizz

  • 192
    Posts
    16
    Years
    • Seen Oct 28, 2020
    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