|
|
|
@ -45,42 +45,49 @@
|
|
|
|
|
Vehicle *vhead, *vtmp;
|
|
|
|
|
static const uint MAX_ARTICULATED_PARTS = 100;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef _DEBUG
|
|
|
|
|
// debugging printing functions for convenience, usually called from gdb
|
|
|
|
|
void pat() {
|
|
|
|
|
void tbtr_debug_pat()
|
|
|
|
|
{
|
|
|
|
|
TemplateVehicle *tv;
|
|
|
|
|
FOR_ALL_TEMPLATES(tv) {
|
|
|
|
|
if ( tv->Prev() ) continue;
|
|
|
|
|
ptv(tv);
|
|
|
|
|
if (tv->Prev()) continue;
|
|
|
|
|
tbtr_debug_ptv(tv);
|
|
|
|
|
printf("__________\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void pav() {
|
|
|
|
|
|
|
|
|
|
void tbtr_debug_pav()
|
|
|
|
|
{
|
|
|
|
|
Train *t;
|
|
|
|
|
FOR_ALL_TRAINS(t) {
|
|
|
|
|
if ( t->Previous() ) continue;
|
|
|
|
|
pvt(t);
|
|
|
|
|
if (t->Previous()) continue;
|
|
|
|
|
tbtr_debug_pvt(t);
|
|
|
|
|
printf("__________\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void ptv(TemplateVehicle* tv) {
|
|
|
|
|
|
|
|
|
|
void tbtr_debug_ptv(TemplateVehicle* tv)
|
|
|
|
|
{
|
|
|
|
|
if (!tv) return;
|
|
|
|
|
while (tv->Next() ) {
|
|
|
|
|
printf("eid:%3d st:%2d tv:%x next:%x cargo: %d cargo_sub: %d\n", tv->engine_type, tv->subtype, tv, tv->Next(), tv->cargo_type, tv->cargo_subtype);
|
|
|
|
|
printf("eid:%3d st:%2d tv:%p next:%p cargo: %d cargo_sub: %d\n", tv->engine_type, tv->subtype, tv, tv->Next(), tv->cargo_type, tv->cargo_subtype);
|
|
|
|
|
tv = tv->Next();
|
|
|
|
|
}
|
|
|
|
|
printf("eid:%3d st:%2d tv:%x next:%x cargo: %d cargo_sub: %d\n", tv->engine_type, tv->subtype, tv, tv->Next(), tv->cargo_type, tv->cargo_subtype);
|
|
|
|
|
printf("eid:%3d st:%2d tv:%p next:%p cargo: %d cargo_sub: %d\n", tv->engine_type, tv->subtype, tv, tv->Next(), tv->cargo_type, tv->cargo_subtype);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void pvt (const Train *printme) {
|
|
|
|
|
for ( const Train *tmp = printme; tmp; tmp=tmp->Next() ) {
|
|
|
|
|
if ( tmp->index <= 0 ) {
|
|
|
|
|
printf("train has weird index: %d %d %x\n", tmp->index, tmp->engine_type, (__int64)tmp);
|
|
|
|
|
void tbtr_debug_pvt (const Train *printme)
|
|
|
|
|
{
|
|
|
|
|
for (const Train *tmp = printme; tmp; tmp = tmp->Next()) {
|
|
|
|
|
if (tmp->index <= 0) {
|
|
|
|
|
printf("train has weird index: %d %d %p\n", tmp->index, tmp->engine_type, tmp);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
printf("eid:%3d index:%2d subtype:%2d vehstat: %d cargo_t: %d cargo_sub: %d ref:%x\n", tmp->engine_type, tmp->index, tmp->subtype, tmp->vehstatus, tmp->cargo_type, tmp->cargo_subtype, tmp);
|
|
|
|
|
printf("eid:%3d index:%2d subtype:%2d vehstat: %d cargo_t: %d cargo_sub: %d ref:%p\n", tmp->engine_type, tmp->index, tmp->subtype, tmp->vehstatus, tmp->cargo_type, tmp->cargo_subtype, tmp);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
void BuildTemplateGuiList(GUITemplateList *list, Scrollbar *vscroll, Owner oid, RailType railtype)
|
|
|
|
|
{
|
|
|
|
|