Skip to content

Commit

Permalink
Fixed lights loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Borf committed May 18, 2020
1 parent 1056d2e commit 2d089c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions brolib/BroLib/Rsw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,9 @@ Rsw::Rsw(const std::string &fileName, bool loadModels)
{
Light* light = new Light();
light->name = file->readString(40);
light->todo = file->readString(40);
light->position = file->readVec3();
light->position = file->readVec3() * glm::vec3(1, -1, 1);
for (int i = 0; i < 10; i++)
light->todo[i] = file->readFloat();
light->color = file->readVec3();
light->todo2 = file->readFloat();
objects.push_back(light);
Expand Down Expand Up @@ -393,8 +394,9 @@ void Rsw::save(const std::string &fileName)
pFile->writeInt(2);
Light* light = (Light*)object;
pFile->writeString(light->name, 40);
pFile->writeString(light->todo, 40);
pFile->writeVec3(light->position);
pFile->writeVec3(light->position * glm::vec3(1,-1,1));
for(int i = 0; i < 10; i++)
pFile->writeFloat(light->todo[i]);
pFile->writeVec3(light->color);
pFile->writeFloat(light->todo2);

Expand Down
2 changes: 1 addition & 1 deletion brolib/BroLib/Rsw.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class Rsw
class Light : public Object
{
public:
std::string todo;
float todo[10];
glm::vec3 color;
float todo2;

Expand Down

0 comments on commit 2d089c0

Please sign in to comment.