コード例 #1
0
ファイル: kd_demo.c プロジェクト: Billy2600/refkeen
// Similar new methods for writing/reading game state
static id0_boolean_t SaveGameState(BE_FILE_T file, gametype *state)
{
	return ((BE_Cross_writeInt16LE(file, &state->worldx) == 2)
	        && (BE_Cross_writeInt16LE(file, &state->worldy) == 2)
	        && (BE_Cross_write_booleans_To16LEBuffer(file, state->leveldone, 2*sizeof(state->leveldone)/sizeof(id0_boolean_t)) == 2*sizeof(state->leveldone)/sizeof(id0_boolean_t))
	        && (BE_Cross_writeInt32LE(file, &state->score) == 4)
	        && (BE_Cross_writeInt32LE(file, &state->nextextra) == 4)
	        && (BE_Cross_writeInt16LE(file, &state->flowerpowers) == 2)
	        && (BE_Cross_writeInt16LE(file, &state->boobusbombs) == 2)
	        && (BE_Cross_writeInt16LE(file, &state->bombsthislevel) == 2)
	        && (BE_Cross_writeInt16LE(file, &state->keys) == 2)
	        && (BE_Cross_writeInt16LE(file, &state->mapon) == 2)
	        && (BE_Cross_writeInt16LE(file, &state->lives) == 2)
	        && (BE_Cross_writeInt16LE(file, &state->difficulty) == 2)
	);
}
コード例 #2
0
ファイル: kd_demo.c プロジェクト: NY00123/refkeen
// Similar new methods for writing/reading game state
static id0_boolean_t SaveGameState(BE_FILE_T file, gametype *state)
{
	id0_word_t padding; // Two bytes of struct tail padding for 2015 port
	return ((BE_Cross_writeInt16LE(file, &state->worldx) == 2)
	        && (BE_Cross_writeInt16LE(file, &state->worldy) == 2)
	        && (((refkeen_current_gamever != BE_GAMEVER_KDREAMS2015) && (BE_Cross_write_booleans_To16LEBuffer(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_write_booleans_To32LEBuffer(file, state->leveldone, 4*sizeof(state->leveldone)/sizeof(id0_boolean_t)) == 4*sizeof(state->leveldone)/sizeof(id0_boolean_t)))
	        )
	        && (BE_Cross_writeInt32LE(file, &state->score) == 4)
	        && (BE_Cross_writeInt32LE(file, &state->nextextra) == 4)
	        && (BE_Cross_writeInt16LE(file, &state->flowerpowers) == 2)
	        && (BE_Cross_writeInt16LE(file, &state->boobusbombs) == 2)
	        && (BE_Cross_writeInt16LE(file, &state->bombsthislevel) == 2)
	        && (BE_Cross_writeInt16LE(file, &state->keys) == 2)
	        && (BE_Cross_writeInt16LE(file, &state->mapon) == 2)
	        && (BE_Cross_writeInt16LE(file, &state->lives) == 2)
	        && (BE_Cross_writeInt16LE(file, &state->difficulty) == 2)
		&& (((refkeen_current_gamever != BE_GAMEVER_KDREAMS2015) || (BE_Cross_writeInt16LE(file, &padding) == 2)))
	);
}