diff --git a/src/animlib.c b/src/animlib.c index 03f2f2bb..cda6270d 100644 --- a/src/animlib.c +++ b/src/animlib.c @@ -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); @@ -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++) { diff --git a/src/arg_parse.c b/src/arg_parse.c index 549bfd85..4004a673 100644 --- a/src/arg_parse.c +++ b/src/arg_parse.c @@ -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; diff --git a/src/backgrnd.c b/src/backgrnd.c index e7bff5f4..55f7301e 100644 --- a/src/backgrnd.c +++ b/src/backgrnd.c @@ -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; diff --git a/src/config.c b/src/config.c index 1d06d801..7ebb181f 100644 --- a/src/config.c +++ b/src/config.c @@ -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 diff --git a/src/config_file.c b/src/config_file.c index 075359f6..1d980406 100644 --- a/src/config_file.c +++ b/src/config_file.c @@ -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]; diff --git a/src/config_file.h b/src/config_file.h index 6707b40c..613f26aa 100644 --- a/src/config_file.h +++ b/src/config_file.h @@ -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 */ diff --git a/src/destruct.c b/src/destruct.c index 7e71dcd7..74846d7b 100644 --- a/src/destruct.c +++ b/src/destruct.c @@ -32,7 +32,7 @@ * 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 @@ -40,7 +40,7 @@ * 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... */ @@ -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])); } } } @@ -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 ) { @@ -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 ) { @@ -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) @@ -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) { diff --git a/src/game_menu.c b/src/game_menu.c index 1c0ea9b3..587a0ca1 100644 --- a/src/game_menu.c +++ b/src/game_menu.c @@ -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 @@ -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 */ @@ -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; diff --git a/src/mainint.c b/src/mainint.c index de2cae3b..d04011bd 100644 --- a/src/mainint.c +++ b/src/mainint.c @@ -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; @@ -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; @@ -3896,7 +3896,7 @@ 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; @@ -3904,7 +3904,7 @@ void JE_playerMovement( Player *this_player, 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; diff --git a/src/network.c b/src/network.c index 4b01f62a..240a3451 100644 --- a/src/network.c +++ b/src/network.c @@ -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 @@ -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; @@ -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]); diff --git a/src/opl.c b/src/opl.c index f15474c4..cd867d78 100644 --- a/src/opl.c +++ b/src/opl.c @@ -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 { diff --git a/src/shots.h b/src/shots.h index ea4a1115..d30647ce 100644 --- a/src/shots.h +++ b/src/shots.h @@ -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, diff --git a/src/sizebuf.c b/src/sizebuf.c index 75b36c1d..97610f20 100644 --- a/src/sizebuf.c +++ b/src/sizebuf.c @@ -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. * diff --git a/src/tyrian2.c b/src/tyrian2.c index 34dd2c1d..c11971ab 100644 --- a/src/tyrian2.c +++ b/src/tyrian2.c @@ -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 diff --git a/src/vga256d.c b/src/vga256d.c index c8752e37..c203458a 100644 --- a/src/vga256d.c +++ b/src/vga256d.c @@ -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); diff --git a/src/video_scale_hqNx.c b/src/video_scale_hqNx.c index 76dd712d..8d70b269 100644 --- a/src/video_scale_hqNx.c +++ b/src/video_scale_hqNx.c @@ -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 ) ); } @@ -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: