Commit Graph

10220 Commits (ipv6)
 

Author SHA1 Message Date
Julius Michaelis 55b6713185 Dedicated server: stop game when there are less than 2 clients 2016-10-30 21:36:29 +01:00
Julius Michaelis 890669ea0d Silence a warning from getopt when using --config 2016-10-30 21:36:29 +01:00
Julius Michaelis 65940080a7 Remove two unused config options, set music to default off with the dedicated.
I admit that this is just a hack to silence some warnings by default.
2016-10-30 21:36:29 +01:00
Julius Michaelis 64dd72c380 Fix dedicated: Load JPEG surfaces so the texture shape information can be correctly generated 2016-10-30 21:36:29 +01:00
Lukas Werling 63cc42e967 Improve script shader code
- Avoid std::list.

 - Don't pass strings and vectors by value.

 - Don't try to update script shader slices as they never change.
2016-10-30 12:06:01 +01:00
Julius Michaelis 29b5fa5946 Fix include: no "src/" 2016-10-30 01:21:44 +02:00
Lukas Werling 5da45d68e1 Add docs for AddFragmentShader/RemoveShader 2016-10-29 21:22:12 +02:00
Lukas Werling 13fa0ab7b1 Implement adding/removing shaders from script
New script functions: AddFragmentShader, RemoveShader.

There is currently no support for adding vertex shaders.
2016-10-29 21:19:08 +02:00
Julius Michaelis 9ab410e47d SDL: Notify C4Application of resolution / window size changes. 2016-10-29 14:15:09 +02:00
Nicolas Hake bce0b45413 Editor: Fix scheduler timer so it doesn't busy wait (#1834)
36/1000 is always 0 and doesn't make a lot of sense anyway. Use 1000/36
(aka 1000ms/36fps) instead so the UI thread has some time to rest.

