Esempio n. 1
0
bool Image_TIFF::load_tiff(char * fname)
{
  tiff_handle = TIFFOpen(fname, "r");
  TIFFGetField(tiff_handle, TIFFTAG_IMAGEWIDTH, &_width);
  TIFFGetField(tiff_handle, TIFFTAG_IMAGELENGTH, &_height);
  _size = _width * _height;
  TIFFGetField(tiff_handle, TIFFTAG_BITSPERSAMPLE, &_depth);
  TIFFGetField(tiff_handle, TIFFTAG_SAMPLESPERPIXEL, &_comps);  
  TIFFGetField(tiff_handle, TIFFTAG_FILLORDER, &_order);
  TIFFGetField(tiff_handle, TIFFTAG_PLANARCONFIG, &_config);
  if (_comps <= 0 || _comps > 4) return false;
  if (_comps == 1) // gray scale data
    {
      init_gs();
      read_gs();
    }
  else if (_comps == 3)
    {
      init_rgb();
      read_rgb();
    }
  else
    {
      printf("..tiff found %d-samples per pixel (not supported) abort.\n", _comps);
      clear_gs();
      clear_rgb();
      return false;
    }
  printf("..libtiff loaded [%dx%d], depth(%d), comps(%d) image\n",_width, _height, _depth, _comps);
  return true;
}
Esempio n. 2
0
static void init_setup_tab( void )
{
   init_wg();
   init_wgs();
   init_wgt0();
   init_wgpt0();
   init_wgst0();
   init_wgspt0();
   init_wgf();
   init_wgfs();
   init_wgft0();
   init_wgfpt0();
   init_wgfst0();
   init_wgfspt0();
   init_t0();
   init_f();
   init_ft0();
   init_g();
   init_gs();
   init_gt0();
   init_gst0();
   init_gf();
   init_gfs();
   init_gft0();
   init_gfst0();
}
Esempio n. 3
0
static void init_setup_tab( void )
{
   init_wg();
   init_wgs();
   init_wgt0();
   init_wgt0t1();
   init_wgpt0();
   init_wgst0();
   init_wgst0t1();
   init_wgspt0();
   init_wgf();
   init_wgfs();
   init_wgft0();
   init_wgft0t1();
   init_wgfpt0();
   init_wgfst0();
   init_wgfst0t1();
   init_wgfspt0();
   init_t0();
   init_t0t1();
   init_f();
   init_ft0();
   init_ft0t1();
   init_g();
   init_gs();
   init_gt0();
   init_gt0t1();
   init_gst0();
   init_gst0t1();
   init_gf();
   init_gfs();
   init_gft0();
   init_gft0t1();
   init_gfst0();
   init_gfst0t1();
   /* Add proj texturing on t1 */
   init_wgpt0t1();
   init_wgspt0t1();
   init_wgfpt0t1();
   init_wgfspt0t1();
}
Esempio n. 4
0
void init_all(int argc, char **argv)
{
   cpu_info();

   char *config = 0, *bpx = 0, *labels = 0;

   char opt;
   while ((opt = getopt(argc, argv, "i:l:b:")) != EOF)
       switch (opt)
       {
       case 'i':
           config = optarg;
           break;
       case 'b':
           bpx = optarg;
           break;
       case 'l':
           labels = optarg;
       }

   temp.Minimized = false;

   init_z80tables();
   init_ie_help();
   load_config(config);
   //make_samples();
   #ifdef MOD_GS
   init_gs();
   #endif
   init_leds();
   init_tape();
   init_hdd_cd();
   start_dx();
   init_debug();
   applyconfig();
   main_reset();
   autoload();
   init_bpx(bpx);
   init_labels(labels);
   temp.Gdiplus = GdiplusStartup();
   if (!temp.Gdiplus)
   {
       color(CONSCLR_WARNING);
       printf("warning: gdiplus.dll was not loaded, only SCR and BMP screenshots available\n");
   }

   if (comp.ts.vdac2)
   {
     if (!vdac2::open_ft8xx())
     {
       color(CONSCLR_WARNING);
       printf("warning: ft8xx library was not loaded\n");
       comp.ts.vdac2 = false;
     }
   }
   
   load_errors = 0;
   trd_toload = 0;
   *(DWORD*)trd_loaded = 0; // clear loaded flags, don't see autoload'ed images

   for (; optind < argc; optind++)
   {
      char fname[0x200], *temp;
      GetFullPathName(argv[optind], sizeof fname, fname, &temp);

      trd_toload = DefaultDrive; // auto-select
      if (!loadsnap(fname)) errmsg("error loading <%s>", argv[optind]), load_errors = 1;
   }

   if (load_errors) {
      int code = MessageBox(wnd, "Some files, specified in\r\ncommand line, failed to load\r\n\r\nContinue emulation?", "File loading error", MB_YESNO | MB_ICONWARNING);
      if (code != IDYES) exit();
   }

   SetCurrentDirectory(conf.workdir);
//   timeBeginPeriod(1);

   InitializeCriticalSection(&tsu_toggle_cr);
}