Merge lp:~luke-jr/armagetronad/armagetronad-map-zone-visuals into lp:~armagetronad-dev/armagetronad/trunk-armagetronad-work

Proposed by Luke-Jr
Status: Work in progress
Proposed branch: lp:~luke-jr/armagetronad/armagetronad-map-zone-visuals
Merge into: lp:~armagetronad-dev/armagetronad/trunk-armagetronad-work
Diff against target: None lines
To merge this branch: bzr merge lp:~luke-jr/armagetronad/armagetronad-map-zone-visuals
Reviewer Review Type Date Requested Status
Manuel Moos Needs Fixing
Review via email: mp+4037@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Manuel Moos (z-man) wrote :

Nice. However, I don't think time dependant segment count is a good thing to have. The transitions just look wrong. Can we get rid of that and just have it a constant integer?

review: Needs Fixing
Revision history for this message
Luke-Jr (luke-jr) wrote :

How does it hurt? If it's just compatibility, the safest route would be to block it in the DTD if possible.

Revision history for this message
Manuel Moos (z-man) wrote :

It's just ugly, both visually and technically :) Visuals should not jump around like that, it takes the player's focus away from actually important things. And on the technical side, the number of segments IS an integer.

And yeah, I should have complained about that in the previous merge where the network sync for that was introduced already. My bad. Luckily, at this point, with no release containing the code, it's perfectly fine to switch the network type to an integer.

Unmerged revisions

874. By Luke-Jr

flyingzones test/demo map

873. By Luke-Jr

fix a few issues

872. By Luke-Jr

allow maps to set bottom, height, segments, and seglength attributes on shapes

871. By Luke-Jr

copied from map-0.3.1-c.dtd

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'resource/proto/AATeam/map-0.3.2-prealpha1.dtd'
--- resource/proto/AATeam/map-0.3.2-prealpha1.dtd 1970-01-01 00:00:00 +0000
+++ resource/proto/AATeam/map-0.3.2-prealpha1.dtd 2009-02-28 18:38:10 +0000
@@ -0,0 +1,179 @@
1<!-- version="0.3.2-prealpha1" -->
2<!ELEMENT Resource (Map)>
3
4<!ATTLIST Resource
5 type (aamap) "aamap"
6 name CDATA #REQUIRED
7 version CDATA "1.0"
8 author CDATA "Anonymous"
9 category CDATA "unsorted"
10 comissioner CDATA #IMPLIED
11>
12
13<!ELEMENT Map (Settings?, World)>
14
15<!ELEMENT Settings (Setting*)>
16<!ELEMENT Setting EMPTY>
17<!ATTLIST Setting name CDATA #REQUIRED>
18<!ATTLIST Setting value CDATA #REQUIRED>
19
20<!-- ATM, a map contain only one Field -->
21<!ELEMENT World (Field)>
22<!-- a field
23 - may have an axes declared
24 - need at least one spawn
25 - need at least one wall -->
26<!ELEMENT Field (Axes?, Ownership?, (Spawn | Wall | Monitor | Zone | Zone_v1 )*)>
27
28<!ELEMENT Axes (Axis*)>
29<!ELEMENT Ownership (TeamOwnership*)>
30<!ELEMENT Spawn EMPTY>
31<!ELEMENT Wall (Point+) >
32<!ELEMENT Point EMPTY>
33<!ELEMENT Axis EMPTY>
34<!ELEMENT Zone ((ShapeCircle | ShapePolygon), (Enter | Inside | Leave | Outside)+ ) >
35
36<!ATTLIST Map version CDATA #REQUIRED>
37
38<!ATTLIST Field logicalBox (true | false) "true">
39
40<!ATTLIST Axes number CDATA "4">
41<!ATTLIST Axes normalize (true | false) "true">
42
43<!ATTLIST Spawn x CDATA #REQUIRED>
44<!ATTLIST Spawn y CDATA #REQUIRED>
45<!ATTLIST Spawn xdir CDATA #IMPLIED>
46<!ATTLIST Spawn ydir CDATA #IMPLIED>
47<!ATTLIST Spawn angle CDATA #IMPLIED>
48<!ATTLIST Spawn length CDATA "1.0">
49
50<!ATTLIST Wall height CDATA #IMPLIED>
51
52<!ATTLIST Point x CDATA #REQUIRED>
53<!ATTLIST Point y CDATA #REQUIRED>
54
55<!ATTLIST Axis xdir CDATA #IMPLIED>
56<!ATTLIST Axis ydir CDATA #IMPLIED>
57<!ATTLIST Axis angle CDATA #IMPLIED>
58<!ATTLIST Axis length CDATA "1.0">
59
60
61<!ATTLIST Zone name CDATA "">
62
63<!ELEMENT Monitor (OnOver | OnUnder | InRange | OutsideRange)+ >
64<!ATTLIST Monitor name CDATA #REQUIRED>
65<!ATTLIST Monitor init CDATA "0.0">
66<!ATTLIST Monitor drift CDATA "0.0">
67<!ATTLIST Monitor low CDATA "0.0">
68<!ATTLIST Monitor high CDATA "1.0">
69
70<!ELEMENT OnOver (EffectGroup | ZoneInfluence | MonitorInfluence)+ >
71<!ATTLIST OnOver value CDATA #REQUIRED>
72
73<!ELEMENT OnUnder (EffectGroup | ZoneInfluence | MonitorInfluence)+ >
74<!ATTLIST OnUnder value CDATA #REQUIRED>
75
76<!ELEMENT InRange (EffectGroup | ZoneInfluence | MonitorInfluence)+ >
77<!ATTLIST InRange low CDATA #REQUIRED>
78<!ATTLIST InRange high CDATA #REQUIRED>
79
80<!ELEMENT OutsideRange (EffectGroup | ZoneInfluence | MonitorInfluence)+ >
81<!ATTLIST OutsideRange low CDATA #REQUIRED>
82<!ATTLIST OutsideRange high CDATA #REQUIRED>
83
84
85<!ELEMENT ShapeCircle (Point, Color?)>
86<!ATTLIST ShapeCircle bottom CDATA "0.0">
87<!ATTLIST ShapeCircle scale CDATA "1.0">
88<!ATTLIST ShapeCircle height CDATA "5.0">
89<!ATTLIST ShapeCircle growth CDATA #IMPLIED>
90<!ATTLIST ShapeCircle rotation CDATA "0.0">
91<!ATTLIST ShapeCircle segments CDATA #IMPLIED>
92<!ATTLIST ShapeCircle seglength CDATA #IMPLIED>
93<!ATTLIST ShapeCircle radius CDATA "1.0">
94
95<!ELEMENT ShapePolygon (Point, Color, Point+)>
96<!ATTLIST ShapePolygon bottom CDATA "0.0">
97<!ATTLIST ShapePolygon scale CDATA "1.0">
98<!ATTLIST ShapePolygon height CDATA "5.0">
99<!ATTLIST ShapePolygon growth CDATA #IMPLIED>
100<!ATTLIST ShapePolygon rotation CDATA "0.0">
101
102<!ELEMENT Color EMPTY>
103<!ATTLIST Color red CDATA "1.0">
104<!ATTLIST Color green CDATA "0.0">
105<!ATTLIST Color blue CDATA "0.0">
106<!ATTLIST Color alpha CDATA "0.7">
107<!ATTLIST Color hexCode CDATA #IMPLIED>
108<!ATTLIST Color name CDATA #IMPLIED>
109
110
111<!ELEMENT Enter (EffectGroup+) >
112<!ELEMENT Inside (EffectGroup+) >
113<!ELEMENT Leave (EffectGroup+) >
114<!ELEMENT Outside (EffectGroup+) >
115
116<!ELEMENT EffectGroup (User)>
117<!ATTLIST EffectGroup owners CDATA #IMPLIED>
118<!ATTLIST EffectGroup teamOwners CDATA #IMPLIED>
119
120<!ELEMENT User (Target | MonitorInfluence | ZoneInfluence)+ >
121<!ATTLIST User user (all | owner | ownerTeam | allButOwner | allButTeamOwner | anotherTeammate) "all" >
122<!ATTLIST User positive (true | false | ignore) "ignore" >
123<!ATTLIST User marked (true | false | ignore) "ignore" >
124
125
126<!ELEMENT Target (Effect)+ >
127<!ATTLIST Target target (self | teammate | team | all | allButSelf |
128 another |
129owner | ownerTeam | ownerTeamTeammate | anyDead |
130allDead | anotherTeammateDead | anotherNotTeammateDead |
131singleDeadOwner
132) "self" >
133<!--
134<!ATTLIST Target target (self | teammate | team | all | allButSelf |
135allButTeam | another | anotherTeam | anotherTeammate |
136anotherNotTeammate | owner | ownerTeam | ownerTeamTeammate | anyDead |
137allDead | AnotherTeammateDead | anotherNotTeammateDead) "self" >
138-->
139<!ATTLIST Target count CDATA "-1">
140
141
142<!ELEMENT Effect EMPTY>
143<!ATTLIST Effect effect (win | death | point | brakerecharge |
144rubberrecharge | acceleration | spawnplayer | setting ) "death" >
145<!ATTLIST Effect count CDATA "-1">
146<!ATTLIST Effect description CDATA #IMPLIED>
147<!ATTLIST Effect score CDATA "1"> <!-- only for point -->
148<!ATTLIST Effect settingName CDATA #IMPLIED> <!-- only for setting -->
149<!ATTLIST Effect settingValue CDATA #IMPLIED><!-- only for setting -->
150<!ATTLIST Effect value CDATA "0"> <!-- only for acceleration atm, but should be for nearly all -->
151
152<!ELEMENT MonitorInfluence EMPTY>
153<!ATTLIST MonitorInfluence name CDATA #IMPLIED>
154<!ATTLIST MonitorInfluence marked (true | false | ignore) "ignore">
155<!ATTLIST MonitorInfluence influence CDATA #IMPLIED>
156<!ATTLIST MonitorInfluence influenceSlide CDATA "0.0"> <!-- deprecated as of rev 8042 -->
157<!ATTLIST MonitorInfluence influenceAdd CDATA "0.0"> <!-- deprecated as of rev 8042 -->
158<!ATTLIST MonitorInfluence influenceSet CDATA "0.0"> <!-- deprecated as of rev 8042 -->
159
160<!ELEMENT ZoneInfluence (Rotation | Scale | Point | Color)+ >
161<!ATTLIST ZoneInfluence name CDATA #IMPLIED>
162
163<!ELEMENT Rotation EMPTY>
164<!ATTLIST Rotation rotation CDATA #IMPLIED>
165<!ATTLIST Rotation rotationAngle CDATA "0.0"> <!-- deprecated as of rev 8042 -->
166<!ATTLIST Rotation rotationSpeed CDATA "0.0"> <!-- deprecated as of rev 8042 -->
167
168<!ELEMENT Scale EMPTY>
169<!ATTLIST Scale scale CDATA "1.0">
170
171<!ELEMENT TeamOwnership EMPTY>
172<!ATTLIST TeamOwnership teamId CDATA #REQUIRED>
173<!ATTLIST TeamOwnership playerId CDATA #IMPLIED>
174
175<!ELEMENT Zone_v1 (ShapeCircle) >
176<!ATTLIST Zone_v1 effect (win | death | fortress ) "death" >
177
178
179
0180
=== added file 'resource/proto/flyingzones.aamap.xml'
--- resource/proto/flyingzones.aamap.xml 1970-01-01 00:00:00 +0000
+++ resource/proto/flyingzones.aamap.xml 2009-02-28 18:38:43 +0000
@@ -0,0 +1,48 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE Resource SYSTEM "AATeam/map-0.3.2-prealpha1.dtd">
3<Resource type="aamap" name="flyingzones" version="0.0.1" author="Luke-Jr" category="_TEST">
4 <Map version="2">
5 <World>
6 <Field>
7 <Spawn x="255" y="50" xdir="0" ydir="1" />
8 <Spawn x="245" y="450" xdir="0" ydir="-1" />
9 <Spawn x="50" y="245" xdir="1" ydir="0" />
10 <Spawn x="450" y="255" xdir="-1" ydir="0" />
11
12 <Spawn x="305" y="100" xdir="0" ydir="1" />
13 <Spawn x="195" y="400" xdir="0" ydir="-1" />
14 <Spawn x="100" y="195" xdir="1" ydir="0" />
15 <Spawn x="400" y="305" xdir="-1" ydir="0" />
16
17 <Spawn x="205" y="100" xdir="0" ydir="1" />
18 <Spawn x="295" y="400" xdir="0" ydir="-1" />
19 <Spawn x="100" y="295" xdir="1" ydir="0" />
20 <Spawn x="400" y="205" xdir="-1" ydir="0" />
21
22 <Wall>
23 <Point x="0" y="0" />
24 <Point x="0" y="500" />
25 <Point x="500" y="500" />
26 <Point x="500" y="0" />
27 <Point x="0" y="0" />
28 </Wall>
29
30 <Zone>
31 <ShapeCircle radius="100;-1" bottom="-1;0;0.01" height="-0.05;.1;.05" segments="3;0.3" seglength="1.1;-0.01">
32 <Point x="250" y="250"/>
33 <Color red="1" green="0" blue="0"/>
34 </ShapeCircle>
35 <Enter>
36 <EffectGroup>
37 <User>
38 <Target>
39 <Effect count="0" effect="win"/>
40 </Target>
41 </User>
42 </EffectGroup>
43 </Enter>
44 </Zone>
45 </Field>
46 </World>
47 </Map>
48</Resource>
049
=== modified file 'src/tron/gParser.cpp'
--- src/tron/gParser.cpp 2009-02-26 22:15:59 +0000
+++ src/tron/gParser.cpp 2009-02-28 07:48:33 +0000
@@ -740,6 +740,34 @@
740 shape->setRotation2( tpRotation );740 shape->setRotation2( tpRotation );
741 }741 }
742742
743 if (myxmlHasProp(cur, "segments")) {
744 string str = string(myxmlGetProp(cur, "segments"));
745 tPolynomial tpSegments;
746 tpSegments.parse(str);
747 shape->setSegments( tpSegments );
748 }
749
750 if (myxmlHasProp(cur, "seglength")) {
751 string str = string(myxmlGetProp(cur, "seglength"));
752 tPolynomial tpSegLength;
753 tpSegLength.parse(str);
754 shape->setSegLength( tpSegLength );
755 }
756
757 if (myxmlHasProp(cur, "bottom")) {
758 string str = string(myxmlGetProp(cur, "bottom"));
759 tPolynomial tpBottom;
760 tpBottom.parse(str);
761 shape->setBottom( tpBottom );
762 }
763
764 if (myxmlHasProp(cur, "height")) {
765 string str = string(myxmlGetProp(cur, "height"));
766 tPolynomial tpHeight;
767 tpHeight.parse(str);
768 shape->setHeight( tpHeight );
769 }
770
743 cur = cur->xmlChildrenNode;771 cur = cur->xmlChildrenNode;
744 while ( cur != NULL) {772 while ( cur != NULL) {
745 if (!xmlStrcmp(cur->name, (const xmlChar *)"text") || !xmlStrcmp(cur->name, (const xmlChar *)"comment")) {}773 if (!xmlStrcmp(cur->name, (const xmlChar *)"text") || !xmlStrcmp(cur->name, (const xmlChar *)"comment")) {}
746774
=== modified file 'src/tron/zone/zShape.cpp'
--- src/tron/zone/zShape.cpp 2009-02-27 20:57:31 +0000
+++ src/tron/zone/zShape.cpp 2009-02-28 18:38:10 +0000
@@ -163,8 +163,16 @@
163 setColor(state.get<rColor>("color"));163 setColor(state.get<rColor>("color"));
164 if (state.isset("rotation"))164 if (state.isset("rotation"))
165 setRotation2( state.get<tPolynomial>("rotation") );165 setRotation2( state.get<tPolynomial>("rotation") );
166 if (state.isset("segments"))
167 setSegments( state.get<tPolynomial>("segments") );
168 if (state.isset("seglength"))
169 setSegLength( state.get<tPolynomial>("seglength") );
166 if (state.isset("scale"))170 if (state.isset("scale"))
167 setScale( state.get<tFunction>("scale") );171 setScale( state.get<tFunction>("scale") );
172 if (state.isset("bottom"))
173 setBottom( state.get<tPolynomial>("bottom") );
174 if (state.isset("height"))
175 setHeight( state.get<tPolynomial>("height") );
168}176}
169177
170REAL zShape::calcDistanceNear(tCoord & p) {178REAL zShape::calcDistanceNear(tCoord & p) {
@@ -204,10 +212,42 @@
204 }212 }
205}213}
206214
215void zShape::setSegments(const tPolynomial & s) {
216 if(segments_ == s)
217 return;
218 segments_ = s;
219 if (sn_GetNetState() != nCLIENT)
220 RequestSync();
221}
222
223void zShape::setSegLength(const tPolynomial & s) {
224 if(seglength_ == s)
225 return;
226 seglength_ = s;
227 if (sn_GetNetState() != nCLIENT)
228 RequestSync();
229}
230
207void zShape::setScale(const tFunction & s){231void zShape::setScale(const tFunction & s){
208 scale_ = s;232 scale_ = s;
209}233}
210234
235void zShape::setBottom(const tPolynomial & p) {
236 if(bottom_ == p)
237 return;
238 bottom_ = p;
239 if (sn_GetNetState() != nCLIENT)
240 RequestSync();
241}
242
243void zShape::setHeight(const tPolynomial & p) {
244 if(height_ == p)
245 return;
246 height_ = p;
247 if (sn_GetNetState() != nCLIENT)
248 RequestSync();
249}
250
211void zShape::setGrowth(REAL growth) {251void zShape::setGrowth(REAL growth) {
212 REAL s = scale_(lasttime_ - referencetime_);252 REAL s = scale_(lasttime_ - referencetime_);
213 scale_.SetSlope(growth);253 scale_.SetSlope(growth);
@@ -280,7 +320,7 @@
280320
281REAL zShape::GetEffectiveSegmentLength() const {321REAL zShape::GetEffectiveSegmentLength() const {
282 if (seglength_.Len())322 if (seglength_.Len())
283 return int( seglength_.evaluate(lastTime) );323 return seglength_.evaluate(lastTime);
284 return sz_zoneSegLength;324 return sz_zoneSegLength;
285}325}
286326
287327
=== modified file 'src/tron/zone/zShape.h'
--- src/tron/zone/zShape.h 2009-02-27 20:50:40 +0000
+++ src/tron/zone/zShape.h 2009-02-28 07:48:33 +0000
@@ -57,9 +57,13 @@
57 void setPosY(const tFunction &y);57 void setPosY(const tFunction &y);
58 virtual58 virtual
59 void setRotation2(const tPolynomial & r);59 void setRotation2(const tPolynomial & r);
60 virtual void setSegments(const tPolynomial &);
61 virtual void setSegLength(const tPolynomial &);
6062
61 virtual63 virtual
62 void setScale(const tFunction &s);64 void setScale(const tFunction &s);
65 virtual void setBottom(const tPolynomial &);
66 virtual void setHeight(const tPolynomial &);
63 void setColor(const rColor &c);67 void setColor(const rColor &c);
6468
65 void setColorNow(const rColor &c);69 void setColorNow(const rColor &c);
@@ -68,7 +72,11 @@
68 tFunction getPosX() {return posx_;};72 tFunction getPosX() {return posx_;};
69 tFunction getPosY() {return posy_;};73 tFunction getPosY() {return posy_;};
70 tPolynomial getRotation2() { return rotation2; };74 tPolynomial getRotation2() { return rotation2; };
75 tPolynomial getSegments() { return segments_; };
76 tPolynomial getSegLength() { return seglength_; };
71 tFunction getScale() {return scale_;};77 tFunction getScale() {return scale_;};
78 tPolynomial getBottom() { return bottom_; };
79 tPolynomial getHeight() { return height_; };
72 rColor getColor() {return color_;};80 rColor getColor() {return color_;};
7381
74 REAL GetEffectiveBottom() const;82 REAL GetEffectiveBottom() const;

Subscribers

People subscribed via source and target branches

to status/vote changes: