From bfa780c03322141db6a1322a1fa83bc5bef7d83d Mon Sep 17 00:00:00 2001
From: Bruno Albuquerque <bga@bug-br.org.br>
Date: Tue, 4 Mar 2014 09:55:53 -0300
Subject: [PATCH] Fix 64 bit build of Haiku3D.
- Correct prototype for error callback function.
- Use B_PRI8 macros where needed.
---
src/apps/haiku3d/RenderView.cpp | 2 +-
src/apps/haiku3d/RenderView.h | 2 +-
src/apps/haiku3d/mesh/StaticMesh.cpp | 12 ++++++------
src/apps/haiku3d/texture/BitmapTexture.cpp | 3 ++-
4 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/apps/haiku3d/RenderView.cpp b/src/apps/haiku3d/RenderView.cpp
index 44f8427..2eea432 100644
a
|
b
|
RenderView::FrameResized(float width, float height)
|
257 | 257 | |
258 | 258 | |
259 | 259 | void |
260 | | RenderView::ErrorCallback(uint32 error) |
| 260 | RenderView::ErrorCallback(unsigned long error) |
261 | 261 | { |
262 | 262 | fprintf(stderr, "OpenGL error (%li): %s\n", error, gluErrorString(error)); |
263 | 263 | } |
diff --git a/src/apps/haiku3d/RenderView.h b/src/apps/haiku3d/RenderView.h
index 9fcfc88..65e23e2 100644
a
|
b
|
public:
|
24 | 24 | |
25 | 25 | virtual void AttachedToWindow(); |
26 | 26 | virtual void FrameResized(float width, float height); |
27 | | virtual void ErrorCallback(uint32 error); |
| 27 | virtual void ErrorCallback(unsigned long error); |
28 | 28 | |
29 | 29 | protected: |
30 | 30 | void _InitGL(); |
diff --git a/src/apps/haiku3d/mesh/StaticMesh.cpp b/src/apps/haiku3d/mesh/StaticMesh.cpp
index 16f6fd9..b468226 100644
a
|
b
|
StaticMesh::_ReadText(const char* fileName)
|
49 | 49 | return; |
50 | 50 | } |
51 | 51 | |
52 | | fscanf(f, "%lu", &fFaceCount); |
| 52 | fscanf(f, "%" B_PRIu32, &fFaceCount); |
53 | 53 | fFaces = new Face[fFaceCount]; |
54 | 54 | |
55 | 55 | for (uint32 i = 0; i < fFaceCount; i++) { |
56 | 56 | |
57 | 57 | uint32 vertexCount = 0; |
58 | | fscanf(f, "%lu", &vertexCount); |
| 58 | fscanf(f, "%" B_PRIu32, &vertexCount); |
59 | 59 | fFaces[i].vertexCount = vertexCount; |
60 | 60 | |
61 | 61 | for (uint32 vi = 0; vi < vertexCount; vi++) { |
… |
… |
StaticMesh::_ReadText(const char* fileName)
|
68 | 68 | } |
69 | 69 | |
70 | 70 | fclose(f); |
71 | | printf("Mesh::_ReadText, loaded %s (%lu faces)\n", fileName, fFaceCount); |
| 71 | printf("Mesh::_ReadText, loaded %s (%" B_PRIu32 " faces)\n", fileName, fFaceCount); |
72 | 72 | } |
73 | 73 | |
74 | 74 | |
… |
… |
StaticMesh::_WriteBinary(const char* fileName)
|
89 | 89 | file.Write(&fFaces[i].v[vi], sizeof(Vertex)); |
90 | 90 | } |
91 | 91 | } |
92 | | printf("Mesh::_WriteBinary, wrote %s (%lu faces)\n", fileName, fFaceCount); |
| 92 | printf("Mesh::_WriteBinary, wrote %s (%" B_PRIu32 " faces)\n", fileName, fFaceCount); |
93 | 93 | } |
94 | 94 | |
95 | 95 | |
… |
… |
StaticMesh::_ReadBinary(const char* fileName)
|
111 | 111 | file.Read(&fFaces[i].v[vi], sizeof(Vertex)); |
112 | 112 | } |
113 | 113 | } |
114 | | printf("Mesh::_ReadBinary, loaded %s (%lu faces)\n", fileName, fFaceCount); |
| 114 | printf("Mesh::_ReadBinary, loaded %s (%" B_PRIu32 " faces)\n", fileName, fFaceCount); |
115 | 115 | } |
116 | 116 | |
117 | 117 | |
… |
… |
StaticMesh::_ReadResource(const char* resourceName)
|
146 | 146 | memoryIO.Read(&fFaces[i].v[vi], sizeof(Vertex)); |
147 | 147 | } |
148 | 148 | } |
149 | | printf("Mesh::_ReadResource, loaded %s (%lu faces)\n", resourceName, |
| 149 | printf("Mesh::_ReadResource, loaded %s (%" B_PRIu32 " faces)\n", resourceName, |
150 | 150 | fFaceCount); |
151 | 151 | } |
152 | 152 | |
diff --git a/src/apps/haiku3d/texture/BitmapTexture.cpp b/src/apps/haiku3d/texture/BitmapTexture.cpp
index 654c910..78a4966 100644
a
|
b
|
BitmapTexture::_Load(BBitmap* bitmap) {
|
43 | 43 | 0, GL_BGRA, GL_UNSIGNED_BYTE, |
44 | 44 | bitmap->Bits()); |
45 | 45 | |
46 | | printf("BitmapTexture::_Load, loaded texture %u (%li, %li, %libits)\n", |
| 46 | printf("BitmapTexture::_Load, loaded texture %u (%" B_PRId32 ", %" B_PRId32 |
| 47 | ", %" B_PRId32 "bits)\n", |
47 | 48 | fId, (int32) bitmap->Bounds().Width(), |
48 | 49 | (int32) bitmap->Bounds().Height(), |
49 | 50 | 8 * bitmap->BytesPerRow() / (int)bitmap->Bounds().Width()); |