| Index: ddraw/glDirectDrawSurface.cpp |
| — | — | @@ -940,7 +940,6 @@ |
| 941 | 941 | {
|
| 942 | 942 | palette->AddRef();
|
| 943 | 943 | *lplpDDPalette = palette;
|
| 944 | | - TRACE_EXIT(23,DD_OK);
|
| 945 | 944 | err = DD_OK;
|
| 946 | 945 | }
|
| 947 | 946 | else
|
| — | — | @@ -1007,7 +1006,7 @@ |
| 1008 | 1007 | break;
|
| 1009 | 1008 | case 1:
|
| 1010 | 1009 | FIXME("glDirectDrawSurface7::Lock: surface type 1 not supported yet");
|
| 1011 | | - TRACE_EXIT(23,DDERR_GENERIC);
|
| | 1010 | + TRACE_EXIT(23,DDERR_UNSUPPORTED);
|
| 1012 | 1011 | ERR(DDERR_UNSUPPORTED);
|
| 1013 | 1012 | break;
|
| 1014 | 1013 | case 2:
|
| Index: ddraw/glRenderer.cpp |
| — | — | @@ -816,6 +816,7 @@ |
| 817 | 817 | glBindBuffer(GL_PIXEL_PACK_BUFFER,PBO);
|
| 818 | 818 | glBufferData(GL_PIXEL_PACK_BUFFER,width*height*4,NULL,GL_STREAM_READ);
|
| 819 | 819 | glBindBuffer(GL_PIXEL_PACK_BUFFER,0);
|
| | 820 | + TRACE_SYSINFO();
|
| 820 | 821 | return TRUE;
|
| 821 | 822 | }
|
| 822 | 823 |
|
| Index: ddraw/trace.cpp |
| — | — | @@ -1070,7 +1070,7 @@ |
| 1071 | 1071 | if(trace_fail) return;
|
| 1072 | 1072 | if(!trace_ready) init_trace();
|
| 1073 | 1073 | EnterCriticalSection(&trace_cs);
|
| 1074 | | - trace_depth--;
|
| | 1074 | + if(trace_depth) trace_depth--;
|
| 1075 | 1075 | DWORD byteswritten;
|
| 1076 | 1076 | for(unsigned int i = 0; i < trace_depth; i++)
|
| 1077 | 1077 | WriteFile(outfile," ",4,&byteswritten,NULL);
|
| — | — | @@ -1096,4 +1096,76 @@ |
| 1097 | 1097 | WriteFile(outfile,"\r\n",2,&byteswritten,NULL);
|
| 1098 | 1098 | LeaveCriticalSection(&trace_cs);
|
| 1099 | 1099 | }
|
| | 1100 | +
|
| | 1101 | +void trace_sysinfo()
|
| | 1102 | +{
|
| | 1103 | + if(trace_fail) return;
|
| | 1104 | + if(!trace_ready) init_trace();
|
| | 1105 | + EnterCriticalSection(&trace_cs);
|
| | 1106 | + DWORD byteswritten;
|
| | 1107 | + OSVERSIONINFOA osver;
|
| | 1108 | + DWORD buildver;
|
| | 1109 | + char osstring[256];
|
| | 1110 | + osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);
|
| | 1111 | + GetVersionExA(&osver);
|
| | 1112 | + if(osver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) buildver = LOWORD(osver.dwBuildNumber);
|
| | 1113 | + else buildver = osver.dwBuildNumber;
|
| | 1114 | + if((osver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) || (osver.dwPlatformId == VER_PLATFORM_WIN32s))
|
| | 1115 | + sprintf(osstring,"Windows %u.%u.%u",osver.dwMajorVersion,osver.dwMinorVersion,buildver);
|
| | 1116 | + else sprintf(osstring,"Windows NT %u.%u.%u",osver.dwMajorVersion,osver.dwMinorVersion,buildver);
|
| | 1117 | + if(osver.szCSDVersion[0])
|
| | 1118 | + {
|
| | 1119 | + strcat(osstring,", ");
|
| | 1120 | + strcat(osstring,osver.szCSDVersion);
|
| | 1121 | + }
|
| | 1122 | + if(((osver.dwMajorVersion == 5) && (osver.dwMinorVersion >= 1)) || (osver.dwMajorVersion >= 6))
|
| | 1123 | + {
|
| | 1124 | + strcat(osstring,", ");
|
| | 1125 | + HMODULE hKernel32 = LoadLibrary(_T("kernel32.dll"));
|
| | 1126 | + BOOL (WINAPI *iswow64)(HANDLE,PBOOL) = NULL;
|
| | 1127 | + if(hKernel32) iswow64 = (BOOL(WINAPI*)(HANDLE,PBOOL))GetProcAddress(hKernel32,"IsWow64Process");
|
| | 1128 | + BOOL is64 = FALSE;
|
| | 1129 | + if(iswow64) iswow64(GetCurrentProcess(),&is64);
|
| | 1130 | + if(hKernel32) FreeLibrary(hKernel32);
|
| | 1131 | + if(is64) strcat(osstring,"64-bit");
|
| | 1132 | + else strcat(osstring,"32-bit");
|
| | 1133 | + }
|
| | 1134 | + strcat(osstring,"\r\n");
|
| | 1135 | + for(unsigned int i = 0; i < trace_depth-1; i++)
|
| | 1136 | + WriteFile(outfile," ",4,&byteswritten,NULL);
|
| | 1137 | + WriteFile(outfile,"Windows version: ",18,&byteswritten,NULL);
|
| | 1138 | + WriteFile(outfile,osstring,strlen(osstring),&byteswritten,NULL);
|
| | 1139 | + for(unsigned int i = 0; i < trace_depth-1; i++)
|
| | 1140 | + WriteFile(outfile," ",4,&byteswritten,NULL);
|
| | 1141 | + WriteFile(outfile,"GL_VENDOR: ",12,&byteswritten,NULL);
|
| | 1142 | + const GLubyte *glstring;
|
| | 1143 | + glstring = glGetString(GL_VENDOR);
|
| | 1144 | + if(glstring) WriteFile(outfile,glstring,strlen((const char*)glstring),&byteswritten,NULL);
|
| | 1145 | + WriteFile(outfile,"\r\n",2,&byteswritten,NULL);
|
| | 1146 | + for(unsigned int i = 0; i < trace_depth-1; i++)
|
| | 1147 | + WriteFile(outfile," ",4,&byteswritten,NULL);
|
| | 1148 | + WriteFile(outfile,"GL_RENDERER: ",14,&byteswritten,NULL);
|
| | 1149 | + glstring = glGetString(GL_RENDERER);
|
| | 1150 | + if(glstring) WriteFile(outfile,glstring,strlen((const char*)glstring),&byteswritten,NULL);
|
| | 1151 | + WriteFile(outfile,"\r\n",2,&byteswritten,NULL);
|
| | 1152 | + for(unsigned int i = 0; i < trace_depth-1; i++)
|
| | 1153 | + WriteFile(outfile," ",4,&byteswritten,NULL);
|
| | 1154 | + WriteFile(outfile,"GL_VERSION: ",13,&byteswritten,NULL);
|
| | 1155 | + glstring = glGetString(GL_VERSION);
|
| | 1156 | + if(glstring) WriteFile(outfile,glstring,strlen((const char*)glstring),&byteswritten,NULL);
|
| | 1157 | + WriteFile(outfile,"\r\n",2,&byteswritten,NULL);
|
| | 1158 | + for(unsigned int i = 0; i < trace_depth-1; i++)
|
| | 1159 | + WriteFile(outfile," ",4,&byteswritten,NULL);
|
| | 1160 | + WriteFile(outfile,"GL_SHADING_LANGUAGE_VERSION: ",30,&byteswritten,NULL);
|
| | 1161 | + glstring = glGetString(GL_SHADING_LANGUAGE_VERSION);
|
| | 1162 | + if(glstring) WriteFile(outfile,glstring,strlen((const char*)glstring),&byteswritten,NULL);
|
| | 1163 | + WriteFile(outfile,"\r\n",2,&byteswritten,NULL);
|
| | 1164 | + for(unsigned int i = 0; i < trace_depth-1; i++)
|
| | 1165 | + WriteFile(outfile," ",4,&byteswritten,NULL);
|
| | 1166 | + WriteFile(outfile,"GL_EXTENSIONS: ",16,&byteswritten,NULL);
|
| | 1167 | + glstring = glGetString(GL_EXTENSIONS);
|
| | 1168 | + if(glstring) WriteFile(outfile,glstring,strlen((const char*)glstring),&byteswritten,NULL);
|
| | 1169 | + WriteFile(outfile,"\r\n",2,&byteswritten,NULL);
|
| | 1170 | + LeaveCriticalSection(&trace_cs);
|
| | 1171 | +}
|
| 1100 | 1172 | #endif |
| \ No newline at end of file |
| Index: ddraw/trace.h |
| — | — | @@ -22,11 +22,13 @@ |
| 23 | 23 |
|
| 24 | 24 | #ifdef _TRACE
|
| 25 | 25 | #define TRACE_ENTER(paramcount,...) trace_enter(__FUNCTION__,paramcount,__VA_ARGS__)
|
| 26 | | -#define TRACE_EXIT(argtype,arg) trace_exit(__FUNCTION__,argtype,(void*)arg);
|
| 27 | | -#define TRACE_VAR(var,argtype,arg) trace_var(__FUNCTION__,var,argtype,(void*)arg);
|
| | 26 | +#define TRACE_EXIT(argtype,arg) trace_exit(__FUNCTION__,argtype,(void*)arg)
|
| | 27 | +#define TRACE_VAR(var,argtype,arg) trace_var(__FUNCTION__,var,argtype,(void*)arg)
|
| | 28 | +#define TRACE_SYSINFO() trace_sysinfo() // Must be in thread used by OpenGL.
|
| 28 | 29 | void trace_enter(const char *function, int paramcount, ...);
|
| 29 | 30 | void trace_exit(const char *function, int argtype, void *arg);
|
| 30 | 31 | void trace_var(const char *function, const char *var, int argtype, void *arg);
|
| | 32 | +void trace_sysinfo();
|
| 31 | 33 | #define TRACE_RET(argtype, arg) \
|
| 32 | 34 | {\
|
| 33 | 35 | trace_exit(__FUNCTION__,argtype,(void*)arg);\
|
| — | — | @@ -37,6 +39,7 @@ |
| 38 | 40 | #define TRACE_EXIT(a,b)
|
| 39 | 41 | #define TRACE_VAR(a,b,c)
|
| 40 | 42 | #define TRACE_RET(argtype, arg) return arg;
|
| | 43 | +#define TRACE_SYSINFO()
|
| 41 | 44 | #endif
|
| 42 | 45 |
|
| 43 | 46 | #endif //_TRACE_H |
| \ No newline at end of file |