Skip to content

Conversation

@RogueMacro
Copy link
Contributor

@RogueMacro RogueMacro commented Aug 9, 2020

Once the editor is merged with the master branch, some of the features in the renderer branch @Fusioon has, can be integrated into the editor for images and rendering and stuff.

@Fusioon
Copy link
Contributor

Fusioon commented Aug 11, 2020

Dependencies should be added to the Workspace and Editor project.

{
public class RenderSpriteSystem : BaseSystem
{
public this(Application app) : base(app) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here with consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I was messing around with that and forgot to remove them since Application is a singleton now. If it's okay I will replace the existing App property and put Application.Instance instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that is fine! No reason to allow more than one Application I think. As long as we don't think this will end potential support for more than one Window.

Comment on lines 65 to 68
/*Glfw.WindowHint(GlfwWindow.Hint.ContextVersionMajor, 4);
Glfw.WindowHint(GlfwWindow.Hint.ContextVersionMinor, 6);
Glfw.WindowHint(GlfwWindow.Hint.OpenGlProfile, .CoreProfile);
Glfw.WindowHint(GlfwWindow.Hint.OpenGlForwardCompat, Glfw.TRUE);
Glfw.WindowHint(GlfwWindow.Hint.OpenGlForwardCompat, Glfw.TRUE);*/
Copy link
Contributor

Choose a reason for hiding this comment

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

This should have a comment explaining why we aren't using these hints for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it was some problems with ImGui, but I think Qzole fixed that. I will check

Copy link
Contributor

Choose a reason for hiding this comment

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

@RogueMacro Any update on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It wasn’t fixed at the moment of reviewing this, but it might be with the new library. I will look into it later today. Thanks for pointing this out

RogueMacro and others added 2 commits August 22, 2020 17:02
@RogueMacro RogueMacro requested a review from jamesaorson August 22, 2020 15:40
@RogueMacro RogueMacro requested review from a team and MineGame159 October 19, 2020 12:14
@Fusioon Fusioon self-assigned this Oct 22, 2020
Copy link
Contributor

@Fusioon Fusioon left a comment

Choose a reason for hiding this comment

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

Pretty good overall. I did run into issue when creating new project which was caused by the Samples folder being in wrong path and some memory leaks/crashes all of which should have comment besides them.


var filePath = new String();
var fileName = new String();
var newFilePath = new String();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why aren't scope allocations used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because if you have a deeper folder structure, it would allocate lots of strings on the stack, which would make it easier for a stack overflow. There would be 6 strings of unknown length for each level.

@RogueMacro RogueMacro requested a review from Fusioon October 26, 2020 20:59
@RogueMacro
Copy link
Contributor Author

I will look into the other JSON library so that may fix the style serialization issue

{
var typeName = scope String();
type.GetShortName(typeName);
if (typeName == "BaseComponent" || typeName == "BehaviourComponent")
Copy link
Contributor

Choose a reason for hiding this comment

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

The type name is BehaviorComponent (US spelling), not BehaviourComponent (UK spelling).

Is there a way to use reflection to get a nameof like in C#? https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/nameof

Copy link
Contributor

Choose a reason for hiding this comment

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

Btw, because of this misspelling, an error shows up in the console when trying to add a BehaviorComponent

Comment on lines 155 to 165
var typeName = scope String();
type.GetShortName(typeName);
if (typeName == "BaseComponent" || typeName == "BehaviourComponent")
continue;

if (ImGui.MenuItem(typeName))
{
componentType = type;
_showAddComponentPopup = false;
break;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Changing this to

var typeId = type.GetTypeId();
if (typeId == typeof(BaseComponent).GetTypeId() || typeId == typeof(BehaviorComponent).GetTypeId())
    continue;

var typeName = scope String();
type.GetShortName(typeName);
if (ImGui.MenuItem(typeName))
{
    componentType = type;
    _showAddComponentPopup = false;
    break;
}

will make it harder for these mistakes to happen.

{
var typeName = scope String();
componentType.GetName(typeName);
Log.Error("Failed create component ({})", typeName);
Copy link
Contributor

Choose a reason for hiding this comment

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

Change "Failed create component ({})" to "Failed to create component ({})"

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.

3 participants