win32.c
changeset 659 a98c731921b4
parent 656 01540e6c0fed
child 698 edbf72dd127b
equal deleted inserted replaced
658:ed6a0ea93a6c 659:a98c731921b4
    12 #include <io.h>
    12 #include <io.h>
    13 #include <fcntl.h>
    13 #include <fcntl.h>
    14 #include "network.h"
    14 #include "network.h"
    15 
    15 
    16 #define SMART_PALETTE_ANIM
    16 #define SMART_PALETTE_ANIM
    17 
       
    18 /* Declare the revision tag for Windows */
       
    19 #ifdef WITH_REV_HACK
       
    20 	const char _openttd_revision[] = WITH_REV_HACK;
       
    21 #endif
       
    22 
    17 
    23 static struct {
    18 static struct {
    24 	HWND main_wnd;
    19 	HWND main_wnd;
    25 	HBITMAP dib_sect;
    20 	HBITMAP dib_sect;
    26 	void *bitmap_bits;
    21 	void *bitmap_bits;
   444 		if (!RegisterClass(&wnd))
   439 		if (!RegisterClass(&wnd))
   445 			error("RegisterClass failed");
   440 			error("RegisterClass failed");
   446 	}
   441 	}
   447 }
   442 }
   448 
   443 
       
   444 extern const char _openttd_revision[];
       
   445 
   449 static void MakeWindow(bool full_screen)
   446 static void MakeWindow(bool full_screen)
   450 {
   447 {
   451 	_fullscreen = full_screen;
   448 	_fullscreen = full_screen;
   452 
   449 
   453 	_wnd.double_size = _double_size && !full_screen;
   450 	_wnd.double_size = _double_size && !full_screen;
   502 
   499 
   503 		if (_wnd.main_wnd) {
   500 		if (_wnd.main_wnd) {
   504 			SetWindowPos(_wnd.main_wnd, 0, x, y, w, h, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER);
   501 			SetWindowPos(_wnd.main_wnd, 0, x, y, w, h, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER);
   505 		} else {
   502 		} else {
   506 			char Windowtitle[50] = "OpenTTD ";
   503 			char Windowtitle[50] = "OpenTTD ";
   507 			#ifdef WITH_REV
   504 			// also show revision number/release in window title
   508 				// also show revision number/release in window title
   505 			strncat(Windowtitle, _openttd_revision, sizeof(Windowtitle)-(strlen(Windowtitle) + 1));
   509 				strncat(Windowtitle, _openttd_revision, sizeof(Windowtitle)-(strlen(Windowtitle) + 1));
   506 
   510 			#endif
       
   511 			_wnd.main_wnd = CreateWindow("TTD", Windowtitle, style, x, y, w, h, 0, 0, _inst, 0);
   507 			_wnd.main_wnd = CreateWindow("TTD", Windowtitle, style, x, y, w, h, 0, 0, _inst, 0);
   512 			if (_wnd.main_wnd == NULL)
   508 			if (_wnd.main_wnd == NULL)
   513 				error("CreateWindow failed");
   509 				error("CreateWindow failed");
   514 		}
   510 		}
   515 	}
   511 	}