Changeset - r25483:15f7a4f91c03
[Not reviewed]
master
0 3 0
rubidium42 - 3 years ago 2021-05-11 17:36:21
rubidium@openttd.org
Fix: empty undocumented branches
3 files changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/blitter/32bpp_anim_sse4.cpp
Show inline comments
 
@@ -134,48 +134,49 @@ inline void Blitter_32bppSSE4_Anim::Draw
 
							if (a1 == 255) anim01 |= mvX2 & 0xFFFF0000;
 
							*(uint32*) anim = anim01;
 
						} else {
 
							anim[0] = (uint16) anim01;
 
						}
 
					} else {
 
						if (src[0].a) anim[0] = 0;
 
						if (src[1].a) anim[1] = 0;
 
					}
 

	
 
					/* Blend colours. */
 
bmno_alpha_blend:
 
					srcABCD = AlphaBlendTwoPixels(srcABCD, dstABCD, a_cm, pack_low_cm);
 
bmno_full_opacity:
 
					_mm_storel_epi64((__m128i *) dst, srcABCD);
 
bmno_full_transparency:
 
					src_mv += 2;
 
					src += 2;
 
					anim += 2;
 
					dst += 2;
 
				}
 

	
 
				if ((bt_last == BT_NONE && effective_width & 1) || bt_last == BT_ODD) {
 
					if (src->a == 0) {
 
						/* Complete transparency. */
 
					} else if (src->a == 255) {
 
						*anim = *(const uint16*) src_mv;
 
						*dst = (src_mv->m >= PALETTE_ANIM_START) ? AdjustBrightneSSE(LookupColourInPalette(src_mv->m), src_mv->v) : *src;
 
					} else {
 
						*anim = 0;
 
						__m128i srcABCD;
 
						__m128i dstABCD = _mm_cvtsi32_si128(dst->data);
 
						if (src_mv->m >= PALETTE_ANIM_START) {
 
							Colour colour = AdjustBrightneSSE(LookupColourInPalette(src_mv->m), src_mv->v);
 
							colour.a = src->a;
 
							srcABCD = _mm_cvtsi32_si128(colour.data);
 
						} else {
 
							srcABCD = _mm_cvtsi32_si128(src->data);
 
						}
 
						dst->data = _mm_cvtsi128_si32(AlphaBlendTwoPixels(srcABCD, dstABCD, a_cm, pack_low_cm));
 
					}
 
				}
 
				break;
 

	
 
			case BM_COLOUR_REMAP:
 
				for (uint x = (uint) effective_width / 2; x != 0; x--) {
 
					uint32 mvX2 = *((uint32 *) const_cast<MapValue *>(src_mv));
 
					__m128i srcABCD = _mm_loadl_epi64((const __m128i*) src);
 
					__m128i dstABCD = _mm_loadl_epi64((__m128i*) dst);
src/saveload/game_sl.cpp
Show inline comments
 
@@ -49,50 +49,49 @@ static void SaveReal_GSDT(int *index_ptr
 
	_game_saveload_is_random = config->IsRandom();
 
	_game_saveload_settings = config->SettingsToString();
 

	
 
	SlObject(nullptr, _game_script);
 
	Game::Save();
 
}
 

	
 
static void Load_GSDT()
 
{
 
	/* Free all current data */
 
	GameConfig::GetConfig(GameConfig::SSS_FORCE_GAME)->Change(nullptr);
 

	
 
	if ((CompanyID)SlIterateArray() == (CompanyID)-1) return;
 

	
 
	_game_saveload_version = -1;
 
	SlObject(nullptr, _game_script);
 

	
 
	if (_networking && !_network_server) {
 
		GameInstance::LoadEmpty();
 
		if ((CompanyID)SlIterateArray() != (CompanyID)-1) SlErrorCorrupt("Too many GameScript configs");
 
		return;
 
	}
 

	
 
	GameConfig *config = GameConfig::GetConfig(GameConfig::SSS_FORCE_GAME);
 
	if (_game_saveload_name.empty()) {
 
	} else {
 
	if (!_game_saveload_name.empty()) {
 
		config->Change(_game_saveload_name.c_str(), _game_saveload_version, false, _game_saveload_is_random);
 
		if (!config->HasScript()) {
 
			/* No version of the GameScript available that can load the data. Try to load the
 
			 * latest version of the GameScript instead. */
 
			config->Change(_game_saveload_name.c_str(), -1, false, _game_saveload_is_random);
 
			if (!config->HasScript()) {
 
				if (_game_saveload_name.compare("%_dummy") != 0) {
 
					DEBUG(script, 0, "The savegame has an GameScript by the name '%s', version %d which is no longer available.", _game_saveload_name.c_str(), _game_saveload_version);
 
					DEBUG(script, 0, "This game will continue to run without GameScript.");
 
				} else {
 
					DEBUG(script, 0, "The savegame had no GameScript available at the time of saving.");
 
					DEBUG(script, 0, "This game will continue to run without GameScript.");
 
				}
 
			} else {
 
				DEBUG(script, 0, "The savegame has an GameScript by the name '%s', version %d which is no longer available.", _game_saveload_name.c_str(), _game_saveload_version);
 
				DEBUG(script, 0, "The latest version of that GameScript has been loaded instead, but it'll not get the savegame data as it's incompatible.");
 
			}
 
			/* Make sure the GameScript doesn't get the saveload data, as it was not the
 
			 *  writer of the saveload data in the first place */
 
			_game_saveload_version = -1;
 
		}
 
	}
 

	
 
	config->StringToSettings(_game_saveload_settings);
src/strgen/strgen_base.cpp
Show inline comments
 
@@ -436,49 +436,49 @@ void EmitPlural(Buffer *buffer, char *bu
 
}
 

	
 

	
 
void EmitGender(Buffer *buffer, char *buf, int value)
 
{
 
	int argidx = _cur_argidx;
 
	int offset = 0;
 
	uint nw;
 

	
 
	if (buf[0] == '=') {
 
		buf++;
 

	
 
		/* This is a {G=DER} command */
 
		nw = _lang.GetGenderIndex(buf);
 
		if (nw >= MAX_NUM_GENDERS) strgen_fatal("G argument '%s' invalid", buf);
 

	
 
		/* now nw contains the gender index */
 
		buffer->AppendUtf8(SCC_GENDER_INDEX);
 
		buffer->AppendByte(nw);
 
	} else {
 
		const char *words[MAX_NUM_GENDERS];
 

	
 
		/* This is a {G 0 foo bar two} command.
 
		 * If no relative number exists, default to +0 */
 
		if (!ParseRelNum(&buf, &argidx, &offset)) {}
 
		ParseRelNum(&buf, &argidx, &offset);
 

	
 
		const CmdStruct *cmd = _cur_pcs.cmd[argidx];
 
		if (cmd == nullptr || (cmd->flags & C_GENDER) == 0) {
 
			strgen_fatal("Command '%s' can't have a gender", cmd == nullptr ? "<empty>" : cmd->cmd);
 
		}
 

	
 
		for (nw = 0; nw < MAX_NUM_GENDERS; nw++) {
 
			words[nw] = ParseWord(&buf);
 
			if (words[nw] == nullptr) break;
 
		}
 
		if (nw != _lang.num_genders) strgen_fatal("Bad # of arguments for gender command");
 

	
 
		assert(IsInsideBS(cmd->value, SCC_CONTROL_START, UINT8_MAX));
 
		buffer->AppendUtf8(SCC_GENDER_LIST);
 
		buffer->AppendByte(TranslateArgumentIdx(argidx, offset));
 
		EmitWordList(buffer, words, nw);
 
	}
 
}
 

	
 
static const CmdStruct *FindCmd(const char *s, int len)
 
{
 
	for (const CmdStruct *cs = _cmd_structs; cs != endof(_cmd_structs); cs++) {
 
		if (strncmp(cs->cmd, s, len) == 0 && cs->cmd[len] == '\0') return cs;
 
	}
0 comments (0 inline, 0 general)