|
@@ -38,25 +38,25 @@
|
|
|
#include "newgrf_town.h"
|
|
|
#include "newgrf_railtype.h"
|
|
|
#include "newgrf_industries.h"
|
|
|
#include "newgrf_industrytiles.h"
|
|
|
|
|
|
#include "widgets/newgrf_debug_widget.h"
|
|
|
|
|
|
#include "table/strings.h"
|
|
|
|
|
|
#include "safeguards.h"
|
|
|
|
|
|
/** The sprite picker. */
|
|
|
NewGrfDebugSpritePicker _newgrf_debug_sprite_picker = { SPM_NONE, NULL, 0, SmallVector<SpriteID, 256>() };
|
|
|
NewGrfDebugSpritePicker _newgrf_debug_sprite_picker = { SPM_NONE, NULL, 0, std::vector<SpriteID>() };
|
|
|
|
|
|
/**
|
|
|
* Get the feature index related to the window number.
|
|
|
* @param window_number The window to get the feature index from.
|
|
|
* @return the feature index
|
|
|
*/
|
|
|
static inline uint GetFeatureIndex(uint window_number)
|
|
|
{
|
|
|
return GB(window_number, 0, 24);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -885,25 +885,25 @@ struct SpriteAlignerWindow : Window {
|
|
|
|
|
|
DrawSprite(this->current_sprite, PAL_NONE, x, y, NULL, ZOOM_LVL_GUI);
|
|
|
|
|
|
_cur_dpi = old_dpi;
|
|
|
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
case WID_SA_LIST: {
|
|
|
const NWidgetBase *nwid = this->GetWidget<NWidgetBase>(widget);
|
|
|
int step_size = nwid->resize_y;
|
|
|
|
|
|
SmallVector<SpriteID, 256> &list = _newgrf_debug_sprite_picker.sprites;
|
|
|
std::vector<SpriteID> &list = _newgrf_debug_sprite_picker.sprites;
|
|
|
int max = min<int>(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), list.size());
|
|
|
|
|
|
int y = r.top + WD_FRAMERECT_TOP;
|
|
|
for (int i = this->vscroll->GetPosition(); i < max; i++) {
|
|
|
SetDParam(0, list[i]);
|
|
|
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_BLACK_COMMA, TC_FROMSTRING, SA_RIGHT | SA_FORCE);
|
|
|
y += step_size;
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|