Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
KScl committed Sep 17, 2020
2 parents 42ae4f2 + 822c719 commit a84b055
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 36 deletions.
4 changes: 2 additions & 2 deletions src/animlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ int JE_loadPage( unsigned int pagenumber )
* unless it's the end of the file.
*
* Pages repeat their headers for some reason. They then have two bytes of
* padding folowed by a word for every record. THEN the data starts.
* padding followed by a word for every record. THEN the data starts.
*/
fseek(InFile, ANIM_OFFSET + (pagenumber * ANI_PAGE_SIZE), SEEK_SET);
fread_u16_die(&CurrentPageHeader.baseRecord, 1, InFile);
Expand Down Expand Up @@ -189,7 +189,7 @@ void JE_playAnim( const char *animfile, JE_byte startingframe, JE_byte speed )
* The final frame is a delta of the first, and we don't need that.
* We could also, if we ever ended up needing to loop anis, check
* the bools in the header to see if we should render the last
* frame. But that's never going to be encessary :)
* frame. But that's never going to be necessary :)
*/
for (i = startingframe; i < FileHeader.nRecords-1; i++)
{
Expand Down
2 changes: 1 addition & 1 deletion src/arg_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ static int parse_short_opt( int argc, const char *const argv[], const Options *o

if (options->has_arg)
{
if (arg_attached) // arg direclty follows option
if (arg_attached) // arg directly follows option
{
option->arg = arg + offset + 1;

Expand Down
2 changes: 1 addition & 1 deletion src/backgrnd.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ void draw_background_2( SDL_Surface *surface )

if (background2 != 0)
{
// water effect combines background 1 and 2 by syncronizing the x coordinate
// water effect combines background 1 and 2 by synchronizing the x coordinate
int x = smoothies[1] ? mapXPos : mapX2Pos;

Uint8 **map = (Uint8 **)mapY2Pos + (smoothies[1] ? mapXbpPos : mapX2bpPos) - 12;
Expand Down
2 changes: 1 addition & 1 deletion src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ void JE_loadConfiguration( void )
}

/* SYN: This is truncating to bytes. I have no idea what this is doing or why. */
/* TODO: Figure out what this is about and make sure it isn't broked. */
/* TODO: Figure out what this is about and make sure it isn't broken. */
editorLevel = (saveTemp[SIZEOF_SAVEGAMETEMP - 5] << 8) | saveTemp[SIZEOF_SAVEGAMETEMP - 6];

// T2K High Scores are unencrypted after saveTemp
Expand Down
2 changes: 1 addition & 1 deletion src/config_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ bool config_parse( Config *config, FILE *file )

for (size_t line = 0, next_line = 0; ; line = next_line)
{
/* find begining of next line */
/* find beginning of next line */
while (next_line < buffer_end)
{
char c = buffer[next_line];
Expand Down
2 changes: 1 addition & 1 deletion src/config_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ extern void config_deinit( Config *config );
/*!
* \brief Parse a configuration from a file.
*
* \param[in] config the uninitalized configuration
* \param[in] config the uninitialized configuration
* \param[in] file the file handle
* \return whether parsing succeeded
*/
Expand Down
16 changes: 8 additions & 8 deletions src/destruct.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@
* to not have available. Destruct has no configuration options in game, but
* that doesn't stop us from changing various limiting vars and letting
* people remap the keyboard. AIs may also be introduced here; fighting a
* stateless AI isn't really challenging afterall.
* stateless AI isn't really challenging after all.
*
* This hidden config also allows for a hidden game mode! Though as a custom
* game mode wouldn't show up in the data files it forces us to distinguish
* between the constant DESTRUCT_MODES (5) and MAX_MODES (6). DESTRUCT_MODES
* is only used with loaded data.
*
* Things I wanted to do but can't: Remove references to VGAScreen. For
* a multitude of reasons this just isn't feasable. It would have been nice
* a multitude of reasons this just isn't feasible. It would have been nice
* to increase the playing field though...
*/

Expand Down Expand Up @@ -470,7 +470,7 @@ static void load_destruct_config( Config *config_ )
// set defaults
for (unsigned int i = 0; i < COUNTOF(defaultKeyConfig[p][k]); ++i)
if (defaultKeyConfig[p][k][i] != SDL_SCANCODE_UNKNOWN)
config_add_value(option, SDL_GetKeyName(defaultKeyConfig[p][k][i]));
config_add_value(option, SDL_GetScancodeName(defaultKeyConfig[p][k][i]));
}
}
}
Expand Down Expand Up @@ -1324,7 +1324,7 @@ static void JE_pauseScreen( void )

/* DE_ResetX
*
* The reset functions clear the state of whatefer they are assigned to.
* The reset functions clear the state of whatever they are assigned to.
*/
static void DE_ResetUnits( void )
{
Expand Down Expand Up @@ -1511,7 +1511,7 @@ static enum de_state_t DE_RunTick( void )
/* DE_RunTickX
*
* Handles something that we do once per tick, such as
* track ammo and move asplosions.
* track ammo and move explosions.
*/
static void DE_RunTickCycleDeadUnits( void )
{
Expand Down Expand Up @@ -1585,7 +1585,7 @@ static void DE_GravityDrawUnit( enum de_player_t team, struct destruct_unit_s *
anim_index = GraphicBase[team][unit->unitType] + unit->ani_frame;
if (unit->unitType == UNIT_HELI)
{
/* Adjust animation index if we are travelling right or left. */
/* Adjust animation index if we are traveling right or left. */
if (unit->lastMove < -2)
anim_index += 5;
else if (unit->lastMove > 2)
Expand Down Expand Up @@ -2090,9 +2090,9 @@ static void DE_RunTickAI( void )
ptrUnit = ptrTarget->unit;
for (j = 0; j < config.max_installations; j++, ptrUnit++)
{
if (abs(ptrUnit->unitX - ptrCurUnit->unitX) < 8)
if (abs((int)ptrUnit->unitX - (int)ptrCurUnit->unitX) < 8)
{
/* I get it. This makes helicoptors hover over
/* I get it. This makes helicopters hover over
* their enemies. */
if (ptrUnit->unitType == UNIT_SATELLITE)
{
Expand Down
6 changes: 3 additions & 3 deletions src/game_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ void JE_itemScreen( void )
item_level = player[0].items.weapon[port].power;

// calculate upgradeCost
JE_getCost(curSel[MENU_UPGRADES], itemAvail[itemAvailMap[curSel[MENU_UPGRADES]-2]-1][curSel[MENU_KEYBOARD_CONFIG]-2]);
JE_getCost(curSel[MENU_UPGRADES], itemAvail[itemAvailMap[curSel[MENU_UPGRADES]-2]-1][curSel[MENU_UPGRADE_SUB]-2]);

leftPower = item_level > 1; // can downgrade
rightPower = item_level < 11; // can upgrade
Expand Down Expand Up @@ -619,7 +619,7 @@ void JE_itemScreen( void )
JE_drawItem(curSel[MENU_UPGRADES]-1, temp, 160, tempY-4);
}

/* Make selected text brigther */
/* Make selected text brighter */
temp2 = (tempW == curSel[curMenu]-1) ? 15 : 28;

/* Draw Cost: if it's not the DONE option */
Expand Down Expand Up @@ -767,7 +767,7 @@ void JE_itemScreen( void )

blit_sprite(VGAScreenSeg, face_x, face_y, FACE_SHAPES, face_sprite); // datacube face

// modify pallete for face
// modify palette for face
paletteChanged = true;
temp2 = (face_sprite < 12) ? facepal[face_sprite] : 0;
newPal = 0;
Expand Down
8 changes: 4 additions & 4 deletions src/mainint.c
Original file line number Diff line number Diff line change
Expand Up @@ -1414,7 +1414,7 @@ void JE_inGameHelp( void )
helpBoxBrightness = 3;
JE_HBox(VGAScreen, 40, 43, 34, 44);

// sheild/armor help
// shield/armor help
blit_sprite(VGAScreenSeg, 2, 79, OPTION_SHAPES, 42);
helpBoxColor = 5;
helpBoxBrightness = 3;
Expand Down Expand Up @@ -1921,7 +1921,7 @@ void JE_SFCodes( JE_byte playerNum_, JE_integer PX_, JE_integer PY_, JE_integer
}
}

if (temp2 == 1) // if exactly one direction pressed or firebutton is released
if (temp2 == 1) // if exactly one direction pressed or fire button is released
{
temp += button[0] * 4;

Expand Down Expand Up @@ -3896,15 +3896,15 @@ void JE_playerMovement( Player *this_player,
this_player->sidekick[LEFT_SIDEKICK].x = this_player->x;
this_player->sidekick[LEFT_SIDEKICK].y = MAX(10, this_player->y - 20);
break;
case 4: // orbitting
case 4: // orbiting
this_player->sidekick[LEFT_SIDEKICK].x = this_player->x + roundf(sinf(optionSatelliteRotate) * 20);
this_player->sidekick[LEFT_SIDEKICK].y = this_player->y + roundf(cosf(optionSatelliteRotate) * 20);
break;
}

switch (this_player->sidekick[RIGHT_SIDEKICK].style)
{
case 4: // orbitting
case 4: // orbiting
this_player->sidekick[RIGHT_SIDEKICK].x = this_player->x - roundf(sinf(optionSatelliteRotate) * 20);
this_player->sidekick[RIGHT_SIDEKICK].y = this_player->y - roundf(cosf(optionSatelliteRotate) * 20);
break;
Expand Down
8 changes: 4 additions & 4 deletions src/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
* Hopefully it'll be rewritten some day.
*/

#define NET_VERSION 2 // increment whenever networking changes might create incompatability
#define NET_VERSION 2 // increment whenever networking changes might create incompatibility
#define NET_PORT 1333 // UDP

#define NET_PACKET_SIZE 256
#define NET_PACKET_QUEUE 16

#define NET_RETRY 640 // ticks to wait for packet acknowledgement before resending
#define NET_RETRY 640 // ticks to wait for packet acknowledgment before resending
#define NET_RESEND 320 // ticks to wait before requesting unreceived game packet
#define NET_KEEP_ALIVE 1600 // ticks to wait between keep-alive packets
#define NET_TIME_OUT 16000 // ticks to wait before considering connection dead
Expand Down Expand Up @@ -140,7 +140,7 @@ void network_prepare( Uint16 type )
SDLNet_Write16(last_out_sync, &packet_out_temp->data[2]);
}

// send packet but don't expect acknoledgment of delivery
// send packet but don't expect acknowledgment of delivery
static bool network_send_no_ack( int len )
{
packet_out_temp->len = len;
Expand Down Expand Up @@ -178,7 +178,7 @@ bool network_send( int len )
return temp;
}

// send acknowledgement packet
// send acknowledgment packet
static int network_acknowledge( Uint16 sync )
{
SDLNet_Write16(PACKET_ACKNOWLEDGE, &packet_out_temp->data[0]);
Expand Down
2 changes: 1 addition & 1 deletion src/opl.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
adlib register set.
Only the channels 0,1,2 (first set) and 9,10,11 (second set) can act as
4op channels. The two additional operators for a channel y come from the
2op channel y+3 so the operatorss y, (9+y), y+3, (9+y)+3 make up a 4op
2op channel y+3 so the operators y, (9+y), y+3, (9+y)+3 make up a 4op
channel.
*/
typedef struct operator_struct {
Expand Down
2 changes: 1 addition & 1 deletion src/shots.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void simulate_player_shots( void );
void player_shot_set_direction( JE_integer shot_id, uint weapon_id, JE_real direction );

/** Moves and draws a shot. Does \b not collide it with enemies.
* \return False if the shot went offscreen, true otherwise.
* \return False if the shot went off-screen, true otherwise.
*/
bool player_shot_move_and_draw(
int shot_id, bool* out_is_special,
Expand Down
2 changes: 1 addition & 1 deletion src/sizebuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/*
* This file is largely based on (and named after) a set of common reading/
* writing functions used in Quake engines. Its purpose is to allow extraction
* of bytes, words, and dwords in a safe, endian adjused environment and should
* of bytes, words, and dwords in a safe, endian adjusted environment and should
* probably be used in any situation where checking for buffer overflows
* manually makes the code a godawful mess.
*
Expand Down
2 changes: 1 addition & 1 deletion src/tyrian2.c
Original file line number Diff line number Diff line change
Expand Up @@ -5141,7 +5141,7 @@ void JE_whoa( void )
bottomBorder = VGAScreenSeg->pitch * 7;

/* Okay, one disadvantage to using other screens as temp buffers: they
* need to be the right size. I doubt they'l ever be anything but 320x200,
* need to be the right size. I doubt they'll ever be anything but 320x200,
* but just in case, these asserts will clue in whoever stumbles across
* the problem. You can fix it with the stack or malloc. */
assert( (unsigned)VGAScreen2->h * VGAScreen2->pitch >= screenSize
Expand Down
2 changes: 1 addition & 1 deletion src/vga256d.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void JE_pix( SDL_Surface *surface, int x, int y, JE_byte c )

void JE_pix3( SDL_Surface *surface, int x, int y, JE_byte c )
{
/* Originally impemented as several direct accesses */
/* Originally implemented as several direct accesses */
JE_pix(surface, x, y, c);
JE_pix(surface, x - 1, y, c);
JE_pix(surface, x + 1, y, c);
Expand Down
8 changes: 3 additions & 5 deletions src/video_scale_hqNx.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ inline bool diff(unsigned int w1, unsigned int w2)
{
Uint32 YUV1 = yuv_palette[w1];
Uint32 YUV2 = yuv_palette[w2];
return ( ( abs((YUV1 & Ymask) - (YUV2 & Ymask)) > trY ) ||
( abs((YUV1 & Umask) - (YUV2 & Umask)) > trU ) ||
( abs((YUV1 & Vmask) - (YUV2 & Vmask)) > trV ) );
return ( ( abs((int)(YUV1 & Ymask) - (int)(YUV2 & Ymask)) > trY ) ||
( abs((int)(YUV1 & Umask) - (int)(YUV2 & Umask)) > trU ) ||
( abs((int)(YUV1 & Vmask) - (int)(YUV2 & Vmask)) > trV ) );
}


Expand Down Expand Up @@ -11914,5 +11914,3 @@ void hq4x_32( SDL_Surface *src_surface, SDL_Texture *dst_texture )

SDL_UnlockTexture(dst_texture);
}

// kate: tab-width 4; vim: set noet:

0 comments on commit a84b055

Please sign in to comment.