1
0
forked from mirrors/0ad

This was SVN commit r2684.

This commit is contained in:
Matei
2005-09-07 02:24:13 +00:00
parent 55107c69fe
commit 4cc30aeb56
4 changed files with 14 additions and 5 deletions
+3 -2
View File
@@ -4,13 +4,14 @@
using namespace std;
ClumpPlacer::ClumpPlacer(float size, float coherence, float smoothness, int x, int y)
ClumpPlacer::ClumpPlacer(float size, float coherence, float smoothness, float failFraction, int x, int y)
{
this->size = size;
this->coherence = coherence;
this->smoothness = smoothness;
this->x = x;
this->y = y;
this->failFraction = failFraction;
}
ClumpPlacer::~ClumpPlacer()
@@ -80,7 +81,7 @@ bool ClumpPlacer::place(class Map* m, Constraint* constr, std::vector<Point>& re
}
}
return failed > 0 ? false : true;
return failed > size * failFraction ? false : true;
/*if(m->validT(x,y)) {
ret.push_back(Point(x,y));
+2 -1
View File
@@ -10,11 +10,12 @@ private:
float size;
float coherence;
float smoothness;
float failFraction;
int x, y;
public:
virtual bool place(Map* m, Constraint* constr, std::vector<Point>& ret);
ClumpPlacer(float size, float coherence, float smoothness, int x, int y);
ClumpPlacer(float size, float coherence, float smoothness, float failFraction, int x, int y);
virtual ~ClumpPlacer();
};
+3 -2
View File
@@ -160,7 +160,7 @@ AreaPainter* ParseAreaPainter(JSContext* cx, jsval val) {
AreaPlacer* ParseAreaPlacer(JSContext* cx, jsval val) {
int x, y, x1, y1, x2, y2, num, maxFail;
float size, coherence, smoothness;
float size, coherence, smoothness, failFraction;
switch(GetType(cx, val)) {
case TYPE_RECT_PLACER:
@@ -174,9 +174,10 @@ AreaPlacer* ParseAreaPlacer(JSContext* cx, jsval val) {
if(!GetFloatField(cx, val, "size", size)) return 0;
if(!GetFloatField(cx, val, "coherence", coherence)) return 0;
if(!GetFloatField(cx, val, "smoothness", smoothness)) return 0;
if(!GetFloatField(cx, val, "failFraction", failFraction)) return 0;
if(!GetIntField(cx, val, "x", x)) return 0;
if(!GetIntField(cx, val, "y", y)) return 0;
return new ClumpPlacer(size, coherence, smoothness, x, y);
return new ClumpPlacer(size, coherence, smoothness, failFraction, x, y);
default:
return 0;
+6
View File
@@ -284,6 +284,12 @@
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
</Filter>
<File
RelativePath="..\..\..\binaries\data\mods\official\maps\random\andalucia.js">
</File>
<File
RelativePath="..\..\..\binaries\data\mods\official\maps\random\cantabrian_highlands.js">
</File>
<File
RelativePath="..\..\..\libraries\spidermonkey\lib\js32d.lib">
</File>