OpenTyrian: renamed all .cpp files back to .c, for easier marging

This commit is contained in:
pelya
2014-06-09 00:07:42 +03:00
parent e808d2ea86
commit cc172312e5
54 changed files with 45 additions and 41 deletions

View File

@@ -140,15 +140,15 @@ extern JE_byte processorType;
extern JE_SaveFilesType saveFiles; extern JE_SaveFilesType saveFiles;
extern JE_SaveGameTemp saveTemp; extern JE_SaveGameTemp saveTemp;
extern JE_word editorLevel; extern JE_word editorLevel;
enum AutoFireMode_t { AUTOFIRE_TOUCHSCREEN, AUTOFIRE_BUTTON, AUTOFIRE_BUTTON_TOUCH, AUTOFIRE_NONE, AUTOFIRE_LAST }; typedef enum { AUTOFIRE_TOUCHSCREEN, AUTOFIRE_BUTTON, AUTOFIRE_BUTTON_TOUCH, AUTOFIRE_NONE, AUTOFIRE_LAST } AutoFireMode_t;
extern AutoFireMode_t autoFireMode; extern AutoFireMode_t autoFireMode;
enum TouchscreenMode_t { typedef enum {
TOUCHSCREEN_SHIP_ABOVE_FINGER, TOUCHSCREEN_SHIP_ABOVE_FINGER,
TOUCHSCREEN_SHIP_TO_THE_LEFT, TOUCHSCREEN_SHIP_TO_THE_LEFT,
TOUCHSCREEN_SHIP_BELOW_FINGER, TOUCHSCREEN_SHIP_BELOW_FINGER,
TOUCHSCREEN_FIRE_ONLY, TOUCHSCREEN_FIRE_ONLY,
TOUCHSCREEN_NONE, TOUCHSCREEN_NONE,
TOUCHSCREEN_LAST }; TOUCHSCREEN_LAST } TouchscreenMode_t;
extern TouchscreenMode_t touchscreenMode; extern TouchscreenMode_t touchscreenMode;

View File

@@ -720,16 +720,16 @@ void JE_destructGame( void )
load_destruct_config(); load_destruct_config();
//malloc things that have customizable sizes //malloc things that have customizable sizes
shotRec = (destruct_shot_s *)malloc(sizeof(struct destruct_shot_s) * config.max_shots); shotRec = malloc(sizeof(struct destruct_shot_s) * config.max_shots);
exploRec = (destruct_explo_s *)malloc(sizeof(struct destruct_explo_s) * config.max_explosions); exploRec = malloc(sizeof(struct destruct_explo_s) * config.max_explosions);
world.mapWalls = (destruct_wall_s *)malloc(sizeof(struct destruct_wall_s) * config.max_walls); world.mapWalls = malloc(sizeof(struct destruct_wall_s) * config.max_walls);
//Malloc enough structures to cover all of this session's possible needs. //Malloc enough structures to cover all of this session's possible needs.
for(i = 0; i < 10; i++) { for(i = 0; i < 10; i++) {
config.max_installations = MAX(config.max_installations, basetypes[i][0]); config.max_installations = MAX(config.max_installations, basetypes[i][0]);
} }
player[PLAYER_LEFT ].unit = (destruct_unit_s *)malloc(sizeof(struct destruct_unit_s) * config.max_installations); player[PLAYER_LEFT ].unit = malloc(sizeof(struct destruct_unit_s) * config.max_installations);
player[PLAYER_RIGHT].unit = (destruct_unit_s *)malloc(sizeof(struct destruct_unit_s) * config.max_installations); player[PLAYER_RIGHT].unit = malloc(sizeof(struct destruct_unit_s) * config.max_installations);
destructTempScreen = game_screen; destructTempScreen = game_screen;
world.VGAScreen = VGAScreen; world.VGAScreen = VGAScreen;
@@ -836,7 +836,7 @@ enum de_mode_t JE_modeSelect( void )
mode = MODE_5CARDWAR; mode = MODE_5CARDWAR;
// Draw the menu and fade us in // Draw the menu and fade us in
DrawModeSelectMenu((de_mode_t)mode); DrawModeSelectMenu(mode);
JE_showVGA(); JE_showVGA();
fade_palette(colors, 15, 0, 255); fade_palette(colors, 15, 0, 255);
@@ -845,7 +845,7 @@ enum de_mode_t JE_modeSelect( void )
while(1) while(1)
{ {
/* Re-draw the menu every iteration */ /* Re-draw the menu every iteration */
DrawModeSelectMenu((de_mode_t)mode); DrawModeSelectMenu(mode);
JE_showVGA(); JE_showVGA();
/* Grab keys */ /* Grab keys */
@@ -898,7 +898,7 @@ enum de_mode_t JE_modeSelect( void )
fade_black(15); fade_black(15);
memcpy(VGAScreen->pixels, VGAScreen2->pixels, VGAScreen->h * VGAScreen->pitch); memcpy(VGAScreen->pixels, VGAScreen2->pixels, VGAScreen->h * VGAScreen->pitch);
JE_showVGA(); JE_showVGA();
return((de_mode_t)mode); return(mode);
} }
void JE_generateTerrain( void ) void JE_generateTerrain( void )
@@ -1039,7 +1039,7 @@ void DE_generateUnits( unsigned int * baseWorld )
} }
player[i].unit[j].unitY = JE_placementPosition(player[i].unit[j].unitX - 1, 14, baseWorld); player[i].unit[j].unitY = JE_placementPosition(player[i].unit[j].unitX - 1, 14, baseWorld);
player[i].unit[j].unitType = (de_unit_t)basetypes[baseLookup[i][world.destructMode]][(mt_rand() % 10) + 1]; player[i].unit[j].unitType = basetypes[baseLookup[i][world.destructMode]][(mt_rand() % 10) + 1];
/* Sats are special cases since they are useless. They don't count /* Sats are special cases since they are useless. They don't count
* as active units and we can't have a team of all sats */ * as active units and we can't have a team of all sats */
@@ -1071,7 +1071,7 @@ void DE_generateUnits( unsigned int * baseWorld )
player[i].unit[j].isYInAir = false; player[i].unit[j].isYInAir = false;
player[i].unit[j].angle = 0; player[i].unit[j].angle = 0;
player[i].unit[j].power = (player[i].unit[j].unitType == UNIT_LASER) ? 6 : 3; player[i].unit[j].power = (player[i].unit[j].unitType == UNIT_LASER) ? 6 : 3;
player[i].unit[j].shotType = (de_shot_t)defaultWeapon[player[i].unit[j].unitType]; player[i].unit[j].shotType = defaultWeapon[player[i].unit[j].unitType];
player[i].unit[j].health = baseDamage[player[i].unit[j].unitType]; player[i].unit[j].health = baseDamage[player[i].unit[j].unitType];
player[i].unit[j].ani_frame = 0; player[i].unit[j].ani_frame = 0;
} }
@@ -1357,7 +1357,7 @@ void JE_makeExplosion( unsigned int tempPosX, unsigned int tempPosY, enum de_sho
exploRec[i].explomax = tempExploSize; exploRec[i].explomax = tempExploSize;
exploRec[i].explofill = exploDensity[shottype]; exploRec[i].explofill = exploDensity[shottype];
exploRec[i].exploType = (de_expl_t)shotDirt[shottype]; exploRec[i].exploType = shotDirt[shottype];
} }
else else
{ {
@@ -1574,9 +1574,9 @@ void DE_ResetAI( void )
ptr->power = (ptr->unitType == UNIT_LASER) ? 6 : 4; ptr->power = (ptr->unitType == UNIT_LASER) ? 6 : 4;
if (world.mapFlags & MAP_WALLS) if (world.mapFlags & MAP_WALLS)
ptr->shotType = (de_shot_t)defaultCpuWeaponB[ptr->unitType]; ptr->shotType = defaultCpuWeaponB[ptr->unitType];
else else
ptr->shotType = (de_shot_t)defaultCpuWeapon[ptr->unitType]; ptr->shotType = defaultCpuWeapon[ptr->unitType];
} }
} }
} }
@@ -1750,7 +1750,7 @@ void DE_RunTickGravity( void )
} }
/* Draw the unit. */ /* Draw the unit. */
DE_GravityDrawUnit((de_player_t)i, unit); DE_GravityDrawUnit(i, unit);
} }
} }
} }
@@ -1945,7 +1945,7 @@ void DE_TestExplosionCollision( unsigned int PosX, unsigned int PosY)
unit->health--; unit->health--;
if (unit->health <= 0) if (unit->health <= 0)
{ {
DE_DestroyUnit((de_player_t)i, unit); DE_DestroyUnit(i, unit);
} }
} }
} }
@@ -2041,7 +2041,7 @@ void DE_RunTickShots( void )
&& tempPosY < unit->unitY && tempPosY > unit->unitY - 13) && tempPosY < unit->unitY && tempPosY > unit->unitY - 13)
{ {
shotRec[i].isAvailable = true; shotRec[i].isAvailable = true;
JE_makeExplosion(tempPosX, tempPosY, (de_shot_t)shotRec[i].shottype); JE_makeExplosion(tempPosX, tempPosY, shotRec[i].shottype);
} }
} }
} }
@@ -2074,7 +2074,7 @@ void DE_RunTickShots( void )
/* Blow up the wall and remove the shot. */ /* Blow up the wall and remove the shot. */
world.mapWalls[j].wallExist = false; world.mapWalls[j].wallExist = false;
shotRec[i].isAvailable = true; shotRec[i].isAvailable = true;
JE_makeExplosion(tempPosX, tempPosY, (de_shot_t)shotRec[i].shottype); JE_makeExplosion(tempPosX, tempPosY, shotRec[i].shottype);
continue; continue;
} }
else else
@@ -2104,7 +2104,7 @@ void DE_RunTickShots( void )
if((((Uint8 *)destructTempScreen->pixels)[tempPosX + tempPosY * destructTempScreen->pitch]) == PIXEL_DIRT) if((((Uint8 *)destructTempScreen->pixels)[tempPosX + tempPosY * destructTempScreen->pitch]) == PIXEL_DIRT)
{ {
shotRec[i].isAvailable = true; shotRec[i].isAvailable = true;
JE_makeExplosion(tempPosX, tempPosY, (de_shot_t)shotRec[i].shottype); JE_makeExplosion(tempPosX, tempPosY, shotRec[i].shottype);
continue; continue;
} }
} }
@@ -2580,12 +2580,12 @@ void DE_ProcessInput( void )
break; break;
case EXPL_MAGNET: case EXPL_MAGNET:
DE_RunMagnet((de_player_t)player_index, curUnit); DE_RunMagnet(player_index, curUnit);
break; break;
case EXPL_DIRT: case EXPL_DIRT:
case EXPL_NORMAL: case EXPL_NORMAL:
DE_MakeShot((de_player_t)player_index, curUnit, direction); DE_MakeShot(player_index, curUnit, direction);
break; break;
default: default:
@@ -2599,7 +2599,7 @@ void DE_CycleWeaponUp( struct destruct_unit_s * unit )
{ {
do do
{ {
unit->shotType = (de_shot_t)((int)unit->shotType + 1); unit->shotType = ((int)unit->shotType + 1);
if (unit->shotType > SHOT_LAST) if (unit->shotType > SHOT_LAST)
{ {
unit->shotType = SHOT_FIRST; unit->shotType = SHOT_FIRST;
@@ -2610,7 +2610,7 @@ void DE_CycleWeaponDown( struct destruct_unit_s * unit )
{ {
do do
{ {
unit->shotType = (de_shot_t)((int)unit->shotType - 1); unit->shotType = ((int)unit->shotType - 1);
if (unit->shotType < SHOT_FIRST) if (unit->shotType < SHOT_FIRST)
{ {
unit->shotType = SHOT_LAST; unit->shotType = SHOT_LAST;

View File

@@ -146,18 +146,18 @@ typedef struct
JE_word eenemydie; JE_word eenemydie;
} JE_EnemyDatType[ENEMY_NUM + 1]; /* [0..enemynum] */ } JE_EnemyDatType[ENEMY_NUM + 1]; /* [0..enemynum] */
extern "C" JE_WeaponPortType weaponPort; extern JE_WeaponPortType weaponPort;
extern "C" JE_WeaponType weapons; extern JE_WeaponType weapons;
extern "C" JE_PowerType powerSys; extern JE_PowerType powerSys;
extern "C" JE_ShipType ships; extern JE_ShipType ships;
extern "C" JE_OptionType options[OPTION_NUM + 1]; /* [0..optionnum] */ extern JE_OptionType options[OPTION_NUM + 1]; /* [0..optionnum] */
extern "C" JE_ShieldType shields; extern JE_ShieldType shields;
extern "C" JE_SpecialType special; extern JE_SpecialType special;
extern "C" JE_EnemyDatType enemyDat; extern JE_EnemyDatType enemyDat;
extern "C" JE_byte initial_episode_num, episodeNum; extern JE_byte initial_episode_num, episodeNum;
extern "C" JE_boolean episodeAvail[EPISODE_MAX]; extern JE_boolean episodeAvail[EPISODE_MAX];
extern "C" char episode_file[13], cube_file[13]; extern char episode_file[13], cube_file[13];
extern JE_longint episode1DataLoc; extern JE_longint episode1DataLoc;
extern JE_boolean bonusLevel; extern JE_boolean bonusLevel;

View File

@@ -74,12 +74,16 @@ const char *opentyrian_menu_items[] =
}; };
#ifndef ANDROID #ifndef ANDROID
const int menu_item_scaler = 2; enum {
const int menu_item_jukebox = 3; menu_item_scaler = 2,
menu_item_jukebox = 3
};
#else #else
const int menu_item_scaler = 1; enum {
const int menu_item_jukebox = 2; menu_item_scaler = 1,
const int menu_item_destruct = 3; menu_item_jukebox = 2,
menu_item_destruct = 3
};
#endif #endif
/* zero-terminated strncpy */ /* zero-terminated strncpy */