Просмотр исходного кода

Updated the samples to set the aspect ratio from the device's width and height.

Darryl Gough 13 лет назад
Родитель
Сommit
be4b5c8763
2 измененных файлов с 60 добавлено и 60 удалено
  1. 2 2
      gameplay/src/Animation.cpp
  2. 58 58
      gameplay/src/DebugNew.cpp

+ 2 - 2
gameplay/src/Animation.cpp

@@ -71,8 +71,8 @@ Animation::Channel::Channel(Animation* animation, AnimationTarget* target, int p
 
 Animation::Channel::Channel(const Channel& copy, Animation* animation, AnimationTarget* target)
     : _animation(animation), _target(target), _propertyId(copy._propertyId), _curve(copy._curve), _duration(copy._duration)
-{
-    _curve->addRef();
+{
+    _curve->addRef();
     _target->addChannel(this);
 }
 

+ 58 - 58
gameplay/src/DebugNew.cpp

@@ -200,64 +200,64 @@ void debugFree(void* p)
 
 #ifdef WIN32
 void printStackTrace(MemoryAllocationRecord* rec)
-{
-    const unsigned int bufferSize = 512;
-
-    // Resolve the program counter to the corresponding function names.
-    unsigned int pc;
-    for (int i = 0; i < MAX_STACK_FRAMES; i++)
-    {
-        // Check to see if we are at the end of the stack trace.
-        pc = rec->pc[i];
-        if (pc == 0)
-            break;
-
-        // Get the function name.
-        unsigned char buffer[sizeof(IMAGEHLP_SYMBOL64) + bufferSize];
-        IMAGEHLP_SYMBOL64* symbol = (IMAGEHLP_SYMBOL64*)buffer;
-        DWORD64 displacement;
-        memset(symbol, 0, sizeof(IMAGEHLP_SYMBOL64) + bufferSize);
-        symbol->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL64);
-        symbol->MaxNameLength = bufferSize;
-        if (!SymGetSymFromAddr64(GetCurrentProcess(), pc, &displacement, symbol))
-        {
-            gameplay::printError("[memory] STACK TRACE: <unknown location>");
-        }
-        else
-        {
-            symbol->Name[bufferSize - 1] = '\0';
-
-            // Check if we need to go further up the stack.
-            if (strncmp(symbol->Name, "operator new", 12) == 0)
-            {
-                // In operator new or new[], keep going...
-            }
-            else
-            {
-                // Get the file and line number.
-                if (pc != 0)
-                {
-                    IMAGEHLP_LINE64 line;
-                    DWORD displacement;
-                    memset(&line, 0, sizeof(line));
-                    line.SizeOfStruct = sizeof(line);
-                    if (!SymGetLineFromAddr64(GetCurrentProcess(), pc, &displacement, &line))
-                    {
-                        gameplay::printError("[memory] STACK TRACE: %s - <unknown file>:<unknown line number>", symbol->Name);
-                    }
-                    else
-                    {
-                        const char* file = strrchr(line.FileName, '\\');
-                        if(!file) 
-                            file = line.FileName;
-                        else
-                            file++;
-                        
-                        gameplay::printError("[memory] STACK TRACE: %s - %s:%d", symbol->Name, file, line.LineNumber);
-                    }
-                }
-            }
-        }
+{
+    const unsigned int bufferSize = 512;
+
+    // Resolve the program counter to the corresponding function names.
+    unsigned int pc;
+    for (int i = 0; i < MAX_STACK_FRAMES; i++)
+    {
+        // Check to see if we are at the end of the stack trace.
+        pc = rec->pc[i];
+        if (pc == 0)
+            break;
+
+        // Get the function name.
+        unsigned char buffer[sizeof(IMAGEHLP_SYMBOL64) + bufferSize];
+        IMAGEHLP_SYMBOL64* symbol = (IMAGEHLP_SYMBOL64*)buffer;
+        DWORD64 displacement;
+        memset(symbol, 0, sizeof(IMAGEHLP_SYMBOL64) + bufferSize);
+        symbol->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL64);
+        symbol->MaxNameLength = bufferSize;
+        if (!SymGetSymFromAddr64(GetCurrentProcess(), pc, &displacement, symbol))
+        {
+            gameplay::printError("[memory] STACK TRACE: <unknown location>");
+        }
+        else
+        {
+            symbol->Name[bufferSize - 1] = '\0';
+
+            // Check if we need to go further up the stack.
+            if (strncmp(symbol->Name, "operator new", 12) == 0)
+            {
+                // In operator new or new[], keep going...
+            }
+            else
+            {
+                // Get the file and line number.
+                if (pc != 0)
+                {
+                    IMAGEHLP_LINE64 line;
+                    DWORD displacement;
+                    memset(&line, 0, sizeof(line));
+                    line.SizeOfStruct = sizeof(line);
+                    if (!SymGetLineFromAddr64(GetCurrentProcess(), pc, &displacement, &line))
+                    {
+                        gameplay::printError("[memory] STACK TRACE: %s - <unknown file>:<unknown line number>", symbol->Name);
+                    }
+                    else
+                    {
+                        const char* file = strrchr(line.FileName, '\\');
+                        if(!file) 
+                            file = line.FileName;
+                        else
+                            file++;
+                        
+                        gameplay::printError("[memory] STACK TRACE: %s - %s:%d", symbol->Name, file, line.LineNumber);
+                    }
+                }
+            }
+        }
     }
 }
 #endif