Fixed a divide by zero bug in the convertMapToValve220 cmd

This commit is contained in:
Robert Beckebans 2022-03-02 09:27:09 +01:00
parent daf5ed43c0
commit 6d7ebabcbf

View file

@ -220,6 +220,16 @@ void idMapBrushSide::ConvertToValve220Format( const idMat4& entityTransform, idS
texScale[0] = 1.0f / idMath::Sqrt( localMat[0][0] * localMat[0][0] + localMat[1][0] * localMat[1][0] );
texScale[1] = 1.0f / idMath::Sqrt( localMat[0][1] * localMat[0][1] + localMat[1][1] * localMat[1][1] );
if( IsNAN( texScale[0] ) )
{
texScale[0] = 0.5f;
}
if( IsNAN( texScale[1] ) )
{
texScale[1] = 0.5f;
}
if( texMat[0][0] < idMath::FLOAT_EPSILON )
{
texValve[0] = -texValve[0];
@ -3798,8 +3808,271 @@ static quakeToDoom_t textureConvertNames[] =
{"textures/wwood1_7", "textures/id1/wwood1_7"},
{"textures/z_exit", "textures/id1/z_exit"},
// prototype.wad
{"textures/#64_water1_1", "textures/id1/64_water1_1"},
{"textures/#64_water1_2", "textures/id1/64_water1_2"},
{"textures/#64_water1_3", "textures/id1/64_water1_3"},
{"textures/#64_water2_1", "textures/id1/64_water2_1"},
{"textures/#64_water2_2", "textures/id1/64_water2_2"},
{"textures/#64_water2_3", "textures/id1/64_water2_3"},
{"textures/#lava2_1", "textures/id1/lava2_1"},
{"textures/#lava2_2", "textures/id1/lava2_2"},
{"textures/#lava2_3", "textures/id1/lava2_3"},
{"textures/#lava_64_1", "textures/id1/lava_64_1"},
{"textures/#lava_64_2", "textures/id1/lava_64_2"},
{"textures/#lava_64_3", "textures/id1/lava_64_3"},
{"textures/#lavaskip", "textures/id1/lavaskip"},
{"textures/#slime2_1", "textures/id1/slime2_1"},
{"textures/#slime2_2", "textures/id1/slime2_2"},
{"textures/#slime2_3", "textures/id1/slime2_3"},
{"textures/#slimeskip", "textures/id1/slimeskip"},
{"textures/#tele01", "textures/id1/tele01"},
{"textures/#water3_1", "textures/id1/water3_1"},
{"textures/#water3_2", "textures/id1/water3_2"},
{"textures/#water3_3", "textures/id1/water3_3"},
{"textures/#waterskip", "textures/id1/waterskip"},
{"textures/+0button_0", "textures/id1/0button_0"},
{"textures/+0button_1", "textures/id1/0button_1"},
{"textures/+0button_2", "textures/id1/0button_2"},
{"textures/+0button_3", "textures/id1/0button_3"},
{"textures/+0shbtn_1", "textures/id1/0shbtn_1"},
{"textures/+0shbtn_2", "textures/id1/0shbtn_2"},
{"textures/+0shbtn_3", "textures/id1/0shbtn_3"},
{"textures/+0shbtn_4", "textures/id1/0shbtn_4"},
{"textures/+0shbtn_5", "textures/id1/0shbtn_5"},
{"textures/+0shbtn_6", "textures/id1/0shbtn_6"},
{"textures/+0shbtn_7", "textures/id1/0shbtn_7"},
{"textures/+1button_0", "textures/id1/1button_0"},
{"textures/+1button_1", "textures/id1/1button_1"},
{"textures/+1button_2", "textures/id1/1button_2"},
{"textures/+1button_3", "textures/id1/1button_3"},
{"textures/+1shbtn_1", "textures/id1/1shbtn_1"},
{"textures/+1shbtn_2", "textures/id1/1shbtn_2"},
{"textures/+1shbtn_3", "textures/id1/1shbtn_3"},
{"textures/+1shbtn_4", "textures/id1/1shbtn_4"},
{"textures/+1shbtn_5", "textures/id1/1shbtn_5"},
{"textures/+1shbtn_6", "textures/id1/1shbtn_6"},
{"textures/+1shbtn_7", "textures/id1/1shbtn_7"},
{"textures/128_blood_1", "textures/id1/128_blood_1"},
{"textures/128_blood_2", "textures/id1/128_blood_2"},
{"textures/128_blood_3", "textures/id1/128_blood_3"},
{"textures/128_blue_1", "textures/id1/128_blue_1"},
{"textures/128_blue_2", "textures/id1/128_blue_2"},
{"textures/128_blue_3", "textures/id1/128_blue_3"},
{"textures/128_brown_1", "textures/id1/128_brown_1"},
{"textures/128_brown_2", "textures/id1/128_brown_2"},
{"textures/128_brown_3", "textures/id1/128_brown_3"},
{"textures/128_cyan_1", "textures/id1/128_cyan_1"},
{"textures/128_cyan_2", "textures/id1/128_cyan_2"},
{"textures/128_cyan_3", "textures/id1/128_cyan_3"},
{"textures/128_gold_1", "textures/id1/128_gold_1"},
{"textures/128_gold_2", "textures/id1/128_gold_2"},
{"textures/128_gold_3", "textures/id1/128_gold_3"},
{"textures/128_green_1", "textures/id1/128_green_1"},
{"textures/128_green_2", "textures/id1/128_green_2"},
{"textures/128_green_3", "textures/id1/128_green_3"},
{"textures/128_grey_1", "textures/id1/128_grey_1"},
{"textures/128_grey_2", "textures/id1/128_grey_2"},
{"textures/128_grey_3", "textures/id1/128_grey_3"},
{"textures/128_honey_1", "textures/id1/128_honey_1"},
{"textures/128_honey_2", "textures/id1/128_honey_2"},
{"textures/128_honey_3", "textures/id1/128_honey_3"},
{"textures/16_blood_1", "textures/id1/16_blood_1"},
{"textures/16_blood_2", "textures/id1/16_blood_2"},
{"textures/16_blood_3", "textures/id1/16_blood_3"},
{"textures/16_blue_1", "textures/id1/16_blue_1"},
{"textures/16_blue_2", "textures/id1/16_blue_2"},
{"textures/16_blue_3", "textures/id1/16_blue_3"},
{"textures/16_brown_1", "textures/id1/16_brown_1"},
{"textures/16_brown_2", "textures/id1/16_brown_2"},
{"textures/16_brown_3", "textures/id1/16_brown_3"},
{"textures/16_cyan_1", "textures/id1/16_cyan_1"},
{"textures/16_cyan_2", "textures/id1/16_cyan_2"},
{"textures/16_cyan_3", "textures/id1/16_cyan_3"},
{"textures/16_gold_1", "textures/id1/16_gold_1"},
{"textures/16_gold_2", "textures/id1/16_gold_2"},
{"textures/16_gold_3", "textures/id1/16_gold_3"},
{"textures/16_green_1", "textures/id1/16_green_1"},
{"textures/16_green_2", "textures/id1/16_green_2"},
{"textures/16_green_3", "textures/id1/16_green_3"},
{"textures/16_grey_1", "textures/id1/16_grey_1"},
{"textures/16_grey_2", "textures/id1/16_grey_2"},
{"textures/16_grey_3", "textures/id1/16_grey_3"},
{"textures/16_honey_1", "textures/id1/16_honey_1"},
{"textures/16_honey_2", "textures/id1/16_honey_2"},
{"textures/16_honey_3", "textures/id1/16_honey_3"},
{"textures/32_blood_1", "textures/id1/32_blood_1"},
{"textures/32_blood_2", "textures/id1/32_blood_2"},
{"textures/32_blood_3", "textures/id1/32_blood_3"},
{"textures/32_blue_1", "textures/id1/32_blue_1"},
{"textures/32_blue_2", "textures/id1/32_blue_2"},
{"textures/32_blue_3", "textures/id1/32_blue_3"},
{"textures/32_brown_1", "textures/id1/32_brown_1"},
{"textures/32_brown_2", "textures/id1/32_brown_2"},
{"textures/32_brown_3", "textures/id1/32_brown_3"},
{"textures/32_cyan_1", "textures/id1/32_cyan_1"},
{"textures/32_cyan_2", "textures/id1/32_cyan_2"},
{"textures/32_cyan_3", "textures/id1/32_cyan_3"},
{"textures/32_gold_1", "textures/id1/32_gold_1"},
{"textures/32_gold_2", "textures/id1/32_gold_2"},
{"textures/32_gold_3", "textures/id1/32_gold_3"},
{"textures/32_green_1", "textures/id1/32_green_1"},
{"textures/32_green_2", "textures/id1/32_green_2"},
{"textures/32_green_3", "textures/id1/32_green_3"},
{"textures/32_grey_1", "textures/id1/32_grey_1"},
{"textures/32_grey_2", "textures/id1/32_grey_2"},
{"textures/32_grey_3", "textures/id1/32_grey_3"},
{"textures/32_honey_1", "textures/id1/32_honey_1"},
{"textures/32_honey_2", "textures/id1/32_honey_2"},
{"textures/32_honey_3", "textures/id1/32_honey_3"},
{"textures/64_blood_1", "textures/id1/64_blood_1"},
{"textures/64_blood_2", "textures/id1/64_blood_2"},
{"textures/64_blood_3", "textures/id1/64_blood_3"},
{"textures/64_blue_1", "textures/id1/64_blue_1"},
{"textures/64_blue_2", "textures/id1/64_blue_2"},
{"textures/64_blue_3", "textures/id1/64_blue_3"},
{"textures/64_brown_1", "textures/id1/64_brown_1"},
{"textures/64_brown_2", "textures/id1/64_brown_2"},
{"textures/64_brown_3", "textures/id1/64_brown_3"},
{"textures/64_cyan_1", "textures/id1/64_cyan_1"},
{"textures/64_cyan_2", "textures/id1/64_cyan_2"},
{"textures/64_cyan_3", "textures/id1/64_cyan_3"},
{"textures/64_gold_1", "textures/id1/64_gold_1"},
{"textures/64_gold_2", "textures/id1/64_gold_2"},
{"textures/64_gold_3", "textures/id1/64_gold_3"},
{"textures/64_green_1", "textures/id1/64_green_1"},
{"textures/64_green_2", "textures/id1/64_green_2"},
{"textures/64_green_3", "textures/id1/64_green_3"},
{"textures/64_grey_1", "textures/id1/64_grey_1"},
{"textures/64_grey_3", "textures/id1/64_grey_3"},
{"textures/64_grey_4", "textures/id1/64_grey_4"},
{"textures/64_honey_1", "textures/id1/64_honey_1"},
{"textures/64_honey_2", "textures/id1/64_honey_2"},
{"textures/64_honey_3", "textures/id1/64_honey_3"},
{"textures/blood_1", "textures/id1/blood_1"},
{"textures/blood_2", "textures/id1/blood_2"},
{"textures/blood_3", "textures/id1/blood_3"},
{"textures/blue_1", "textures/id1/blue_1"},
{"textures/blue_2", "textures/id1/blue_2"},
{"textures/blue_3", "textures/id1/blue_3"},
{"textures/brown_1", "textures/id1/brown_1"},
{"textures/brown_2", "textures/id1/brown_2"},
{"textures/brown_3", "textures/id1/brown_3"},
{"textures/clip", "textures/id1/clip"},
{"textures/cyan_1", "textures/id1/cyan_1"},
{"textures/cyan_2", "textures/id1/cyan_2"},
{"textures/cyan_3", "textures/id1/cyan_3"},
{"textures/fullbright_1", "textures/id1/fullbright_1"},
{"textures/fullbright_2", "textures/id1/fullbright_2"},
{"textures/fullbright_3", "textures/id1/fullbright_3"},
{"textures/fullbright_4", "textures/id1/fullbright_4"},
{"textures/fullbright_5", "textures/id1/fullbright_5"},
{"textures/fullbright_6", "textures/id1/fullbright_6"},
{"textures/fullbright_7", "textures/id1/fullbright_7"},
{"textures/fullbright_8", "textures/id1/fullbright_8"},
{"textures/fullbright_9", "textures/id1/fullbright_9"},
{"textures/gold_1", "textures/id1/gold_1"},
{"textures/gold_2", "textures/id1/gold_2"},
{"textures/gold_3", "textures/id1/gold_3"},
{"textures/green_1", "textures/id1/green_1"},
{"textures/green_2", "textures/id1/green_2"},
{"textures/green_3", "textures/id1/green_3"},
{"textures/grey_1", "textures/id1/grey_1"},
{"textures/grey_2", "textures/id1/grey_2"},
{"textures/grey_3", "textures/id1/grey_3"},
{"textures/hint", "textures/id1/hint"},
{"textures/hintskip", "textures/id1/hintskip"},
{"textures/honey_1", "textures/id1/honey_1"},
{"textures/honey_2", "textures/id1/honey_2"},
{"textures/honey_3", "textures/id1/honey_3"},
{"textures/key_gold_1", "textures/id1/key_gold_1"},
{"textures/key_silver_1", "textures/id1/key_silver_1"},
{"textures/light1_big", "textures/id1/light1_big"},
{"textures/light1_grt", "textures/id1/light1_grt"},
{"textures/light1_sml", "textures/id1/light1_sml"},
{"textures/origin", "textures/id1/origin"},
{"textures/skip", "textures/id1/skip"},
{"textures/sky1", "textures/id1/sky1"},
{"textures/sky2", "textures/id1/sky2"},
{"textures/sky_blood_1", "textures/id1/sky_blood_1"},
{"textures/sky_blood_2", "textures/id1/sky_blood_2"},
{"textures/sky_blood_3", "textures/id1/sky_blood_3"},
{"textures/sky_blue_1", "textures/id1/sky_blue_1"},
{"textures/sky_blue_2", "textures/id1/sky_blue_2"},
{"textures/sky_blue_3", "textures/id1/sky_blue_3"},
{"textures/sky_brown_1", "textures/id1/sky_brown_1"},
{"textures/sky_brown_2", "textures/id1/sky_brown_2"},
{"textures/sky_brown_3", "textures/id1/sky_brown_3"},
{"textures/sky_cyan_1", "textures/id1/sky_cyan_1"},
{"textures/sky_cyan_2", "textures/id1/sky_cyan_2"},
{"textures/sky_cyan_3", "textures/id1/sky_cyan_3"},
{"textures/sky_gold_1", "textures/id1/sky_gold_1"},
{"textures/sky_gold_2", "textures/id1/sky_gold_2"},
{"textures/sky_gold_3", "textures/id1/sky_gold_3"},
{"textures/sky_green_1", "textures/id1/sky_green_1"},
{"textures/sky_green_2", "textures/id1/sky_green_2"},
{"textures/sky_green_3", "textures/id1/sky_green_3"},
{"textures/sky_grey_1", "textures/id1/sky_grey_1"},
{"textures/sky_grey_2", "textures/id1/sky_grey_2"},
{"textures/sky_grey_3", "textures/id1/sky_grey_3"},
{"textures/sky_honey_1", "textures/id1/sky_honey_1"},
{"textures/sky_honey_2", "textures/id1/sky_honey_2"},
{"textures/sky_honey_3", "textures/id1/sky_honey_3"},
{"textures/sky_void", "textures/id1/sky_void"},
{"textures/text_0", "textures/id1/text_0"},
{"textures/text_1", "textures/id1/text_1"},
{"textures/text_2", "textures/id1/text_2"},
{"textures/text_3", "textures/id1/text_3"},
{"textures/text_4", "textures/id1/text_4"},
{"textures/text_5", "textures/id1/text_5"},
{"textures/text_6", "textures/id1/text_6"},
{"textures/text_7", "textures/id1/text_7"},
{"textures/text_8", "textures/id1/text_8"},
{"textures/text_9", "textures/id1/text_9"},
{"textures/text_A", "textures/id1/text_A"},
{"textures/text_B", "textures/id1/text_B"},
{"textures/text_C", "textures/id1/text_C"},
{"textures/text_D", "textures/id1/text_D"},
{"textures/text_E", "textures/id1/text_E"},
{"textures/text_F", "textures/id1/text_F"},
{"textures/text_G", "textures/id1/text_G"},
{"textures/text_H", "textures/id1/text_H"},
{"textures/text_I", "textures/id1/text_I"},
{"textures/text_J", "textures/id1/text_J"},
{"textures/text_K", "textures/id1/text_K"},
{"textures/text_L", "textures/id1/text_L"},
{"textures/text_M", "textures/id1/text_M"},
{"textures/text_N", "textures/id1/text_N"},
{"textures/text_O", "textures/id1/text_O"},
{"textures/text_P", "textures/id1/text_P"},
{"textures/text_Q", "textures/id1/text_Q"},
{"textures/text_R", "textures/id1/text_R"},
{"textures/text_S", "textures/id1/text_S"},
{"textures/text_T", "textures/id1/text_T"},
{"textures/text_U", "textures/id1/text_U"},
{"textures/text_V", "textures/id1/text_V"},
{"textures/text_W", "textures/id1/text_W"},
{"textures/text_X", "textures/id1/text_X"},
{"textures/text_Y", "textures/id1/text_Y"},
{"textures/text_Z", "textures/id1/text_Z"},
{"textures/text_amper", "textures/id1/text_amper"},
{"textures/text_arrow", "textures/id1/text_arrow"},
{"textures/text_circle", "textures/id1/text_circle"},
{"textures/text_comma", "textures/id1/text_comma"},
{"textures/text_dash", "textures/id1/text_dash"},
{"textures/text_dot", "textures/id1/text_dot"},
{"textures/text_emark", "textures/id1/text_emark"},
{"textures/text_hash", "textures/id1/text_hash"},
{"textures/text_light", "textures/id1/text_light"},
{"textures/text_percent", "textures/id1/text_percent"},
{"textures/text_qmark", "textures/id1/text_qmark"},
{"textures/text_smiley", "textures/id1/text_smiley"},
{"textures/text_sound", "textures/id1/text_sound"},
{"textures/text_uscore", "textures/id1/text_uscore"},
{"textures/trigger", "textures/id1/trigger"},
{"textures/void", "textures/id1/void"},
// TODO add more wads like prototype, Makkon et cetera
// TODO add more wads like Makkon et cetera
};
static const int numTextureConvertNames = sizeof( textureConvertNames ) / sizeof( textureConvertNames[0] );