| 3847 | */ |
| 3848 | |
| 3849 | BOOL CheckTextures () |
| 3850 | { |
| 3851 | BOOL rc = FALSE; |
| 3852 | SHORT n; |
| 3853 | char texname[MAX_BITMAPNAME+1]; |
| 3854 | texname[MAX_BITMAPNAME] = '\0'; |
| 3855 | |
| 3856 | // Select WAIT cursor and save status bar message |
| 3857 | SELECT_WAIT_CURSOR(); |
| 3858 | SAVE_WORK_MSG(); |
| 3859 | TWorkDialog *pWorkDlg = new TWorkDialog; |
| 3860 | pWorkDlg->Create(); |
| 3861 | LogMessage( "\nVerifying textures...\n"); |
| 3862 | |
| 3863 | pWorkDlg->SetRange(0, NumSectors-1); |
| 3864 | pWorkDlg->SetValue(0); |
| 3865 | pWorkDlg->SetWorkText ("Checking texture and height of Sectors..."); |
| 3866 | for (n = 0; n < NumSectors; n++) |
| 3867 | { |
| 3868 | Sector *pSector = &Sectors[n]; |
| 3869 | |
| 3870 | if ( n % 16 == 0 || n == NumSectors-1) |
| 3871 | { |
| 3872 | pWorkDlg->SetValue(n); |
| 3873 | //WorkMessage ("Checking texture and height of Sectors %d/%d...", |
| 3874 | // n, NumSectors-1); |
| 3875 | } |
| 3876 | // Check ceiling texture |
| 3877 | strncpy (texname, pSector->ceilt, MAX_BITMAPNAME); |
| 3878 | if (texname[0] == '-' && texname[1] == '\0') |
| 3879 | { |
| 3880 | CheckFailed (TRUE, "Error: Sector #%d has no ceiling texture.\n" |
| 3881 | "You probaly used a brain-damaged editor to " |
| 3882 | "do that...", n); |
| 3883 | GoToObject (OBJ_SECTORS, n); |
| 3884 | rc = TRUE; |
| 3885 | goto CheckTexturesEnd; |
| 3886 | } |
| 3887 | |
| 3888 | // Check floor texture |
| 3889 | strncpy (texname, pSector->ceilt, MAX_BITMAPNAME); |
| 3890 | if (texname[0] == '-' && texname[1] == '\0') |
| 3891 | { |
| 3892 | CheckFailed (TRUE, "Error: Sector #%d has no floor texture.\n" |
| 3893 | "You probaly used a brain-damaged editor " |
| 3894 | "to do that...", n); |
| 3895 | GoToObject (OBJ_SECTORS, n); |
| 3896 | rc = TRUE; |
| 3897 | goto CheckTexturesEnd; |
| 3898 | } |
| 3899 | |
| 3900 | // Check floor and ceiling heights |
| 3901 | if (pSector->ceilh < pSector->floorh) |
| 3902 | { |
| 3903 | CheckFailed (TRUE, "Error: Sector #%d has its ceiling lower than " |
| 3904 | "its floor.\nThe textures will never be " |
| 3905 | "displayed if you cannot go there", n); |
| 3906 | GoToObject( OBJ_SECTORS, n); |
no test coverage detected