summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-10-20 20:06:25 +0000
committeralberth <alberth@openttd.org>2009-10-20 20:06:25 +0000
commitaf9c76eb6f1c4a866c4f79c488eee253991dc768 (patch)
tree499935136d697a9e6e3f51c6902161ad3964c1fb /src
parentffb729ac9e891c63bcc60b04a3662d3ae8942179 (diff)
downloadopenttd-af9c76eb6f1c4a866c4f79c488eee253991dc768.tar.xz
(svn r17828) -Codechange: Variable declaration code style, and a few comment typo-ish fixes.
Diffstat (limited to 'src')
-rw-r--r--src/industry_gui.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index 5c9064f96..1b64c652a 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -143,6 +143,7 @@ static const WindowDesc _build_industry_desc(
_build_industry_widgets, _nested_build_industry_widgets, lengthof(_nested_build_industry_widgets)
);
+/** Build (fund or prospect) a new industry, */
class BuildIndustryWindow : public Window {
int selected_index; ///< index of the element in the matrix
IndustryType selected_type; ///< industry corresponding to the above index
@@ -155,9 +156,6 @@ class BuildIndustryWindow : public Window {
void SetupArrays()
{
- IndustryType ind;
- const IndustrySpec *indsp;
-
this->count = 0;
for (uint i = 0; i < lengthof(this->index); i++) {
@@ -175,8 +173,8 @@ class BuildIndustryWindow : public Window {
* The tests performed after the enabled allow to load the industries
* In the same way they are inserted by grf (if any)
*/
- for (ind = 0; ind < NUM_INDUSTRYTYPES; ind++) {
- indsp = GetIndustrySpec(ind);
+ for (IndustryType ind = 0; ind < NUM_INDUSTRYTYPES; ind++) {
+ const IndustrySpec *indsp = GetIndustrySpec(ind);
if (indsp->enabled) {
/* Rule is that editor mode loads all industries.
* In game mode, all non raw industries are loaded too
@@ -206,7 +204,7 @@ public:
BuildIndustryWindow() : Window(&_build_industry_desc)
{
/* Shorten the window to the equivalant of the additionnal purchase
- * info coming from the callback. SO it will only be available to its full
+ * info coming from the callback. So it will only be available to its full
* height when newindistries are loaded */
if (!_loaded_newgrf_features.has_newindustries) {
this->widget[DPIW_INFOPANEL].bottom -= 44;
@@ -318,11 +316,11 @@ public:
DrawString(x_str, right, y_str, str);
y_str += 11;
- /* Get the additional purchase info text, if it has not already been */
- if (this->text[this->selected_index] == STR_NULL) { // Have i been called already?
+ /* Get the additional purchase info text, if it has not already been queried. */
+ if (this->text[this->selected_index] == STR_NULL) { // Have I been called already?
if (HasBit(indsp->callback_mask, CBM_IND_FUND_MORE_TEXT)) { // No. Can it be called?
uint16 callback_res = GetIndustryCallback(CBID_INDUSTRY_FUND_MORE_TEXT, 0, 0, NULL, this->selected_type, INVALID_TILE);
- if (callback_res != CALLBACK_FAILED) { // Did it failed?
+ if (callback_res != CALLBACK_FAILED) { // Did it fail?
StringID newtxt = GetGRFStringID(indsp->grf_prop.grffile->grfid, 0xD000 + callback_res); // No. here's the new string
this->text[this->selected_index] = newtxt; // Store it for further usage
}