From 2aac222d350be0d4d85841d0fffafd89ade04903 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 29 Oct 2018 22:32:36 +0200 Subject: [PATCH] - fixed compilation on macOS error: non-constant-expression cannot be narrowed from type 'unsigned long' to 'int' in initializer list error: unknown type name 'OpenGLFrameBuffer' --- src/hwrenderer/data/flatvertices.cpp | 4 ++-- src/hwrenderer/models/hw_models.cpp | 8 ++++---- src/hwrenderer/scene/hw_skydome.cpp | 8 ++++---- src/hwrenderer/utility/hw_draw2d.cpp | 6 +++--- src/posix/cocoa/i_video.mm | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/hwrenderer/data/flatvertices.cpp b/src/hwrenderer/data/flatvertices.cpp index 85fd380d2..c1e3b6086 100644 --- a/src/hwrenderer/data/flatvertices.cpp +++ b/src/hwrenderer/data/flatvertices.cpp @@ -82,8 +82,8 @@ FFlatVertexBuffer::FFlatVertexBuffer(int width, int height) mVertexBuffer->SetData(bytesize, nullptr, false); static const FVertexBufferAttribute format[] = { - { 0, VATTR_VERTEX, VFmt_Float3, myoffsetof(FFlatVertex, x) }, - { 0, VATTR_TEXCOORD, VFmt_Float2, myoffsetof(FFlatVertex, u) } + { 0, VATTR_VERTEX, VFmt_Float3, (int)myoffsetof(FFlatVertex, x) }, + { 0, VATTR_TEXCOORD, VFmt_Float2, (int)myoffsetof(FFlatVertex, u) } }; mVertexBuffer->SetFormat(1, 2, sizeof(FFlatVertex), format); diff --git a/src/hwrenderer/models/hw_models.cpp b/src/hwrenderer/models/hw_models.cpp index 9b499aca1..ce22625d8 100644 --- a/src/hwrenderer/models/hw_models.cpp +++ b/src/hwrenderer/models/hw_models.cpp @@ -141,10 +141,10 @@ FModelVertexBuffer::FModelVertexBuffer(bool needindex, bool singleframe) mIndexBuffer = needindex ? screen->CreateIndexBuffer() : nullptr; static const FVertexBufferAttribute format[] = { - { 0, VATTR_VERTEX, VFmt_Float3, myoffsetof(FModelVertex, x) }, - { 0, VATTR_TEXCOORD, VFmt_Float2, myoffsetof(FModelVertex, u) }, - { 0, VATTR_NORMAL, VFmt_Packed_A2R10G10B10, myoffsetof(FModelVertex, packedNormal) }, - { 1, VATTR_VERTEX2, VFmt_Float3, myoffsetof(FModelVertex, x) } + { 0, VATTR_VERTEX, VFmt_Float3, (int)myoffsetof(FModelVertex, x) }, + { 0, VATTR_TEXCOORD, VFmt_Float2, (int)myoffsetof(FModelVertex, u) }, + { 0, VATTR_NORMAL, VFmt_Packed_A2R10G10B10, (int)myoffsetof(FModelVertex, packedNormal) }, + { 1, VATTR_VERTEX2, VFmt_Float3, (int)myoffsetof(FModelVertex, x) } }; mVertexBuffer->SetFormat(2, 4, sizeof(FModelVertex), format); } diff --git a/src/hwrenderer/scene/hw_skydome.cpp b/src/hwrenderer/scene/hw_skydome.cpp index 230576ca9..3c6e5f635 100644 --- a/src/hwrenderer/scene/hw_skydome.cpp +++ b/src/hwrenderer/scene/hw_skydome.cpp @@ -88,9 +88,9 @@ FSkyVertexBuffer::FSkyVertexBuffer() mVertexBuffer = screen->CreateVertexBuffer(); static const FVertexBufferAttribute format[] = { - { 0, VATTR_VERTEX, VFmt_Float3, myoffsetof(FSkyVertex, x) }, - { 0, VATTR_TEXCOORD, VFmt_Float2, myoffsetof(FSkyVertex, u) }, - { 0, VATTR_COLOR, VFmt_Byte4, myoffsetof(FSkyVertex, color) } + { 0, VATTR_VERTEX, VFmt_Float3, (int)myoffsetof(FSkyVertex, x) }, + { 0, VATTR_TEXCOORD, VFmt_Float2, (int)myoffsetof(FSkyVertex, u) }, + { 0, VATTR_COLOR, VFmt_Byte4, (int)myoffsetof(FSkyVertex, color) } }; mVertexBuffer->SetFormat(1, 3, sizeof(FSkyVertex), format); mVertexBuffer->SetData(mVertices.Size() * sizeof(FSkyVertex), &mVertices[0], true); @@ -329,4 +329,4 @@ void FSkyVertexBuffer::SetupMatrices(FMaterial *tex, float x_offset, float y_off textureMatrix.loadIdentity(); textureMatrix.scale(mirror ? -xscale : xscale, yscale, 1.f); textureMatrix.translate(1.f, y_offset / texh, 1.f); -} \ No newline at end of file +} diff --git a/src/hwrenderer/utility/hw_draw2d.cpp b/src/hwrenderer/utility/hw_draw2d.cpp index 6abadb682..bd442a19a 100644 --- a/src/hwrenderer/utility/hw_draw2d.cpp +++ b/src/hwrenderer/utility/hw_draw2d.cpp @@ -58,9 +58,9 @@ public: mIndexBuffer = screen->CreateIndexBuffer(); static const FVertexBufferAttribute format[] = { - { 0, VATTR_VERTEX, VFmt_Float3, myoffsetof(F2DDrawer::TwoDVertex, x) }, - { 0, VATTR_TEXCOORD, VFmt_Float2, myoffsetof(F2DDrawer::TwoDVertex, u) }, - { 0, VATTR_COLOR, VFmt_Byte4, myoffsetof(F2DDrawer::TwoDVertex, color0) } + { 0, VATTR_VERTEX, VFmt_Float3, (int)myoffsetof(F2DDrawer::TwoDVertex, x) }, + { 0, VATTR_TEXCOORD, VFmt_Float2, (int)myoffsetof(F2DDrawer::TwoDVertex, u) }, + { 0, VATTR_COLOR, VFmt_Byte4, (int)myoffsetof(F2DDrawer::TwoDVertex, color0) } }; mVertexBuffer->SetFormat(1, 3, sizeof(F2DDrawer::TwoDVertex), format); } diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index 122fbf025..c0f56c480 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -204,7 +204,7 @@ class CocoaVideo : public IVideo public: virtual DFrameBuffer* CreateFrameBuffer() override { - auto fb = new OpenGLFrameBuffer(nullptr, fullscreen); + auto fb = new OpenGLRenderer::OpenGLFrameBuffer(nullptr, fullscreen); fb->SetMode(fullscreen, vid_hidpi); fb->SetSize(fb->GetClientWidth(), fb->GetClientHeight());