OpenTyrian: merged upstream changes

This commit is contained in:
pelya
2014-06-09 15:54:16 +03:00
parent 80fa885c13
commit f763376ee4
107 changed files with 3956 additions and 4820 deletions

View File

@@ -1,5 +1,5 @@
/*
* OpenTyrian Classic: A modern cross-platform port of Tyrian
* OpenTyrian: A modern cross-platform port of Tyrian
* Copyright (C) 2007-2009 The OpenTyrian Development Team
*
* This program is free software; you can redistribute it and/or
@@ -26,7 +26,7 @@
/* MAIN Weapons Data */
JE_WeaponPortType weaponPort;
JE_WeaponType weapons;
JE_WeaponType weapons[WEAP_NUM + 1]; /* [0..weapnum] */
/* Items */
JE_PowerType powerSys;
@@ -96,6 +96,12 @@ void JE_loadItemDat( void )
efread(&weapons[i].shipblastfilter, sizeof(JE_byte), 1, f);
}
#ifdef TYRIAN2000
if (episodeNum <= 3) fseek(f, 0x252A4, SEEK_SET);
if (episodeNum == 4) fseek(f, 0xC1F5E, SEEK_SET);
if (episodeNum == 5) fseek(f, 0x5C5B8, SEEK_SET);
#endif
for (int i = 0; i < PORT_NUM + 1; ++i)
{
fseek(f, 1, SEEK_CUR); /* skip string length */
@@ -111,7 +117,15 @@ void JE_loadItemDat( void )
efread(&weaponPort[i].poweruse, sizeof(JE_word), 1, f);
}
for (int i = 0; i < SPECIAL_NUM + 1; ++i)
int specials_count = SPECIAL_NUM;
#ifdef TYRIAN2000
if (episodeNum <= 3) fseek(f, 0x2662E, SEEK_SET);
if (episodeNum == 4) fseek(f, 0xC32E8, SEEK_SET);
if (episodeNum == 5) fseek(f, 0x5D942, SEEK_SET);
if (episodeNum >= 4) specials_count = SPECIAL_NUM + 8; /*this ugly hack will need a fix*/
#endif
for (int i = 0; i < specials_count + 1; ++i)
{
fseek(f, 1, SEEK_CUR); /* skip string length */
efread(&special[i].name, 1, 30, f);
@@ -121,7 +135,13 @@ void JE_loadItemDat( void )
efread(&special[i].stype, sizeof(JE_byte), 1, f);
efread(&special[i].wpn, sizeof(JE_word), 1, f);
}
#ifdef TYRIAN2000
if (episodeNum <= 3) fseek(f, 0x26E21, SEEK_SET);
if (episodeNum == 4) fseek(f, 0xC3ADB, SEEK_SET);
if (episodeNum == 5) fseek(f, 0x5E135, SEEK_SET);
#endif
for (int i = 0; i < POWER_NUM + 1; ++i)
{
fseek(f, 1, SEEK_CUR); /* skip string length */
@@ -132,6 +152,12 @@ void JE_loadItemDat( void )
efread(&powerSys[i].speed, sizeof(JE_byte), 1, f);
efread(&powerSys[i].cost, sizeof(JE_word), 1, f);
}
#ifdef TYRIAN2000
if (episodeNum <= 3) fseek(f, 0x26F24, SEEK_SET);
if (episodeNum == 4) fseek(f, 0xC3BDE, SEEK_SET);
if (episodeNum == 5) fseek(f, 0x5E238, SEEK_SET);
#endif
for (int i = 0; i < SHIP_NUM + 1; ++i)
{
@@ -146,6 +172,12 @@ void JE_loadItemDat( void )
efread(&ships[i].cost, sizeof(JE_word), 1, f);
efread(&ships[i].bigshipgraphic, sizeof(JE_byte), 1, f);
}
#ifdef TYRIAN2000
if (episodeNum <= 3) fseek(f, 0x2722F, SEEK_SET);
if (episodeNum == 4) fseek(f, 0xC3EE9, SEEK_SET);
if (episodeNum == 5) fseek(f, 0x5E543, SEEK_SET);
#endif
for (int i = 0; i < OPTION_NUM + 1; ++i)
{
@@ -166,7 +198,13 @@ void JE_loadItemDat( void )
efread(&options[i].stop, 1, 1, f); /* override sizeof(JE_boolean) */
efread(&options[i].icongr, sizeof(JE_byte), 1, f);
}
#ifdef TYRIAN2000
if (episodeNum <= 3) fseek(f, 0x27EF3, SEEK_SET);
if (episodeNum == 4) fseek(f, 0xC4BAD, SEEK_SET);
if (episodeNum == 5) fseek(f, 0x5F207, SEEK_SET);
#endif
for (int i = 0; i < SHIELD_NUM + 1; ++i)
{
fseek(f, 1, SEEK_CUR); /* skip string length */
@@ -264,4 +302,3 @@ unsigned int JE_findNextEpisode( void )
return newEpisode;
}
// kate: tab-width 4; vim: set noet: