Fix a few compile errors with metrowerks

This commit is contained in:
UnknownShadow200 2020-01-25 17:58:21 +11:00
parent c5c18c7d98
commit d7015cf2e9
3 changed files with 12 additions and 8 deletions

View File

@ -413,7 +413,7 @@ void LocalInterpComp_SetLocation(struct InterpComp* interp, struct LocationUpdat
LocalInterpComp_Angle(&prev->Pitch, &next->Pitch, update->Pitch, interpolate); LocalInterpComp_Angle(&prev->Pitch, &next->Pitch, update->Pitch, interpolate);
} }
if (flags & LOCATIONUPDATE_YAW) { if (flags & LOCATIONUPDATE_YAW) {
LocalInterpComp_Angle(&prev->Yaw, &next->Yaw, update->Yaw, interpolate); LocalInterpComp_Angle(&prev->Yaw, &next->Yaw, update->Yaw, interpolate);
} }
if (flags & LOCATIONUPDATE_ROTX) { if (flags & LOCATIONUPDATE_ROTX) {
LocalInterpComp_Angle(&prev->RotX, &next->RotX, update->RotX, interpolate); LocalInterpComp_Angle(&prev->RotX, &next->RotX, update->RotX, interpolate);

View File

@ -1160,9 +1160,12 @@ static GLuint GL_GenAndBind(GLenum target) {
} }
GfxResourceID Gfx_CreateDynamicVb(VertexFormat fmt, int maxVertices) { GfxResourceID Gfx_CreateDynamicVb(VertexFormat fmt, int maxVertices) {
GLuint id;
cc_uint32 size;
if (Gfx.LostContext) return 0; if (Gfx.LostContext) return 0;
GLuint id = GL_GenAndBind(GL_ARRAY_BUFFER);
cc_uint32 size = maxVertices * gfx_strideSizes[fmt]; id = GL_GenAndBind(GL_ARRAY_BUFFER);
size = maxVertices * gfx_strideSizes[fmt];
_glBufferData(GL_ARRAY_BUFFER, size, NULL, GL_DYNAMIC_DRAW); _glBufferData(GL_ARRAY_BUFFER, size, NULL, GL_DYNAMIC_DRAW);
return id; return id;
} }
@ -1230,10 +1233,10 @@ cc_result Gfx_TakeScreenshot(struct Stream* output) {
void Gfx_GetApiInfo(String* lines) { void Gfx_GetApiInfo(String* lines) {
static const String memExt = String_FromConst("GL_NVX_gpu_memory_info"); static const String memExt = String_FromConst("GL_NVX_gpu_memory_info");
int totalKb, curKb; GLint totalKb, curKb, depthBits;
float total, cur; float total, cur;
String extensions; String extensions;
int depthBits, pointerSize = sizeof(void*) * 8; int pointerSize = sizeof(void*) * 8;
glGetIntegerv(GL_DEPTH_BITS, &depthBits); glGetIntegerv(GL_DEPTH_BITS, &depthBits);
String_Format1(&lines[0], "-- Using OpenGL (%i bit) --", &pointerSize); String_Format1(&lines[0], "-- Using OpenGL (%i bit) --", &pointerSize);

View File

@ -629,7 +629,7 @@ cc_result File_Length(FileHandle file, cc_uint32* len) {
*#########################################################################################################################*/ *#########################################################################################################################*/
#if defined CC_BUILD_WIN #if defined CC_BUILD_WIN
void Thread_Sleep(cc_uint32 milliseconds) { Sleep(milliseconds); } void Thread_Sleep(cc_uint32 milliseconds) { Sleep(milliseconds); }
DWORD WINAPI Thread_StartCallback(void* param) { static DWORD WINAPI Thread_StartCallback(void* param) {
Thread_StartFunc* func = (Thread_StartFunc*)param; Thread_StartFunc* func = (Thread_StartFunc*)param;
(*func)(); (*func)();
return 0; return 0;
@ -711,7 +711,7 @@ void Waitable_Wait(void* handle) { }
void Waitable_WaitFor(void* handle, cc_uint32 milliseconds) { } void Waitable_WaitFor(void* handle, cc_uint32 milliseconds) { }
#elif defined CC_BUILD_POSIX #elif defined CC_BUILD_POSIX
void Thread_Sleep(cc_uint32 milliseconds) { usleep(milliseconds * 1000); } void Thread_Sleep(cc_uint32 milliseconds) { usleep(milliseconds * 1000); }
void* Thread_StartCallback(void* lpParam) { static void* Thread_StartCallback(void* lpParam) {
Thread_StartFunc* func = (Thread_StartFunc*)lpParam; Thread_StartFunc* func = (Thread_StartFunc*)lpParam;
(*func)(); (*func)();
return NULL; return NULL;
@ -1800,6 +1800,7 @@ int Platform_GetCommandLineArgs(int argc, STRING_REF char** argv, String* args)
cc_result Platform_SetDefaultCurrentDirectory(int argc, char **argv) { cc_result Platform_SetDefaultCurrentDirectory(int argc, char **argv) {
char path[NATIVE_STR_LEN]; char path[NATIVE_STR_LEN];
int i, len = 0; int i, len = 0;
cc_result res;
for (i = 1; i < argc; ++i) { for (i = 1; i < argc; ++i) {
if (strlen(argv[i]) > 2 && argv[i][0] == '-' && argv[i][1] == 'd') { if (strlen(argv[i]) > 2 && argv[i][0] == '-' && argv[i][1] == 'd') {
@ -1812,7 +1813,7 @@ cc_result Platform_SetDefaultCurrentDirectory(int argc, char **argv) {
return chdir(Platform_DefaultDirectory + 2) == -1 ? errno : 0; return chdir(Platform_DefaultDirectory + 2) == -1 ? errno : 0;
} }
cc_result res = Process_RawGetExePath(path, &len); res = Process_RawGetExePath(path, &len);
if (res) return res; if (res) return res;
/* get rid of filename at end of directory */ /* get rid of filename at end of directory */