mikymod 12 år sedan
förälder
incheckning
01476a2ba5
3 ändrade filer med 7 tillägg och 8 borttagningar
  1. 2 0
      engine/os/OS.h
  2. 4 8
      engine/os/win/WinOS.cpp
  3. 1 0
      engine/resource/ResourceLoader.h

+ 2 - 0
engine/os/OS.h

@@ -46,6 +46,8 @@ namespace crown
 
 	#define snprintf _snprintf
 
+	#define Thread os::Thread
+
 	#undef MK_SHIFT
 	#undef MK_ALT
 #elif defined(ANDROID)

+ 4 - 8
engine/os/win/WinOS.cpp

@@ -244,7 +244,7 @@ void list_files(const char* path, Vector<DynamicString>& files)
 //-----------------------------------------------------------------------------
 const char* normalize_path(const char* path)
 {
-	static char norm[1024];
+	static char norm[MAX_PATH_LENGTH];
 
 	for (uint32_t i = 0; i < string::strlen(path)+1; i++)
 	{
@@ -337,12 +337,10 @@ void execute_process(const char* args[])
 		cmds += ' ';
 	}
 
+	// Necessary because CreateProcess second argument must be non-const
 	char tmp[1024];
 	string::strncpy(tmp, normalize_path(cmds.c_str()), string::strlen(cmds.c_str()));
-	printf("normalized: %s\n", tmp);
 
-	printf("current dir: %s\n", get_cwd());
-	
 	int32_t res;
 	if (res = CreateProcess(args[0], tmp, NULL, NULL, TRUE, 0, NULL, NULL, &info, &process))
 	{
@@ -350,10 +348,8 @@ void execute_process(const char* args[])
    		CloseHandle(process.hProcess);
     	CloseHandle(process.hThread);
 	}
-	else
-	{
-		printf("Unable to create process for %s, errno: %d\n\n", args[0], GetLastError());
-	}
+
+	CE_ASSERT(res != 0, "Unable to create process for %s, errno: %d\n", args[0], GetLastError());
 }
 
 } // namespace os

+ 1 - 0
engine/resource/ResourceLoader.h

@@ -33,6 +33,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "List.h"
 #include "Mutex.h"
 #include "Cond.h"
+#include "OS.h"
 
 namespace crown
 {