This commit is contained in:
Anselme 2017-08-28 17:17:11 +02:00
commit 925faa7717
130 changed files with 1325 additions and 248 deletions

1
.gitattributes vendored
View File

@ -10,3 +10,4 @@
*.khe filter=lfs diff=lfs merge=lfs -text
*.7z filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.xcf filter=lfs diff=lfs merge=lfs -text

3
.gitignore vendored
View File

@ -2,4 +2,5 @@ build*
*.user
deploy/config.ini
deploy/imgui.ini
deploy/*.exe
deploy/*.exe
deploy/libstdc++-6.dll

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:45812db95bd21535b6a14db30c949d67aa39545b9dd1866c103da6b74e1c62b1
size 49196

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:daf58d6d059395121cfff3340645b1790fce56c988d5414b29d393e5f64c90cc
size 49196

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:904069dc6c60ed9823d6379827fe6434b3a05a7331631a508f6f4b96eb208a7a
size 49196

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3f4864454868b3c5b7625e82584e6a28adb1b8727e96266984c4dfc23850f25d
size 49196

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:08a8539cdb09329b5404e2aef67265c4bade0d7761474cd650450d94cb2b9493
size 49196

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d835a097cb53d3e43ffb3e4be852c2047c8fdfed8c9d8eb218cefb2147bf3f74
size 49196

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c2744d10d39572868f161f77fee1e6c6114348b31bd735d0535119d956df330e
size 442368

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fdfb67810a152660d7ddaa702e1bf8ead86cefe3f44cef45f97b34f2f8d8e00b
size 9673
oid sha256:5d2bc01b2b7aaf394acb0ec5338516465e1c9e2780cd8452330f5d287c6a271e
size 90112

BIN
deploy/data/placeholder_metallic.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
deploy/data/placeholder_roughness.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8e2729d1b53d001080f0e4709b597a8103a98564c7e8b40753158c7a8c0744a2
size 75
oid sha256:14a8c4e1ff1636ce10365e4346a7525228929c5dec6c4edc61c3158200174abc
size 135

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:84dd7a98e4102ce03cd8067bca5b395f63129ab68fd21f6e5114bb4ba7e085c8
size 365831
oid sha256:99a23ed6dc26e87d4b9e21addfdc636288211764879582a5299e39f5cc488a10
size 161050

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:936d3c5ea0589cb0600ae0d7116cafd2792e025055e0a3b7eb4ecfda2291e93b
size 12582930

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:68288c1a11df99056d5009ddf67accc5f52677ceff0c990152ef4b643ee2e8c4
size 12582930

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4ce096e0ce8da69464a183c9d80ea9e7937b4e960ef2774237f2a6ade2bddf50
size 241711

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7bce18ac878bf0df16f9a55d881ab076a074c257b7c24f40249ddd77d43d36c6
size 2848272

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:58192d9fa5dcbc58884d90db48469197561b4b8d49d7a39c71b4521743fdc4b2
size 12582930

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:087883d665611ebec43e4b3e10abb10595a40bdd1084dbd350c1f0b4f59f542e
size 12582930

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e916551b97b12ebd31228fe8ccc06523cc7ac98eee1daa76032b8fee1b0cee11
size 769437

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:47a24fd77edac34fbd9b9031754624e1fca3c047830b0820654b74e202969891
size 757939

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b7b25f9cfdaa42f9ea37596e07edc120df9261c0c695ab3cead68d7c646c2a73
size 737349

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c1d5aee7e0a4041674f1ce844fbfd194972e6968002e05570c098e65530c862b
size 766552

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:037b77efe579a762a1acc920388d4da1d16658893179502324ee89598eb69cff
size 704063

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cc2c22f138ad728700079827f0202a91dcd7c5be10d683c887c0b2970def5d95
size 626448

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c1baaa3242ba7698b15abc9aaf5c7c3204e58292f59228824279fa52cdb89b05
size 49196

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8f4b359239337835920df3a5daccce444dcf460042b98d2fa3939fe9547b8b80
size 49196

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f4121e8341bfab6af25dfdb1c7a53fe21fd43f2096dc36418c0d6829575b609a
size 49196

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f7e278b2b3ca38f5dd9cd23e8f515414c164674f423a0647d370235691de6392
size 49196

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:00b22806b3a4c783ef2940a41b737e3cc3514f61c132d572570b667cec9fe267
size 49196

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bc714292c57032f7b2240406895e1ac615e4a6712e20d8eea7bf6bda9f06fe80
size 49196

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6efcbf14235195b091b931afe485161faec35e00387d09f26f95bc11a7576d7f
size 984770

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ebfc03ca277689fa7599d13bd68e87504f6a5a567096b87ca3bd275612ef110c
size 920695

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:01b5ffa6298bbf3ce0c18ac64a6a0f26fc41b9e0f97f621c0e1ce24912571335
size 969866

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8a0859370df4e5c0344b4aac3b3d560a2c2028e3d39157a5b4b9c73a13558c2f
size 828251

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:64d1fe87044df58be2684c6e23d22bb26bade269967b696c329fd2aa8f1e9c15
size 441172

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f54c2adf921ff84237b09192cb4264ea61702930f5c7359b13561f4b19ee08e1
size 874231

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:333fecf8797a6544af2e52322d1eb008157dd85e94e6f79db041a6ba4f9336d2
size 196652

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:08f71d708e9d5d59a494950c75449dc28c67b6506d870402f8a666cf7a997efe
size 49196

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2c25024509999c76ad9efe170738e1483ea17ca2db9b8524e052956eeeaaedbf
size 12332

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7097ad8a89a6f3af9647f700f0d26ac087840e52a84099510e1b80fb003fa84d
size 3116

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4a7a2b4e2292d84840020583caa71c402ca126ae6428351fda4f035327487090
size 812

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7b56b99b2544af4ee9d59c8a8dba10187da143f25402b3acdb139995ff52cbfd
size 236

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:416310b4a3f4d37ed6504457bb8190d20b5272d75c12eb1413a5bae8cd74c48e
size 92

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:373f8428acfefda452bf911c1ebfb2f350df3209b1e4b282992fa10105588c60
size 196652

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5af91cbc5db96a8b88bb4e551d0ba0dea7bb5bf45b8c1c72c1653de7286427fa
size 49196

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2377e72db989c13092b75a315578e6db558fc3b321457d4de4c15df97abc7540
size 12332

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e651764a88659811d324142561ac6aa1af3f7715101ecde0d4f6bf543c0e903a
size 3116

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5a3ada5ab96b4527391564c32623de9edacaf3e9b09bd85bd5124a3c55825ae6
size 812

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3b72bde41cea39f7bb135c7e8a417b77c18d43adcc22d5c6b25cd70dd6eda69f
size 236

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3bf3ffc2ea6e6c26aeae7c5604ed5faa2e34c645c0dd93008a7de2a6cec15019
size 92

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4e45c458624b60f6643b792bae38d9fdb0e2ce09e0017e57413cac6d088526a6
size 196652

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:93dc1b44a9e8c4d97936a3d6905f1f05487c9d7f40a06b1671aea4b63687629f
size 49196

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:88ab3af933739bbaa9249e0280fef5133e9880c72cb8ffd37bc9dacc4c71b691
size 12332

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5d421cb3efd11a343e14d2a6554c68c70c8f6dbb290bfe6bf360d63d052a5823
size 3116

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:947ea79f3e73b0abf28be86765cd856a6fb563aabe32c5da5d501b20dac95d7a
size 812

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d28cbd7ebddab169c2173978c9c81e74061b224e5855b199ca6537bf3a239e70
size 236

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6d472dfce75085ff25ba3e23829f23d2447b247b78c615ad8cec10da04169558
size 92

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:60be6c064bcb36d3d762547e8698e5f68f084071a3ed66721c915afc9a8e6f21
size 196652

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c277d76ba3899b71db2e4eae36a23188db4537aaeeaa8332c2e2a3332458a5fd
size 49196

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:29e252f5dc01e7268af321662d983fd04ae034ff95c87da1a84352b6c39cea8a
size 12332

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e6329d770f72439a9972be6c7924f62815894a21dd64fcb5d9655319a32d01f1
size 3116

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b0f067a63e0a07bb3b46d1aa41b7e9af4bc9c9a646d891390c12dceb4789fcf3
size 812

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7013ee41b72266d21185a7dd0a9befa330687db228b13e63a4a08b9f4b1016ec
size 236

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ea743089b0a17b78595995eda9a52e2915585c22bb1489b00a72c0a8bd4e53e6
size 92

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3d5beee5ddf88e9adeba84cb7210e6855f8f8cbb9b902afdf4dbd06419a53537
size 196652

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a0449d6dbafc88beb246817625317893b9926ee9cf10860b3a10ddf43d239f2b
size 49196

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6f1808e3adc6abfbab52e9d972cccd9ffd04f4903ebd3e794d628bdd62030e2a
size 12332

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7f4eac30e58b0dc2d05d392b8fe3c4019012e41a8745bbdf104903490efec650
size 3116

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bb236d64b7e41e297e6b5553c9660fcee9eaf6dde03da8f642102dff163b7cf0
size 812

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f742960ac07dba64a8ca5fc8e1b8c73565e175b8e35b19ad61a316cd48fb4ab5
size 236

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:18d6f1b5259741b319bfea4736da0832448beb1e02dcdbff108bd87125f2ae31
size 92

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:10d29620fed7c07a8106501d3079f917e64b66447850f3f3d89069f9e0a4be72
size 196652

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:28b757b41ad55e7b008e599832063c3e206f14b3d1cd10c3c1e531ef08b03f54
size 49196

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4032c4118ba7c21636405a9cd70d82e210de016090b155be5f5546b637c6abb4
size 12332

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1ad4a9a7848931af6d42719cc8ee1f6347a8f20621e4e14b7519c4ae072ad202
size 3116

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bd569691d35e6968f8a0baa4326b4ca4af2602880ad879d0b853fee97124c101
size 812

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1251d21c9e3f07f0f1c27c09b17be7b5aeaae51d60809a4432007d5f5ca6463c
size 236

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f6b1b62b71cb4d758b1f0712a227e23795346d94ccd101b57a4a31be9ac044ff
size 92

Binary file not shown.

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:162ceea8b3cc087aa4bcb25db70a88b433649e6e8a7f491ba50cc2581585bf47
size 7314341

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:16ab4394f49880fe64b2a6405592a0325367f184d4829d8219612aef91c05f18
size 15009

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ce7fa8504ccc7ef77e9dcb16bd1e1043797de43783dfbe472bf52ffb6e65da56
size 7533234

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3c3f730b52ba57e9b5f64490b27a702b38222d043264d3e414722dbe5bac6bd1
size 4799103

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:40ba8f1ef59a9cfda99149b0aca367e9211f130da99a9fdfc547cedfa1a4bcb4
size 6474

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4c21a445fb923a8c0afe279135470f1da0290dd43b4f0ebcdcad458374fcb536
size 1335112

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:07f3c88595d842cf1cd40d4c9bebb4e82e97ae850d9a80500d4fd56a785e902b
size 19626

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5c7f0e3e6fc1725c71257cf4192792ef03c79d98cf0fa515189dadb04bb785cd
size 2982336

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:21173927cb0e81a2acbc0e4e8382293c08d8e633f47caa3ce76f870b56b6d561
size 129
oid sha256:e27f98dd3a63a908e4afdbeddba84670faf89d31e7a25c0dcaf642cda5cf7c37
size 229

38
deploy/data/woodbox.pack Normal file
View File

@ -0,0 +1,38 @@
{
"TextureResource": [
{
"woodbox albedo",
"woodframe_albedo.png",
24,
1,
1
}
{
"woodbox roughness",
"woodframe_roughness.png",
8,
1,
1
}
{
"woodbox metallic",
"woodframe_metallic.png",
8,
1,
1
}
{
"woodbox normals",
"woodframe_normal.png",
24,
1,
1
}
],
"ResourcePack": [
{
"woodbox",
[{"TextureResource", 0}]
}
]
}

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6bad25466e6184902ee2c2ec7d47f8ae112943d3c92fca387a5b41da0b42a2a5
size 6976127

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:289e65cf6fa41d6c00a62cde57ffb20dbe5f1de6b3e6a3ef4d8a7de8f41524bd
size 15007

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:25c6e56846639f176e8d9ef756b5df8329cba6cd0117812dc79dfa2892ccf560
size 6869334

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f714f443197a22e6f7148004b344f0081f9c7667b85429472d38b9190af43d79
size 1822076

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:544d488fcfd76749c5ef2cd6bf9f73cc9fe59a86a819d369d710cca6e43cf4b1
size 1540622

View File

@ -6,9 +6,9 @@
class DefaultKeysMap : public IKeysMap
{
public:
enum{MAIN_ACTION, SECONDARY_ACTION, TERTIARY_ACTION, MOVE_FORWARD, MOVE_BACKWARD, STRAFE_LEFT, STRAFE_RIGHT, JUMP,
enum{MAIN_ACTION, SECONDARY_ACTION, TERTIARY_ACTION, MOVE_FORWARD, MOVE_BACKWARD, STRAFE_LEFT, STRAFE_RIGHT, JUMP,RUN,
TOGGLE_NOCLIP, TOGGLE_PHYSICS_DEBUG, TOGGLE_CONSOLE,
MOVE_CURSOR_LEFT, MOVE_CURSOR_RIGHT, TOGGLE_MOUSE_CURSOR, LEFT_CLICK,
MOVE_CURSOR_LEFT, MOVE_CURSOR_RIGHT, HISTORY_UP,HISTORY_DOWN, TOGGLE_MOUSE_CURSOR, LEFT_CLICK,
EXIT_GAME,LAST_DEFAULT_ACTION};
DefaultKeysMap(){
@ -16,15 +16,18 @@ public:
keys.push_back( {{SECONDARY_ACTION,input::MOUSE}, sf::Mouse::Right, IKeysMap::PRESSED} );
keys.push_back( {{TERTIARY_ACTION,input::MOUSE}, sf::Mouse::Middle, IKeysMap::PRESSED} );
keys.push_back( {{MOVE_FORWARD,input::KEYBOARD}, sf::Keyboard::Z, IKeysMap::HOLD} );
keys.push_back( {{MOVE_BACKWARD,input::KEYBOARD}, sf::Keyboard::S, IKeysMap::HOLD} );
keys.push_back( {{MOVE_BACKWARD,input::KEYBOARD}, sf::Keyboard::S, IKeysMap::HOLD} );
keys.push_back( {{STRAFE_LEFT,input::KEYBOARD}, sf::Keyboard::Q, IKeysMap::HOLD} );
keys.push_back( {{STRAFE_RIGHT,input::KEYBOARD}, sf::Keyboard::D, IKeysMap::HOLD} );
keys.push_back( {{RUN,input::KEYBOARD}, sf::Keyboard::LShift,IKeysMap::HOLD} );
keys.push_back( {{JUMP,input::KEYBOARD}, sf::Keyboard::Space, IKeysMap::PRESSED} );
keys.push_back( {{TOGGLE_NOCLIP,input::KEYBOARD}, sf::Keyboard::G, IKeysMap::PRESSED} );
keys.push_back( {{TOGGLE_PHYSICS_DEBUG,input::KEYBOARD},sf::Keyboard::P, IKeysMap::PRESSED} );
keys.push_back( {{TOGGLE_CONSOLE,input::KEYBOARD}, sf::Keyboard::F3, IKeysMap::PRESSED} );
keys.push_back( {{MOVE_CURSOR_LEFT,input::KEYBOARD}, sf::Keyboard::Left, IKeysMap::PRESSED} );
keys.push_back( {{MOVE_CURSOR_RIGHT,input::KEYBOARD}, sf::Keyboard::Right, IKeysMap::PRESSED} );
keys.push_back( {{HISTORY_UP,input::KEYBOARD}, sf::Keyboard::Up, IKeysMap::PRESSED} );
keys.push_back( {{HISTORY_DOWN,input::KEYBOARD}, sf::Keyboard::Down, IKeysMap::PRESSED} );
keys.push_back( {{TOGGLE_MOUSE_CURSOR,input::KEYBOARD}, sf::Keyboard::M, IKeysMap::PRESSED} );
keys.push_back( {{EXIT_GAME,input::KEYBOARD}, sf::Keyboard::Escape,IKeysMap::PRESSED} );
keys.push_back( {{LEFT_CLICK,input::MOUSE}, sf::Mouse::Left, IKeysMap::PRESSED} );
@ -41,6 +44,7 @@ public:
{STRAFE_LEFT,input::KEYBOARD},
{STRAFE_RIGHT,input::KEYBOARD},
{JUMP,input::KEYBOARD},
{RUN,input::KEYBOARD},
{TOGGLE_NOCLIP,input::KEYBOARD},
{TOGGLE_PHYSICS_DEBUG,input::KEYBOARD},
{TOGGLE_MOUSE_CURSOR,input::KEYBOARD},
@ -55,7 +59,9 @@ public:
{TOGGLE_CONSOLE,input::KEYBOARD},
{EXIT_GAME,input::KEYBOARD},
{MOVE_CURSOR_LEFT,input::KEYBOARD},
{MOVE_CURSOR_RIGHT,input::KEYBOARD}
{MOVE_CURSOR_RIGHT,input::KEYBOARD},
{HISTORY_UP,input::KEYBOARD},
{HISTORY_DOWN,input::KEYBOARD}
};
}

View File

@ -13,6 +13,8 @@
#include "scene/physicsdebugnode.h"
#include "imgui/imgui.h"
#include "tools/loader.h"
#include "guitools.h"
#include "tools/loadingthread.h"
Engine::Engine() :
m_window(nullptr),
@ -23,7 +25,8 @@ Engine::Engine() :
m_toggleShellAction(NO_ACTION),
m_exitGameAction(NO_ACTION),
m_showMouseAction(NO_ACTION),
m_mouseVisible(true)
m_mouseVisible(true),
m_pickerEnabled(false)
{
m_clock = new sf::Clock();
m_clock->restart();
@ -32,6 +35,7 @@ Engine::Engine() :
Engine::~Engine()
{
LoadingThread::destroy();
delete m_clock;
delete m_renderer;
if(m_window != NULL)
@ -62,6 +66,8 @@ void Engine::createWindow(std::string title,
m_input = new Input(m_window);
m_renderer->initGL(w, h);
m_sparrowshell = new SparrowShell(m_window);
m_guiTools = new GuiTools();
m_loadingThread = LoadingThread::init();
}
void Engine::initPhysics()
@ -88,13 +94,12 @@ void Engine::update()
io.DeltaTime = float(getDeltaTime()) / 1000.;
ImGui::NewFrame();
// test gui
// settings gui
{
static bool testGuiOpen = true;
if(testGuiOpen)
static bool settingsGuiOpen = true;
if(settingsGuiOpen)
{
ImGui::Begin("Test imgui Window", &testGuiOpen);
ImGui::Text("Hello, world!");
ImGui::Begin("Window Settings", &settingsGuiOpen);
ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate);
bool physicsDebugEnabled = (m_physicsDebugNode != nullptr);
if(ImGui::Checkbox("Toggle physics debug", &physicsDebugEnabled))
@ -107,11 +112,7 @@ void Engine::update()
bool isMouseVisible = m_mouseVisible;
if(ImGui::Checkbox("Mouse cursor ( shortcut : [M] )", &isMouseVisible))
toggleMouseVisibility();
if(ImGui::Button("EXIT GAME"))
stop();
float gravity = - m_world->getGravity().y();
if(ImGui::SliderFloat("Gravity", &gravity, 0.f, 100.f))
m_world->setGravity(btVector3(0, -gravity, 0));
ImGui::ProgressBar(m_loadingThread->getTotalProgress());
ImGui::End();
}
}
@ -124,11 +125,13 @@ void Engine::update()
{
m_physicsDebugNode->clearBuffers();
m_world->debugDrawWorld();
getScene()->registerMeshType(m_physicsDebugNode->getFlags());
}
}
// update Scene
getScene()->update();
getScene()->updateShaders();
// update Display
if(m_input->isResized())
@ -176,10 +179,13 @@ void Engine::setScene(std::string scene)
}
previous_scene->getRootObject()->removeChild(m_sparrowshell);
previous_scene->getRootObject()->removeChild(m_guiTools);
m_renderer->setScene(new_scene);
m_renderer->resizeGL(m_window->getSize().x, m_window->getSize().y);
new_scene->getRootObject()->addChild(m_sparrowshell);
new_scene->updateShaders();
new_scene->getRootObject()->addChild(m_guiTools);
}
void Engine::enablePhysicsDebug()
@ -190,7 +196,6 @@ void Engine::enablePhysicsDebug()
getScene()->addToIndex(m_physicsDebugNode);
m_world->setDebugDrawer(m_physicsDebugNode);
m_world->getDebugDrawer()->setDebugMode(btIDebugDraw::DBG_DrawWireframe);
getScene()->updateShaders();
}
}
@ -205,6 +210,7 @@ void Engine::disablePhysicsDebug()
}
}
void Engine::toggleMouseVisibility()
{
m_mouseVisible = !m_mouseVisible;
@ -263,7 +269,7 @@ void Engine::checkSpecialInputs()
void Engine::createScene(std::string scene_name)
{
RESOURCE_ADD(new SceneTree(*this),SceneTree,scene_name);
RESOURCE_ADD(new SceneTree(*this), SceneTree, scene_name);
//return new SceneTree(*this);
}

View File

@ -8,6 +8,8 @@ class SparrowRenderer;
class SceneTree;
class SparrowShell;
class PhysicsDebugNode;
class GuiTools;
class LoadingThread;
namespace sf
{
@ -34,6 +36,7 @@ public:
void disablePhysicsDebug();
void toggleMouseVisibility();
bool isMouseGrabbed() const { return !m_mouseVisible; }
// special inputs
void setTogglePhysicsDebugAction(int action);
@ -49,11 +52,14 @@ public:
SparrowRenderer* getRenderer() const {return m_renderer;}
btDiscreteDynamicsWorld* getPhysics() const {return m_world;}
SparrowShell* getShell() const {return m_sparrowshell;}
GuiTools* getGuiTools() const {return m_guiTools;}
LoadingThread* getLoadingThread() const {return m_loadingThread;}
SceneTree* getScene() const;
unsigned int getTime() const;
unsigned int getDeltaTime() const;
// SceneTree* createScene();
void createScene(std::string scene_name);
//void setCurrentScene(std::string scene_name){m_current_scene = scene_name;}
@ -73,6 +79,8 @@ private:
btDiscreteDynamicsWorld* m_world;
PhysicsDebugNode *m_physicsDebugNode;
SparrowRenderer* m_renderer;
GuiTools* m_guiTools;
LoadingThread* m_loadingThread;
void update();
@ -81,6 +89,7 @@ private:
int m_exitGameAction;
int m_showMouseAction;
bool m_mouseVisible;
bool m_pickerEnabled;
void checkSpecialInputs();
};

Some files were not shown because too many files have changed in this diff Show More