Пример #1
0
static id0_boolean_t LoadGameState(BE_FILE_T file, gametype *state)
{
	return ((BE_Cross_readInt16LE(file, &state->worldx) == 2)
	        && (BE_Cross_readInt16LE(file, &state->worldy) == 2)
	        && (BE_Cross_read_booleans_From16LEBuffer(file, state->leveldone, 2*sizeof(state->leveldone)/sizeof(id0_boolean_t)) == 2*sizeof(state->leveldone)/sizeof(id0_boolean_t))
	        && (BE_Cross_readInt32LE(file, &state->score) == 4)
	        && (BE_Cross_readInt32LE(file, &state->nextextra) == 4)
	        && (BE_Cross_readInt16LE(file, &state->flowerpowers) == 2)
	        && (BE_Cross_readInt16LE(file, &state->boobusbombs) == 2)
	        && (BE_Cross_readInt16LE(file, &state->bombsthislevel) == 2)
	        && (BE_Cross_readInt16LE(file, &state->keys) == 2)
	        && (BE_Cross_readInt16LE(file, &state->mapon) == 2)
	        && (BE_Cross_readInt16LE(file, &state->lives) == 2)
	        && (BE_Cross_readInt16LE(file, &state->difficulty) == 2)
	);
}
Пример #2
0
static id0_boolean_t LoadGameState(BE_FILE_T file, gametype *state)
{
	id0_longword_t padding; // Two bytes of struct tail padding for 2015 port
	return ((BE_Cross_readInt16LE(file, &state->worldx) == 2)
	        && (BE_Cross_readInt16LE(file, &state->worldy) == 2)
	        && (((refkeen_current_gamever != BE_GAMEVER_KDREAMS2015) && (BE_Cross_read_booleans_From16LEBuffer(file, state->leveldone, 2*sizeof(state->leveldone)/sizeof(id0_boolean_t)) == 2*sizeof(state->leveldone)/sizeof(id0_boolean_t)))
	            || ((refkeen_current_gamever == BE_GAMEVER_KDREAMS2015) && (BE_Cross_read_booleans_From32LEBuffer(file, state->leveldone, 4*sizeof(state->leveldone)/sizeof(id0_boolean_t)) == 4*sizeof(state->leveldone)/sizeof(id0_boolean_t)))
	        )
	        && (BE_Cross_readInt32LE(file, &state->score) == 4)
	        && (BE_Cross_readInt32LE(file, &state->nextextra) == 4)
	        && (BE_Cross_readInt16LE(file, &state->flowerpowers) == 2)
	        && (BE_Cross_readInt16LE(file, &state->boobusbombs) == 2)
	        && (BE_Cross_readInt16LE(file, &state->bombsthislevel) == 2)
	        && (BE_Cross_readInt16LE(file, &state->keys) == 2)
	        && (BE_Cross_readInt16LE(file, &state->mapon) == 2)
	        && (BE_Cross_readInt16LE(file, &state->lives) == 2)
	        && (BE_Cross_readInt16LE(file, &state->difficulty) == 2)
		&& (((refkeen_current_gamever != BE_GAMEVER_KDREAMS2015) || (BE_Cross_readInt16LE(file, &padding) == 2)))
	);
}