Если нравится наш проект, пожалуйста, поддержите любой приемлимой суммой чтобы помочь оплачивать хостинг. Спасибо!
Навигация  🇷🇺RU | 🇬🇧EN

Новые комментарии

Последние файлы

Пожертвования
[ Через Yoo.Money ]
(бывшие Яндекс.Деньги) 410011494554572

Contact us if you wish
PayPal or BitCoin donation

Наши друзья

Файловый архив

This software and its source code (if available) are licensed under the Apache-2.0 license (unless otherwise specified) which DOES NOT APPLY to any third-party code (such as zlib for example) and borrowed Assembler code (ripped code from other software executable files).


#pragma pack(push, 1)
typedef struct {
  char magic[16];
  uint8_t unused[8];
  uint16_t flags;
  uint16_t width;
  uint16_t height;
  uint32_t isize;
} img_head; /* 34 */
#pragma pack(pop)

int conv_img(FILE *fl, uint32_t sz, char *f) {
img_head head;
uint32_t l;
uint8_t *p;
char s[260];
  fseek(fl, 0, SEEK_SET);
  readdata(fl, &head, sizeof(head));
  if (
    (sz <= sizeof(head)) ||
    (!CheckMagic("RUSH Image File.", head.magic)) ||
    (sz != (sizeof(head) + head.isize)) ||
    (!head.width) || (!head.height) || (!head.isize)
  ) {
    return(3);
  }
  l = sizeof(tga_head) + (head.width * head.height * 2);
  p = (uint8_t *) malloc(head.isize + l);
  if (!p) {
    return(4);
  }
  strcpy(s, f);
  printf("%s -> ", s);
  newext(s, ".tga");
  printf("%s\n", s);
  readdata(fl, p, head.isize);
  tga_init(&p[head.isize], head.width, head.height);
  spr_unpack(p, head.isize, &p[head.isize + sizeof(tga_head)], head.width, head.height);
  dumpdata(s, &p[head.isize], l);
  free(p);
  return(0);
}
    © CTPAX-X 2006-2026 | engine version 2.7
Based on original site design by Blade

 

 

 
При копировании материалов ссылка на сайт WWW.CTPAX-X.ORG обязательна!
Использование материалов влечёт безоговорочное принятие правил сайта.
Количество запросов к БД: 7 | Страница сгенерирована за 0.055502 сек.