![]() |
|
|
#5 | |
|
Архивный участник
Join Date: Oct 2005
Posts: 330
|
Quote:
so it's not true you cant make perfect terrain from .bmp you just need not to open it with UTPT cuz it discards 8bit info p.s. catacomb of branded for some reason has serious problems and also terrain over tombs when it is 4100 layer has no flags ( devastated castle front of it, EG tomb ). i also think in some geos you frame it with flags utxreader.c #include <stdio.h> #include <stdlib.h> int main (int argc, char *argv[]) { FILE *fi, *fo; unsigned long int counter = 0; unsigned char dummy,height; unsigned int offset,size,realoffset; unsigned int x,y; if (argc != 5) { printf("Usage : utxreader 'UTX file' 'RAW file' 'OFFSET' 'SIZE'\n"); exit(0); } offset = atoi(argv[3]); size = atoi(argv[4]); realoffset = offset + size - 10 - 131072; if ((fi=fopen(argv[1],"rb"))!=NULL) { for (y=0;y<=realoffset-1;y++) fread(&dummy, sizeof(dummy), 1, fi); if ((fo=fopen(argv[2],"wb"))!=NULL) { for (x=0;x<=131071;x++) { fread(&height, sizeof(height), 1, fi); fwrite(&height, sizeof(height), 1, fo); counter++; } } fclose(fo); } fclose(fi); printf("%lu heights were written\n",counter); return 0; } |
|
|
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|