discosultan / penumbra

2D lighting with soft shadows for MonoGame
MIT License
315 stars 32 forks source link

Unable to build without this specific change. #15

Closed ghost closed 6 years ago

discosultan commented 6 years ago

I think the issue is that if you reference the source of the project directly, you are not specifying a preprocessor directive when building. You could either add the WindowsDX directive or, as you suggested, make WindowsDX the default when creating a content manager.

Can you change the entire _content assignment to:

            _content = new ResourceContentManager(Game.Services,
#if DesktopGL
                new ResourceManager("Penumbra.Resource.DesktopGL", typeof(PenumbraComponent).Assembly)
#else
                new ResourceManager("Penumbra.Resource.WindowsDX", typeof(PenumbraComponent).Assembly)
#endif
            );

Check that it works for you and then I'll merge. Also, make sure whitespaces are used correctly (spaces, not tabs and no redundant symbols).


Nice catch and thanks!

ghost commented 6 years ago

Well the issue is that there's a ');' that the compiler doesn't recognize. Additionally, when using the change I'm trying to commit it doesn't recognize that the build is in WindowsDX. So instead I've just cut out the OpenGL if statements and put the DX ones in instead. Without the #IF or #IFELSE.

ghost commented 6 years ago

I've implemented this project by just copying all of the sourcecode into my project and removing the AssemblyInfo, Properties, and solution files. Is that what you meant?

discosultan commented 6 years ago

Yep. Wait, let me push a commit to show you what I mean by the change.

discosultan commented 6 years ago

I pushed the following commit: https://github.com/discosultan/penumbra/commit/ac60beebab5e720defa6ebee8f21900f63f57d18. Does this work for you?

ghost commented 6 years ago

Yes, that solution resolves the issue. There's two other classes that implement similar #IF logic that also need that specific change.

discosultan commented 6 years ago

Yup, fixed those here: https://github.com/discosultan/penumbra/commit/3caf48a793e4993e16c1f0f52da6fe4388468753

ghost commented 6 years ago

Sweet, if you have Discord feel free to add me there. It's Eddie! #9684.

Over and out.