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

files structure #34

Open
turican0 opened this issue Feb 7, 2021 · 6 comments
Open

files structure #34

turican0 opened this issue Feb 7, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@turican0
Copy link
Collaborator

turican0 commented Feb 7, 2021

In the future, it will be desirable to split sub_main.cpp / .h into multiple folders. I would wait to change these actions. But I would divide the part as soon as the current branches are merged. These are sounds and animation(videos).

I would create Basics.cpp/.h - some basic function used in both sound and animations only temporary solutions - may not be needed
I would create Sound.cpp/.h(include Basics)
I would create Animation.cpp/.h(include Basics, Sound)
I would create LevelGeneration.cpp/.h(include Basics)
I would change sub_main.cpp/.h(include Basics, Sound, Animations, LevelGeneration)

I would leave further divisions for later, because they are not unambiguous.

Independent LevelGeneration is good basis for editor - I want change it to project solution, but with use some files from remc2 project. Editor will be good for testing individual entities separately - for easy find some errors.

Do you agree with that?

Tom.

@GrimSqueaker
Copy link
Owner

Yes, this totally makes sense. Just do it for the Windows side and I can fix the CMake setup for Linux. But if you feel confident, you can also do the change in the CMakeLists.txt file to apply the change to Linux.

@turican0
Copy link
Collaborator Author

turican0 commented Feb 8, 2021

I started by dividing the functions into separate Sound and Animation files. This is only begin many functions is in bad files, now. The Basic file swelled a lot :) It will later need to be divided into things about rendering (Bitmap or Draw2D), things about memory (Memory) and more, but until then it would like to understand more what it is for. So far, I've left the files in remc2, so CMakeLists.txt probably wouldn't be affected.
Tom.

@turican0
Copy link
Collaborator Author

turican0 commented Feb 9, 2021

I begin with separate editor to own solution. Now is some code unclear, data is must copy to editor directory.
image
image

@turican0 turican0 added the enhancement New feature or request label Feb 10, 2021
@GrimSqueaker
Copy link
Owner

Ok, I have not tried to get the editor running on Linux. I think I would need to get kiss_sdl running for that.

@turican0
Copy link
Collaborator Author

Kiss-SDL is only 5 files, where is included in project(I modify original code adding some enhanced elements).

@turican0
Copy link
Collaborator Author

I'm thinking about further dividing functions into more files, so far this occurs to me, but in the future we should divide the functions even more into a more structured hierarchy in order to improve the orientation in the code.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants