ttd.c
changeset 223 0e5cc5a65df6
parent 222 b88456001397
child 239 23958632a582
equal deleted inserted replaced
222:b88456001397 223:0e5cc5a65df6
    50 extern void HalGameLoop();
    50 extern void HalGameLoop();
    51 
    51 
    52 uint32 _pixels_redrawn;
    52 uint32 _pixels_redrawn;
    53 bool _dbg_screen_rect;
    53 bool _dbg_screen_rect;
    54 bool disable_computer;
    54 bool disable_computer;
       
    55 static byte _os_version = 0;
    55 
    56 
    56 void CDECL error(const char *s, ...) {
    57 void CDECL error(const char *s, ...) {
    57 	va_list va;
    58 	va_list va;
    58 	char buf[512];
    59 	char buf[512];
    59 	va_start(va, s);
    60 	va_start(va, s);
   190 static const DriverDesc *ChooseDefaultDriver(const DriverDesc *dd)
   191 static const DriverDesc *ChooseDefaultDriver(const DriverDesc *dd)
   191 {
   192 {
   192 	const DriverDesc *best = NULL;
   193 	const DriverDesc *best = NULL;
   193 	int best_pri = -1;
   194 	int best_pri = -1;
   194 	do {
   195 	do {
   195 		if ((int)(dd->flags&DF_PRIORITY_MASK) > best_pri) {
   196 		if ((int)(dd->flags&DF_PRIORITY_MASK) > best_pri && _os_version >= (byte)dd->flags) {
   196 			best_pri = dd->flags&DF_PRIORITY_MASK;
   197 			best_pri = dd->flags&DF_PRIORITY_MASK;
   197 			best = dd;
   198 			best = dd;
   198 		}
   199 		}
   199 	} while ((++dd)->name);
   200 	} while ((++dd)->name);
   200 	return best;
   201 	return best;
   569 	// initialize airport state machines
   570 	// initialize airport state machines
   570 	InitializeAirports();
   571 	InitializeAirports();
   571 
   572 
   572 	// Sample catalogue
   573 	// Sample catalogue
   573 	DEBUG(misc, 1) ("Loading sound effects...");
   574 	DEBUG(misc, 1) ("Loading sound effects...");
       
   575 	_os_version = GetOSVersion();
   574 	MxInitialize(11025, "sample.cat");
   576 	MxInitialize(11025, "sample.cat");
   575 
   577 
   576 	// This must be done early, since functions use the InvalidateWindow* calls
   578 	// This must be done early, since functions use the InvalidateWindow* calls
   577 	InitWindowSystem();
   579 	InitWindowSystem();
   578 
   580