Fix: SE051 Problem: The Qt interface does not cope with tiles in x11tiles that are not 16x16. The comments suggest that it should, but the code is completely flawed. Note that while this will allow the Qt interface to use 32x32 tile sets there is still no support for selecting which tile file to open. The user would need to provide a symbolic link from x11tiles to x11bigtiles to do this. This will have to be changed. Compatible with: Slash'EM 0.0.6E0F2 Author: J. Ali Harlow, ali@avrc.city.ac.uk Date: 3 Mar 2000 *** ../slashem-0.0.6E0F2/win/Qt/qt_win.cpp Thu Mar 2 20:38:14 2000 --- ./win/Qt/qt_win.cpp Fri Mar 3 14:36:20 2000 *************** *** 192,201 **** extern short glyph2tile[]; // from tile.c } - // ### Try to replace these by looking at image size - #define TILEWBASE 16 - #define TILEHBASE 16 - #define TILEWMIN 4 #define TILEHMIN 4 --- 192,197 ---- *************** *** 3466,3474 **** char* tile_file = make_file_name(FILE_AREA_SHARE, "x11tiles"); #endif ! int tw = TILEWBASE; ! int th = TILEHBASE; ! if (!img.load(tile_file)) { #ifndef FILE_AREAS --- 3462,3468 ---- char* tile_file = make_file_name(FILE_AREA_SHARE, "x11tiles"); #endif ! int tw, th; if (!img.load(tile_file)) { #ifndef FILE_AREAS *************** *** 3483,3488 **** --- 3477,3483 ---- QMessageBox::warning(0, "IO Error", msg); } else { tiles_per_row = 40; + tiles_per_col = (total_tiles_used + 39) / 40; } } else { if (img.height()%tiles_per_col || img.width()%tiles_per_row) { *************** *** 3526,3538 **** if (!w || !h) return; // Still not decided ! if (w==TILEWBASE && h==TILEHBASE) { pm.convertFromImage(img); } else { QApplication::setOverrideCursor( Qt::waitCursor ); QImage scaled = img.smoothScale( ! w*img.width()/TILEWBASE, ! h*img.height()/TILEHBASE ); pm.convertFromImage(scaled,Qt::ThresholdDither|Qt::PreferDither); QApplication::restoreOverrideCursor(); --- 3521,3532 ---- if (!w || !h) return; // Still not decided ! if (w*tiles_per_row==img.width() && h*tiles_per_col==img.height()) { pm.convertFromImage(img); } else { QApplication::setOverrideCursor( Qt::waitCursor ); QImage scaled = img.smoothScale( ! w*tiles_per_row, h*tiles_per_col ); pm.convertFromImage(scaled,Qt::ThresholdDither|Qt::PreferDither); QApplication::restoreOverrideCursor();