From 9880829fc5ae772570b0a85c868c862a84bcb9f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Mon, 13 Jan 2020 04:19:37 -0300 Subject: [PATCH] Migrated to Github (remove hg stuffs, added git submodules). Fixed compilation (SoundFileReaderFlac needed some updateds). Updated README.md. --- .gitmodules | 6 ++ .hgignore | 60 ------------ .hgtags | 1 - README.md | 126 ++++++++++++++++++------- projects/linux/ee.creator.user | 118 ++++++++++++++++++++++- src/eepp/audio/soundfilereaderflac.cpp | 6 +- src/thirdparty/SOIL2 | 1 + src/thirdparty/efsw | 1 + 8 files changed, 220 insertions(+), 99 deletions(-) create mode 100644 .gitmodules delete mode 100644 .hgignore delete mode 100644 .hgtags create mode 160000 src/thirdparty/SOIL2 create mode 160000 src/thirdparty/efsw diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..b4f01378b --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "src/thirdparty/efsw"] + path = src/thirdparty/efsw + url = https://github.com/SpartanJ/efsw +[submodule "src/thirdparty/SOIL2"] + path = src/thirdparty/SOIL2 + url = https://github.com/SpartanJ/soil2 diff --git a/.hgignore b/.hgignore deleted file mode 100644 index e022631d4..000000000 --- a/.hgignore +++ /dev/null @@ -1,60 +0,0 @@ -syntax: regexp -^fonts$ -^assets/temp$ -^obj$ -^libs$ -^make$ -^data$ -^docs/doxygen-html$ -^docs/html$ -^docs/rst$ -^docs/xml$ -^docs/doxyrest/sphinx/__pycache__$ -^projects/android-project/.gradle$ -^projects/android-project/build$ -^projects/android-project/local.properties$ -^projects/android-project/app/.externalNativeBuild$ -^projects/android-project/app/build$ -^projects/android-project/app/src/main/assets$ -^projects/android-project-ant/bin$ -^projects/android-project-ant/obj$ -^projects/android-project-ant/data$ -^projects/android-project-ant/gen$ -^projects/android-project-ant/assets$ -^projects/android-project-ant/libs$ -^src/examples/strobe$ -.*.dll -eees* -eeew* -eetest* -eesound* -eesprite* -eefonts* -eevbo-fbo-batch* -eephysics* -eestrobe* -eeiv* -eehttp-request* -eepp-TextureAtlasEditor* -eepp-UIEditor* -ee.tag -log.log -external_projects.lua -.*\.user$ -.*\.filters$ -.*\.suo$ -.*\.DS_Store$ -.*.pdb$ -syntax: glob -src/thirdparty/SDL2/include/SDL2 -projects/ios/eepp.app/assets -projects/ios/eepp.app/eepp -bin/libeepp-debug.dylib -bin/libeepp.dylib -bin/eeui-hello-world* -bin/eepp-MapEditor* -*.iml -.idea -eepp.kdev4 -eepp.tags -eepp.geany diff --git a/.hgtags b/.hgtags deleted file mode 100644 index d76afc06d..000000000 --- a/.hgtags +++ /dev/null @@ -1 +0,0 @@ -b44ee6ad77045ed9d64c07452f747e3317fa1dcd release-0.9.5 diff --git a/README.md b/README.md index ed1de6097..622bd76e5 100644 --- a/README.md +++ b/README.md @@ -201,7 +201,8 @@ UI Screenshots UI Layout XML example --------------------- -It should look really familiar to any Android developer. This is a window with the most basic controls in a vertical linear layout display. +It should look really familiar to any Android developer. This is a window with +the most basic controls in a vertical linear layout display. ```xml @@ -237,8 +238,9 @@ UITextView::New()->setText( "Text on test 1" ) UI Styling ---------- -Element styling can be done with a custom implementation of Cascading Style Sheets, most common CSS2 rules are available, -plus several CSS3 rules (some examples: [transitions](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Transitions), +Element styling can be done with a custom implementation of Cascading Style +Sheets, most common CSS2 rules are available, plus several CSS3 rules (some +examples: [transitions](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Transitions), [custom properties](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties), [media queries](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries), [@font-face at rule](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face), @@ -318,18 +320,34 @@ Here is a small example on how the CSS looks like: ``` -How can I learn to use the library? ------------------------------------ -This is the current big issue with the library. Since I'm solo working, it's really difficult keep up the documentation updated. But I'll work to improve that in the near future. For the moment you have two options: build the documentation and read code examples. The documentation is not complete but most modules are documented. Sadly not the UI module ( the biggest one ), but it's easy to get along with the examples. The library is supper easy to use, but is kind of big, so, knowing about everything I'll take time. I you're interested you can contact me anytime. +Documentation +------------- +Documentation is located [here](https://eepp.ensoft.dev). I'm currently working +on improving it. About 50% of the project is currently documented so still needs +a lot of work. Please check the code examples located in `src/examples` and you +can also check out the test ( `src/test` ) and tools ( `src/tools` ). +I'm putting my efforts on improving the documentation on the UI module since +currently is the most important and complex module but lacks of proper +documentation. If you have any question you can contact me anytime. + +Getting the code +---------------- +The repository uses git submodules so you'll need to clone the repository and +its submodules, in order to achieve this easily you can simply clone with: +`git clone --recurse-submodules https://github.com/SpartanJ/eepp.git` How to build it? ---------------- -The library has very few external dependencies. Most of the time you will only need SDL2 and OpenAL libraries with the headers installed. Also **premake4** or **premake5** is needed to generate the Makefiles or project files to build the library. I will assume that you know what you are doing and skip the basics. +The library has very few external dependencies. Most of the time you will only +need SDL2 and OpenAL libraries with the headers installed. Also **premake4** or +**premake5** is needed to generate the Makefiles or project files to build the +library. I will assume that you know what you are doing and skip the basics. _**GNU/Linux**_ -In a Ubuntu system it would be something like ( also you will need gcc and freetype, but it will be installed anyways ): +In a Ubuntu system it would be something like ( also you will need gcc and freetype, +but it will be installed anyways ): `sudo apt-get install premake4 libsdl2-2.0-0 libsdl2-dev libopenal1 libopenal-dev` @@ -346,7 +364,9 @@ That's it. That will build the whole project. _**Windows**_ You have two options: build with *Visual Studio* or with *mingw*. -To build with any of both options first you will need to build the project files with [premake4](https://premake.github.io/download.html). Then add the premake4.exe file to any of the executable paths defined in `PATH` ( or add one ). +To build with any of both options first you will need to build the project files +with [premake4](https://premake.github.io/download.html). Then add the +premake4.exe file to any of the executable paths defined in `PATH` ( or add one ). For *Visual Studio*: `premake5.exe vs2019` @@ -356,20 +376,29 @@ or For *mingw*: `premake4.exe gmake` -Then you will need the prebuild binaries and development libraries of [SDL2](http://libsdl.org/download-2.0.php) and [openal-soft](http://kcat.strangesoft.net/openal.html#download). Download the ones needed ( *VS* or *mingw* ). +Then you will need the prebuild binaries and development libraries of +[SDL2](http://libsdl.org/download-2.0.php) and +[openal-soft](http://kcat.strangesoft.net/openal.html#download). +Download the ones needed ( *VS* or *mingw* ). -Then the project files should be found in `make/windows/`. A solution (sln) for *Visual Studio* or the corresponding `Makefiles` for *mingw*. +Then the project files should be found in `make/windows/`. A solution (sln) for +*Visual Studio* or the corresponding `Makefiles` for *mingw*. -Having installed everything, you'll be able to build for *Visual Studio* as any other project. +Having installed everything, you'll be able to build for *Visual Studio* as any +other project. And for *mingw* just make the project with: `mingw32-make` or any equivalent. _**macOS**_ You have two options to build the project: with XCode or with gcc/clang manually. -To build with any of both options first you will also need to build the project files with [premake4](https://premake.github.io/download.html). -Then you will need the prebuild binaries and development libraries of [SDL2](http://libsdl.org/download-2.0.php), OpenAL is included with the OS. Install the *SDL2* framework and you should be able to build the project. +To build with any of both options first you will also need to build the project +files with [premake4](https://premake.github.io/download.html). +Then you will need the prebuild binaries and development libraries of +[SDL2](http://libsdl.org/download-2.0.php), OpenAL is included with the OS. +Install the *SDL2* framework and you should be able to build the project. -For a CLI build you can use the `projects/osx/make.sh` script, that generates the *Makefiles* and builds the project, also fix the dylibs generated. +For a CLI build you can use the `projects/osx/make.sh` script, that generates +the *Makefiles* and builds the project, also fix the dylibs generated. For *XCode* : `premake4 xcode4` @@ -379,40 +408,73 @@ And open the XCode project generated in `make/osx/` _**Android**_ -There's a gradle project in `projects/android-project/`. It will build the library with all the dependencies included. Use the example project as a base for your project. Notice that there's a `eepp.mk` project file that builds the library. That can be used in you projects. +There's a gradle project in `projects/android-project/`. It will build the +library with all the dependencies included. Use the example project as a base +for your project. Notice that there's a `eepp.mk` project file that builds the +library. That can be used in you projects. _**iOS**_ -I've compiled the project for *iOS* many times in the past but there's not a recent build of it, so it might fail. But you can get the scripts to build it in `projects/ios/`. You'll need some inspiration to make this work, but i promise that i'll work on make this easier in the near future. +I've compiled the project for *iOS* many times in the past but there's not a +recent build of it, so it might fail. But you can get the scripts to build it in +`projects/ios/`. You'll need some inspiration to make this work, but i promise +that i'll work on make this easier in the near future. _**emscripten**_ -There's a script for building the *emscripten* project in `projects/emscripten/make.sh`. That should be enough in *GNU/Linux* or *macOS* ( only tested this on *Linux* ). +There's a script for building the *emscripten* project in +`projects/emscripten/make.sh`. That should be enough in *GNU/Linux* or *macOS* +( only tested this on *Linux* ). Author comment -------------- -The library has been being developed for several years, it suffered many changes since its beginnings, -I'm making any changes that I find necessary to improve it, so the API still not totally stable (but close to be). -It's being used in several applications oriented to publicity campaigns mostly developed for Android devices and Windows PCs. -I personally never had the time to use it to develop a real game with the library ( several frustrated projects ). -The current project focus is on the UI module. And I'll continue working putting my focus on this. -The plan is to provide an alternative UI toolkit fully hardware accelerated similar to the Android toolkit but simpler ( as in easy to use ) and also oriented to desktop apps. +The library has been being developed for several years, it suffered many changes +since its beginnings, I'm making any changes that I find necessary to improve +it, so the API is still not totally stable (but close to be). +It's being used in several applications oriented to publicity campaigns mostly +developed for Android devices and Windows PCs. +I personally never had the time to use it to develop a complex game with the +library ( several frustrated projects ), but I made several UI oriented games +for clients. +The current project focus is on the UI module. And I'll continue working +putting my focus on this. +The plan is to provide an alternative UI toolkit fully hardware accelerated +similar to the Android toolkit but simpler ( as in easy to use ) and also +oriented to desktop apps. -Audio and Network modules were based the modules in SFML with several important differences mentioned above. -I like to use what's well done and fit my needs, but since I have my personal views on how to implement some things I prefer to take the code, to have full control over it. -Also many ideas were/are taken from other projects. Some I can think about: *cocos2d-x*, *raylib*, *Android SDK*, *libgdx*, *Godot*, *XNA*, *LÖVE*, and many other projects. +Audio and Network modules were based the modules in SFML with several important +differences mentioned above. +I like to use what's well done and fit my needs, but since I have my personal +views on how to implement some things I prefer to take the code, to have full +control over it. +Also many ideas were/are taken from other projects. Some I can think about: +*cocos2d-x*, *raylib*, *Android SDK*, *libgdx*, *Godot*, *XNA*, *LÖVE*, and many +other projects. -If all this sounds interesting to you for some crazy reason, contact me and let me know if I can help you to get into the library, and may be, contribute to it in the future. +If all this sounds interesting to you for some crazy reason, contact me and let +me know if I can help you to get into the library, and may be if you want, you +can contribute to it in the future. This project needs *contributors* more than anything else. -The current state of the library is decent. In terms of features should be in a similar position than the most used 2D game engines out there. -But lacks of course of the support+community that you can get from *Godot* or *cocos2d-x* to mention a couple. -The main idea of this library is to focus on a better general approach to develop heavily UI based apps/games than the other options, with cleaner code and implementation. +The current state of the library is decent. In terms of features should be in a +similar position than the most used 2D game engines out there. +But lacks of course of the support+community that you can get from *Godot* or +*cocos2d-x* to mention a couple. +The main idea of this library is to focus on a better general approach to +develop heavily UI based apps/games than the other options, with cleaner code +and implementation. + +The main reason I developed the library is for _fun_ and to _learn_ new +technologies. I love spending time working on the library, but I know there's +probably no real reason to develop something like this with the immense number +of similar alternatives. _**Plans/ideas for the future:**_ -Keep improving the UI system, adding new widgets and improving the CSS support, also simplify and improve the widgets skinning/theming. +Keep improving the UI system, adding new widgets and improving the CSS support. +Simplify and improve the UI widgets skinning/theming support. +Add [CSS animations](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Animations/Using_CSS_animations) support. Improve/create documentation for the UI module. Add more examples and also some tools. Add Scripting support ( first i would like to stabilize the library, but i'm getting there ). diff --git a/projects/linux/ee.creator.user b/projects/linux/ee.creator.user index 7daf07331..62a7cfb70 100644 --- a/projects/linux/ee.creator.user +++ b/projects/linux/ee.creator.user @@ -1,6 +1,6 @@ - + EnvironmentId @@ -615,6 +615,42 @@ debug-eeiv GenericProjectManager.GenericBuildConfiguration + + ../../make/linux + + + + false + eepp-ui-hello-world + make + false + true + GenericProjectManager.GenericMakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + clean + make + %{buildDir} + ProjectExplorer.ProcessStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + debug-ui-hello-world + GenericProjectManager.GenericBuildConfiguration + ../../make/linux @@ -885,7 +921,7 @@ release-es GenericProjectManager.GenericBuildConfiguration - 21 + 22 0 @@ -1507,6 +1543,82 @@ %{buildDir}../../../bin/ + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 0 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + %{buildDir}../../../bin/eeui-hello-world-debug + eeui-hello-world-debug + ProjectExplorer.CustomExecutableRunConfiguration + + + false + + true + false + false + false + true + false + %{buildDir}../../../bin/ + + dwarf @@ -2115,7 +2227,7 @@ %{buildDir}../../../bin/ - 16 + 17 diff --git a/src/eepp/audio/soundfilereaderflac.cpp b/src/eepp/audio/soundfilereaderflac.cpp index 91f91ad57..f897f5a56 100644 --- a/src/eepp/audio/soundfilereaderflac.cpp +++ b/src/eepp/audio/soundfilereaderflac.cpp @@ -27,7 +27,7 @@ static drflac_bool32 drflac_func_seek( void* data, int offset, drflac_seek_origi namespace EE { namespace Audio { namespace Private { bool SoundFileReaderFlac::check( IOStream& stream ) { - drflac* flac = drflac_open( drflac_func_read, drflac_func_seek, &stream ); + drflac* flac = drflac_open( drflac_func_read, drflac_func_seek, &stream, NULL ); if ( flac ) { drflac_close( flac ); @@ -47,10 +47,10 @@ SoundFileReaderFlac::~SoundFileReaderFlac() { bool SoundFileReaderFlac::open( IOStream& stream, Info& info ) { stream.seek( 0 ); - if ( ( mFlac = drflac_open( drflac_func_read, drflac_func_seek, &stream ) ) ) { + if ( ( mFlac = drflac_open( drflac_func_read, drflac_func_seek, &stream, NULL ) ) ) { info.channelCount = mChannelCount = mFlac->channels; info.sampleRate = mFlac->sampleRate; - info.sampleCount = mFlac->totalSampleCount; + info.sampleCount = mFlac->totalPCMFrameCount * mFlac->channels; return true; } diff --git a/src/thirdparty/SOIL2 b/src/thirdparty/SOIL2 new file mode 160000 index 000000000..2488385ab --- /dev/null +++ b/src/thirdparty/SOIL2 @@ -0,0 +1 @@ +Subproject commit 2488385abca9677a59afb3f809b4ebe133f1098b diff --git a/src/thirdparty/efsw b/src/thirdparty/efsw new file mode 160000 index 000000000..33d6ce34a --- /dev/null +++ b/src/thirdparty/efsw @@ -0,0 +1 @@ +Subproject commit 33d6ce34a53d2b2c5dfb856570c8c259fce2682a