mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r27893) -Codechange: Use fallthrough attribute. (LordAro)
This commit is contained in:
parent
19bae485b0
commit
b4b98e5165
|
@ -215,7 +215,7 @@ bool SQVM::ObjCmp(const SQObjectPtr &o1,const SQObjectPtr &o2,SQInteger &result)
|
||||||
_RET_SUCCEED(_integer(res))
|
_RET_SUCCEED(_integer(res))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//continues through (no break needed)
|
FALLTHROUGH;
|
||||||
default:
|
default:
|
||||||
_RET_SUCCEED( _userpointer(o1) < _userpointer(o2)?-1:1 );
|
_RET_SUCCEED( _userpointer(o1) < _userpointer(o2)?-1:1 );
|
||||||
}
|
}
|
||||||
|
@ -287,6 +287,7 @@ void SQVM::ToString(const SQObjectPtr &o,SQObjectPtr &res)
|
||||||
//else keeps going to the default
|
//else keeps going to the default
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FALLTHROUGH;
|
||||||
default:
|
default:
|
||||||
seprintf(buf, lastof(buf),"(%s : 0x%p)",GetTypeName(o),(void*)_rawval(o));
|
seprintf(buf, lastof(buf),"(%s : 0x%p)",GetTypeName(o),(void*)_rawval(o));
|
||||||
}
|
}
|
||||||
|
@ -539,7 +540,7 @@ bool SQVM::FOREACH_OP(SQObjectPtr &o1,SQObjectPtr &o2,SQObjectPtr
|
||||||
_generator(o1)->Resume(this, arg_2+1);
|
_generator(o1)->Resume(this, arg_2+1);
|
||||||
_FINISH(0);
|
_FINISH(0);
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
default:
|
default:
|
||||||
Raise_Error("cannot iterate %s", GetTypeName(o1));
|
Raise_Error("cannot iterate %s", GetTypeName(o1));
|
||||||
}
|
}
|
||||||
|
@ -769,7 +770,7 @@ exception_restore:
|
||||||
ct_stackbase = _stackbase;
|
ct_stackbase = _stackbase;
|
||||||
goto common_call;
|
goto common_call;
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
case _OP_CALL: {
|
case _OP_CALL: {
|
||||||
ct_tailcall = false;
|
ct_tailcall = false;
|
||||||
ct_target = arg0;
|
ct_target = arg0;
|
||||||
|
@ -1330,7 +1331,7 @@ bool SQVM::Set(const SQObjectPtr &self,const SQObjectPtr &key,const SQObjectPtr
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//keeps going
|
FALLTHROUGH;
|
||||||
case OT_USERDATA:
|
case OT_USERDATA:
|
||||||
if(_delegable(self)->_delegate) {
|
if(_delegable(self)->_delegate) {
|
||||||
SQObjectPtr t;
|
SQObjectPtr t;
|
||||||
|
|
|
@ -114,7 +114,7 @@ AIInfo *AIScannerInfo::FindInfo(const char *nameParam, int versionParam, bool fo
|
||||||
*e = '\0';
|
*e = '\0';
|
||||||
e++;
|
e++;
|
||||||
versionParam = atoi(e);
|
versionParam = atoi(e);
|
||||||
/* FALL THROUGH, like we were calling this function with a version. */
|
/* Continue, like we were calling this function with a version. */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (force_exact_match) {
|
if (force_exact_match) {
|
||||||
|
|
|
@ -162,7 +162,7 @@ static bool IsValidCompanyManagerFace(CompanyManagerFace cmf)
|
||||||
for (CompanyManagerFaceVariable cmfv = CMFV_CHEEKS; cmfv < CMFV_END; cmfv++) {
|
for (CompanyManagerFaceVariable cmfv = CMFV_CHEEKS; cmfv < CMFV_END; cmfv++) {
|
||||||
switch (cmfv) {
|
switch (cmfv) {
|
||||||
case CMFV_MOUSTACHE: if (!has_moustache) continue; break;
|
case CMFV_MOUSTACHE: if (!has_moustache) continue; break;
|
||||||
case CMFV_LIPS: // FALL THROUGH
|
case CMFV_LIPS:
|
||||||
case CMFV_NOSE: if (has_moustache) continue; break;
|
case CMFV_NOSE: if (has_moustache) continue; break;
|
||||||
case CMFV_TIE_EARRING: if (!has_tie_earring) continue; break;
|
case CMFV_TIE_EARRING: if (!has_tie_earring) continue; break;
|
||||||
case CMFV_GLASSES: if (!has_glasses) continue; break;
|
case CMFV_GLASSES: if (!has_glasses) continue; break;
|
||||||
|
|
|
@ -318,7 +318,8 @@ struct CompanyFinancesWindow : Window {
|
||||||
case WID_CF_EXPS_PRICE2:
|
case WID_CF_EXPS_PRICE2:
|
||||||
case WID_CF_EXPS_PRICE3:
|
case WID_CF_EXPS_PRICE3:
|
||||||
size->height = _expenses_list_types[type].GetHeight();
|
size->height = _expenses_list_types[type].GetHeight();
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case WID_CF_BALANCE_VALUE:
|
case WID_CF_BALANCE_VALUE:
|
||||||
case WID_CF_LOAN_VALUE:
|
case WID_CF_LOAN_VALUE:
|
||||||
case WID_CF_TOTAL_VALUE:
|
case WID_CF_TOTAL_VALUE:
|
||||||
|
@ -636,7 +637,8 @@ public:
|
||||||
size->width = 0;
|
size->width = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case WID_SCL_PRI_COL_DROPDOWN: {
|
case WID_SCL_PRI_COL_DROPDOWN: {
|
||||||
int padding = this->square.width + NWidgetScrollbar::GetVerticalDimension().width + 10;
|
int padding = this->square.width + NWidgetScrollbar::GetVerticalDimension().width + 10;
|
||||||
for (const StringID *id = _colour_dropdown; id != endof(_colour_dropdown); id++) {
|
for (const StringID *id = _colour_dropdown; id != endof(_colour_dropdown); id++) {
|
||||||
|
@ -892,7 +894,7 @@ void DrawCompanyManagerFace(CompanyManagerFace cmf, int colour, int x, int y)
|
||||||
for (CompanyManagerFaceVariable cmfv = CMFV_CHEEKS; cmfv < CMFV_END; cmfv++) {
|
for (CompanyManagerFaceVariable cmfv = CMFV_CHEEKS; cmfv < CMFV_END; cmfv++) {
|
||||||
switch (cmfv) {
|
switch (cmfv) {
|
||||||
case CMFV_MOUSTACHE: if (!has_moustache) continue; break;
|
case CMFV_MOUSTACHE: if (!has_moustache) continue; break;
|
||||||
case CMFV_LIPS: // FALL THROUGH
|
case CMFV_LIPS:
|
||||||
case CMFV_NOSE: if (has_moustache) continue; break;
|
case CMFV_NOSE: if (has_moustache) continue; break;
|
||||||
case CMFV_TIE_EARRING: if (!has_tie_earring) continue; break;
|
case CMFV_TIE_EARRING: if (!has_tie_earring) continue; break;
|
||||||
case CMFV_GLASSES: if (!has_glasses) continue; break;
|
case CMFV_GLASSES: if (!has_glasses) continue; break;
|
||||||
|
@ -1365,7 +1367,7 @@ public:
|
||||||
/* OK button */
|
/* OK button */
|
||||||
case WID_SCMF_ACCEPT:
|
case WID_SCMF_ACCEPT:
|
||||||
DoCommandP(0, 0, this->face, CMD_SET_COMPANY_MANAGER_FACE);
|
DoCommandP(0, 0, this->face, CMD_SET_COMPANY_MANAGER_FACE);
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
/* Cancel button */
|
/* Cancel button */
|
||||||
case WID_SCMF_CANCEL:
|
case WID_SCMF_CANCEL:
|
||||||
|
|
|
@ -468,7 +468,7 @@ void IConsoleCmdExec(const char *cmdstr)
|
||||||
tokenstream[tstream_i++] = *++cmdptr;
|
tokenstream[tstream_i++] = *++cmdptr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
default: // Normal character
|
default: // Normal character
|
||||||
tokenstream[tstream_i++] = *cmdptr;
|
tokenstream[tstream_i++] = *cmdptr;
|
||||||
|
|
||||||
|
|
|
@ -445,7 +445,8 @@ struct DepotWindow : Window {
|
||||||
switch (this->type) {
|
switch (this->type) {
|
||||||
case VEH_TRAIN:
|
case VEH_TRAIN:
|
||||||
if (wagon) return MODE_ERROR;
|
if (wagon) return MODE_ERROR;
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case VEH_ROAD:
|
case VEH_ROAD:
|
||||||
if (xm <= this->flag_width) return MODE_START_STOP;
|
if (xm <= this->flag_width) return MODE_START_STOP;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1726,7 +1726,7 @@ static void LoadUnloadVehicle(Vehicle *front)
|
||||||
/* update stats */
|
/* update stats */
|
||||||
int t;
|
int t;
|
||||||
switch (front->type) {
|
switch (front->type) {
|
||||||
case VEH_TRAIN: /* FALL THROUGH */
|
case VEH_TRAIN:
|
||||||
case VEH_SHIP:
|
case VEH_SHIP:
|
||||||
t = front->vcache.cached_max_speed;
|
t = front->vcache.cached_max_speed;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -126,7 +126,7 @@ struct EnginePreviewWindow : Window {
|
||||||
switch (widget) {
|
switch (widget) {
|
||||||
case WID_EP_YES:
|
case WID_EP_YES:
|
||||||
DoCommandP(0, this->window_number, 0, CMD_WANT_ENGINE_PREVIEW);
|
DoCommandP(0, this->window_number, 0, CMD_WANT_ENGINE_PREVIEW);
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
case WID_EP_NO:
|
case WID_EP_NO:
|
||||||
if (!_shift_pressed) delete this;
|
if (!_shift_pressed) delete this;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -522,7 +522,7 @@ FILE *FioFOpenFile(const char *filename, const char *mode, Subdirectory subdir,
|
||||||
case BASESET_DIR:
|
case BASESET_DIR:
|
||||||
f = FioFOpenFile(filename, mode, OLD_GM_DIR, filesize);
|
f = FioFOpenFile(filename, mode, OLD_GM_DIR, filesize);
|
||||||
if (f != NULL) break;
|
if (f != NULL) break;
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
case NEWGRF_DIR:
|
case NEWGRF_DIR:
|
||||||
f = FioFOpenFile(filename, mode, OLD_DATA_DIR, filesize);
|
f = FioFOpenFile(filename, mode, OLD_DATA_DIR, filesize);
|
||||||
break;
|
break;
|
||||||
|
@ -1477,7 +1477,7 @@ uint FileScanner::Scan(const char *extension, Subdirectory sd, bool tars, bool r
|
||||||
switch (sd) {
|
switch (sd) {
|
||||||
case BASESET_DIR:
|
case BASESET_DIR:
|
||||||
num += this->Scan(extension, OLD_GM_DIR, tars, recursive);
|
num += this->Scan(extension, OLD_GM_DIR, tars, recursive);
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
case NEWGRF_DIR:
|
case NEWGRF_DIR:
|
||||||
num += this->Scan(extension, OLD_DATA_DIR, tars, recursive);
|
num += this->Scan(extension, OLD_DATA_DIR, tars, recursive);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -158,7 +158,8 @@ const char *FiosBrowseTo(const FiosItem *item)
|
||||||
#elif defined(WIN32) || defined(__OS2__)
|
#elif defined(WIN32) || defined(__OS2__)
|
||||||
seprintf(_fios_path, _fios_path_last, "%c:" PATHSEP, item->title[0]);
|
seprintf(_fios_path, _fios_path_last, "%c:" PATHSEP, item->title[0]);
|
||||||
#endif
|
#endif
|
||||||
/* FALL THROUGH */
|
break;
|
||||||
|
|
||||||
case FIOS_TYPE_INVALID:
|
case FIOS_TYPE_INVALID:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -702,7 +702,8 @@ public:
|
||||||
this->vscroll->SetCount(this->fios_items.Length());
|
this->vscroll->SetCount(this->fios_items.Length());
|
||||||
this->selected = NULL;
|
this->selected = NULL;
|
||||||
_load_check_data.Clear();
|
_load_check_data.Clear();
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
/* Selection changes */
|
/* Selection changes */
|
||||||
if (!gui_scope) break;
|
if (!gui_scope) break;
|
||||||
|
|
|
@ -126,7 +126,7 @@ void SpriteFontCache::InitializeUnicodeGlyphMap()
|
||||||
SpriteID base;
|
SpriteID base;
|
||||||
switch (this->fs) {
|
switch (this->fs) {
|
||||||
default: NOT_REACHED();
|
default: NOT_REACHED();
|
||||||
case FS_MONO: // Use normal as default for mono spaced font, i.e. FALL THROUGH
|
case FS_MONO: // Use normal as default for mono spaced font
|
||||||
case FS_NORMAL: base = SPR_ASCII_SPACE; break;
|
case FS_NORMAL: base = SPR_ASCII_SPACE; break;
|
||||||
case FS_SMALL: base = SPR_ASCII_SPACE_SMALL; break;
|
case FS_SMALL: base = SPR_ASCII_SPACE_SMALL; break;
|
||||||
case FS_LARGE: base = SPR_ASCII_SPACE_BIG; break;
|
case FS_LARGE: base = SPR_ASCII_SPACE_BIG; break;
|
||||||
|
|
|
@ -55,7 +55,7 @@ GameInfo *GameScannerInfo::FindInfo(const char *nameParam, int versionParam, boo
|
||||||
*e = '\0';
|
*e = '\0';
|
||||||
e++;
|
e++;
|
||||||
versionParam = atoi(e);
|
versionParam = atoi(e);
|
||||||
/* FALL THROUGH, like we were calling this function with a version. */
|
/* Continue like we were calling this function with a version. */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (force_exact_match) {
|
if (force_exact_match) {
|
||||||
|
|
|
@ -785,7 +785,7 @@ public:
|
||||||
DrawString(left_side, right - WD_FRAMERECT_RIGHT, y, STR_INDUSTRY_VIEW_ACCEPT_CARGO_AMOUNT);
|
DrawString(left_side, right - WD_FRAMERECT_RIGHT, y, STR_INDUSTRY_VIEW_ACCEPT_CARGO_AMOUNT);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case CSD_CARGO:
|
case CSD_CARGO:
|
||||||
SetDParam(0, CargoSpec::Get(i->accepts_cargo[j])->name);
|
SetDParam(0, CargoSpec::Get(i->accepts_cargo[j])->name);
|
||||||
|
|
|
@ -1007,10 +1007,12 @@ struct QueryStringWindow : public Window
|
||||||
switch (widget) {
|
switch (widget) {
|
||||||
case WID_QS_DEFAULT:
|
case WID_QS_DEFAULT:
|
||||||
this->editbox.text.DeleteAll();
|
this->editbox.text.DeleteAll();
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case WID_QS_OK:
|
case WID_QS_OK:
|
||||||
this->OnOk();
|
this->OnOk();
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case WID_QS_CANCEL:
|
case WID_QS_CANCEL:
|
||||||
delete this;
|
delete this;
|
||||||
break;
|
break;
|
||||||
|
@ -1160,7 +1162,8 @@ struct QueryWindow : public Window {
|
||||||
this->proc(this->parent, true);
|
this->proc(this->parent, true);
|
||||||
this->proc = NULL;
|
this->proc = NULL;
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case WKC_ESC:
|
case WKC_ESC:
|
||||||
delete this;
|
delete this;
|
||||||
return ES_HANDLED;
|
return ES_HANDLED;
|
||||||
|
|
|
@ -124,7 +124,7 @@ void MusicDriver_ExtMidi::DoPlay()
|
||||||
|
|
||||||
case -1:
|
case -1:
|
||||||
DEBUG(driver, 0, "extmidi: couldn't fork: %s", strerror(errno));
|
DEBUG(driver, 0, "extmidi: couldn't fork: %s", strerror(errno));
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
this->song[0] = '\0';
|
this->song[0] = '\0';
|
||||||
|
|
|
@ -242,7 +242,7 @@ void MusicDriver_QtMidi::Stop()
|
||||||
|
|
||||||
case QT_STATE_PLAY:
|
case QT_STATE_PLAY:
|
||||||
StopSong();
|
StopSong();
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case QT_STATE_STOP:
|
case QT_STATE_STOP:
|
||||||
DisposeMovie(_quicktime_movie);
|
DisposeMovie(_quicktime_movie);
|
||||||
|
@ -267,13 +267,13 @@ void MusicDriver_QtMidi::PlaySong(const char *filename)
|
||||||
case QT_STATE_PLAY:
|
case QT_STATE_PLAY:
|
||||||
StopSong();
|
StopSong();
|
||||||
DEBUG(driver, 3, "qtmidi: previous tune stopped");
|
DEBUG(driver, 3, "qtmidi: previous tune stopped");
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case QT_STATE_STOP:
|
case QT_STATE_STOP:
|
||||||
DisposeMovie(_quicktime_movie);
|
DisposeMovie(_quicktime_movie);
|
||||||
DEBUG(driver, 3, "qtmidi: previous tune disposed");
|
DEBUG(driver, 3, "qtmidi: previous tune disposed");
|
||||||
_quicktime_state = QT_STATE_IDLE;
|
_quicktime_state = QT_STATE_IDLE;
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case QT_STATE_IDLE:
|
case QT_STATE_IDLE:
|
||||||
LoadMovieForMIDIFile(filename, &_quicktime_movie);
|
LoadMovieForMIDIFile(filename, &_quicktime_movie);
|
||||||
|
@ -294,7 +294,7 @@ void MusicDriver_QtMidi::StopSong()
|
||||||
|
|
||||||
switch (_quicktime_state) {
|
switch (_quicktime_state) {
|
||||||
case QT_STATE_IDLE:
|
case QT_STATE_IDLE:
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case QT_STATE_STOP:
|
case QT_STATE_STOP:
|
||||||
DEBUG(driver, 3, "qtmidi: stop requested, but already idle");
|
DEBUG(driver, 3, "qtmidi: stop requested, but already idle");
|
||||||
|
|
|
@ -252,17 +252,20 @@ void NetworkUDPSocketHandler::ReceiveNetworkGameInfo(Packet *p, NetworkGameInfo
|
||||||
*dst = c;
|
*dst = c;
|
||||||
dst = &c->next;
|
dst = &c->next;
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
|
||||||
}
|
}
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
info->game_date = Clamp(p->Recv_uint32(), 0, MAX_DATE);
|
info->game_date = Clamp(p->Recv_uint32(), 0, MAX_DATE);
|
||||||
info->start_date = Clamp(p->Recv_uint32(), 0, MAX_DATE);
|
info->start_date = Clamp(p->Recv_uint32(), 0, MAX_DATE);
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
info->companies_max = p->Recv_uint8 ();
|
info->companies_max = p->Recv_uint8 ();
|
||||||
info->companies_on = p->Recv_uint8 ();
|
info->companies_on = p->Recv_uint8 ();
|
||||||
info->spectators_max = p->Recv_uint8 ();
|
info->spectators_max = p->Recv_uint8 ();
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
p->Recv_string(info->server_name, sizeof(info->server_name));
|
p->Recv_string(info->server_name, sizeof(info->server_name));
|
||||||
p->Recv_string(info->server_revision, sizeof(info->server_revision));
|
p->Recv_string(info->server_revision, sizeof(info->server_revision));
|
||||||
|
|
|
@ -492,10 +492,13 @@ struct NetworkChatWindow : public Window {
|
||||||
virtual void OnClick(Point pt, int widget, int click_count)
|
virtual void OnClick(Point pt, int widget, int click_count)
|
||||||
{
|
{
|
||||||
switch (widget) {
|
switch (widget) {
|
||||||
/* Send */
|
case WID_NC_SENDBUTTON: /* Send */
|
||||||
case WID_NC_SENDBUTTON: SendChat(this->message_editbox.text.buf, this->dtype, this->dest);
|
SendChat(this->message_editbox.text.buf, this->dtype, this->dest);
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
case WID_NC_CLOSE: /* Cancel */ delete this; break;
|
|
||||||
|
case WID_NC_CLOSE: /* Cancel */
|
||||||
|
delete this;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -965,7 +965,8 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::Receive_SERVER_CHAT(Packet *p)
|
||||||
/* For speaking to company or giving money, we need the company-name */
|
/* For speaking to company or giving money, we need the company-name */
|
||||||
case NETWORK_ACTION_GIVE_MONEY:
|
case NETWORK_ACTION_GIVE_MONEY:
|
||||||
if (!Company::IsValidID(ci_to->client_playas)) return NETWORK_RECV_STATUS_OKAY;
|
if (!Company::IsValidID(ci_to->client_playas)) return NETWORK_RECV_STATUS_OKAY;
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case NETWORK_ACTION_CHAT_COMPANY: {
|
case NETWORK_ACTION_CHAT_COMPANY: {
|
||||||
StringID str = Company::IsValidID(ci_to->client_playas) ? STR_COMPANY_NAME : STR_NETWORK_SPECTATORS;
|
StringID str = Company::IsValidID(ci_to->client_playas) ? STR_COMPANY_NAME : STR_NETWORK_SPECTATORS;
|
||||||
SetDParam(0, ci_to->client_playas);
|
SetDParam(0, ci_to->client_playas);
|
||||||
|
|
|
@ -908,7 +908,8 @@ public:
|
||||||
}
|
}
|
||||||
return ES_HANDLED;
|
return ES_HANDLED;
|
||||||
}
|
}
|
||||||
/* FALL THROUGH, space is pressed and filter is focused. */
|
/* space is pressed and filter is focused. */
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return ES_NOT_HANDLED;
|
return ES_NOT_HANDLED;
|
||||||
|
|
|
@ -2053,7 +2053,8 @@ struct NetworkJoinStatusWindow : Window {
|
||||||
progress = 15; // We don't have the final size yet; the server is still compressing!
|
progress = 15; // We don't have the final size yet; the server is still compressing!
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
default: // Waiting is 15%, so the resting receivement of map is maximum 70%
|
default: // Waiting is 15%, so the resting receivement of map is maximum 70%
|
||||||
progress = 15 + _network_join_bytes * (100 - 15) / _network_join_bytes_total;
|
progress = 15 + _network_join_bytes * (100 - 15) / _network_join_bytes_total;
|
||||||
}
|
}
|
||||||
|
@ -2182,7 +2183,7 @@ struct NetworkCompanyPasswordWindow : public Window {
|
||||||
switch (widget) {
|
switch (widget) {
|
||||||
case WID_NCP_OK:
|
case WID_NCP_OK:
|
||||||
this->OnOk();
|
this->OnOk();
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case WID_NCP_CANCEL:
|
case WID_NCP_CANCEL:
|
||||||
delete this;
|
delete this;
|
||||||
|
|
|
@ -1361,7 +1361,8 @@ void NetworkServerSendChat(NetworkAction action, DestType desttype, int dest, co
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
DEBUG(net, 0, "[server] received unknown chat destination type %d. Doing broadcast instead", desttype);
|
DEBUG(net, 0, "[server] received unknown chat destination type %d. Doing broadcast instead", desttype);
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case DESTTYPE_BROADCAST:
|
case DESTTYPE_BROADCAST:
|
||||||
FOR_ALL_CLIENT_SOCKETS(cs) {
|
FOR_ALL_CLIENT_SOCKETS(cs) {
|
||||||
cs->SendChat(action, from_id, false, msg, data);
|
cs->SendChat(action, from_id, false, msg, data);
|
||||||
|
@ -1396,7 +1397,7 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::Receive_CLIENT_CHAT(Packet *p)
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case NETWORK_ACTION_GIVE_MONEY:
|
case NETWORK_ACTION_GIVE_MONEY:
|
||||||
if (!Company::IsValidID(ci->client_playas)) break;
|
if (!Company::IsValidID(ci->client_playas)) break;
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
case NETWORK_ACTION_CHAT:
|
case NETWORK_ACTION_CHAT:
|
||||||
case NETWORK_ACTION_CHAT_CLIENT:
|
case NETWORK_ACTION_CHAT_CLIENT:
|
||||||
case NETWORK_ACTION_CHAT_COMPANY:
|
case NETWORK_ACTION_CHAT_COMPANY:
|
||||||
|
|
|
@ -2969,7 +2969,7 @@ static ChangeInfoResult CargoChangeInfo(uint cid, int numinfo, int prop, ByteRea
|
||||||
case 0x0B: cs->town_effect = TE_FOOD; break;
|
case 0x0B: cs->town_effect = TE_FOOD; break;
|
||||||
default:
|
default:
|
||||||
grfmsg(1, "CargoChangeInfo: Unknown town growth substitute value %d, setting to none.", substitute_type);
|
grfmsg(1, "CargoChangeInfo: Unknown town growth substitute value %d, setting to none.", substitute_type);
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
case 0xFF: cs->town_effect = TE_NONE; break;
|
case 0xFF: cs->town_effect = TE_NONE; break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -4094,7 +4094,7 @@ static ChangeInfoResult RailTypeChangeInfo(uint id, int numinfo, int prop, ByteR
|
||||||
RailType rt = GetRailTypeByLabel(BSWAP32(label), false);
|
RailType rt = GetRailTypeByLabel(BSWAP32(label), false);
|
||||||
if (rt != INVALID_RAILTYPE) {
|
if (rt != INVALID_RAILTYPE) {
|
||||||
switch (prop) {
|
switch (prop) {
|
||||||
case 0x0F: SetBit(rti->powered_railtypes, rt); // Powered implies compatible.
|
case 0x0F: SetBit(rti->powered_railtypes, rt); FALLTHROUGH; // Powered implies compatible.
|
||||||
case 0x0E: SetBit(rti->compatible_railtypes, rt); break;
|
case 0x0E: SetBit(rti->compatible_railtypes, rt); break;
|
||||||
case 0x18: SetBit(rti->introduction_required_railtypes, rt); break;
|
case 0x18: SetBit(rti->introduction_required_railtypes, rt); break;
|
||||||
case 0x19: SetBit(rti->introduces_railtypes, rt); break;
|
case 0x19: SetBit(rti->introduces_railtypes, rt); break;
|
||||||
|
@ -4211,7 +4211,7 @@ static ChangeInfoResult RailTypeReserveInfo(uint id, int numinfo, int prop, Byte
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
grfmsg(1, "RailTypeReserveInfo: Ignoring property 1D for rail type %u because no label was set", id + i);
|
grfmsg(1, "RailTypeReserveInfo: Ignoring property 1D for rail type %u because no label was set", id + i);
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case 0x0E: // Compatible railtype list
|
case 0x0E: // Compatible railtype list
|
||||||
case 0x0F: // Powered railtype list
|
case 0x0F: // Powered railtype list
|
||||||
|
@ -4350,7 +4350,7 @@ static bool HandleChangeInfoResult(const char *caller, ChangeInfoResult cir, uin
|
||||||
|
|
||||||
case CIR_UNKNOWN:
|
case CIR_UNKNOWN:
|
||||||
grfmsg(0, "%s: Unknown property 0x%02X of feature 0x%02X, disabling", caller, property, feature);
|
grfmsg(0, "%s: Unknown property 0x%02X of feature 0x%02X, disabling", caller, property, feature);
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case CIR_INVALID_ID: {
|
case CIR_INVALID_ID: {
|
||||||
/* No debug message for an invalid ID, as it has already been output */
|
/* No debug message for an invalid ID, as it has already been output */
|
||||||
|
|
|
@ -1032,8 +1032,9 @@ struct NewGRFWindow : public Window, NewGRFScanCallback {
|
||||||
if (this->editable && this->active_sel != NULL) SetObjectToPlaceWnd(SPR_CURSOR_MOUSE, PAL_NONE, HT_DRAG, this);
|
if (this->editable && this->active_sel != NULL) SetObjectToPlaceWnd(SPR_CURSOR_MOUSE, PAL_NONE, HT_DRAG, this);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* FALL THROUGH, with double click. */
|
/* With double click, continue */
|
||||||
}
|
}
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
case WID_NS_REMOVE: { // Remove GRF
|
case WID_NS_REMOVE: { // Remove GRF
|
||||||
if (this->active_sel == NULL || !this->editable) break;
|
if (this->active_sel == NULL || !this->editable) break;
|
||||||
|
@ -1087,8 +1088,9 @@ struct NewGRFWindow : public Window, NewGRFScanCallback {
|
||||||
if (this->editable && this->avail_sel != NULL && !HasBit(this->avail_sel->flags, GCF_INVALID)) SetObjectToPlaceWnd(SPR_CURSOR_MOUSE, PAL_NONE, HT_DRAG, this);
|
if (this->editable && this->avail_sel != NULL && !HasBit(this->avail_sel->flags, GCF_INVALID)) SetObjectToPlaceWnd(SPR_CURSOR_MOUSE, PAL_NONE, HT_DRAG, this);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* FALL THROUGH, with double click. */
|
/* With double click, continue */
|
||||||
}
|
}
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
case WID_NS_ADD:
|
case WID_NS_ADD:
|
||||||
if (this->avail_sel == NULL || !this->editable || HasBit(this->avail_sel->flags, GCF_INVALID)) break;
|
if (this->avail_sel == NULL || !this->editable || HasBit(this->avail_sel->flags, GCF_INVALID)) break;
|
||||||
|
@ -1225,10 +1227,12 @@ struct NewGRFWindow : public Window, NewGRFScanCallback {
|
||||||
}
|
}
|
||||||
|
|
||||||
this->avails.ForceRebuild();
|
this->avails.ForceRebuild();
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case GOID_NEWGRF_LIST_EDITED:
|
case GOID_NEWGRF_LIST_EDITED:
|
||||||
this->preset = -1;
|
this->preset = -1;
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case GOID_NEWGRF_PRESET_LOADED: {
|
case GOID_NEWGRF_PRESET_LOADED: {
|
||||||
/* Update scrollbars */
|
/* Update scrollbars */
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
|
@ -128,7 +128,7 @@ static uint32 GetCountAndDistanceOfClosestInstance(byte param_setID, byte layout
|
||||||
|
|
||||||
case 0xFFFFFFFF: // current grf
|
case 0xFFFFFFFF: // current grf
|
||||||
GrfID = GetIndustrySpec(current->type)->grf_prop.grffile->grfid;
|
GrfID = GetIndustrySpec(current->type)->grf_prop.grffile->grfid;
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
default: // use the grfid specified in register 100h
|
default: // use the grfid specified in register 100h
|
||||||
SetBit(param_setID, 7); // bit 7 means it is not an old type
|
SetBit(param_setID, 7); // bit 7 means it is not an old type
|
||||||
|
|
|
@ -48,9 +48,11 @@ struct IndustriesResolverObject : public ResolverObject {
|
||||||
case VSG_SCOPE_PARENT: {
|
case VSG_SCOPE_PARENT: {
|
||||||
TownScopeResolver *tsr = this->GetTown();
|
TownScopeResolver *tsr = this->GetTown();
|
||||||
if (tsr != NULL) return tsr;
|
if (tsr != NULL) return tsr;
|
||||||
/* FALL-THROUGH */
|
|
||||||
}
|
}
|
||||||
default: return ResolverObject::GetScope(scope, relative);
|
FALLTHROUGH;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return ResolverObject::GetScope(scope, relative);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -232,7 +232,7 @@ static uint32 GetCountAndDistanceOfClosestInstance(byte local_id, uint32 grfid,
|
||||||
|
|
||||||
case 0xFFFFFFFF: // current grf
|
case 0xFFFFFFFF: // current grf
|
||||||
grf_id = grfid;
|
grf_id = grfid;
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
default: // use the grfid specified in register 100h
|
default: // use the grfid specified in register 100h
|
||||||
idx = _object_mngr.GetID(local_id, grf_id);
|
idx = _object_mngr.GetID(local_id, grf_id);
|
||||||
|
|
|
@ -128,10 +128,11 @@ struct ObjectResolverObject : public ResolverObject {
|
||||||
case VSG_SCOPE_PARENT: {
|
case VSG_SCOPE_PARENT: {
|
||||||
TownScopeResolver *tsr = this->GetTown();
|
TownScopeResolver *tsr = this->GetTown();
|
||||||
if (tsr != NULL) return tsr;
|
if (tsr != NULL) return tsr;
|
||||||
/* FALL-THROUGH */
|
|
||||||
}
|
}
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
default: return ResolverObject::GetScope(scope, relative);
|
default:
|
||||||
|
return ResolverObject::GetScope(scope, relative);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,8 +59,8 @@ struct StationResolverObject : public ResolverObject {
|
||||||
case VSG_SCOPE_PARENT: {
|
case VSG_SCOPE_PARENT: {
|
||||||
TownScopeResolver *tsr = this->GetTown();
|
TownScopeResolver *tsr = this->GetTown();
|
||||||
if (tsr != NULL) return tsr;
|
if (tsr != NULL) return tsr;
|
||||||
/* FALL-THROUGH */
|
|
||||||
}
|
}
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return ResolverObject::GetScope(scope, relative);
|
return ResolverObject::GetScope(scope, relative);
|
||||||
|
|
|
@ -772,7 +772,8 @@ CommandCost CmdInsertOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
|
||||||
case OSL_PLATFORM_NEAR_END:
|
case OSL_PLATFORM_NEAR_END:
|
||||||
case OSL_PLATFORM_MIDDLE:
|
case OSL_PLATFORM_MIDDLE:
|
||||||
if (v->type != VEH_TRAIN) return CMD_ERROR;
|
if (v->type != VEH_TRAIN) return CMD_ERROR;
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case OSL_PLATFORM_FAR_END:
|
case OSL_PLATFORM_FAR_END:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -880,7 +881,8 @@ CommandCost CmdInsertOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
|
||||||
case OCV_LOAD_PERCENTAGE:
|
case OCV_LOAD_PERCENTAGE:
|
||||||
case OCV_RELIABILITY:
|
case OCV_RELIABILITY:
|
||||||
if (new_order.GetConditionValue() > 100) return CMD_ERROR;
|
if (new_order.GetConditionValue() > 100) return CMD_ERROR;
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (occ == OCC_IS_TRUE || occ == OCC_IS_FALSE) return CMD_ERROR;
|
if (occ == OCC_IS_TRUE || occ == OCC_IS_FALSE) return CMD_ERROR;
|
||||||
break;
|
break;
|
||||||
|
@ -1466,7 +1468,8 @@ CommandCost CmdModifyOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
|
||||||
case OCV_LOAD_PERCENTAGE:
|
case OCV_LOAD_PERCENTAGE:
|
||||||
case OCV_RELIABILITY:
|
case OCV_RELIABILITY:
|
||||||
if (order->GetConditionValue() > 100) order->SetConditionValue(100);
|
if (order->GetConditionValue() > 100) order->SetConditionValue(100);
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (occ == OCC_IS_TRUE || occ == OCC_IS_FALSE) order->SetConditionComparator(OCC_EQUALS);
|
if (occ == OCC_IS_TRUE || occ == OCC_IS_FALSE) order->SetConditionComparator(OCC_EQUALS);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -841,7 +841,7 @@ public:
|
||||||
case VIWD_AUTOREPLACE:
|
case VIWD_AUTOREPLACE:
|
||||||
/* Autoreplace replaced the vehicle */
|
/* Autoreplace replaced the vehicle */
|
||||||
this->vehicle = Vehicle::Get(this->window_number);
|
this->vehicle = Vehicle::Get(this->window_number);
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case VIWD_CONSIST_CHANGED:
|
case VIWD_CONSIST_CHANGED:
|
||||||
/* Vehicle composition was changed. */
|
/* Vehicle composition was changed. */
|
||||||
|
|
|
@ -140,7 +140,8 @@ public:
|
||||||
* waypoint. */
|
* waypoint. */
|
||||||
Yapf().DisableCache(true);
|
Yapf().DisableCache(true);
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case OT_GOTO_STATION:
|
case OT_GOTO_STATION:
|
||||||
m_destTile = CalcClosestStationTile(v->current_order.GetDestination(), v->tile, v->current_order.IsType(OT_GOTO_STATION) ? STATION_RAIL : STATION_WAYPOINT);
|
m_destTile = CalcClosestStationTile(v->current_order.GetDestination(), v->tile, v->current_order.IsType(OT_GOTO_STATION) ? STATION_RAIL : STATION_WAYPOINT);
|
||||||
m_dest_station_id = v->current_order.GetDestination();
|
m_dest_station_id = v->current_order.GetDestination();
|
||||||
|
|
|
@ -554,8 +554,8 @@ CommandCost CmdBuildSingleRail(TileIndex tile, DoCommandFlag flags, uint32 p1, u
|
||||||
if (IsLevelCrossing(tile) && GetCrossingRailBits(tile) == trackbit) {
|
if (IsLevelCrossing(tile) && GetCrossingRailBits(tile) == trackbit) {
|
||||||
return_cmd_error(STR_ERROR_ALREADY_BUILT);
|
return_cmd_error(STR_ERROR_ALREADY_BUILT);
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
|
||||||
}
|
}
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
/* Will there be flat water on the lower halftile? */
|
/* Will there be flat water on the lower halftile? */
|
||||||
|
@ -2444,33 +2444,60 @@ static void DrawTile_Track(TileInfo *ti)
|
||||||
SpriteID ground = GetCustomRailSprite(rti, ti->tile, RTSG_GROUND);
|
SpriteID ground = GetCustomRailSprite(rti, ti->tile, RTSG_GROUND);
|
||||||
|
|
||||||
switch (GetRailDepotDirection(ti->tile)) {
|
switch (GetRailDepotDirection(ti->tile)) {
|
||||||
case DIAGDIR_NE: if (!IsInvisibilitySet(TO_BUILDINGS)) break; // else FALL THROUGH
|
case DIAGDIR_NE:
|
||||||
case DIAGDIR_SW: DrawGroundSprite(ground + RTO_X, PAL_NONE); break;
|
if (!IsInvisibilitySet(TO_BUILDINGS)) break;
|
||||||
case DIAGDIR_NW: if (!IsInvisibilitySet(TO_BUILDINGS)) break; // else FALL THROUGH
|
FALLTHROUGH;
|
||||||
case DIAGDIR_SE: DrawGroundSprite(ground + RTO_Y, PAL_NONE); break;
|
case DIAGDIR_SW:
|
||||||
default: break;
|
DrawGroundSprite(ground + RTO_X, PAL_NONE);
|
||||||
|
break;
|
||||||
|
case DIAGDIR_NW:
|
||||||
|
if (!IsInvisibilitySet(TO_BUILDINGS)) break;
|
||||||
|
FALLTHROUGH;
|
||||||
|
case DIAGDIR_SE:
|
||||||
|
DrawGroundSprite(ground + RTO_Y, PAL_NONE);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_settings_client.gui.show_track_reservation && HasDepotReservation(ti->tile)) {
|
if (_settings_client.gui.show_track_reservation && HasDepotReservation(ti->tile)) {
|
||||||
SpriteID overlay = GetCustomRailSprite(rti, ti->tile, RTSG_OVERLAY);
|
SpriteID overlay = GetCustomRailSprite(rti, ti->tile, RTSG_OVERLAY);
|
||||||
|
|
||||||
switch (GetRailDepotDirection(ti->tile)) {
|
switch (GetRailDepotDirection(ti->tile)) {
|
||||||
case DIAGDIR_NE: if (!IsInvisibilitySet(TO_BUILDINGS)) break; // else FALL THROUGH
|
case DIAGDIR_NE:
|
||||||
case DIAGDIR_SW: DrawGroundSprite(overlay + RTO_X, PALETTE_CRASH); break;
|
if (!IsInvisibilitySet(TO_BUILDINGS)) break;
|
||||||
case DIAGDIR_NW: if (!IsInvisibilitySet(TO_BUILDINGS)) break; // else FALL THROUGH
|
FALLTHROUGH;
|
||||||
case DIAGDIR_SE: DrawGroundSprite(overlay + RTO_Y, PALETTE_CRASH); break;
|
case DIAGDIR_SW:
|
||||||
default: break;
|
DrawGroundSprite(overlay + RTO_X, PALETTE_CRASH);
|
||||||
|
break;
|
||||||
|
case DIAGDIR_NW:
|
||||||
|
if (!IsInvisibilitySet(TO_BUILDINGS)) break;
|
||||||
|
FALLTHROUGH;
|
||||||
|
case DIAGDIR_SE:
|
||||||
|
DrawGroundSprite(overlay + RTO_Y, PALETTE_CRASH);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* PBS debugging, draw reserved tracks darker */
|
/* PBS debugging, draw reserved tracks darker */
|
||||||
if (_game_mode != GM_MENU && _settings_client.gui.show_track_reservation && HasDepotReservation(ti->tile)) {
|
if (_game_mode != GM_MENU && _settings_client.gui.show_track_reservation && HasDepotReservation(ti->tile)) {
|
||||||
switch (GetRailDepotDirection(ti->tile)) {
|
switch (GetRailDepotDirection(ti->tile)) {
|
||||||
case DIAGDIR_NE: if (!IsInvisibilitySet(TO_BUILDINGS)) break; // else FALL THROUGH
|
case DIAGDIR_NE:
|
||||||
case DIAGDIR_SW: DrawGroundSprite(rti->base_sprites.single_x, PALETTE_CRASH); break;
|
if (!IsInvisibilitySet(TO_BUILDINGS)) break;
|
||||||
case DIAGDIR_NW: if (!IsInvisibilitySet(TO_BUILDINGS)) break; // else FALL THROUGH
|
FALLTHROUGH;
|
||||||
case DIAGDIR_SE: DrawGroundSprite(rti->base_sprites.single_y, PALETTE_CRASH); break;
|
case DIAGDIR_SW:
|
||||||
default: break;
|
DrawGroundSprite(rti->base_sprites.single_x, PALETTE_CRASH);
|
||||||
|
break;
|
||||||
|
case DIAGDIR_NW:
|
||||||
|
if (!IsInvisibilitySet(TO_BUILDINGS)) break;
|
||||||
|
FALLTHROUGH;
|
||||||
|
case DIAGDIR_SE:
|
||||||
|
DrawGroundSprite(rti->base_sprites.single_y, PALETTE_CRASH);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,7 +154,7 @@ static void ConvertTownOwner()
|
||||||
if (GB(_m[tile].m5, 4, 2) == ROAD_TILE_CROSSING && HasBit(_m[tile].m3, 7)) {
|
if (GB(_m[tile].m5, 4, 2) == ROAD_TILE_CROSSING && HasBit(_m[tile].m3, 7)) {
|
||||||
_m[tile].m3 = OWNER_TOWN;
|
_m[tile].m3 = OWNER_TOWN;
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case MP_TUNNELBRIDGE:
|
case MP_TUNNELBRIDGE:
|
||||||
if (_m[tile].m1 & 0x80) SetTileOwner(tile, OWNER_TOWN);
|
if (_m[tile].m1 & 0x80) SetTileOwner(tile, OWNER_TOWN);
|
||||||
|
|
|
@ -185,7 +185,7 @@ void AfterLoadCompanyStats()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case MP_OBJECT:
|
case MP_OBJECT:
|
||||||
if (GetWaterClass(tile) == WATER_CLASS_CANAL) {
|
if (GetWaterClass(tile) == WATER_CLASS_CANAL) {
|
||||||
|
|
|
@ -433,8 +433,8 @@ void AfterLoadVehicles(bool part_of_load)
|
||||||
RoadVehicle *rv = RoadVehicle::From(v);
|
RoadVehicle *rv = RoadVehicle::From(v);
|
||||||
rv->roadtype = HasBit(EngInfo(v->First()->engine_type)->misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD;
|
rv->roadtype = HasBit(EngInfo(v->First()->engine_type)->misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD;
|
||||||
rv->compatible_roadtypes = RoadTypeToRoadTypes(rv->roadtype);
|
rv->compatible_roadtypes = RoadTypeToRoadTypes(rv->roadtype);
|
||||||
/* FALL THROUGH */
|
|
||||||
}
|
}
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
case VEH_TRAIN:
|
case VEH_TRAIN:
|
||||||
case VEH_SHIP:
|
case VEH_SHIP:
|
||||||
|
|
|
@ -40,7 +40,8 @@ ScriptError::ScriptErrorMapString ScriptError::error_map_string = ScriptError::S
|
||||||
|
|
||||||
case TEXT_TAB_SPECIAL:
|
case TEXT_TAB_SPECIAL:
|
||||||
if (index < 0xE4) break; // Player name
|
if (index < 0xE4) break; // Player name
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case TEXT_TAB_TOWN:
|
case TEXT_TAB_TOWN:
|
||||||
if (index < 0xC0) break; // Town name
|
if (index < 0xC0) break; // Town name
|
||||||
/* These strings are 'random' and have no meaning.
|
/* These strings are 'random' and have no meaning.
|
||||||
|
|
|
@ -178,7 +178,8 @@ static int ParseIntList(const char *p, int *items, int maxitems)
|
||||||
/* Do not accept multiple commas between numbers */
|
/* Do not accept multiple commas between numbers */
|
||||||
if (!comma) return -1;
|
if (!comma) return -1;
|
||||||
comma = false;
|
comma = false;
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case ' ':
|
case ' ':
|
||||||
p++;
|
p++;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -504,7 +504,8 @@ static SigSegState UpdateSignalsInBuffer(Owner owner)
|
||||||
_tbdset.Add(tile, INVALID_DIAGDIR); // start from depot inside
|
_tbdset.Add(tile, INVALID_DIAGDIR); // start from depot inside
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case MP_STATION:
|
case MP_STATION:
|
||||||
case MP_ROAD:
|
case MP_ROAD:
|
||||||
if ((TrackStatusToTrackBits(GetTileTrackStatus(tile, TRANSPORT_RAIL, 0)) & _enterdir_to_trackbits[dir]) != TRACK_BIT_NONE) {
|
if ((TrackStatusToTrackBits(GetTileTrackStatus(tile, TRANSPORT_RAIL, 0)) & _enterdir_to_trackbits[dir]) != TRACK_BIT_NONE) {
|
||||||
|
@ -513,7 +514,8 @@ static SigSegState UpdateSignalsInBuffer(Owner owner)
|
||||||
_tbdset.Add(tile + TileOffsByDiagDir(dir), ReverseDiagDir(dir));
|
_tbdset.Add(tile + TileOffsByDiagDir(dir), ReverseDiagDir(dir));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
/* jump to next tile */
|
/* jump to next tile */
|
||||||
tile = tile + TileOffsByDiagDir(dir);
|
tile = tile + TileOffsByDiagDir(dir);
|
||||||
|
|
|
@ -514,7 +514,7 @@ struct SignWindow : Window, SignList {
|
||||||
|
|
||||||
case WID_QES_OK:
|
case WID_QES_OK:
|
||||||
if (RenameSign(this->cur_sign, this->name_editbox.text.buf)) break;
|
if (RenameSign(this->cur_sign, this->name_editbox.text.buf)) break;
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case WID_QES_CANCEL:
|
case WID_QES_CANCEL:
|
||||||
delete this;
|
delete this;
|
||||||
|
|
|
@ -1229,10 +1229,12 @@ void SmallMapWindow::RebuildColourIndexIfNecessary()
|
||||||
if (tbl->show_on_map && tbl->type == _smallmap_industry_highlight) {
|
if (tbl->show_on_map && tbl->type == _smallmap_industry_highlight) {
|
||||||
legend_colour = _smallmap_industry_highlight_state ? PC_WHITE : PC_BLACK;
|
legend_colour = _smallmap_industry_highlight_state ? PC_WHITE : PC_BLACK;
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case SMT_LINKSTATS:
|
case SMT_LINKSTATS:
|
||||||
SetDParam(0, tbl->legend);
|
SetDParam(0, tbl->legend);
|
||||||
/* FALL_THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case SMT_OWNER:
|
case SMT_OWNER:
|
||||||
if (this->map_type != SMT_OWNER || tbl->company != INVALID_COMPANY) {
|
if (this->map_type != SMT_OWNER || tbl->company != INVALID_COMPANY) {
|
||||||
if (this->map_type == SMT_OWNER) SetDParam(0, tbl->company);
|
if (this->map_type == SMT_OWNER) SetDParam(0, tbl->company);
|
||||||
|
@ -1246,7 +1248,8 @@ void SmallMapWindow::RebuildColourIndexIfNecessary()
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* FALL_THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (this->map_type == SMT_CONTOUR) SetDParam(0, tbl->height * TILE_HEIGHT_STEP);
|
if (this->map_type == SMT_CONTOUR) SetDParam(0, tbl->height * TILE_HEIGHT_STEP);
|
||||||
/* Anything that is not an industry or a company is using normal process */
|
/* Anything that is not an industry or a company is using normal process */
|
||||||
|
@ -1465,7 +1468,6 @@ int SmallMapWindow::GetPositionOnLegend(Point pt)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WID_SM_ENABLE_ALL:
|
case WID_SM_ENABLE_ALL:
|
||||||
/* FALL THROUGH */
|
|
||||||
case WID_SM_DISABLE_ALL: {
|
case WID_SM_DISABLE_ALL: {
|
||||||
LegendAndColour *tbl = NULL;
|
LegendAndColour *tbl = NULL;
|
||||||
switch (this->map_type) {
|
switch (this->map_type) {
|
||||||
|
|
|
@ -818,7 +818,7 @@ static void *HandleInvalidSpriteRequest(SpriteID sprite, SpriteType requested, S
|
||||||
switch (requested) {
|
switch (requested) {
|
||||||
case ST_NORMAL:
|
case ST_NORMAL:
|
||||||
if (sprite == SPR_IMG_QUERY) usererror("Uhm, would you be so kind not to load a NewGRF that makes the 'query' sprite a non-normal sprite?");
|
if (sprite == SPR_IMG_QUERY) usererror("Uhm, would you be so kind not to load a NewGRF that makes the 'query' sprite a non-normal sprite?");
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
case ST_FONT:
|
case ST_FONT:
|
||||||
return GetRawSprite(SPR_IMG_QUERY, ST_NORMAL, allocator);
|
return GetRawSprite(SPR_IMG_QUERY, ST_NORMAL, allocator);
|
||||||
case ST_RECOLOUR:
|
case ST_RECOLOUR:
|
||||||
|
|
|
@ -3091,7 +3091,8 @@ static void TileLoop_Station(TileIndex tile)
|
||||||
|
|
||||||
case STATION_DOCK:
|
case STATION_DOCK:
|
||||||
if (!IsTileFlat(tile)) break; // only handle water part
|
if (!IsTileFlat(tile)) break; // only handle water part
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case STATION_OILRIG: //(station part)
|
case STATION_OILRIG: //(station part)
|
||||||
case STATION_BUOY:
|
case STATION_BUOY:
|
||||||
TileLoop_Water(tile);
|
TileLoop_Water(tile);
|
||||||
|
|
19
src/stdafx.h
19
src/stdafx.h
|
@ -156,6 +156,17 @@
|
||||||
#else
|
#else
|
||||||
#define FINAL
|
#define FINAL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Use fallthrough attribute where supported */
|
||||||
|
#if __GNUC__ >= 7
|
||||||
|
#if __cplusplus > 201402L // C++17
|
||||||
|
#define FALLTHROUGH [[fallthrough]]
|
||||||
|
#else
|
||||||
|
#define FALLTHROUGH __attribute__((fallthrough))
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define FALLTHROUGH
|
||||||
|
#endif
|
||||||
#endif /* __GNUC__ */
|
#endif /* __GNUC__ */
|
||||||
|
|
||||||
#if defined(__WATCOMC__)
|
#if defined(__WATCOMC__)
|
||||||
|
@ -164,6 +175,7 @@
|
||||||
#define GCC_PACK
|
#define GCC_PACK
|
||||||
#define WARN_FORMAT(string, args)
|
#define WARN_FORMAT(string, args)
|
||||||
#define FINAL
|
#define FINAL
|
||||||
|
#define FALLTHROUGH
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif /* __WATCOMC__ */
|
#endif /* __WATCOMC__ */
|
||||||
|
|
||||||
|
@ -235,6 +247,13 @@
|
||||||
#define WARN_FORMAT(string, args)
|
#define WARN_FORMAT(string, args)
|
||||||
#define FINAL sealed
|
#define FINAL sealed
|
||||||
|
|
||||||
|
/* fallthrough attribute, VS 2017 */
|
||||||
|
#if (_MSC_VER >= 1910)
|
||||||
|
#define FALLTHROUGH [[fallthrough]]
|
||||||
|
#else
|
||||||
|
#define FALLTHROUGH
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(WINCE)
|
#if defined(WINCE)
|
||||||
int CDECL vsnprintf(char *str, size_t size, const char *format, va_list ap);
|
int CDECL vsnprintf(char *str, size_t size, const char *format, va_list ap);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -80,12 +80,14 @@ static void GenerateRockyArea(TileIndex end, TileIndex start)
|
||||||
switch (GetTileType(tile)) {
|
switch (GetTileType(tile)) {
|
||||||
case MP_TREES:
|
case MP_TREES:
|
||||||
if (GetTreeGround(tile) == TREE_GROUND_SHORE) continue;
|
if (GetTreeGround(tile) == TREE_GROUND_SHORE) continue;
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case MP_CLEAR:
|
case MP_CLEAR:
|
||||||
MakeClear(tile, CLEAR_ROCKS, 3);
|
MakeClear(tile, CLEAR_ROCKS, 3);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: continue;
|
default:
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
MarkTileDirtyByTile(tile);
|
MarkTileDirtyByTile(tile);
|
||||||
success = true;
|
success = true;
|
||||||
|
|
|
@ -197,7 +197,8 @@ struct TimetableWindow : Window {
|
||||||
this->deparr_time_width = GetStringBoundingBox(STR_JUST_DATE_TINY).width;
|
this->deparr_time_width = GetStringBoundingBox(STR_JUST_DATE_TINY).width;
|
||||||
this->deparr_abbr_width = max(GetStringBoundingBox(STR_TIMETABLE_ARRIVAL_ABBREVIATION).width, GetStringBoundingBox(STR_TIMETABLE_DEPARTURE_ABBREVIATION).width);
|
this->deparr_abbr_width = max(GetStringBoundingBox(STR_TIMETABLE_ARRIVAL_ABBREVIATION).width, GetStringBoundingBox(STR_TIMETABLE_DEPARTURE_ABBREVIATION).width);
|
||||||
size->width = WD_FRAMERECT_LEFT + this->deparr_abbr_width + 10 + this->deparr_time_width + WD_FRAMERECT_RIGHT;
|
size->width = WD_FRAMERECT_LEFT + this->deparr_abbr_width + 10 + this->deparr_time_width + WD_FRAMERECT_RIGHT;
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case WID_VT_ARRIVAL_DEPARTURE_SELECTION:
|
case WID_VT_ARRIVAL_DEPARTURE_SELECTION:
|
||||||
case WID_VT_TIMETABLE_PANEL:
|
case WID_VT_TIMETABLE_PANEL:
|
||||||
resize->height = FONT_HEIGHT_NORMAL;
|
resize->height = FONT_HEIGHT_NORMAL;
|
||||||
|
|
|
@ -1244,7 +1244,7 @@ static void GrowTownInTile(TileIndex *tile_ptr, RoadBits cur_rb, DiagDirection t
|
||||||
|
|
||||||
case TL_3X3_GRID: // Use 2x2 grid afterwards!
|
case TL_3X3_GRID: // Use 2x2 grid afterwards!
|
||||||
GrowTownWithExtraHouse(t1, TileAddByDiagDir(house_tile, target_dir));
|
GrowTownWithExtraHouse(t1, TileAddByDiagDir(house_tile, target_dir));
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case TL_2X2_GRID:
|
case TL_2X2_GRID:
|
||||||
rcmd = GetTownRoadGridElement(t1, tile, target_dir);
|
rcmd = GetTownRoadGridElement(t1, tile, target_dir);
|
||||||
|
@ -1253,7 +1253,7 @@ static void GrowTownInTile(TileIndex *tile_ptr, RoadBits cur_rb, DiagDirection t
|
||||||
|
|
||||||
case TL_BETTER_ROADS: // Use original afterwards!
|
case TL_BETTER_ROADS: // Use original afterwards!
|
||||||
GrowTownWithExtraHouse(t1, TileAddByDiagDir(house_tile, target_dir));
|
GrowTownWithExtraHouse(t1, TileAddByDiagDir(house_tile, target_dir));
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case TL_ORIGINAL:
|
case TL_ORIGINAL:
|
||||||
/* Allow a house at the edge. 60% chance or
|
/* Allow a house at the edge. 60% chance or
|
||||||
|
@ -3259,7 +3259,7 @@ Town *ClosestTownFromTile(TileIndex tile, uint threshold)
|
||||||
|
|
||||||
return town;
|
return town;
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case MP_HOUSE:
|
case MP_HOUSE:
|
||||||
return Town::GetByTile(tile);
|
return Town::GetByTile(tile);
|
||||||
|
|
|
@ -267,9 +267,10 @@ public:
|
||||||
this->sel_index = y;
|
this->sel_index = y;
|
||||||
this->SetDirty();
|
this->SetDirty();
|
||||||
}
|
}
|
||||||
/* FALL THROUGH, when double-clicking. */
|
/* When double-clicking, continue */
|
||||||
if (click_count == 1 || y < 0) break;
|
if (click_count == 1 || y < 0) break;
|
||||||
}
|
}
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
case WID_TA_EXECUTE:
|
case WID_TA_EXECUTE:
|
||||||
DoCommandP(this->town->xy, this->window_number, this->sel_index, CMD_DO_TOWN_ACTION | CMD_MSG(STR_ERROR_CAN_T_DO_THIS));
|
DoCommandP(this->town->xy, this->window_number, this->sel_index, CMD_DO_TOWN_ACTION | CMD_MSG(STR_ERROR_CAN_T_DO_THIS));
|
||||||
|
|
|
@ -2502,6 +2502,7 @@ public:
|
||||||
case OT_GOTO_DEPOT:
|
case OT_GOTO_DEPOT:
|
||||||
/* Skip service in depot orders when the train doesn't need service. */
|
/* Skip service in depot orders when the train doesn't need service. */
|
||||||
if ((order->GetDepotOrderType() & ODTFB_SERVICE) && !this->v->NeedsServicing()) break;
|
if ((order->GetDepotOrderType() & ODTFB_SERVICE) && !this->v->NeedsServicing()) break;
|
||||||
|
FALLTHROUGH;
|
||||||
case OT_GOTO_STATION:
|
case OT_GOTO_STATION:
|
||||||
case OT_GOTO_WAYPOINT:
|
case OT_GOTO_WAYPOINT:
|
||||||
this->v->current_order = *order;
|
this->v->current_order = *order;
|
||||||
|
@ -3608,7 +3609,7 @@ static bool TrainApproachingLineEnd(Train *v, bool signal, bool reverse)
|
||||||
* for other directions, it will be 1, 3, 5, ..., 15 */
|
* for other directions, it will be 1, 3, 5, ..., 15 */
|
||||||
switch (v->direction) {
|
switch (v->direction) {
|
||||||
case DIR_N : x = ~x + ~y + 25; break;
|
case DIR_N : x = ~x + ~y + 25; break;
|
||||||
case DIR_NW: x = y; // FALL THROUGH
|
case DIR_NW: x = y; FALLTHROUGH;
|
||||||
case DIR_NE: x = ~x + 16; break;
|
case DIR_NE: x = ~x + 16; break;
|
||||||
case DIR_E : x = ~x + y + 9; break;
|
case DIR_E : x = ~x + y + 9; break;
|
||||||
case DIR_SE: x = y; break;
|
case DIR_SE: x = y; break;
|
||||||
|
|
|
@ -375,7 +375,8 @@ CommandCost CmdPlantTree(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||||
msg = STR_ERROR_CAN_T_BUILD_ON_WATER;
|
msg = STR_ERROR_CAN_T_BUILD_ON_WATER;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case MP_CLEAR: {
|
case MP_CLEAR: {
|
||||||
if (IsBridgeAbove(tile)) {
|
if (IsBridgeAbove(tile)) {
|
||||||
msg = STR_ERROR_SITE_UNSUITABLE;
|
msg = STR_ERROR_SITE_UNSUITABLE;
|
||||||
|
@ -680,7 +681,7 @@ static void TileLoop_Trees(TileIndex tile)
|
||||||
SetTreeGrowth(tile, 0);
|
SetTreeGrowth(tile, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case 2: { // add a neighbouring tree
|
case 2: { // add a neighbouring tree
|
||||||
/* Don't plant extra trees if that's not allowed. */
|
/* Don't plant extra trees if that's not allowed. */
|
||||||
|
|
|
@ -1269,7 +1269,7 @@ bool Vehicle::HandleBreakdown()
|
||||||
SetWindowDirty(WC_VEHICLE_VIEW, this->index);
|
SetWindowDirty(WC_VEHICLE_VIEW, this->index);
|
||||||
SetWindowDirty(WC_VEHICLE_DETAILS, this->index);
|
SetWindowDirty(WC_VEHICLE_DETAILS, this->index);
|
||||||
|
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
case 1:
|
case 1:
|
||||||
/* Aircraft breakdowns end only when arriving at the airport */
|
/* Aircraft breakdowns end only when arriving at the airport */
|
||||||
if (this->type == VEH_AIRCRAFT) return false;
|
if (this->type == VEH_AIRCRAFT) return false;
|
||||||
|
|
|
@ -817,8 +817,8 @@ struct RefitWindow : public Window {
|
||||||
Vehicle *v = Vehicle::Get(this->window_number);
|
Vehicle *v = Vehicle::Get(this->window_number);
|
||||||
this->selected_vehicle = v->index;
|
this->selected_vehicle = v->index;
|
||||||
this->num_vehicles = UINT8_MAX;
|
this->num_vehicles = UINT8_MAX;
|
||||||
/* FALL THROUGH */
|
|
||||||
}
|
}
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
case 2: { // The vehicle selection has changed; rebuild the entire list.
|
case 2: { // The vehicle selection has changed; rebuild the entire list.
|
||||||
if (!gui_scope) break;
|
if (!gui_scope) break;
|
||||||
|
@ -843,8 +843,8 @@ struct RefitWindow : public Window {
|
||||||
this->information_width = max_width;
|
this->information_width = max_width;
|
||||||
this->ReInit();
|
this->ReInit();
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
|
||||||
}
|
}
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
case 1: // A new cargo has been selected.
|
case 1: // A new cargo has been selected.
|
||||||
if (!gui_scope) break;
|
if (!gui_scope) break;
|
||||||
|
@ -905,8 +905,8 @@ struct RefitWindow : public Window {
|
||||||
if (_ctrl_pressed) this->num_vehicles = UINT8_MAX;
|
if (_ctrl_pressed) this->num_vehicles = UINT8_MAX;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
|
||||||
}
|
}
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
/* Clear the selection. */
|
/* Clear the selection. */
|
||||||
|
@ -940,8 +940,8 @@ struct RefitWindow : public Window {
|
||||||
this->InvalidateData(1);
|
this->InvalidateData(1);
|
||||||
|
|
||||||
if (click_count == 1) break;
|
if (click_count == 1) break;
|
||||||
/* FALL THROUGH */
|
|
||||||
}
|
}
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
case WID_VR_REFIT: // refit button
|
case WID_VR_REFIT: // refit button
|
||||||
if (this->cargo != NULL) {
|
if (this->cargo != NULL) {
|
||||||
|
@ -2638,8 +2638,7 @@ public:
|
||||||
str = STR_VEHICLE_STATUS_LEAVING;
|
str = STR_VEHICLE_STATUS_LEAVING;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* FALL THROUGH, if aircraft. Does this even happen? */
|
FALLTHROUGH;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (v->GetNumManualOrders() == 0) {
|
if (v->GetNumManualOrders() == 0) {
|
||||||
str = STR_VEHICLE_STATUS_NO_ORDERS_VEL;
|
str = STR_VEHICLE_STATUS_NO_ORDERS_VEL;
|
||||||
|
|
|
@ -156,7 +156,7 @@ bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &vli
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case VL_STANDARD:
|
case VL_STANDARD:
|
||||||
FOR_ALL_VEHICLES(v) {
|
FOR_ALL_VEHICLES(v) {
|
||||||
|
|
|
@ -610,7 +610,7 @@ static bool QZ_PollEvent()
|
||||||
* the mouse position programmatically, which would trigger OS X to show
|
* the mouse position programmatically, which would trigger OS X to show
|
||||||
* the default arrow cursor if the events are propagated. */
|
* the default arrow cursor if the events are propagated. */
|
||||||
if (_cursor.fix_at) break;
|
if (_cursor.fix_at) break;
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
[ NSApp sendEvent:event ];
|
[ NSApp sendEvent:event ];
|
||||||
|
|
|
@ -680,7 +680,7 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
|
||||||
|
|
||||||
case WM_PALETTECHANGED:
|
case WM_PALETTECHANGED:
|
||||||
if ((HWND)wParam == hwnd) return 0;
|
if ((HWND)wParam == hwnd) return 0;
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case WM_QUERYNEWPALETTE: {
|
case WM_QUERYNEWPALETTE: {
|
||||||
HDC hDC = GetWindowDC(hwnd);
|
HDC hDC = GetWindowDC(hwnd);
|
||||||
|
|
|
@ -2633,8 +2633,8 @@ static int CalcHeightdiff(HighLightStyle style, uint distance, TileIndex start_t
|
||||||
byte style_t = (byte)(TileX(end_tile) > TileX(start_tile));
|
byte style_t = (byte)(TileX(end_tile) > TileX(start_tile));
|
||||||
start_tile = TILE_ADD(start_tile, ToTileIndexDiff(heightdiff_area_by_dir[style_t]));
|
start_tile = TILE_ADD(start_tile, ToTileIndexDiff(heightdiff_area_by_dir[style_t]));
|
||||||
end_tile = TILE_ADD(end_tile, ToTileIndexDiff(heightdiff_area_by_dir[2 + style_t]));
|
end_tile = TILE_ADD(end_tile, ToTileIndexDiff(heightdiff_area_by_dir[2 + style_t]));
|
||||||
/* FALL THROUGH */
|
|
||||||
}
|
}
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
case HT_POINT:
|
case HT_POINT:
|
||||||
h0 = TileHeight(start_tile);
|
h0 = TileHeight(start_tile);
|
||||||
|
@ -2979,7 +2979,7 @@ void VpSelectTilesWithMethod(int x, int y, ViewportPlaceMethod method)
|
||||||
|
|
||||||
case VPM_X_LIMITED: // Drag in X direction (limited size).
|
case VPM_X_LIMITED: // Drag in X direction (limited size).
|
||||||
limit = (_thd.sizelimit - 1) * TILE_SIZE;
|
limit = (_thd.sizelimit - 1) * TILE_SIZE;
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case VPM_FIX_X: // drag in Y direction
|
case VPM_FIX_X: // drag in Y direction
|
||||||
x = sx;
|
x = sx;
|
||||||
|
@ -2988,7 +2988,7 @@ void VpSelectTilesWithMethod(int x, int y, ViewportPlaceMethod method)
|
||||||
|
|
||||||
case VPM_Y_LIMITED: // Drag in Y direction (limited size).
|
case VPM_Y_LIMITED: // Drag in Y direction (limited size).
|
||||||
limit = (_thd.sizelimit - 1) * TILE_SIZE;
|
limit = (_thd.sizelimit - 1) * TILE_SIZE;
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case VPM_FIX_Y: // drag in X direction
|
case VPM_FIX_Y: // drag in X direction
|
||||||
y = sy;
|
y = sy;
|
||||||
|
@ -3026,7 +3026,7 @@ calc_heightdiff_single_direction:;
|
||||||
limit = (_thd.sizelimit - 1) * TILE_SIZE;
|
limit = (_thd.sizelimit - 1) * TILE_SIZE;
|
||||||
x = sx + Clamp(x - sx, -limit, limit);
|
x = sx + Clamp(x - sx, -limit, limit);
|
||||||
y = sy + Clamp(y - sy, -limit, limit);
|
y = sy + Clamp(y - sy, -limit, limit);
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case VPM_X_AND_Y: // drag an X by Y area
|
case VPM_X_AND_Y: // drag an X by Y area
|
||||||
if (_settings_client.gui.measure_tooltip) {
|
if (_settings_client.gui.measure_tooltip) {
|
||||||
|
|
|
@ -437,7 +437,7 @@ CommandCost CmdBuildCanal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||||
MakeSea(tile);
|
MakeSea(tile);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
MakeCanal(tile, _current_company, Random());
|
MakeCanal(tile, _current_company, Random());
|
||||||
|
@ -1015,7 +1015,7 @@ FloodingBehaviour GetFloodingBehaviour(TileIndex tile)
|
||||||
Slope tileh = GetTileSlope(tile);
|
Slope tileh = GetTileSlope(tile);
|
||||||
return (IsSlopeWithOneCornerRaised(tileh) ? FLOOD_ACTIVE : FLOOD_DRYUP);
|
return (IsSlopeWithOneCornerRaised(tileh) ? FLOOD_ACTIVE : FLOOD_DRYUP);
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
case MP_STATION:
|
case MP_STATION:
|
||||||
case MP_INDUSTRY:
|
case MP_INDUSTRY:
|
||||||
case MP_OBJECT:
|
case MP_OBJECT:
|
||||||
|
@ -1064,7 +1064,7 @@ void DoFloodTile(TileIndex target)
|
||||||
flooded = true;
|
flooded = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case MP_CLEAR:
|
case MP_CLEAR:
|
||||||
if (DoCommand(target, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR).Succeeded()) {
|
if (DoCommand(target, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR).Succeeded()) {
|
||||||
|
|
|
@ -2287,8 +2287,8 @@ void NWidgetLeaf::SetupSmallestSize(Window *w, bool init_array)
|
||||||
Dimension sprite_size = GetSpriteSize(_current_text_dir == TD_RTL ? SPR_IMG_DELETE_RIGHT : SPR_IMG_DELETE_LEFT);
|
Dimension sprite_size = GetSpriteSize(_current_text_dir == TD_RTL ? SPR_IMG_DELETE_RIGHT : SPR_IMG_DELETE_LEFT);
|
||||||
size.width = max(size.width, 30 + sprite_size.width);
|
size.width = max(size.width, 30 + sprite_size.width);
|
||||||
size.height = max(sprite_size.height, GetStringBoundingBox("_").height + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM);
|
size.height = max(sprite_size.height, GetStringBoundingBox("_").height + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM);
|
||||||
/* FALL THROUGH */
|
|
||||||
}
|
}
|
||||||
|
FALLTHROUGH;
|
||||||
case WWT_PUSHBTN: {
|
case WWT_PUSHBTN: {
|
||||||
static const Dimension extra = {WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM};
|
static const Dimension extra = {WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM};
|
||||||
padding = &extra;
|
padding = &extra;
|
||||||
|
|
|
@ -1277,26 +1277,33 @@ static uint GetWindowZPriority(const Window *w)
|
||||||
switch (w->window_class) {
|
switch (w->window_class) {
|
||||||
case WC_ENDSCREEN:
|
case WC_ENDSCREEN:
|
||||||
++z_priority;
|
++z_priority;
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
case WC_HIGHSCORE:
|
case WC_HIGHSCORE:
|
||||||
++z_priority;
|
++z_priority;
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
case WC_TOOLTIPS:
|
case WC_TOOLTIPS:
|
||||||
++z_priority;
|
++z_priority;
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
case WC_DROPDOWN_MENU:
|
case WC_DROPDOWN_MENU:
|
||||||
++z_priority;
|
++z_priority;
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
case WC_MAIN_TOOLBAR:
|
case WC_MAIN_TOOLBAR:
|
||||||
case WC_STATUS_BAR:
|
case WC_STATUS_BAR:
|
||||||
++z_priority;
|
++z_priority;
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
case WC_OSK:
|
case WC_OSK:
|
||||||
++z_priority;
|
++z_priority;
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
case WC_QUERY_STRING:
|
case WC_QUERY_STRING:
|
||||||
case WC_SEND_NETWORK_MSG:
|
case WC_SEND_NETWORK_MSG:
|
||||||
++z_priority;
|
++z_priority;
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
case WC_ERRMSG:
|
case WC_ERRMSG:
|
||||||
case WC_CONFIRM_POPUP_QUERY:
|
case WC_CONFIRM_POPUP_QUERY:
|
||||||
|
@ -1304,6 +1311,7 @@ static uint GetWindowZPriority(const Window *w)
|
||||||
case WC_NETWORK_STATUS_WINDOW:
|
case WC_NETWORK_STATUS_WINDOW:
|
||||||
case WC_SAVE_PRESET:
|
case WC_SAVE_PRESET:
|
||||||
++z_priority;
|
++z_priority;
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
case WC_GENERATE_LANDSCAPE:
|
case WC_GENERATE_LANDSCAPE:
|
||||||
case WC_SAVELOAD:
|
case WC_SAVELOAD:
|
||||||
|
@ -1315,15 +1323,19 @@ static uint GetWindowZPriority(const Window *w)
|
||||||
case WC_AI_SETTINGS:
|
case WC_AI_SETTINGS:
|
||||||
case WC_TEXTFILE:
|
case WC_TEXTFILE:
|
||||||
++z_priority;
|
++z_priority;
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
case WC_CONSOLE:
|
case WC_CONSOLE:
|
||||||
++z_priority;
|
++z_priority;
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
case WC_NEWS_WINDOW:
|
case WC_NEWS_WINDOW:
|
||||||
++z_priority;
|
++z_priority;
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
++z_priority;
|
++z_priority;
|
||||||
|
FALLTHROUGH;
|
||||||
|
|
||||||
case WC_MAIN_WINDOW:
|
case WC_MAIN_WINDOW:
|
||||||
return z_priority;
|
return z_priority;
|
||||||
|
@ -2867,7 +2879,7 @@ static void MouseLoop(MouseClick click, int mousewheel)
|
||||||
if (!scrollwheel_scrolling || w == NULL || w->window_class != WC_SMALLMAP) break;
|
if (!scrollwheel_scrolling || w == NULL || w->window_class != WC_SMALLMAP) break;
|
||||||
/* We try to use the scrollwheel to scroll since we didn't touch any of the buttons.
|
/* We try to use the scrollwheel to scroll since we didn't touch any of the buttons.
|
||||||
* Simulate a right button click so we can get started. */
|
* Simulate a right button click so we can get started. */
|
||||||
/* FALL THROUGH */
|
FALLTHROUGH;
|
||||||
|
|
||||||
case MC_RIGHT: DispatchRightClickEvent(w, x - w->left, y - w->top); break;
|
case MC_RIGHT: DispatchRightClickEvent(w, x - w->left, y - w->top); break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue