Skip to content

Allow multi file support for extensions#371

Merged
OneLoneCoder merged 3 commits into
developfrom
allow-multi-file-support-for-extensions
May 20, 2024
Merged

Allow multi file support for extensions#371
OneLoneCoder merged 3 commits into
developfrom
allow-multi-file-support-for-extensions

Conversation

@Moros1138

Copy link
Copy Markdown
Collaborator

Added multi file support for the extensions by adding #include "olcPixelGameEngine.h" to headers that was missing it.

At the same time, olcPGEX_Graphics3D produces the following errors

In file included from ./include/olcPixelGameEngine/extensions/olcPGEX_Graphics3D.cpp:2:
./include/olcPixelGameEngine/extensions/olcPGEX_Graphics3D.h:209:138: error: default member initializer for 'w' needed within definition of enclosing class 'GFX3D' outside of member functions
  209 |                         void SetLightSource(uint32_t nSlot, uint32_t nType, olc::Pixel col, olc::GFX3D::vec3d pos, olc::GFX3D::vec3d dir = { 0.0f, 0.0f, 1.0f }, float fParam = 0.0f);
      |                                                                                                                                                               ^
./include/olcPixelGameEngine/extensions/olcPGEX_Graphics3D.h:105:10: note: default member initializer declared here
  105 |                         float w = 1; // Need a 4th term to perform sensible matrix vector multiplication
      |                               ^
./include/olcPixelGameEngine/extensions/olcPGEX_Graphics3D.h:595:18: error: no viable overloaded '='
  595 |                         out_tri1.p[0] = *inside_points[0];
      |                         ~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~
./include/olcPixelGameEngine/extensions/olcPGEX_Graphics3D.h:100:10: note: candidate function (the implicit move assignment operator) not viable: expects an rvalue for 1st argument
  100 |                 struct vec3d
      |                        ^~~~~
./include/olcPixelGameEngine/extensions/olcPGEX_Graphics3D.h:631:18: error: no viable overloaded '='
  631 |                         out_tri1.p[0] = *inside_points[0];                      
      |                         ~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~
./include/olcPixelGameEngine/extensions/olcPGEX_Graphics3D.h:100:10: note: candidate function (the implicit move assignment operator) not viable: expects an rvalue for 1st argument
  100 |                 struct vec3d
      |                        ^~~~~
./include/olcPixelGameEngine/extensions/olcPGEX_Graphics3D.h:634:18: error: no viable overloaded '='
  634 |                         out_tri1.p[1] = *inside_points[1];
      |                         ~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~
./include/olcPixelGameEngine/extensions/olcPGEX_Graphics3D.h:100:10: note: candidate function (the implicit move assignment operator) not viable: expects an rvalue for 1st argument
  100 |                 struct vec3d
      |                        ^~~~~
./include/olcPixelGameEngine/extensions/olcPGEX_Graphics3D.h:646:18: error: no viable overloaded '='
  646 |                         out_tri2.p[1] = *inside_points[1];
      |                         ~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~
./include/olcPixelGameEngine/extensions/olcPGEX_Graphics3D.h:100:10: note: candidate function (the implicit move assignment operator) not viable: expects an rvalue for 1st argument
  100 |                 struct vec3d
      |                        ^~~~~
./include/olcPixelGameEngine/extensions/olcPGEX_Graphics3D.h:648:18: error: no viable overloaded '='
  648 |                         out_tri2.p[0] = out_tri1.p[2];
      |                         ~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~
./include/olcPixelGameEngine/extensions/olcPGEX_Graphics3D.h:100:10: note: candidate function (the implicit move assignment operator) not viable: expects an rvalue for 1st argument
  100 |                 struct vec3d
      |                        ^~~~~
./include/olcPixelGameEngine/extensions/olcPGEX_Graphics3D.h:1018:22: error: no viable overloaded '='
 1018 |                         lights[nSlot].pos = pos;
      |                         ~~~~~~~~~~~~~~~~~ ^ ~~~
./include/olcPixelGameEngine/extensions/olcPGEX_Graphics3D.h:100:10: note: candidate function (the implicit move assignment operator) not viable: expects an rvalue for 1st argument
  100 |                 struct vec3d
      |                        ^~~~~
./include/olcPixelGameEngine/extensions/olcPGEX_Graphics3D.h:1019:22: error: no viable overloaded '='
 1019 |                         lights[nSlot].dir = dir;
      |                         ~~~~~~~~~~~~~~~~~ ^ ~~~
./include/olcPixelGameEngine/extensions/olcPGEX_Graphics3D.h:100:10: note: candidate function (the implicit move assignment operator) not viable: expects an rvalue for 1st argument
  100 |                 struct vec3d
      |                        ^~~~~
8 errors generated.

Which was fixed by adding the 4th term to the initializer list, default value for w

@OneLoneCoder OneLoneCoder merged commit f16c146 into develop May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants