Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid loadMedia copy and do some cleanups #3722

Closed
wants to merge 1 commit into from

Conversation

nerzhul
Copy link
Member

@nerzhul nerzhul commented Feb 16, 2016

No description provided.

@@ -690,7 +686,7 @@ bool Client::loadMedia(const std::string &data, const std::string &filename)

// Create an irrlicht memory file
io::IReadFile *rfile = irrfs->createMemoryReadFile(
*data_rw, data_rw.getSize(), "_tempreadfile");
(void*)data.c_str(), data.size(), "_tempreadfile");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best would be:

  1. Adding an #ifdef for irrlicht 1.9 with the "direct" way that doesn't do a cast
  2. in the else part, add a comment that properly explains that casting is legal in this specific case

Other people might even say that the < 1.9 case should remain a copy, idk.

@est31
Copy link
Contributor

est31 commented Feb 16, 2016

Other than that, looks good.

@est31 est31 added the Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements label Feb 16, 2016
@nerzhul
Copy link
Member Author

nerzhul commented Feb 17, 2016

@est31 builders uses 1.8 and it's working. I think condition should be 1.7

@est31
Copy link
Contributor

est31 commented Feb 18, 2016

@nerzhul No, it should check for 1.8 too because the API didn't change. It changed between 1.8 and 1.9.

@nerzhul
Copy link
Member Author

nerzhul commented Feb 18, 2016

@est31 then there is no problem because jenkins & travis uses irrlicht 1.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants