Quick test scenario for 50% Clonk.

Peter Wortmann 2010-02-12 19:08:05 +01:00
parent b2f85fa743
commit 1aff82edb7
33 changed files with 138303 additions and 86 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,45 @@
[DefCore]
id=_CLN
Version=4,9,8,8
Category=C4D_Living|C4D_SelectHomebase
MaxUserSelect=10
Width=4
Height=10
Offset=-2,-5
Vertices=5
VertexX=0,0,-0,-2,2
VertexY=1,4,-4,1,1
VertexCNAT=0,8,4,1,2
VertexFriction=300,300,100,300,300,300,300
Value=25
Mass=50
Components=CLNK=1
Picture=192,100,32,40
Collection=-4,-5,9,12
ContactIncinerate=1
Prey=1
CrewMember=1
Float=1
ColorByOwner=1
BorderBound=1
StretchGrowth=1
NoBurnDecay=1
IncompleteActivity=1
Oversize=1
NoFight=1
[Physical]
Energy=50000
Breath=50000
Walk=40000
Jump=30000
Scale=15000
Hangle=15000
Dig=20000
Swim=30000
Throw=25000
Push=200s00
Fight=25000
CanDig=1
CanConstruct=1
CanChop=1

View File

@ -0,0 +1 @@
Ein kleines aber robustes humanoides Wesen, gewitzt und flink, wenn gekonnt gesteuert.

View File

@ -0,0 +1 @@
A small but robust humanoid being. Witty and nimble, if skillfully controlled.

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

View File

@ -0,0 +1,28 @@
Clonk
Fähnrich
Leutnant
Hauptmann
Major
Oberst
Brigadegeneral
Generalmajor
Generalleutnant
General
Feldmarschall
Kadett
Fregattenkapitän
Kapitän
Konteradmiral
Vizeadmiral
Admiral
Großadmiral
Staatsrat
Staatssekretär
Kanzler
Vizepräsident
Präsident
Ministerpräsident
*%s Erster Klasse
*%s Zweiten Grades
*%s ohne Gleichen
*Erhabener %s

View File

@ -0,0 +1,28 @@
Clonk
Ensign
Lieutenant
Captain
Major
Lieutenant Colonel
Colonel
Brigade General
Major General
Lieutenant General
General
Midshipman
Commander
Commodore
Rear-Admiral
Vice-Admiral
Admiral
Fleet Admiral
Counsellor of State
Secretary of State
Chancellor
Vice President
President
Premier
*%s First Class
*%s Second Degree
*%s Without Equal
*Sublime %s

View File

@ -0,0 +1,58 @@
material Body
{
receive_shadows on
technique
{
pass
{
ambient 0.500000 0.500000 0.500000 1.000000
diffuse 0.810000 0.810000 0.810000 1.000000
specular 0.000000 0.000000 0.000000 1.000000 3.000000
emissive 0.000000 0.000000 0.000000 1.000000
texture_unit
{
texture Overlay.png
tex_address_mode wrap
filtering trilinear
colour_op_ex modulate src_texture src_player_colour
// take alpha from texture only, ignore player alpha
alpha_op_ex source1 src_texture src_player_colour
}
texture_unit
{
texture Clonk.png
tex_address_mode wrap
filtering trilinear
colour_op_ex blend_texture_alpha src_texture src_current
// Don't blend alpha, to make sure we have full intensity at the base/overlay border region
alpha_op_ex add src_current src_texture
}
texture_unit
{
// apply lighting
colour_op_ex modulate src_current src_diffuse
alpha_op_ex modulate src_current src_diffuse
}
}
}
}
material Clonkess_Body
{
receive_shadows on
technique
{
pass
{
ambient 0.500000 0.500000 0.500000 1.000000
diffuse 0.702745 0.702745 0.702745 1.000000
specular 0.000000 0.000000 0.000000 1.000000 12.500000
emissive 0.000000 0.000000 0.000000 1.000000
texture_unit
{
texture Clonkess.png
tex_address_mode wrap
filtering trilinear
}
}
}
}

View File

@ -0,0 +1,221 @@
/*-- Der Clonk --*/
#include CLNK
/* Act Map */
func Definition(def) {
inherited();
SetProperty("ActMap", {
Walk = {
Prototype = Action,
Name = "Walk",
Procedure = DFA_WALK,
Directions = 2,
FlipDir = 0,
Length = 1,
Delay = 0,
X = 0,
Y = 0,
Wdt = 4,
Hgt = 10,
StartCall = "StartWalk",
AbortCall = "StopWalk",
InLiquidAction = "Swim",
},
Scale = {
Prototype = Action,
Name = "Scale",
Procedure = DFA_SCALE,
Attach = CNAT_MultiAttach,
Directions = 2,
Length = 1,
Delay = 0,
X = 0,
Y = 20,
Wdt = 4,
Hgt = 10,
OffX = 0,
OffY = 0,
StartCall = "StartScale",
},
Tumble = {
Prototype = Action,
Name = "Tumble",
Procedure = DFA_FLIGHT,
Directions = 2,
Length = 1,
Delay = 0,
X = 0,
Y = 40,
Wdt = 4,
Hgt = 10,
NextAction = "Tumble",
ObjectDisabled = 1,
InLiquidAction = "Swim",
StartCall = "StartTumble",
EndCall = "CheckStuck",
},
Dig = {
Prototype = Action,
Name = "Dig",
Procedure = DFA_DIG,
Directions = 2,
Length = 16,
Delay = 15*3*0,
X = 0,
Y = 60,
Wdt = 4,
Hgt = 10,
NextAction = "Dig",
StartCall = "StartDigging",
AbortCall = "StopDigging",
DigFree = 6,
InLiquidAction = "Swim",
Attach = CNAT_Left | CNAT_Right | CNAT_Bottom,
},
Bridge = {
Prototype = Action,
Name = "Bridge",
Procedure = DFA_THROW,
Directions = 2,
Length = 16,
Delay = 1,
X = 0,
Y = 60,
Wdt = 4,
Hgt = 10,
NextAction = "Bridge",
StartCall = "Digging",
InLiquidAction = "Swim",
},
Swim = {
Prototype = Action,
Name = "Swim",
Procedure = DFA_SWIM,
Directions = 2,
Length = 1,
Delay = 0,
X = 0,
Y = 80,
Wdt = 4,
Hgt = 10,
OffX = 0,
OffY = 2,
StartCall = "StartSwim",
AbortCall = "StopSwim",
},
Hangle = {
Prototype = Action,
Name = "Hangle",
Procedure = DFA_HANGLE,
Directions = 2,
Length = 1,
Delay = 0,
X = 0,
Y = 100,
Wdt = 4,
Hgt = 10,
OffX = 0,
OffY = 0,
StartCall = "StartHangle",
AbortCall = "StopHangle",
InLiquidAction = "Swim",
},
Jump = {
Prototype = Action,
Name = "Jump",
Procedure = DFA_FLIGHT,
Directions = 2,
Length = 1,
Delay = 0,
X = 0,
Y = 120,
Wdt = 4,
Hgt = 10,
InLiquidAction = "Swim",
PhaseCall = "CheckStuck",
// Animation = "Jump",
StartCall = "StartJump",
},
Dive = {
Prototype = Action,
Name = "Dive",
Procedure = DFA_FLIGHT,
Directions = 2,
Length = 8,
Delay = 4,
X = 0,
Y = 160,
Wdt = 4,
Hgt = 10,
NextAction = "Hold",
ObjectDisabled = 1,
InLiquidAction = "Swim",
PhaseCall = "CheckStuck",
},
Dead = {
Prototype = Action,
Name = "Dead",
Directions = 2,
X = 0,
Y = 240,
Wdt = 4,
Hgt = 10,
Length = 1,
Delay = 0,
NextAction = "Hold",
StartCall = "StartDead",
NoOtherAction = 1,
ObjectDisabled = 1,
},
Ride = {
Prototype = Action,
Name = "Ride",
Procedure = DFA_ATTACH,
Directions = 2,
FlipDir = 1,
Length = 4,
Delay = 3,
X = 128,
Y = 120,
Wdt = 4,
Hgt = 10,
NextAction = "Ride",
StartCall = "Riding",
InLiquidAction = "Swim",
},
RideStill = {
Prototype = Action,
Name = "RideStill",
Procedure = DFA_ATTACH,
Directions = 2,
FlipDir = 1,
Length = 1,
Delay = 10,
X = 128,
Y = 120,
Wdt = 4,
Hgt = 10,
NextAction = "RideStill",
StartCall = "Riding",
InLiquidAction = "Swim",
},
Push = {
Prototype = Action,
Name = "Push",
Procedure = DFA_PUSH,
Directions = 2,
FlipDir = 1,
Length = 8,
Delay = 15,
X = 128,
Y = 140,
Wdt = 4,
Hgt = 10,
NextAction = "Push",
InLiquidAction = "Swim",
},
}, def);
}

View File

@ -0,0 +1,8 @@
CtxConstructionDesc=Bauauftrag
CtxConstructionMaterial=Baumaterial
CtxHomeDesc=Zurück zur Basis
CtxRelease=Entlassen
CtxChop=Fällen
CtrlMenuDesc=Menü
TxtDescend=Abspringen
TxtEnergysupply=Energieversorgung

View File

@ -0,0 +1,8 @@
CtxConstructionDesc=Construction
CtxConstructionMaterial=Construction material
CtxHomeDesc=Back to base
CtxRelease=Release
CtxChop=Chop
CtrlMenuDesc=Menu
TxtDescend=Jump off
TxtEnergysupply=Energy supply

View File

@ -0,0 +1,16 @@
[DefCore]
id=FIGB
Category=C4D_Object
MaxUserSelect=30
Width=10
Height=10
Offset=-5,-5
Vertices=1
VertexY=0
VertexFriction=100
Picture=0,0,10,10
Value=8
Mass=1
Collectible=1
Rebuy=1
Rotate=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -0,0 +1,7 @@
[DefCore]
id=VIPU
Version=4,9,8,2
Category=C4D_StaticBack
Width=1
Height=1
Picture=0,0,1,1

Binary file not shown.

After

Width:  |  Height:  |  Size: 851 B

View File

@ -0,0 +1,49 @@
public func Set(int sx, int sy, int ex, int ey) {
//SetObjectBlitMode(GFX_BLIT_Additive);
SetAction("Vis");
SetPosition(sx,sy);
SetClrModulation(RGB(255,0,0));
var cl = 1000*Distance(sx,sy,ex,ey)/this["ActMap"]["Vis"]["Hgt"];
var w = 650;
var r = Angle(sx,sy,ex,ey)-180;
var fsin = -Sin(r, 1000), fcos = Cos(r, 1000);
var xoff = -4;
var yoff = 0;
var width = +fcos*w/1000, height = +fcos*cl/1000;
var xskew = +fsin*cl/1000, yskew = -fsin*w/1000;
var xadjust = +fcos*xoff + fsin*yoff;
var yadjust = -fsin*xoff + fcos*yoff;
// set matrix values
SetObjDrawTransform (
width, xskew, xadjust,
yskew, height, yadjust
);
}
func Definition(def) {
SetProperty("ActMap", {
Vis = {
Prototype = Action,
Name = "Vis",
Procedure = DFA_FLOAT,
Length = 1,
X = 0,
Y = 0,
Wdt = 32,
Hgt = 256,
OffX = -16,
OffY = 0,
NextAction = "Hold"
}, }, def);
SetProperty("Name", "Path", def);
}

View File

@ -0,0 +1,208 @@
/*
FireGlobe
Author: Newton
*/
local sx,sy,ex,ey;
local vis;
local aimed;
func Construction()
{
vis = nil;
aimed = false;
}
func ControlUse(object clonk, int x, int y)
{
if(!aimed) return false;
// fire fireball
var angle = Angle(0,0,x,y);
Exit();
Launch(angle,120,clonk,this);
SetDivert(sx,sy,ex,ey);
return true;
}
func ControlUseStart(object clonk, int x, int y)
{
if(aimed) return false;
sx = x+clonk->GetX();
sy = y+clonk->GetY();
if(vis) vis->RemoveObject();
vis = CreateObject(VIPU,0,0,clonk->GetOwner());
vis->Set(sx,sy,x+clonk->GetX(),y+clonk->GetY());
vis["Visibility"]=VIS_Owner;
return true;
}
func HoldingEnabled() { return true; }
func ControlUseHolding(object clonk, int x, int y)
{
if(aimed) return false;
if(vis) vis->Set(sx,sy,x+clonk->GetX(),y+clonk->GetY());
}
func ControlUseStop(object clonk, int x, int y)
{
if(aimed) return false;
ex = x+clonk->GetX();
ey = y+clonk->GetY();
vis->Set(sx,sy,ex,ey);
aimed=true;
return true;
}
public func DelLine()
{
if(vis) vis->RemoveObject();
}
public func Deselection()
{
DelLine();
}
public func Destruction()
{
DelLine();
}
public func Launch(int angle, int str, object shooter)
{
var xdir = Sin(angle,str);
var ydir = Cos(angle,-str);
SetXDir(xdir);
SetYDir(ydir);
AddEffect("HitCheck", this, 1,1, nil,nil, shooter);
AddEffect("InFlight", this, 1,1, this);
}
public func SetDivert(int x1, int y1, int x2, int y2)
{
var inflight = GetEffect("InFlight",this);
EffectVar(2,this,inflight) = x1;
EffectVar(3,this,inflight) = y1;
EffectVar(4,this,inflight) = x2;
EffectVar(5,this,inflight) = y2;
EffectVar(6,this,inflight) = true;
}
public func HitObject(object obj)
{
Hit();
}
public func Hit()
{
DelLine();
Explode(20);
}
// rotate arrow according to speed
public func FxInFlightStart(object target, int effect, int temp)
{
if(temp) return;
EffectVar(0,target,effect) = target->GetX();
EffectVar(1,target,effect) = target->GetY();
}
public func FxInFlightTimer(object target, int effect, int time)
{
var oldx = EffectVar(0,target,effect);
var oldy = EffectVar(1,target,effect);
var newx = target->GetX();
var newy = target->GetY();
if(EffectVar(6,target,effect))
{
var ax = EffectVar(2,target,effect);
var ay = EffectVar(3,target,effect);
var bx = EffectVar(4,target,effect);
var by = EffectVar(5,target,effect);
var xo, yo;
if(Intersect(oldx, oldy, newx, newy, ax, ay, bx, by, xo, yo))
{
var angle = Angle(ax, ay, bx, by);
var speed = 60;
target->SetXDir(Sin(angle,speed));
target->SetYDir(-Cos(angle, speed));
EffectVar(6,target,effect) = false;
}
}
EffectVar(0,target,effect) = newx;
EffectVar(1,target,effect) = newy;
}
global func Intersect(int Ax, int Ay, int Bx, int By, int Px, int Py, int Qx, int Qy, &Xout, &Yout)
{
var BAx = Bx-Ax;
var BAy = By-Ay;
var PAx = Px-Ax;
var PAy = Py-Ay;
var QPx = Qx-Px;
var QPy = Qy-Py;
var denominator = (BAy*QPx - BAx*QPy);
var numerator = (BAx*PAy - BAy*PAx);
// parallel!
if(denominator == 0)
{
if(numerator != 0) return false;
// on same line somewhere
else
{
Xout = Ax;
Yout = Ay;
return true;
}
}
// in parameter bounds?
var Y = 10000 * numerator/denominator;
if(!Inside(Y,0,10000)) return false;
// we don't want division by zero...
if(BAy != 0) {
numerator = (PAy + Y*QPy/10000);
denominator = BAy;
}
else if(BAx != 0) {
numerator = (PAx + Y*QPx/10000);
denominator = BAx;
}
// in parameter bounds
var X = 10000*numerator / denominator;
if(!Inside(X,0,10000)) return false;
// this is the point...
Xout = Ax+X*(BAx)/10000;
Yout = Ay+X*(BAy)/10000;
return true;
}
func Definition(def) {
SetProperty("Name", "$Name$", def);
}

View File

@ -0,0 +1 @@
Name=Feuerglob

View File

@ -0,0 +1 @@
Name=Fire globe

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1,58 @@
[Head]
Icon=26
Title=Test1
Version=4,10
Difficulty=10
Access=1
MaxPlayer=8
NoInitialize=0
ForcedGfxMode=1
[Definitions]
Definition1=Objects.c4d
[Game]
Rules=RSTR=1
[Player1]
Wealth=50,0,0,250
Crew=_CLN=1
[Player2]
Wealth=50,0,0,250
Crew=_CLN=1
[Player3]
Wealth=50,0,0,250
Crew=_CLN=1
[Player4]
Wealth=50,0,0,250
Crew=_CLN=1
[Landscape]
Vegetation=TRE1=1;TRE2=2;TRE3=1;TRE4=1
VegetationLevel=100,0,0,100
InEarth=ROCK=1;GOLD=1;FIGB=1;LOAM=1
InEarthLevel=65,0,0,100
Sky=Clouds2
BottomOpen=1
MapWidth=500,0,64,10000
MapHeight=100,0,40,10000
Amplitude=10,10,0,100
Phase=50,50,0,100
Period=10,10,0,100
Random=20,20,0,100
Liquid=Water-Smooth
LiquidLevel=20,30,0,100
Layers=Rock=7;Rock=7;Gold=7;Granite=4;Water=5;Earth-earth=50;Earth-earth_dry=50
SkyScrollMode=2
NewStyleLandscape=2
[Weather]
Climate=0,0,0,100
YearSpeed=20,10,0,100
Wind=1,100,-100,100
[Environment]
Objects=EGLN=1;EGRS=1

View File

@ -0,0 +1,28 @@
/* Sky race */
func InitializePlayer(int iPlr, int iX, int iY, object pBase, int iTeam)
{
JoinPlayer(iPlr);
return;
}
func RelaunchPlayer(int iPlr)
{
var clonk = CreateObject(CLNK, 0, 0, iPlr);
clonk->MakeCrewMember(iPlr);
SetCursor(iPlr,clonk);
SelectCrew(iPlr, clonk, true);
JoinPlayer(iPlr);
return;
}
func JoinPlayer(int iPlr)
{
var clonk = GetCrew(iPlr);
clonk->DoEnergy(100000);
clonk->SetPosition(50, 490);
clonk->CreateContents(BOW1);
clonk->CreateContents(FIGB);
clonk->Collect(CreateObject(ARRW));
return;
}

View File

@ -0,0 +1,5 @@
[Teams]
Active=false
Custom=false
AllowHostilityChange=true
AutoGenerateTeams=true

View File

@ -0,0 +1,2 @@
DE:Test 50% Clonk
US:Test 50% Clonk

View File

@ -25,9 +25,9 @@
#include "C4Control.h"
#include "C4Game.h"
#include "C4Log.h"
#include "C4GraphicsSystem.h"
#include "C4GraphicsResource.h"
#include "C4MouseControl.h"
#include "C4GraphicsSystem.h"
#include "C4Viewport.h"
#include "C4Object.h"
#include "C4ObjectMenu.h"

View File

@ -210,40 +210,8 @@ bool C4Shape::Attach(int32_t &cx, int32_t &cy, BYTE cnat_pos)
// Until a better solution for designing battlements is found, the old-style
// behaviour will be used for Clonks. Both code variants should behave equally
// for objects with only one matching vertex to cnat_pos.
if (!(cnat_pos & CNAT_MultiAttach))
{
// old-style attachment
for (vtx=0; vtx<VtxNum; vtx++)
if (VtxCNAT[vtx] & cnat_pos)
{
xcd=ycd=0;
switch (cnat_pos & (~CNAT_Flags))
{
case CNAT_Top: ycd=-1; break;
case CNAT_Bottom: ycd=+1; break;
case CNAT_Left: xcd=-1; break;
case CNAT_Right: xcd=+1; break;
}
xcrng=AttachRange*xcd*(-1); ycrng=AttachRange*ycd*(-1);
for (xcnt=xcrng,ycnt=ycrng; (xcnt!=-xcrng) || (ycnt!=-ycrng); xcnt+=xcd,ycnt+=ycd)
{
int32_t ax=cx+VtxX[vtx]+xcnt+xcd, ay=cy+VtxY[vtx]+ycnt+ycd;
if (GBackDensity(ax,ay) >= ContactDensity)
{
cpix=GBackPix(ax,ay);
AttachMat=PixCol2Mat(cpix);
iAttachX=ax; iAttachY=ay;
iAttachVtx=vtx;
cx+=xcnt; cy+=ycnt;
fAttached=1;
break;
}
}
}
}
else // CNAT_MultiAttach
{
// new-style attachment
// new-style attachment
// determine attachment direction
xcd=ycd=0;
switch (cnat_pos & (~CNAT_Flags))
@ -280,8 +248,7 @@ bool C4Shape::Attach(int32_t &cx, int32_t &cy, BYTE cnat_pos)
break;
}
}
}
return fAttached;
}

View File

@ -5,7 +5,7 @@
* Copyright (c) 2001-2008 Sven Eberhardt
* Copyright (c) 2002-2008 Peter Wortmann
* Copyright (c) 2004 Armin Burgmeier
* Copyright (c) 2005-2009 Günther Brammer
* Copyright (c) 2005-2009 Gºnther Brammer
* Copyright (c) 2009 Nicolas Hake
* Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de
*
@ -963,7 +963,7 @@ void C4Player::CheckCrewExPromotion()
C4Object *hirank;
if ((hirank=GetHiRankActiveCrew(false)))
if (hirank->Info)
if (hirank->Info->Rank<1) // No Fähnrich -> except. promo.
if (hirank->Info->Rank<1) // No Fhnrich -> except. promo.
if ((hirank=GetHiExpActiveCrew(false)))
hirank->Promote(1,true,false);
}
@ -1739,10 +1739,7 @@ int VisibilityCheck(int iVis, int sx, int sy, int cx, int cy)
{
int x = (sx * (st - i) + cx * i) / st, y = (sy * (st - i) + cy * i) / st;
if(GBackSolid(x, y))
{
if((iVis -= 2) <= 0)
return 0;
}
return 0;
}
return iVis;
}
@ -1752,11 +1749,11 @@ void C4Player::FoW2Map(CClrModAddMap &rMap, int iOffX, int iOffY)
// No fog of war
if (!fFogOfWar) return;
igOffX = iOffX; igOffY = iOffY;
// Add view for all FoW-repellers - keep track of FoW-generators, which should be avaluated finally
// Add view for all FoW-repellers - keep track of FoW-generators, which should be avaluated last
// so they override repellers
bool fAnyGenerators = false;
C4Object *cobj; C4ObjectLink *clnk;
for (clnk=FoWViewObjs.First; clnk && (cobj=clnk->Obj); clnk=clnk->Next)
C4Object *cobj; C4ObjectLink *clnk;
for (clnk=FoWViewObjs.First; clnk && (cobj=clnk->Obj); clnk=clnk->Next)
if (!cobj->Contained || cobj->Contained->Def->ClosedContainer != 1)
{
if (cobj->PlrViewRange > 0)

View File

@ -1036,7 +1036,13 @@ void C4Viewport::Draw(C4TargetFacet &cgo, bool fDrawOverlay)
C4Player *pPlr=::Players.Get(Player);
if (pPlr && pPlr->fFogOfWar)
{
ClrModMap.Reset(Game.C4S.Landscape.FoWRes, Game.C4S.Landscape.FoWRes, ViewWdt, ViewHgt, int(cgo.TargetX*Zoom), int(cgo.TargetY*Zoom), 0, cgo.X-BorderLeft, cgo.Y-BorderTop, Game.FoWColor, cgo.Surface);
ClrModMap.Reset(Game.C4S.Landscape.FoWRes, Game.C4S.Landscape.FoWRes,
ViewWdt/Zoom, ViewHgt/Zoom,
cgo.TargetX,
cgo.TargetY,
0,
cgo.X, cgo.Y,
Game.FoWColor, cgo.Surface);
pPlr->FoW2Map(ClrModMap, int(float(cgo.X)/Zoom-cgo.TargetX), int(float(cgo.Y)/Zoom-cgo.TargetY));
lpDDraw->SetClrModMap(&ClrModMap);
lpDDraw->SetClrModMapEnabled(true);

View File

@ -273,23 +273,14 @@ CSurface *CClrModAddMap::GetSurface()
void CClrModAddMap::ReduceModulation(int cx, int cy, int Radius, int (*VisProc)(int, int, int, int, int))
{
// landscape coordinates: cx, cy, VisProc
// display coordinates: zx, zy, x, y
float zx = float(cx);
float zy = float(cy);
lpDDraw->ApplyZoom(zx, zy);
Radius = int(lpDDraw->Zoom * Radius);
// reveal all within iRadius1; fade off squared until iRadius2
int x = OffX, y = OffY, xe = Wdt*ResolutionX+OffX;
int RadiusSq = Radius*Radius;
for (unsigned int i = 0; i < MapSize; i++)
{
if ((x-zx)*(x-zx)+(y-zy)*(y-zy) < RadiusSq)
if ((x-cx)*(x-cx)+(y-cy)*(y-cy) < RadiusSq)
{
float lx = float(x);
float ly = float(y);
lpDDraw->RemoveZoom(lx, ly);
pMap[i] = Max<int>(pMap[i], VisProc(255, int(lx), int(ly), int(cx), int(cy)));
pMap[i] = 255; // Max<int>(pMap[i], VisProc(255, int(lx), int(ly), int(cx), int(cy)));
}
// next pos
x += ResolutionX;
@ -297,6 +288,24 @@ void CClrModAddMap::ReduceModulation(int cx, int cy, int Radius, int (*VisProc)(
}
}
/*
void CClrModAddMap::PropagateModulation(int (*VisProc)(int, int, int, int, int))
{
int x = OffX, y = OffY, xe = Wdt*ResolutionX+OffX;
for(unsigned int i = 0; i < MapSize; i++)
{
if(pMap[i] > 0) {
// propagate left?
if((i % Wdt) > 0 && pMap[i - 1] < 255)
pMap[i - 1] = VisProc(pMap[i - 1],
// next pos
x += ResolutionX;
if (x >= xe) { x = OffX; y += ResolutionY; }
}
}
*/
void CClrModAddMap::AddModulation(int cx, int cy, int Radius, uint8_t Transparency)
{
{
@ -330,6 +339,9 @@ uint32_t CClrModAddMap::GetModAt(int x, int y) const
// slower, more accurate method: Interpolate between 4 neighboured modulations
x -= OffX;
y -= OffY;
float lx = x, ly = y; lpDDraw->RemoveZoom(lx, ly); x = lx; y = ly;
int tx = BoundBy(x / ResolutionX, 0, Wdt-1);
int ty = BoundBy(y / ResolutionY, 0, Hgt-1);
int tx2 = Min(tx + 1, Wdt-1);
@ -344,7 +356,7 @@ uint32_t CClrModAddMap::GetModAt(int x, int y) const
uint32_t c3 = FadeTransparent ? 0xffffff | (Vis << 24) : 0xff000000|RGB(Vis, Vis, Vis);
Vis = pMap[ty2*Wdt+tx2];
uint32_t c4 = FadeTransparent ? 0xffffff | (Vis << 24) : 0xff000000|RGB(Vis, Vis, Vis);
CColorFadeMatrix clrs(tx*ResolutionX, ty*ResolutionY, ResolutionX, ResolutionY, c1, c2, c3, c4);
CColorFadeMatrix clrs(tx*ResolutionX, ty*ResolutionY, ResolutionX, ResolutionY, c1, c1, c1, c1);
return clrs.GetColorAt(x, y);
#endif
}

View File

@ -233,7 +233,7 @@ public:
StdCopyStrBuf Name;
float Length;
private:
public:
std::vector<StdMeshTrack*> Tracks; // bone-indexed
};

View File

@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 45;
objects = {
/* Begin PBXBuildFile section */
@ -1924,8 +1924,8 @@
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "OpenClonk" */;
compatibilityVersion = "Xcode 3.2";
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Clonk" */;
compatibilityVersion = "Xcode 3.1";
hasScannedForEncodings = 1;
mainGroup = 29B97314FDCFA39411CA2CEA /* Clonk */;
projectDirPath = "";
@ -2486,7 +2486,7 @@
/usr/X11R6/include,
/usr/X11R6/include/freetype2,
../../standard/inc,
"\"$(SRCROOT)/../../../../CPP/SDL/include\"",
"\\\"$(SRCROOT)/../../../../CPP/SDL/include\\\"",
./SDL_mixer.framework/Headers,
/opt/local/include,
);
@ -2494,13 +2494,13 @@
INSTALL_PATH = "$(HOME)/Applications";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SDKROOT)/usr/lib/system\"",
"\"$(SDKROOT)/usr/lib/gcc/arm-apple-darwin9/4.0.1\"",
"\"$(SDKROOT)/usr/lib/gcc/arm-apple-darwin9/4.2.1\"",
"\"$(SDKROOT)/usr/lib/gcc/i686-apple-darwin9/4.0.1\"",
"\"$(SDKROOT)/usr/lib/gcc/i686-apple-darwin9/4.2.1\"",
"\"$(SDKROOT)/usr/lib/gcc/powerpc-apple-darwin9/4.0.1\"",
"\"$(SDKROOT)/usr/lib/gcc/powerpc-apple-darwin9/4.2.1\"",
"\\\"$(SDKROOT)/usr/lib/system\\\"",
"\\\"$(SDKROOT)/usr/lib/gcc/arm-apple-darwin9/4.0.1\\\"",
"\\\"$(SDKROOT)/usr/lib/gcc/arm-apple-darwin9/4.2.1\\\"",
"\\\"$(SDKROOT)/usr/lib/gcc/i686-apple-darwin9/4.0.1\\\"",
"\\\"$(SDKROOT)/usr/lib/gcc/i686-apple-darwin9/4.2.1\\\"",
"\\\"$(SDKROOT)/usr/lib/gcc/powerpc-apple-darwin9/4.0.1\\\"",
"\\\"$(SDKROOT)/usr/lib/gcc/powerpc-apple-darwin9/4.2.1\\\"",
);
OTHER_LDFLAGS = (
"-framework",
@ -2528,13 +2528,13 @@
INSTALL_PATH = "$(HOME)/Applications";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SDKROOT)/usr/lib/system\"",
"\"$(SDKROOT)/usr/lib/gcc/arm-apple-darwin9/4.0.1\"",
"\"$(SDKROOT)/usr/lib/gcc/arm-apple-darwin9/4.2.1\"",
"\"$(SDKROOT)/usr/lib/gcc/i686-apple-darwin9/4.0.1\"",
"\"$(SDKROOT)/usr/lib/gcc/i686-apple-darwin9/4.2.1\"",
"\"$(SDKROOT)/usr/lib/gcc/powerpc-apple-darwin9/4.0.1\"",
"\"$(SDKROOT)/usr/lib/gcc/powerpc-apple-darwin9/4.2.1\"",
"\\\"$(SDKROOT)/usr/lib/system\\\"",
"\\\"$(SDKROOT)/usr/lib/gcc/arm-apple-darwin9/4.0.1\\\"",
"\\\"$(SDKROOT)/usr/lib/gcc/arm-apple-darwin9/4.2.1\\\"",
"\\\"$(SDKROOT)/usr/lib/gcc/i686-apple-darwin9/4.0.1\\\"",
"\\\"$(SDKROOT)/usr/lib/gcc/i686-apple-darwin9/4.2.1\\\"",
"\\\"$(SDKROOT)/usr/lib/gcc/powerpc-apple-darwin9/4.0.1\\\"",
"\\\"$(SDKROOT)/usr/lib/gcc/powerpc-apple-darwin9/4.2.1\\\"",
);
OTHER_LDFLAGS = (
"-framework",
@ -2560,13 +2560,13 @@
INSTALL_PATH = "$(HOME)/Applications";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SDKROOT)/usr/lib/system\"",
"\"$(SDKROOT)/usr/lib/gcc/arm-apple-darwin9/4.0.1\"",
"\"$(SDKROOT)/usr/lib/gcc/arm-apple-darwin9/4.2.1\"",
"\"$(SDKROOT)/usr/lib/gcc/i686-apple-darwin9/4.0.1\"",
"\"$(SDKROOT)/usr/lib/gcc/i686-apple-darwin9/4.2.1\"",
"\"$(SDKROOT)/usr/lib/gcc/powerpc-apple-darwin9/4.0.1\"",
"\"$(SDKROOT)/usr/lib/gcc/powerpc-apple-darwin9/4.2.1\"",
"\\\"$(SDKROOT)/usr/lib/system\\\"",
"\\\"$(SDKROOT)/usr/lib/gcc/arm-apple-darwin9/4.0.1\\\"",
"\\\"$(SDKROOT)/usr/lib/gcc/arm-apple-darwin9/4.2.1\\\"",
"\\\"$(SDKROOT)/usr/lib/gcc/i686-apple-darwin9/4.0.1\\\"",
"\\\"$(SDKROOT)/usr/lib/gcc/i686-apple-darwin9/4.2.1\\\"",
"\\\"$(SDKROOT)/usr/lib/gcc/powerpc-apple-darwin9/4.0.1\\\"",
"\\\"$(SDKROOT)/usr/lib/gcc/powerpc-apple-darwin9/4.2.1\\\"",
);
OTHER_LDFLAGS = (
"-framework",
@ -2890,7 +2890,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "OpenClonk" */ = {
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "Clonk" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D43533520B444795009841F0 /* Debug */,