diff Engine/MMT.cpp @ 2524:c7264ab7132f

Main menu rendered using d3d11
author a.parshin
date Fri, 10 Oct 2014 17:42:05 +0300
parents c532d5242055
children a902abdfc7f2
line wrap: on
line diff
--- a/Engine/MMT.cpp	Thu Oct 09 23:33:36 2014 +0300
+++ b/Engine/MMT.cpp	Fri Oct 10 17:42:05 2014 +0300
@@ -60,14 +60,20 @@
     tex.LoadPCXFile("data/New_Icons/MMTTITLE.pcx", 0);
   else
     tex.Load("mm6title.pcx", 2);
-
+  
+  pRenderer->ResetUIClipRect();
   pRenderer->BeginScene();
-  pRenderer->DrawTextureNew(0, 0, &tex);
-
+  {
+    pRenderer->DrawTextureNew(0, 0, &tex);
+  }
+  pRenderer->EndScene();
+  pRenderer->Present();
+  
   tex.Release();
 
   MainMenuUI_LoadFontsAndSomeStuff();
-
+  
+  pRenderer->BeginScene();
   if (use_MMT)
     DrawMMTCopyrightWindow();
   else
@@ -76,9 +82,10 @@
   pRenderer->EndScene();
   pRenderer->Present();
 
-  #ifndef _DEBUG
+  #ifdef NDEBUG
     Sleep(1500);   // let the copyright window stay for a while
   #endif
+
   if (!use_MMT)
   {
     if (!bNoSound && pAudioPlayer->hAILRedbook )
@@ -106,15 +113,6 @@
   bGameoverLoop = 0;
 }
 
-void abort_(const char * s, ...)
-{
-  va_list args;
-  va_start(args, s);
-  vfprintf(stderr, s, args);
-  fprintf(stderr, "\n");
-  va_end(args);
-  abort();
-}
 
 Texture *LoadPNG(const char *name)
 {
@@ -134,21 +132,21 @@
   /* open file and test for it being a png */
   FILE *fp = fopen(name, "rb");
   if (!fp)
-    abort_("[read_png_file] File %s could not be opened for reading", name);
+    Error("[read_png_file] File %s could not be opened for reading", name);
   fread(header, 1, 8, fp);
   if (png_sig_cmp((png_bytep)header, 0, 8))
-    abort_("[read_png_file] File %s is not recognized as a PNG file", name);
+    Error("[read_png_file] File %s is not recognized as a PNG file", name);
   /* initialize stuff */
   png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
 
   if (!png_ptr)
-    abort_("[read_png_file] png_create_read_struct failed");
+    Error("[read_png_file] png_create_read_struct failed");
   info_ptr = png_create_info_struct(png_ptr);
   if (!info_ptr)
-    abort_("[read_png_file] png_create_info_struct failed");
+    Error("[read_png_file] png_create_info_struct failed");
 
   if (setjmp(png_jmpbuf(png_ptr)))
-    abort_("[read_png_file] Error during init_io");
+    Error("[read_png_file] Error during init_io");
 
   png_init_io(png_ptr, fp);
   png_set_sig_bytes(png_ptr, 8);
@@ -165,7 +163,7 @@
 
   /* read file */
   if (setjmp(png_jmpbuf(png_ptr)))
-    abort_("[read_png_file] Error during read_image");
+    Error("[read_png_file] Error during read_image");
   row_pointers = (png_bytep*) malloc(sizeof(png_bytep) * height);
   for (y=0; y<height; y++)
     row_pointers[y] = (png_byte*) malloc(png_get_rowbytes(png_ptr,info_ptr));