char *empty_title = "-------- EMPTY --------";
int i, x, y;
- native_sp_level.game_sp = &game_sp;
-
native_sp_level.width = SP_STD_PLAYFIELD_WIDTH;
native_sp_level.height = SP_STD_PLAYFIELD_HEIGHT;
LevelInfoType *header = &native_sp_level.header;
int i, x, y;
- /* for details of the Supaplex level format, see Herman Perk's Supaplex
- documentation file "SPFIX63.DOC" from his Supaplex "SpeedFix" package */
+ // for details of the Supaplex level format, see Herman Perk's Supaplex
+ // documentation file "SPFIX63.DOC" from his Supaplex "SpeedFix" package
native_sp_level.width = MIN(width, SP_MAX_PLAYFIELD_WIDTH);
native_sp_level.height = MIN(height, SP_MAX_PLAYFIELD_HEIGHT);
// initial "freeze zonks": 2 == "on", anything else (0, 1) == "off"
header->InitialFreezeZonks = getFile8Bit(file);
- /* number of infotrons needed; 0 means that Supaplex will count the total
- amount of infotrons in the level and use the low byte of that number
- (a multiple of 256 infotrons will result in "0 infotrons needed"!) */
+ // number of infotrons needed; 0 means that Supaplex will count the total
+ // amount of infotrons in the level and use the low byte of that number
+ // (a multiple of 256 infotrons will result in "0 infotrons needed"!)
header->InfotronsNeeded = getFile8Bit(file);
// number of special ("gravity") port entries below (maximum 10 allowed)
}
if (i >= SP_MAX_TAPE_LEN)
- Error(ERR_WARN, "SP demo truncated: size exceeds maximum SP demo size %d",
+ Warn("SP demo truncated: size exceeds maximum SP demo size %d",
SP_MAX_TAPE_LEN);
native_sp_level.demo.length = i;
if (!(file = openFile(filename, MODE_READ)))
{
if (!level_info_only)
- Error(ERR_WARN, "cannot open file '%s' -- using empty level", filename);
+ Warn("cannot open file '%s' -- using empty level", filename);
return FALSE;
}
if (!strEqual(mpx_chunk_name, "MPX "))
{
- Error(ERR_WARN, "cannot find MPX ID in file '%s' -- using empty level",
- filename);
+ Warn("cannot find MPX ID in file '%s' -- using empty level", filename);
return FALSE;
}
if (mpx_version != 1)
{
- Error(ERR_WARN, "unknown MPX version in file '%s' -- using empty level",
- filename);
+ Warn("unknown MPX version in file '%s' -- using empty level", filename);
return FALSE;
}
if (mpx_level_count < 1)
{
- Error(ERR_WARN, "no MPX levels found in file '%s' -- using empty level",
- filename);
+ Warn("no MPX levels found in file '%s' -- using empty level", filename);
return FALSE;
}
if (level_pos >= mpx_level_count)
{
- Error(ERR_WARN, "MPX level not found in file '%s' -- using empty level",
- filename);
+ Warn("MPX level not found in file '%s' -- using empty level", filename);
return FALSE;
}
// position file stream to the requested level (in case of level package)
if (seekFile(file, file_seek_pos, SEEK_SET) != 0)
{
- Error(ERR_WARN, "cannot fseek in file '%s' -- using empty level", filename);
+ Warn("cannot fseek in file '%s' -- using empty level", filename);
return FALSE;
}
if (!reading_multipart_level && !is_multipart_level)
{
- /* the current level is simply a normal single-part level, and we are
- not reading a multi-part level yet, so return the level as it is */
+ // the current level is simply a normal single-part level, and we are
+ // not reading a multi-part level yet, so return the level as it is
break;
}
if (!reading_multipart_level && is_multipart_level && !is_first_part)
{
- /* this is a part of a multi-part level, but not the first part
- (and we are not already reading parts of a multi-part level);
- in this case, use an empty level instead of the single part */
+ // this is a part of a multi-part level, but not the first part
+ // (and we are not already reading parts of a multi-part level);
+ // in this case, use an empty level instead of the single part
use_empty_level = TRUE;
!strEqualN(header->LevelTitle, multipart_level.header.LevelTitle,
SP_LEVEL_NAME_LEN)))
{
- /* we are already reading parts of a multi-part level, but this level is
- either not a multi-part level, or a part of a different multi-part
- level; in both cases, the multi-part level seems to be complete */
+ // we are already reading parts of a multi-part level, but this level is
+ // either not a multi-part level, or a part of a different multi-part
+ // level; in both cases, the multi-part level seems to be complete
break;
}
if (multipart_xpos * SP_STD_PLAYFIELD_WIDTH > SP_MAX_PLAYFIELD_WIDTH ||
multipart_ypos * SP_STD_PLAYFIELD_HEIGHT > SP_MAX_PLAYFIELD_HEIGHT)
{
- Error(ERR_WARN, "multi-part level is too big -- ignoring part of it");
+ Warn("multi-part level is too big -- ignoring part of it");
break;
}
{
setLevelInfoToDefaults_SP();
- Error(ERR_WARN, "single part of multi-part level -- using empty level");
+ Warn("single part of multi-part level -- using empty level");
}
if (reading_multipart_level)
if (!(file = fopen(filename, MODE_WRITE)))
{
- Error(ERR_WARN, "cannot save native level file '%s'", filename);
+ Warn("cannot save native level file '%s'", filename);
return;
}