Also use a Qt::PreciseTimer so Qt doesn't try to coalesce the scheduler
timer with other timers to save energy.
2016-10-28 21:31:14 +02:00
Sven Eberhardt f2231e848e AulCompiler: Fix static parameter type check 2016-10-24 22:00:30 -04:00
Sven Eberhardt 2b6eb83e48 Fix some parameter count errors 2016-10-24 21:28:31 -04:00
Sven Eberhardt 591b20b6ca Fix some variable name shadowing errors 2016-10-24 21:21:55 -04:00
Sven Eberhardt 0d20551ab6 Fix some "function variable hides local variable" warnings 2016-10-24 21:05:17 -04:00
Sven Eberhardt 342916a1ed Fix some implicit for loop declaration errors 2016-10-24 21:02:02 -04:00
Sven Eberhardt 7f543e8390 Add AI control UserActions 2016-10-24 21:02:02 -04:00
Sven Eberhardt 2e73343814 EnemyAI: Add "active" setting
This allows disabled AI clonks (to be used by UserActions)
2016-10-24 21:02:01 -04:00
David Dormagen 83260c5e69 Key object: updated graphics
This one has a higher resolution and should also look decent when bigger (e.g. as an inventory picture). Made by me with Blender.
2016-10-24 18:12:45 +02:00
Julius Michaelis e61dcbe4c3 Extend the netpuncher: clients can ask hosts for a connection initiation to circumvent port restricted NATs 2016-10-23 22:34:43 +02:00
Julius Michaelis 078ac47780 Add CMake option for headless-only build. 2016-10-23 22:34:42 +02:00
David Dormagen c2f391e565 editor: don't crash on selecting object when EditorBase doesn't have member EditorProps
This crash happened for me in a custom scenario but with unmodified original objects. No idea why, but it seemed defective anyway.
2016-10-23 18:47:44 +02:00
Sven Eberhardt 8fb8be9cec Sequence: Store trigger offset to allow non-synchronized triggers at the same interval 2016-10-23 00:20:26 -04:00
Julius Michaelis 072c4a3475 Fix windows build: link libpng to libopenclonk
Attempt #2
2016-10-22 21:33:10 +02:00
Julius Michaelis b658f6aeed Fix windows build
Attempt #1
Make that 26 compilation units saved.
2016-10-22 19:59:23 +02:00
Julius Michaelis f72bfc72a3 Add a libopenclonk target to save compiling some units twice
Unfortunately, only 27 units could be deduplicated with the current state of USE_CONSOLE.
2016-10-22 18:28:25 +02:00
Julius Michaelis 3c5dde1293 .gitignore 2016-10-22 17:42:23 +02:00
Julius Michaelis 376ca5a9df Prevent using USE_CONSOLE in lib{misc,c4script} 2016-10-22 17:42:23 +02:00
Lukas Werling e7f4105b97 Replace duplicate BreakMessage() implementations
...with a single one based on std::string in the hope of getting rid of
StdStrBuf some day.
2016-10-22 17:00:20 +02:00
Nicolas Hake cada67c097 Prohibit overriding local vars with functions (#1831)
The old parser threw a standard compile error in this case; the
AST-based parser threw an ICE, which is ultimately the same thing but
made it sound like the parser was at fault. And maybe it is, and we
should allow code like "local a; func a() {}" but that seems like it
should be a conscious design decision.
2016-10-21 22:32:24 +02:00
Julius Michaelis 8d2f2846b5 Fix mac build
Also move some stuff around once again…
2016-10-21 01:25:48 +02:00
Julius Michaelis 5b7c5b48ee Fix mape and mac build
Attempt #1.
2016-10-20 20:36:52 +02:00
Julius Michaelis 34a9a1de8d Twiddle with header organization: lib{misc,c4script} do no longer include GL/glew.h
(Yes, it is just that complicated.)
2016-10-20 18:46:32 +02:00
Nicolas Hake e2fd7095c1 Merge branch 'ast'
# Conflicts:
#	src/C4Include.h
#	src/script/C4AulCompiler.cpp
#	src/script/C4AulParse.cpp
#	src/script/C4AulParse.h
#	src/script/C4ScriptHost.cpp
#	src/script/C4ScriptHost.h
#	tests/CMakeLists.txt
2016-10-20 17:33:02 +02:00
Nicolas Hake 266feeda4d Aul: Add AST generation tests
Just making sure the parser creates the AST the way we expect before we
hand off the code to the codegen.
2016-10-20 17:20:55 +02:00
Nicolas Hake 118961d0b7 Aul: fix octal escape parsing
Bet you didn't know C4Script supported octal escapes inside strings.
Well, it didn't; or at least not correctly.
2016-10-20 16:53:23 +02:00
Nicolas Hake 5915f79960 Don't entirely recreate global vars in second compile pass
This allows people to properly cross-reference two proplists from each
proplist's initializer.
2016-10-19 14:20:48 +02:00
Nicolas Hake 021a6e89f5 Implement direct execution of whole function definitions
This implements the changes made in c6e4bfd on the AST-based parser.
2016-10-19 14:20:47 +02:00
Nicolas Hake 1a8db9e109 Make C4ScriptHost store C4Value refs to owned functions
C4Value already handles refcounting properly for us, so we don't need to
do it manually. It might still be worth manually refcounting them
to avoid the boxing/unboxing overhead, but it's only needed at load and
unload so it's not a priority at the moment.
2016-10-19 14:20:46 +02:00
Nicolas Hake 5f3dbdd417 Reject function expressions inside proplists inside functions
These aren't supported by the codegen on account of not working in
savegames.
2016-10-19 14:20:45 +02:00
Nicolas Hake 9caaf1e298 Aul: Split out error handling into a separate class for easier testing
By using an extern error handler in the script engine, we can mock that
handler and make sure something that should fail actually does, instead
of having to parse log messages.
2016-10-19 14:20:41 +02:00
Nicolas Hake b2d5164a0f Remove re namespace alias
This alias is a legacy from when we were using Boost.Regexp to
workaround a broken implementation in GCC's libstdc++ earlier than 4.9.
2016-10-19 13:46:03 +02:00
Nicolas Hake a188500609 Remove MS CRT memory management debugging
Redefining new breaks perfectly valid code, but only on MSVC and only in
one particular configuration (Debug). This is very annoying because it
means people not using MSVC, or even people doing Release builds, can
write standards-conforming code which then may fail to build for other
people.
2016-10-19 13:46:01 +02:00
Nicolas Hake f7a04624eb Remove references to functions defined in unloading defs (#1776) 2016-10-19 13:45:59 +02:00
Nicolas Hake ab1e6bd5a4 Allow proplist-local funcs to access vars of their owner's prototype
Thanks to JCaesar for providing this test case.
2016-10-19 13:45:35 +02:00
Nicolas Hake 46f342dd0c Tests: Split test helper functions into Expr/Code/Script evaluators
RunExpr will evaluate and return the value of a single expression.
RunCode will evaluate a full function body.
RunScript will compile a complete standalone script and return the
return value of its Main() function.
2016-10-19 13:45:11 +02:00
Sven Eberhardt a0580580aa Add rdir parameter to user action object creation 2016-10-16 21:47:20 -04:00
Nicolas Hake 1b32633806 Add C4LangStringTable::system_string_table def'n to standalone stubs 2016-10-16 20:11:13 +02:00
Maikel de Vries 0d6a8497fc allow setting the rotation of an created object in editor user actions 2016-10-16 19:59:54 +02:00
Lukas Werling 2163e27661 Add documentation for SetSky() 2016-10-16 19:41:03 +02:00
Armin Burgmeier 2362a73e60 FnSetSky: open Graphics.ocg before re-loading sky (#1827)
Needed to load shader slices in C4Sky::Init.
2016-10-16 10:04:54 -07:00