Commit graph

15393 commits

Author SHA1 Message Date
joris
a34a1b8828 Fix compilation with MSVC 2012-02-14 12:01:26 +01:00
joris
0b6296d96f NewResetPath is now a method in COrder instead of a Macro 2012-02-13 15:44:20 +01:00
joris
6341a4cafd Clean up :
- use reference,
- remove dead code (class AiTransportRequest)
2012-02-13 15:24:12 +01:00
joris
7b2f40f2f1 Fix warning with gcc 2012-02-13 15:21:29 +01:00
joris
2308356ddb Use delete with new instead of free. 2012-02-13 12:41:37 +01:00
joris
79d5c7c344 move inner class CUnit::Corder to actions.h 2012-02-13 12:28:38 +01:00
joris
a8892060d1 CUnit::SavedOrder is now a pointer. 2012-02-12 11:28:35 +01:00
joris
ec080631d9 Use less memory in AiCollectResources.
use std::sort instead of qsort.
2012-02-11 16:06:33 +01:00
joris
12e8eb6846 Replace some COrder in CUnit by pointer.
Begin to have order and action more linked.
2012-02-07 14:15:16 +01:00
joris
0bd9d6ad4c Move order data from CUnit to COrder. 2012-02-06 14:49:52 +01:00
joris
e4e9e51c22 Fix bug in AStarMarkGoal with maxRange > 2 2012-02-03 14:53:48 +01:00
joris
a3c5e8f5c8 Fix bug in AiAttack which set unit.GroupId to 0.
(Force[force].Reset() should be placed before the loop)
Remove the behavior of changing of force index (since it doesn't work befor and it is strange)
Some clean up.
2012-02-03 14:52:55 +01:00
joris
7eb7972e5b Merge.
seem that my previous change have been overwrited :-/
2012-01-26 13:53:36 +01:00
Pali Rohár
29078444ef Merge network submodule from boswars-engine to stratagus 2012-01-24 18:41:56 +01:00
joris
09f642805e Fix ActionRessource and DeassignWorkerFromMine 2012-01-23 11:59:13 +01:00
joris
04c20eb84d Fix warning. 2012-01-23 11:42:20 +01:00
joris
e61a271d9c Fix warning in guichan : variable set not used. 2012-01-23 11:22:11 +01:00
joris
350b038d3b clean up : remove unused function UnitFindMiningArea
replace some x,y by pos
add const, and replace pointer by ref
2012-01-21 14:03:16 +01:00
joris
19bb9fbd75 Fix pathfinding to tree 2012-01-20 13:39:49 +01:00
joris
48fb47ce8f Fix autoattack for still action : Now tower attacks correctly in wargus.
some clean up
2012-01-20 10:58:56 +01:00
joris
673885a12d Remove most warnings for variable set but never used. 2012-01-19 11:19:45 +01:00
Pali Rohár
a1e9861094 cmake: Add sections for tolua pkg files and doxygen depends files
Also remove file names with '*' and then cmake with ninja works too
2012-01-17 01:25:05 +01:00
feb
e45bb6b2bf Do not show waypoints for enemy units when SHIFT key is pressed down.
Fix by Pali Rohár in the stratagus engine 
(http://bazaar.launchpad.net/~stratagus/stratagus/trunk/revision/7857).

Reported by cybermind (https://bugs.launchpad.net/stratagus/+bug/633863).
2012-01-08 12:11:40 +00:00
Pali Rohár
b9af3a9754 Fixed segfault, patch by Neil Tan 2012-01-07 16:50:59 +01:00
Pali Rohár
780a035f95 Fixed problem: unit unable to find path to goal if unit is next to goal
Patch by Neil Tan
2012-01-07 16:49:03 +01:00
Pali Rohár
84d1fe7fcd Fixed problem: worker unable to do anything after building structure
Patch by: Neil Tan
2012-01-07 16:47:40 +01:00
Pali Rohár
8d4e9572f5 Fixed compilation on Maemo with Touchscreen 2012-01-02 23:13:23 +01:00
Pali Rohár
281029f150 Fixed maemo-extract header 2012-01-02 11:37:51 +01:00
Pali Rohár
edf5f9dda3 maemo-extract: fix message string 2012-01-02 10:49:25 +01:00
Pali Rohár
8d61a78d5a Fixed compile errors in stratagus-maemo-extract.h 2011-12-31 20:34:31 +01:00
Pali Rohár
b160633444 Fixed compile errors on Maemo 2011-12-30 13:24:23 +01:00
Pali Rohár
c2cb48c3b9 Fixed compile errors on OpenBSD 2011-12-30 11:44:30 +01:00
Pali Rohár
630fc2c65c Release version 2.2.6 2011-12-24 16:16:33 +01:00
Pali Rohár
98803131db Fix stack overflow on MinGW32 2011-12-24 16:16:18 +01:00
Pali Rohár
125132b62a CMake: add option ENABLE_STRIP for stripping all symbols from executables 2011-12-19 18:16:02 +01:00
Pali Rohár
c748bca93d Fixed debian/control 2011-12-19 14:10:57 +01:00
Pali Rohár
21b9b9935c Fixed help string 2011-12-19 12:18:59 +01:00
kon
d366d92838 Don't recognize tilde syntaxes in text input fields
If the user types something like "foo~!bar" in a TextField widget,
then display the tilde as is; the "~!" there does not mean that the
next character is a hot key.  The user is not supposed to know about
any such syntax.

Implemented by having a parallel plain-text CFont that Lua code then
assigns to each TextField it creates.  The plain-text CFont shares
textures with the markup CFont, so the memory cost is minimal.

(Originally, I was instead going to implement this by adding a syntax
parameter to gcn::Font::drawString and all related functions.  That
however was the wrong choice because e.g. gcn::ImageFont::drawString
then had to take the parameter but had no idea what to do with it.)

Plain-text fonts can be used in all other widgets too, such as list
boxes or labels.  This commit does not make any such widgets use them
though, and the choice of font does not currently affect how the
engine checks whether the widget has a hot key defined.
2011-12-07 00:20:25 +00:00
kon
6095035ceb gcn::DefaultFont::drawString: Correctly increment x
This was doing x += getWidth(text) after drawing each glyph,
but getWidth returns the width of the whole string, thus being
wrong if the string contains more than one glyph.
drawGlyph has already been documented as returning the width
of the single glyph, so use that instead.

This fix is not particularly important, because gcn::DefaultFont
is only a fallback for when the correct font has not been set.
2011-12-06 19:27:33 +00:00
kon
cdb7709b26 CSerializeLua::AppendLuaValue: Pass index to lua_toboolean.
Do not assume the Boolean value is at the top of the Lua stack,
although it currently always is because CSerializeLua::AppendLuaFields
does not support Boolean values as keys in the table.
2011-12-02 23:23:11 +00:00
kon
f2b2b08ea6 Initialize AiState before StartEditor
Fixes https://savannah.nongnu.org/bugs/?34929

Also, add an assertion to make this kind of bug easier to understand.
2011-11-28 22:20:27 +00:00
kon
aa2faaebff Save AI state in AiState[AiPlayer()] 2011-11-27 20:05:31 +00:00
kon
57fdc83822 Replaced AiList and _ai_scripts_ with AiTypes
Also replaced RegisterAi and DefineAi with DefineAiType,
which now takes a table rather than a set of parameters.
This table is the object that DefineAiType adds to AiTypes.
The keys of the table are constant strings, not numbers.

The purpose is to make the engine more aware of AI initialization
functions, although this commit doesn't yet get that far.
2011-11-27 20:05:19 +00:00
kon
573af8e55a SaveGlobal: Support sparse integer keys
After assignments such as
  test = {};
  test[42] = 61;
  test[69] = 105;
SaveGlobal used to serialize the variable like this:
  test={61
  , 105
  }
Which was wrong because the keys then became 1 and 2,
rather than 42 and 69.  Fix SaveGlobal so that it outputs
numeric keys where necessary.

While at it, make some more changes:
- Wrap the related functions in a new class, CSerializeLua.
- Append the output into an std::vector, instead of duplicating
  strings everywhere.  This makes it easier to ensure that
  no memory will leak.
- In the global environment, forbid keys that begin with a digit.
- In other tables, allow arbitrary strings as keys.
- Forbid tables that have metatables.
- Blacklist _G (previously a separate check) and AllowedUnits
  (previously blocked by the dashes in its key strings).
- Nicely indent the output with tab characters.
2011-11-27 18:37:14 +00:00
Pali Rohár
8be0752ec3 Fix debian dependences for package stratagus-dev 2011-11-07 11:06:24 +01:00
Pali Rohár
3ce0fc416d Fixed definitions in gameheaders for proper generating doxygen doc 2011-11-06 20:39:07 +01:00
Pali Rohár
3ace22754f Update Doxyfile (with header and footer) to version 1.7.4 2011-11-06 17:50:32 +01:00
Pali Rohár
1eb620711e Make doxygen documentation files with relative paths, add generated file tolua.cpp to doxygen too 2011-11-06 16:53:50 +01:00
Joris Dauphin
08add126f4 Clean up :
Create functions
Move some functions
Move some globals into a class.
2011-10-25 14:09:38 +02:00
Joris Dauphin
7398355e9f Revert file which should not be commited 2011-10-17 20:36:07 +02:00