MCPcopy Create free account
hub / github.com/Meridian59/Meridian59 / CheckTextureNames

Function CheckTextureNames

roomedit/source/objects.cpp:4109–4241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4107*/
4108
4109BOOL CheckTextureNames ()
4110{
4111 BOOL rc = FALSE;
4112 SHORT n;
4113 char texname[MAX_BITMAPNAME+1];
4114 texname[MAX_BITMAPNAME] = '\0';
4115
4116 // Select WAIT cursor and save status bar message
4117 SELECT_WAIT_CURSOR();
4118 SAVE_WORK_MSG();
4119 TWorkDialog *pWorkDlg = new TWorkDialog;
4120 pWorkDlg->Create();
4121
4122 LogMessage ("\nVerifying texture names...\n");
4123
4124 /*
4125 TODO: What is this? PROTECTION (REMOVED!)
4126 if (FindMasterDir (MasterDir, "F2_START") == NULL)
4127 NumThings--;
4128 */
4129 pWorkDlg->SetRange(0, NumSectors-1);
4130 pWorkDlg->SetValue(0);
4131 pWorkDlg->SetWorkText ("Looking for invalid Sector texture names...");
4132
4133 for (n = 0; n < NumSectors; n++)
4134 {
4135 if ( n % 16 == 0 || n == NumSectors-1)
4136 {
4137 pWorkDlg->SetValue(n);
4138 COOPERATE();
4139 if ( pWorkDlg->Cancel )
4140 goto CheckTexturesNamesEnd;
4141
4142 // WorkMessage ("Looking for invalid Sector texture names %d/%d...",
4143 // n, NumSectors-1);
4144 }
4145 Sector *pSector = &Sectors[n];
4146
4147 strncpy (texname, pSector->ceilt, MAX_BITMAPNAME);
4148 if (! IsTextureNameInList (texname, FTexture, NumFTexture))
4149 {
4150 if ( CheckFailed (FALSE, "Invalid ceiling texture in Sector #%d.\n"
4151 "The name \"%s\" is not a floor/ceiling "
4152 "texture", n, texname))
4153 {
4154 GoToObject (OBJ_SECTORS, n);
4155 rc = TRUE;
4156 goto CheckTexturesNamesEnd;
4157 }
4158 }
4159
4160 strncpy (texname, pSector->floort, MAX_BITMAPNAME);
4161 if (! IsTextureNameInList (texname, FTexture, NumFTexture))
4162 {
4163 if (CheckFailed (FALSE, "Invalid floor texture in Sector #%d.\n"
4164 "The name \"%s\" is not a floor/ceiling"
4165 "texture", n, texname))
4166 {

Callers 1

CmCheckNamesMethod · 0.85

Calls 8

LogMessageFunction · 0.85
IsTextureNameInListFunction · 0.85
CheckFailedFunction · 0.85
GoToObjectFunction · 0.85
SetWorkTextMethod · 0.80
CreateMethod · 0.45
SetRangeMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected