2005-07-24 16:12:37 +02:00
|
|
|
/* $Id$ */
|
|
|
|
|
2009-08-21 22:21:05 +02:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
|
|
|
|
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2008-05-06 17:11:33 +02:00
|
|
|
/** @file engine_gui.cpp GUI to show engine related information. */
|
2007-02-23 19:55:07 +01:00
|
|
|
|
2004-08-09 19:04:08 +02:00
|
|
|
#include "stdafx.h"
|
2007-12-19 21:45:46 +01:00
|
|
|
#include "window_gui.h"
|
2008-01-09 10:45:45 +01:00
|
|
|
#include "gfx_func.h"
|
2008-03-31 02:17:39 +02:00
|
|
|
#include "engine_func.h"
|
2008-04-29 23:31:29 +02:00
|
|
|
#include "engine_base.h"
|
2007-12-21 22:50:46 +01:00
|
|
|
#include "command_func.h"
|
2007-12-21 20:49:27 +01:00
|
|
|
#include "strings_func.h"
|
2008-05-27 14:24:23 +02:00
|
|
|
#include "engine_gui.h"
|
2008-06-20 09:23:00 +02:00
|
|
|
#include "articulated_vehicles.h"
|
2009-05-27 19:18:53 +02:00
|
|
|
#include "vehicle_func.h"
|
|
|
|
#include "company_func.h"
|
2008-08-24 23:31:24 +02:00
|
|
|
#include "rail.h"
|
2009-10-27 20:56:00 +01:00
|
|
|
#include "settings_type.h"
|
2004-08-09 19:04:08 +02:00
|
|
|
|
2008-01-13 02:21:35 +01:00
|
|
|
#include "table/strings.h"
|
2004-08-09 19:04:08 +02:00
|
|
|
|
2009-08-30 19:54:11 +02:00
|
|
|
/** Return the category of an engine.
|
|
|
|
* @param engine Engine to examine.
|
|
|
|
* @return String describing the category ("road veh", "train". "airplane", or "ship") of the engine.
|
|
|
|
*/
|
2008-05-13 12:17:04 +02:00
|
|
|
StringID GetEngineCategoryName(EngineID engine)
|
2004-08-09 19:04:08 +02:00
|
|
|
{
|
2009-10-06 21:17:07 +02:00
|
|
|
const Engine *e = Engine::Get(engine);
|
|
|
|
switch (e->type) {
|
2007-03-03 23:03:15 +01:00
|
|
|
default: NOT_REACHED();
|
2009-04-22 01:40:56 +02:00
|
|
|
case VEH_ROAD: return STR_ENGINE_PREVIEW_ROAD_VEHICLE;
|
|
|
|
case VEH_AIRCRAFT: return STR_ENGINE_PREVIEW_AIRCRAFT;
|
|
|
|
case VEH_SHIP: return STR_ENGINE_PREVIEW_SHIP;
|
2007-03-08 17:27:54 +01:00
|
|
|
case VEH_TRAIN:
|
2009-10-06 21:17:07 +02:00
|
|
|
return GetRailTypeInfo(e->u.rail.railtype)->strings.new_loco;
|
2004-11-19 20:13:32 +01:00
|
|
|
}
|
2004-08-09 19:04:08 +02:00
|
|
|
}
|
|
|
|
|
2009-03-21 21:39:37 +01:00
|
|
|
/** Widgets used for the engine preview window */
|
|
|
|
enum EnginePreviewWidgets {
|
2009-11-08 20:22:45 +01:00
|
|
|
EPW_QUESTION, ///< The container for the question
|
2009-03-21 21:39:37 +01:00
|
|
|
EPW_NO, ///< No button
|
|
|
|
EPW_YES, ///< Yes button
|
|
|
|
};
|
|
|
|
|
2009-03-28 14:35:07 +01:00
|
|
|
static const NWidgetPart _nested_engine_preview_widgets[] = {
|
|
|
|
NWidget(NWID_HORIZONTAL),
|
2009-11-24 19:05:55 +01:00
|
|
|
NWidget(WWT_CLOSEBOX, COLOUR_LIGHT_BLUE),
|
|
|
|
NWidget(WWT_CAPTION, COLOUR_LIGHT_BLUE), SetDataTip(STR_ENGINE_PREVIEW_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
2009-03-28 14:35:07 +01:00
|
|
|
EndContainer(),
|
2009-11-24 22:13:36 +01:00
|
|
|
NWidget(WWT_PANEL, COLOUR_LIGHT_BLUE),
|
2009-11-22 19:26:01 +01:00
|
|
|
NWidget(WWT_EMPTY, INVALID_COLOUR, EPW_QUESTION), SetMinimalSize(300, 0), SetPadding(8, 8, 8, 8), SetFill(1, 0),
|
2009-11-08 20:22:45 +01:00
|
|
|
NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), SetPIP(85, 10, 85),
|
2009-11-22 19:26:01 +01:00
|
|
|
NWidget(WWT_PUSHTXTBTN, COLOUR_LIGHT_BLUE, EPW_NO), SetDataTip(STR_QUIT_NO, STR_NULL), SetFill(1, 0),
|
|
|
|
NWidget(WWT_PUSHTXTBTN, COLOUR_LIGHT_BLUE, EPW_YES), SetDataTip(STR_QUIT_YES, STR_NULL), SetFill(1, 0),
|
2009-03-28 14:35:07 +01:00
|
|
|
EndContainer(),
|
|
|
|
NWidget(NWID_SPACER), SetMinimalSize(0, 8),
|
|
|
|
EndContainer(),
|
|
|
|
};
|
|
|
|
|
2008-05-18 22:49:22 +02:00
|
|
|
struct EnginePreviewWindow : Window {
|
2009-11-08 20:22:45 +01:00
|
|
|
static const int VEHICLE_SPACE = 40; // The space to show the vehicle image
|
|
|
|
|
|
|
|
EnginePreviewWindow(const WindowDesc *desc, WindowNumber window_number) : Window()
|
2008-05-18 22:49:22 +02:00
|
|
|
{
|
2009-11-08 20:22:45 +01:00
|
|
|
this->InitNested(desc, window_number);
|
2008-05-18 22:49:22 +02:00
|
|
|
}
|
2005-10-01 14:43:34 +02:00
|
|
|
|
2008-05-18 22:49:22 +02:00
|
|
|
virtual void OnPaint()
|
|
|
|
{
|
|
|
|
this->DrawWidgets();
|
2009-11-08 20:22:45 +01:00
|
|
|
}
|
|
|
|
|
2009-11-22 19:28:14 +01:00
|
|
|
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
|
2009-11-08 20:22:45 +01:00
|
|
|
{
|
|
|
|
if (widget != EPW_QUESTION) return;
|
|
|
|
|
|
|
|
EngineID engine = this->window_number;
|
|
|
|
SetDParam(0, GetEngineCategoryName(engine));
|
|
|
|
size->height = GetStringHeight(STR_ENGINE_PREVIEW_MESSAGE, size->width) + WD_PAR_VSEP_WIDE + FONT_HEIGHT_NORMAL + VEHICLE_SPACE;
|
|
|
|
SetDParam(0, engine);
|
|
|
|
size->height += GetStringHeight(GetEngineInfoString(engine), size->width);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void DrawWidget(const Rect &r, int widget) const
|
|
|
|
{
|
|
|
|
if (widget != EPW_QUESTION) return;
|
2004-08-09 19:04:08 +02:00
|
|
|
|
2008-05-18 22:49:22 +02:00
|
|
|
EngineID engine = this->window_number;
|
2004-12-02 23:53:07 +01:00
|
|
|
SetDParam(0, GetEngineCategoryName(engine));
|
2009-11-08 20:22:45 +01:00
|
|
|
int y = r.top + GetStringHeight(STR_ENGINE_PREVIEW_MESSAGE, r.right - r.top + 1);
|
|
|
|
y = DrawStringMultiLine(r.left, r.right, r.top, y, STR_ENGINE_PREVIEW_MESSAGE, TC_FROMSTRING, SA_CENTER) + WD_PAR_VSEP_WIDE;
|
2004-08-09 19:04:08 +02:00
|
|
|
|
2007-06-25 16:46:32 +02:00
|
|
|
SetDParam(0, engine);
|
2009-11-08 20:22:45 +01:00
|
|
|
DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, STR_ENGINE_NAME, TC_BLACK, SA_CENTER);
|
|
|
|
y += FONT_HEIGHT_NORMAL;
|
|
|
|
|
2009-11-16 18:15:42 +01:00
|
|
|
DrawVehicleEngine(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, this->width >> 1, y + VEHICLE_SPACE / 2, engine, GetEnginePalette(engine, _local_company));
|
2004-08-09 19:04:08 +02:00
|
|
|
|
2009-11-08 20:22:45 +01:00
|
|
|
y += VEHICLE_SPACE;
|
|
|
|
DrawStringMultiLine(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, r.bottom, GetEngineInfoString(engine), TC_FROMSTRING, SA_CENTER);
|
2005-10-01 14:43:34 +02:00
|
|
|
}
|
2004-08-09 19:04:08 +02:00
|
|
|
|
2008-05-18 22:49:22 +02:00
|
|
|
virtual void OnClick(Point pt, int widget)
|
|
|
|
{
|
|
|
|
switch (widget) {
|
2009-03-21 21:39:37 +01:00
|
|
|
case EPW_YES:
|
2008-12-28 15:37:19 +01:00
|
|
|
DoCommandP(0, this->window_number, 0, CMD_WANT_ENGINE_PREVIEW);
|
2006-11-18 18:04:44 +01:00
|
|
|
/* Fallthrough */
|
2009-03-21 21:39:37 +01:00
|
|
|
case EPW_NO:
|
2008-05-18 22:49:22 +02:00
|
|
|
delete this;
|
2005-11-14 20:48:04 +01:00
|
|
|
break;
|
2004-08-09 19:04:08 +02:00
|
|
|
}
|
|
|
|
}
|
2008-05-18 22:49:22 +02:00
|
|
|
};
|
2004-08-09 19:04:08 +02:00
|
|
|
|
2009-03-15 16:12:06 +01:00
|
|
|
static const WindowDesc _engine_preview_desc(
|
2009-11-17 20:16:48 +01:00
|
|
|
WDP_CENTER, WDP_CENTER, 300, 192,
|
2007-02-01 16:49:12 +01:00
|
|
|
WC_ENGINE_PREVIEW, WC_NONE,
|
2009-11-24 18:28:29 +01:00
|
|
|
WDF_CONSTRUCTION,
|
2009-11-15 11:26:01 +01:00
|
|
|
_nested_engine_preview_widgets, lengthof(_nested_engine_preview_widgets)
|
2009-03-15 16:12:06 +01:00
|
|
|
);
|
2004-08-09 19:04:08 +02:00
|
|
|
|
|
|
|
|
2005-10-01 14:43:34 +02:00
|
|
|
void ShowEnginePreviewWindow(EngineID engine)
|
2004-08-09 19:04:08 +02:00
|
|
|
{
|
2008-05-18 22:49:22 +02:00
|
|
|
AllocateWindowDescFront<EnginePreviewWindow>(&_engine_preview_desc, engine);
|
2004-08-09 19:04:08 +02:00
|
|
|
}
|
|
|
|
|
2009-10-06 21:52:38 +02:00
|
|
|
uint GetTotalCapacityOfArticulatedParts(EngineID engine)
|
2008-06-20 09:23:00 +02:00
|
|
|
{
|
|
|
|
uint total = 0;
|
|
|
|
|
2009-10-06 21:52:38 +02:00
|
|
|
CargoArray cap = GetCapacityOfArticulatedParts(engine);
|
2009-06-27 23:36:04 +02:00
|
|
|
for (CargoID c = 0; c < NUM_CARGO; c++) {
|
2008-06-20 09:23:00 +02:00
|
|
|
total += cap[c];
|
|
|
|
}
|
|
|
|
|
|
|
|
return total;
|
|
|
|
}
|
|
|
|
|
2009-08-30 20:41:03 +02:00
|
|
|
static StringID GetTrainEngineInfoString(const Engine *e)
|
2005-07-01 16:05:44 +02:00
|
|
|
{
|
2009-01-25 01:57:03 +01:00
|
|
|
SetDParam(0, e->GetCost());
|
2009-02-01 17:10:06 +01:00
|
|
|
SetDParam(2, e->GetDisplayMaxSpeed());
|
|
|
|
SetDParam(3, e->GetPower());
|
|
|
|
SetDParam(1, e->GetDisplayWeight());
|
2009-10-27 20:56:00 +01:00
|
|
|
SetDParam(7, e->GetDisplayMaxTractiveEffort());
|
2005-07-01 16:05:44 +02:00
|
|
|
|
2009-01-25 01:57:03 +01:00
|
|
|
SetDParam(4, e->GetRunningCost());
|
2005-07-01 16:05:44 +02:00
|
|
|
|
2009-10-06 21:52:38 +02:00
|
|
|
uint capacity = GetTotalCapacityOfArticulatedParts(e->index);
|
2008-06-20 09:23:00 +02:00
|
|
|
if (capacity != 0) {
|
2009-02-21 13:52:41 +01:00
|
|
|
SetDParam(5, e->GetDefaultCargoType());
|
2008-07-27 00:00:59 +02:00
|
|
|
SetDParam(6, capacity);
|
2005-10-23 15:04:44 +02:00
|
|
|
} else {
|
2006-10-20 21:48:25 +02:00
|
|
|
SetDParam(5, CT_INVALID);
|
2005-07-01 16:05:44 +02:00
|
|
|
}
|
2009-10-27 20:56:00 +01:00
|
|
|
return (_settings_game.vehicle.train_acceleration_model != TAM_ORIGINAL && e->u.rail.railtype != RAILTYPE_MAGLEV) ? STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER_MAX_TE : STR_ENGINE_PREVIEW_COST_WEIGHT_SPEED_POWER;
|
2005-07-01 16:05:44 +02:00
|
|
|
}
|
|
|
|
|
2009-08-30 20:41:03 +02:00
|
|
|
static StringID GetAircraftEngineInfoString(const Engine *e)
|
2005-07-01 16:05:44 +02:00
|
|
|
{
|
2009-03-14 00:49:12 +01:00
|
|
|
CargoID cargo = e->GetDefaultCargoType();
|
2009-10-31 18:48:09 +01:00
|
|
|
uint16 mail_capacity;
|
|
|
|
uint capacity = e->GetDisplayDefaultCapacity(&mail_capacity);
|
2009-01-25 01:57:03 +01:00
|
|
|
|
2009-10-31 18:48:09 +01:00
|
|
|
if (mail_capacity > 0) {
|
2009-03-14 00:49:12 +01:00
|
|
|
SetDParam(0, e->GetCost());
|
|
|
|
SetDParam(1, e->GetDisplayMaxSpeed());
|
2009-10-31 18:48:09 +01:00
|
|
|
SetDParam(2, cargo);
|
|
|
|
SetDParam(3, capacity);
|
|
|
|
SetDParam(4, CT_MAIL);
|
|
|
|
SetDParam(5, mail_capacity);
|
2009-04-21 00:41:09 +02:00
|
|
|
SetDParam(6, e->GetRunningCost());
|
2009-08-30 20:41:03 +02:00
|
|
|
return STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAPACITY_CAPACITY_RUNCOST;
|
2009-03-14 00:49:12 +01:00
|
|
|
} else {
|
|
|
|
SetDParam(0, e->GetCost());
|
|
|
|
SetDParam(1, e->GetDisplayMaxSpeed());
|
|
|
|
SetDParam(2, cargo);
|
2009-10-31 18:48:09 +01:00
|
|
|
SetDParam(3, capacity);
|
2009-03-14 00:49:12 +01:00
|
|
|
SetDParam(4, e->GetRunningCost());
|
2009-08-30 20:41:03 +02:00
|
|
|
return STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAPACITY_RUNCOST;
|
2009-03-14 00:49:12 +01:00
|
|
|
}
|
2005-07-01 16:05:44 +02:00
|
|
|
}
|
|
|
|
|
2009-08-30 20:41:03 +02:00
|
|
|
static StringID GetRoadVehEngineInfoString(const Engine *e)
|
2005-07-01 16:05:44 +02:00
|
|
|
{
|
2009-01-25 01:57:03 +01:00
|
|
|
SetDParam(0, e->GetCost());
|
2009-02-01 17:10:06 +01:00
|
|
|
SetDParam(1, e->GetDisplayMaxSpeed());
|
2009-10-06 21:52:38 +02:00
|
|
|
uint capacity = GetTotalCapacityOfArticulatedParts(e->index);
|
2009-02-21 13:52:41 +01:00
|
|
|
if (capacity != 0) {
|
2009-04-20 23:29:41 +02:00
|
|
|
SetDParam(2, e->GetDefaultCargoType());
|
|
|
|
SetDParam(3, capacity);
|
2009-02-21 13:52:41 +01:00
|
|
|
} else {
|
2009-04-20 23:29:41 +02:00
|
|
|
SetDParam(2, CT_INVALID);
|
2009-02-21 13:52:41 +01:00
|
|
|
}
|
2009-04-20 23:29:41 +02:00
|
|
|
SetDParam(4, e->GetRunningCost());
|
2009-08-30 20:41:03 +02:00
|
|
|
return STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAPACITY_RUNCOST;
|
2005-07-01 16:05:44 +02:00
|
|
|
}
|
|
|
|
|
2009-08-30 20:41:03 +02:00
|
|
|
static StringID GetShipEngineInfoString(const Engine *e)
|
2005-07-01 16:05:44 +02:00
|
|
|
{
|
2009-01-25 01:57:03 +01:00
|
|
|
SetDParam(0, e->GetCost());
|
2009-02-01 17:10:06 +01:00
|
|
|
SetDParam(1, e->GetDisplayMaxSpeed());
|
2009-02-21 13:52:41 +01:00
|
|
|
SetDParam(2, e->GetDefaultCargoType());
|
2009-03-18 20:32:13 +01:00
|
|
|
SetDParam(3, e->GetDisplayDefaultCapacity());
|
2009-01-25 01:57:03 +01:00
|
|
|
SetDParam(4, e->GetRunningCost());
|
2009-08-30 20:41:03 +02:00
|
|
|
return STR_ENGINE_PREVIEW_COST_MAX_SPEED_CAPACITY_RUNCOST;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get a multi-line string with some technical data, describing the engine.
|
|
|
|
* @param engine Engine to describe.
|
|
|
|
* @return String describing the engine.
|
|
|
|
* @post \c DParam array is set up for printing the string.
|
|
|
|
*/
|
|
|
|
StringID GetEngineInfoString(EngineID engine)
|
|
|
|
{
|
|
|
|
const Engine *e = Engine::Get(engine);
|
|
|
|
|
|
|
|
switch (e->type) {
|
|
|
|
case VEH_TRAIN:
|
|
|
|
return GetTrainEngineInfoString(e);
|
|
|
|
|
|
|
|
case VEH_ROAD:
|
|
|
|
return GetRoadVehEngineInfoString(e);
|
|
|
|
|
|
|
|
case VEH_SHIP:
|
|
|
|
return GetShipEngineInfoString(e);
|
|
|
|
|
|
|
|
case VEH_AIRCRAFT:
|
|
|
|
return GetAircraftEngineInfoString(e);
|
|
|
|
|
|
|
|
default: NOT_REACHED();
|
|
|
|
}
|
2005-07-01 16:05:44 +02:00
|
|
|
}
|
|
|
|
|
2009-08-30 19:38:28 +02:00
|
|
|
/**
|
|
|
|
* Draw an engine.
|
2009-11-16 18:15:42 +01:00
|
|
|
* @param left Minimum horizontal position to use for drawing the engine
|
|
|
|
* @param right Maximum horizontal position to use for drawing the engine
|
|
|
|
* @param preferred_x Horizontal position to use for drawing the engine.
|
2009-08-30 19:38:28 +02:00
|
|
|
* @param y Vertical position to use for drawing the engine.
|
|
|
|
* @param engine Engine to draw.
|
2009-09-19 11:51:14 +02:00
|
|
|
* @param pal Palette to use for drawing.
|
2009-08-30 19:38:28 +02:00
|
|
|
*/
|
2009-11-16 18:15:42 +01:00
|
|
|
void DrawVehicleEngine(int left, int right, int preferred_x, int y, EngineID engine, SpriteID pal)
|
2009-08-30 19:38:28 +02:00
|
|
|
{
|
|
|
|
const Engine *e = Engine::Get(engine);
|
|
|
|
|
|
|
|
switch (e->type) {
|
|
|
|
case VEH_TRAIN:
|
2009-11-16 18:15:42 +01:00
|
|
|
DrawTrainEngine(left, right, preferred_x, y, engine, pal);
|
2009-08-30 19:38:28 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case VEH_ROAD:
|
2009-11-16 18:15:42 +01:00
|
|
|
DrawRoadVehEngine(left, right, preferred_x, y, engine, pal);
|
2009-08-30 19:38:28 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case VEH_SHIP:
|
2009-11-16 18:15:42 +01:00
|
|
|
DrawShipEngine(left, right, preferred_x, y, engine, pal);
|
2009-08-30 19:38:28 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case VEH_AIRCRAFT:
|
2009-11-16 18:15:42 +01:00
|
|
|
DrawAircraftEngine(left, right, preferred_x, y, engine, pal);
|
2009-08-30 19:38:28 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
default: NOT_REACHED();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-09-13 19:47:07 +02:00
|
|
|
/** Sort all items using quick sort and given 'CompareItems' function
|
2008-05-27 14:24:23 +02:00
|
|
|
* @param el list to be sorted
|
|
|
|
* @param compare function for evaluation of the quicksort
|
|
|
|
*/
|
2008-05-28 19:29:27 +02:00
|
|
|
void EngList_Sort(GUIEngineList *el, EngList_SortTypeFunction compare)
|
2008-05-27 14:24:23 +02:00
|
|
|
{
|
2008-05-28 19:29:27 +02:00
|
|
|
uint size = el->Length();
|
2008-05-27 14:24:23 +02:00
|
|
|
/* out-of-bounds access at the next line for size == 0 (even with operator[] at some systems)
|
|
|
|
* generally, do not sort if there are less than 2 items */
|
|
|
|
if (size < 2) return;
|
2009-09-13 19:47:07 +02:00
|
|
|
QSortT(el->Begin(), size, compare);
|
2008-05-27 14:24:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/** Sort selected range of items (on indices @ <begin, begin+num_items-1>)
|
|
|
|
* @param el list to be sorted
|
|
|
|
* @param compare function for evaluation of the quicksort
|
|
|
|
* @param begin start of sorting
|
|
|
|
* @param num_items count of items to be sorted
|
|
|
|
*/
|
2008-05-28 19:29:27 +02:00
|
|
|
void EngList_SortPartial(GUIEngineList *el, EngList_SortTypeFunction compare, uint begin, uint num_items)
|
2008-05-27 14:24:23 +02:00
|
|
|
{
|
2008-05-28 22:06:00 +02:00
|
|
|
if (num_items < 2) return;
|
2008-05-28 19:29:27 +02:00
|
|
|
assert(begin < el->Length());
|
|
|
|
assert(begin + num_items <= el->Length());
|
2009-09-13 19:47:07 +02:00
|
|
|
QSortT(el->Get(begin), num_items, compare);
|
2008-05-27 14:24:23 +02:00
|
|
|
}
|
|
|
|
|