Merge 'master' into liquid_container

liquid_container
Mark 2016-02-27 12:51:11 +01:00
commit 7a1b7d6258
20 changed files with 238 additions and 56 deletions

View File

@ -57,6 +57,8 @@
<funclink>PV_KeyFrames</funclink>
<funclink>PV_Wind</funclink>
<funclink>PV_Gravity</funclink>
<funclink>PV_Sin</funclink>
<funclink>PV_Cos</funclink>
</text>
<text>
<table>

View File

@ -555,8 +555,8 @@ global func FxExplodeOnDeathCurseStop(object target, proplist effect, int reason
<text>new_timer is the timer interval of the new effect; var1 to var4 are the parameters from AddEffect. Notice: in temporary calls, these parameters are not available - here they will be 0.</text>
<text>If -1 is returned, the accepting effect is deleted also. Logically, the calling AddEffect function will then return -2.</text>
<h>Fx*Damage</h>
<text><code>int Fx*Damage (object target, proplist effect, int damage, int cause);</code></text>
<text>Every effect receives this callback whenever the energy or damage value of the target object is to change. If the function is defined, it should then return whether to allow the change.</text>
<text><code>int Fx*Damage (object target, proplist effect, int damage, int cause, int by_player);</code></text>
<text>Every effect receives this callback whenever the energy or damage value of the target object is to change. If the function is defined, it should then return the damage to be done to the target.</text>
<text id="damagecause">This callback is made upon life energy changes in living beings and damage value changes in non-livings - but not vice versa. cause contains the value change and reason:</text>
<text>
<table>

View File

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>PV_Cos</title>
<category>Particles</category>
<version>8.0 OC</version>
<syntax>
<rtype>array</rtype>
<params>
<param>
<type>int</type>
<name>value</name>
<desc>Value or value provider to calculate the cosine of. The result of <funclink>PV_Linear</funclink> can be used to evaluate the cosine function linearly over time.</desc>
</param>
<param>
<type>int</type>
<name>amplitude</name>
<desc>Amplitude of result. May be a value or value provider.</desc>
</param>
<param>
<type>int</type>
<name>offset</name>
<desc>Offset added to result. May be a value or value provider. Defaults to zero.</desc>
<optional />
</param>
</params>
</syntax>
<desc>The value will is calculates as cos(value) * amplitude + offset with value given in degrees.</desc>
<remark>See the <emlink href="particle/index.html">particle documentation</emlink> for further explanations of the particle system.</remark>
<remark>See <funclink>PV_Random</funclink> for another example with PV_Cos.</remark>
<related>
<funclink>CreateParticle</funclink>
<funclink>PV_Sin</funclink>
<funclink>PV_Direction</funclink>
<funclink>PV_Random</funclink>
<funclink>PV_Step</funclink>
<funclink>PV_Linear</funclink>
<funclink>PV_Speed</funclink>
<funclink>PV_KeyFrames</funclink>
</related>
</func>
<author>Zapper</author><date>2016-02</date>
</funcs>

View File

@ -27,12 +27,37 @@
<name>reroll_interval</name>
<desc>Interval in frames after which a new random number will be drawn.</desc>
<optional />
</param>
<param>
<type>int</type>
<name>seed</name>
<desc>Particle-local seed that is used for the random rool. Can be used to draw the same random number two times (see example).</desc>
<optional />
</param>
</params>
</syntax>
<desc>The value will be a random number in the interval from start_value to (not including) end_value. The values in between are not whole integers, but are also in fraction of integers. This means that PV_Random(0, 1) can not only return one value (the 0) but a lot of different values in the interval between 0 and 1.</desc>
<remark>See the <emlink href="particle/index.html">particle documentation</emlink> for further explanations of the particle system.</remark>
<related>
<examples>
<example>
<code><funclink>CreateParticle</funclink>("MagicRing", 0, 0, PV_Random(-100, 100), -20, 100, {Prototype = Particles_Glimmer(), Size = PV_Random(0, 3, 10)}, 100);</code>
<text>Creates 100 particles with a random speed in X direction and a random size (which changes every ten frames).</text>
</example>
<example>
<code>
var min_speed = 50;
var max_speed = 100;
var min_angle = 0;
var max_angle = 360;
<funclink>CreateParticle</funclink>("SphereSpark", 0, 0,
<funclink>PV_Sin</funclink>(<funclink>PV_Random</funclink>(min_angle, max_angle, 0, 1), <funclink>PV_Random</funclink>(min_speed, max_speed, 0, 2)),
<funclink>PV_Cos</funclink>(<funclink>PV_Random</funclink>(min_angle, max_angle, 0, 1), <funclink>PV_Random</funclink>(min_speed, max_speed, 0, 2)),
PV_Random(10, 200),
Particles_Glimmer(), 400);</code>
<text>Uses the particle-local seed to draw the same angle and radius for the X and Y speed of the particle. This leads to a radial distribution (instead of a square). The seed parameter is set to the same number (here 1 and 2) where the same result should be drawn.</text>
</example>
</examples>
<related>
<funclink>CreateParticle</funclink>
<funclink>PV_Linear</funclink>
<funclink>PV_Direction</funclink>
@ -40,6 +65,7 @@
<funclink>PV_Speed</funclink>
<funclink>PV_KeyFrames</funclink>
<funclink>PV_Sin</funclink>
<funclink>PV_Cos</funclink>
<funclink>PC_Die</funclink>
<funclink>PC_Bounce</funclink>
</related>

View File

@ -30,6 +30,7 @@
</syntax>
<desc>The value will is calculates as sin(value) * amplitude + offset with value given in degrees.</desc>
<remark>See the <emlink href="particle/index.html">particle documentation</emlink> for further explanations of the particle system.</remark>
<remark>See <funclink>PV_Random</funclink> for another example with PV_Sin.</remark>
<examples>
<example>
<code><funclink>CreateParticle</funclink>("MagicRing", 0, 0, 0, 0, 100, {R=0xff,G=0x00,B=0x30, Size = PV_Sin(<funclink>PV_Linear</funclink>(0,180),10,0)}, 1);</code>
@ -38,6 +39,7 @@
</examples>
<related>
<funclink>CreateParticle</funclink>
<funclink>PV_Cos</funclink>
<funclink>PV_Direction</funclink>
<funclink>PV_Random</funclink>
<funclink>PV_Step</funclink>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -3,39 +3,38 @@
func InitializeObjects()
{
CreateObject(Rule_KillLogs, 50, 50);
CreateObject(Rule_Gravestones, 50, 50);
CreateObject(Rule_Restart, 50, 50);
CreateObject(Goal_Melee, 50, 50);
ItemSpawn->Create(Firestone,407,389);
ItemSpawn->Create(Firestone,423,389);
ItemSpawn->Create(PowderKeg,669,261);
ItemSpawn->Create(Bread,407,258);
ItemSpawn->Create(Bread,352,258);
ItemSpawn->Create(IronBomb,441,389);
ItemSpawn->Create(IceWallKit,990,400);
ItemSpawn->Create(Firestone,443,101);
ItemSpawn->Create(IceWallKit,372,258);
var Chest001 = CreateObjectAbove(Chest, 1047, 359);
CreateObjectAbove(Idol, 313, 254);
CreateObjectAbove(Idol, 315, 235);
var WoodenBridge001 = CreateObjectAbove(WoodenBridge, 1126, 372);
var WoodenBridge001 = CreateObjectAbove(WoodenBridge, 513, 282);
WoodenBridge001->SetCategory(C4D_StaticBack);
var WoodenBridge002 = CreateObjectAbove(WoodenBridge, 513, 282);
var WoodenBridge002 = CreateObjectAbove(WoodenBridge, 1126, 372);
WoodenBridge002->SetCategory(C4D_StaticBack);
CreateObjectAbove(Goal_Flag, 507, 180);
CreateObjectAbove(Goal_Flag, 497, 125);
CreateObjectAbove(Catapult, 728, 431);
CreateObjectAbove(Catapult, 627, 269);
CreateObjectAbove(Catapult, 558, 107);
var Cannon001 = CreateObjectAbove(Cannon, 692, 253);
Cannon001->SetRDir(3);
CreateObjectAbove(Cannon, 511, 179);
CreateObjectAbove(Airship, 369, 269);
Chest001->CreateContents(Boompack);
CreateObjectAbove(Airship, 383, 181);
Chest001->CreateContents(IronBomb, 2);

View File

@ -42,10 +42,12 @@ func Initialize()
flag.Destruction = Scenario.OnFlagDestruction;
flag.team = 1;
flag.Plane = 274; // cannot be moved by airship
flag.RejectWindbagForce = Clonk.IsClonk;
if (flag->GetX() > LandscapeWidth()/2) ++flag.team;
g_respawn_flags[flag.team] = flag;
}
// Weapon drops timer
g_num_avail_weapons = 6;
ScheduleCall(nil, Scenario.DoBalloonDrop, 36*8, 99999);
return true;
}
@ -56,14 +58,17 @@ local weapon_list = [ // id, vertex, offx, offy, deployy
[IceWallKit, 2, 0, -5, -10],
[DynamiteBox, 0, 3, -5, -10],
[BombArrow, 2, 0, -8, -10],
[Boompack, 0, 0, 0, 0],
[GrenadeLauncher, 3, 0, -4, -10]
[GrenadeLauncher, 3, 0, -4, -10],
[Boompack, 0, 0, 0, 0]
];
static g_num_avail_weapons; // boompack available later
func DoBalloonDrop()
{
// Random weapon
var wp = Scenario.weapon_list[Random(GetLength(Scenario.weapon_list))];
if (FrameCounter() > 36*60*4) g_num_avail_weapons = 7; // enable boompacks after some time
var wp = Scenario.weapon_list[Random(g_num_avail_weapons)];
var x = LandscapeWidth()/4 + Random(LandscapeWidth()/2);
var y = 0;
var balloon = CreateObject(BalloonDeployed, x, y);
@ -153,6 +158,8 @@ func RelaunchPlayer(int plr)
crew->MakeCrewMember(plr);
SetCursor(plr, crew, false);
}
// Reset available items in spawns
for (var item_spawn in FindObjects(Find_ID(ItemSpawn))) item_spawn->Reset(plr);
// Relaunch near current flag pos (will be adjusted on actual relaunch)
crew->SetPosition(start_x, start_y);
var relaunch = CreateObjectAbove(RelaunchContainer, start_x, start_y, plr);

View File

@ -37,6 +37,18 @@ public func SetSpawnObject(id def)
return true;
}
// Re-enable spawning for given player
public func Reset(plr)
{
if (!GetType(plr)) plr = GetPlayers(); else plr = [plr];
for (p in plr)
{
spawn_list[p] = nil;
UpdateVisibility(p);
}
return true;
}
// If called, items can only be collected by members of this team
public func SetTeam(int new_team)
{

View File

@ -1,26 +1,28 @@
/**
Animals can use Decay() in their Death() function so they will slowly decay and spawn a few temporary flies.
The delay parameter specifies the amount of frames before decaying one Con.
*/
global func Decay()
global func Decay(int delay)
{
AddEffect("Decaying", this, 1, 500);
delay = delay ?? 100;
AddEffect("Decaying", this, 1, delay);
if (!GBackSemiSolid())
{
var rnd = Random(4);
for (var i = 0; i < rnd; i++)
{
var mos = CreateObject(Mosquito);
ScheduleCall(mos, "RemoveObject", 9000 + Random(300));
ScheduleCall(mos, "RemoveObject", Max(0, GetCon() - 20) * delay + Random(300));
}
}
}
global func FxDecayingTimer(object target)
global func FxDecayingTimer(object target, effect fx, int time)
{
if (target->GetCon() < 20)
target->RemoveObject();
else
target->DoCon(-5);
return true;
target->DoCon(-1);
return FX_OK;
}

View File

@ -1812,13 +1812,14 @@ static C4ValueArray* FnPV_Linear(C4PropList * _this, C4Value startValue, C4Value
return pArray;
}
static C4ValueArray* FnPV_Random(C4PropList * _this, C4Value startValue, C4Value endValue, C4Value rerollInterval)
static C4ValueArray* FnPV_Random(C4PropList * _this, C4Value startValue, C4Value endValue, C4Value rerollInterval, C4Value seed)
{
C4ValueArray *pArray = new C4ValueArray(4);
pArray->SetItem(0, C4VInt(C4PV_Random));
pArray->SetItem(1, startValue);
pArray->SetItem(2, endValue);
pArray->SetItem(3, rerollInterval);
pArray->SetItem(4, seed);
return pArray;
}
@ -1871,6 +1872,16 @@ static C4ValueArray* FnPV_Sin(C4PropList * _this, C4Value value, C4Value amplitu
return pArray;
}
static C4ValueArray* FnPV_Cos(C4PropList * _this, C4Value value, C4Value amplitude, C4Value offset)
{
C4ValueArray *pArray = new C4ValueArray(5);
pArray->SetItem(0, C4VInt(C4PV_Cos));
pArray->SetItem(1, value);
pArray->SetItem(2, amplitude);
pArray->SetItem(3, offset);
return pArray;
}
static C4ValueArray* FnPV_Speed(C4PropList * _this, C4Value factor, C4Value startValue)
{
C4ValueArray *pArray = new C4ValueArray(3);
@ -2920,6 +2931,7 @@ void InitGameFunctionMap(C4AulScriptEngine *pEngine)
F(PV_Gravity);
// F(PV_KeyFrames); added below
F(PV_Sin);
F(PV_Cos);
F(PC_Die);
F(PC_Bounce);
F(PC_Stop);

View File

@ -54,7 +54,7 @@ const char *const SEPERATOR_TEXTURE = "--SEP--";
C4LandscapeRenderGL::C4LandscapeRenderGL()
{
ZeroMem(Surfaces, sizeof(Surfaces));
hMaterialTexture = 0;
hMaterialTexture = matMapTexture = 0;
hVBO = 0;
hVAOIDNoLight = 0;
hVAOIDLight = 0;
@ -146,6 +146,8 @@ void C4LandscapeRenderGL::Clear()
}
if (hMaterialTexture) glDeleteTextures(1, &hMaterialTexture);
hMaterialTexture = 0;
if (matMapTexture) glDeleteTextures(1, &matMapTexture);
matMapTexture = 0;
if (hVBO != 0)
{
@ -297,6 +299,9 @@ bool C4LandscapeRenderGL::InitMaterialTexture(C4TextureMap *pTexs)
// Clear error error(s?)
while(glGetError()) {}
// Alloc 1D matmap texture
glGenTextures(1, &matMapTexture);
// Alloc 2D texture array
glGenTextures(1, &hMaterialTexture);
@ -1009,6 +1014,7 @@ void C4LandscapeRenderGL::Draw(const C4TargetFacet &cgo, const C4FoWRegion *Ligh
{
uint32_t MatMap[2*256];
BuildMatMap(MatMap);
glBindTexture(GL_TEXTURE_1D, matMapTexture);
glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA8, 2*256, 0, GL_RGBA, GL_UNSIGNED_BYTE, MatMap);
glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
}

View File

@ -123,6 +123,8 @@ private:
unsigned int hVAOIDNoLight;
unsigned int hVAOIDLight;
// 1D texture for material map
GLuint matMapTexture;
// 2D texture array of material textures
GLuint hMaterialTexture;
// material texture positions in texture array

View File

@ -376,20 +376,59 @@ void C4ParticleValueProvider::Floatify(float denominator)
{
FloatifyParameterValue(&C4ParticleValueProvider::maxValue, denominator);
}
else if (valueFunction == &C4ParticleValueProvider::Sin)
else if (valueFunction == &C4ParticleValueProvider::Sin || valueFunction == &C4ParticleValueProvider::Cos)
{
FloatifyParameterValue(&C4ParticleValueProvider::parameterValue, 1.0f);
FloatifyParameterValue(&C4ParticleValueProvider::maxValue, denominator);
}
}
void C4ParticleValueProvider::RollRandom()
void C4ParticleValueProvider::RollRandom(const C4Particle *forParticle)
{
if (randomSeed == -1) return RollRandomUnseeded();
return RollRandomSeeded(forParticle);
}
void C4ParticleValueProvider::RollRandomUnseeded()
{
float range = endValue - startValue;
float rnd = (float)(rand()) / (float)(RAND_MAX);
currentValue = startValue + rnd * range;
}
void C4ParticleValueProvider::RollRandomSeeded(const C4Particle *forParticle)
{
// We need a particle-local additional seed.
// Since this is by no means synchronisation relevant and since the particles lie on the heap
// we just use the address here.
// These conversion steps here just make it explicit that we do not care about the upper 32bit
// of a pointer in case it's too long.
const std::uintptr_t ourAddress = reinterpret_cast<std::uintptr_t>(forParticle);
const unsigned long mostSignificantBits = ourAddress & 0xffffffff;
const unsigned long particleLocalSeed = mostSignificantBits;
// The actual seed is then calculated from the last random value (or initial seed) and the local seed.
unsigned long seed = static_cast<unsigned long>(randomSeed) + particleLocalSeed;
// This is a simple linear congruential generator which should suffice for our graphical effects.
// https://en.wikipedia.org/wiki/Linear_congruential_generator
const unsigned long maxRandomValue = 32767;
auto roll = [&seed, &maxRandomValue]()
{
const unsigned long value = seed * 1103515245l + 12345l;
return static_cast<unsigned int>(value / 65536) % (maxRandomValue + 1);
};
const unsigned int randomNumber = roll();
assert(randomNumber >= 0 && randomNumber <= maxRandomValue);
// Now force the integer-random-value into our float-range.
const float range = endValue - startValue;
const float rnd = static_cast<float>(randomNumber) / static_cast<float>(maxRandomValue);
currentValue = startValue + rnd * range;
// Finally update our seed to the new random value.
randomSeed = static_cast<int> (randomNumber);
}
float C4ParticleValueProvider::GetValue(C4Particle *forParticle)
{
UpdateChildren(forParticle);
@ -408,10 +447,19 @@ float C4ParticleValueProvider::Const(C4Particle *forParticle)
float C4ParticleValueProvider::Random(C4Particle *forParticle)
{
if ((rerollInterval != 0 && ((int)forParticle->GetAge() % rerollInterval == 0)) || alreadyRolled == 0)
// We need to roll again if..
const bool needToReevaluate =
// .. we haven't rolled yet
alreadyRolled == 0
// .. we are still in the intialization stage (and thus, this value provider could be an intialization term for multiple particles)
|| (forParticle->lifetime == forParticle->startingLifetime)
// .. or the reroll interval is set and expired.
|| (rerollInterval != 0 && ((int)forParticle->GetAge() % rerollInterval == 0));
if (needToReevaluate)
{
alreadyRolled = 1;
RollRandom();
RollRandom(forParticle);
}
return currentValue;
}
@ -465,6 +513,11 @@ float C4ParticleValueProvider::Sin(C4Particle *forParticle)
return sin(parameterValue * M_PI / 180.0f) * maxValue + startValue;
}
float C4ParticleValueProvider::Cos(C4Particle *forParticle)
{
return cos(parameterValue * M_PI / 180.0f) * maxValue + startValue;
}
float C4ParticleValueProvider::Speed(C4Particle *forParticle)
{
float distX = forParticle->currentSpeedX;
@ -509,6 +562,9 @@ void C4ParticleValueProvider::SetType(C4ParticleValueProviderID what)
case C4PV_Sin:
valueFunction = &C4ParticleValueProvider::Sin;
break;
case C4PV_Cos:
valueFunction = &C4ParticleValueProvider::Cos;
break;
case C4PV_Speed:
valueFunction = &C4ParticleValueProvider::Speed;
break;
@ -562,8 +618,10 @@ void C4ParticleValueProvider::Set(const C4ValueArray &fromArray)
SetType(C4PV_Random);
SetParameterValue(VAL_TYPE_FLOAT, fromArray[1], &C4ParticleValueProvider::startValue);
SetParameterValue(VAL_TYPE_FLOAT, fromArray[2], &C4ParticleValueProvider::endValue);
if (arraySize >= 4)
if (arraySize >= 4 && fromArray[3].GetType() != C4V_Type::C4V_Nil)
SetParameterValue(VAL_TYPE_INT, fromArray[3], 0, &C4ParticleValueProvider::rerollInterval);
if (arraySize >= 5 && fromArray[4].GetType() != C4V_Type::C4V_Nil)
SetParameterValue(VAL_TYPE_INT, fromArray[4], 0, &C4ParticleValueProvider::randomSeed);
alreadyRolled = 0;
}
break;
@ -612,10 +670,11 @@ void C4ParticleValueProvider::Set(const C4ValueArray &fromArray)
}
break;
case C4PV_Sin:
case C4PV_Sin: // fallthrough
case C4PV_Cos:
if (arraySize >= 3)
{
SetType(C4PV_Sin); // Sin(parameterValue) * maxValue + startValue
SetType(static_cast<C4ParticleValueProviderID> (type)); // Sin(parameterValue) * maxValue + startValue
SetParameterValue(VAL_TYPE_FLOAT, fromArray[1], &C4ParticleValueProvider::parameterValue);
SetParameterValue(VAL_TYPE_FLOAT, fromArray[2], &C4ParticleValueProvider::maxValue);
SetParameterValue(VAL_TYPE_FLOAT, fromArray[3], &C4ParticleValueProvider::startValue);
@ -1373,13 +1432,7 @@ void C4ParticleSystem::Create(C4ParticleDef *of_def, C4ParticleValueProvider &x,
chunk->ReserveSpace(static_cast<uint32_t>(amount));
while (amount--)
{
if (x.IsRandom()) x.RollRandom();
if (y.IsRandom()) y.RollRandom();
if (speedX.IsRandom()) speedX.RollRandom();
if (speedY.IsRandom()) speedY.RollRandom();
if (lifetime.IsRandom()) lifetime.RollRandom();
{
// create a particle in the fitting chunk (note that we tell the particle list, we already locked it)
C4Particle *particle = chunk->AddNewParticle();
@ -1389,9 +1442,13 @@ void C4ParticleSystem::Create(C4ParticleDef *of_def, C4ParticleValueProvider &x,
particle->properties.Floatify();
// setup some more non-property attributes of the particle
float lifetime_value = lifetime.GetValue(particle);
if (lifetime_value < 0.0f) lifetime_value = 0.0f; // negative values not allowed (would crash later); using a value of 0 is most likely visible to the scripter
particle->lifetime = particle->startingLifetime = lifetime_value;
// The particle having lifetime == startingLifetime will force all random values to alway-reevaluate.
// Thus we need to guarantee that even before setting the lifetime (to allow a PV_Random for the lifetime).
particle->lifetime = particle->startingLifetime = 0.0f;
const float lifetime_value = lifetime.GetValue(particle);
// Negative values are not allowed (would crash later); using a value of 0 is most likely visible to the scripter.
if (lifetime_value >= 0.0f)
particle->lifetime = particle->startingLifetime = lifetime_value;
particle->currentSpeedX = speedX.GetValue(particle);
particle->currentSpeedY = speedY.GetValue(particle);

View File

@ -28,6 +28,7 @@ enum C4ParticleValueProviderID
C4PV_Random,
C4PV_KeyFrames,
C4PV_Sin,
C4PV_Cos,
C4PV_Direction,
C4PV_Step,
C4PV_Speed,
@ -121,6 +122,8 @@ private:
float maxValue; // for Step & Sin
};
int randomSeed = -1; // for Random
size_t keyFrameCount;
std::vector<float> keyFrames;
@ -156,7 +159,11 @@ public:
}
C4ParticleValueProvider(const C4ParticleValueProvider &other) { *this = other; }
C4ParticleValueProvider & operator= (const C4ParticleValueProvider &other);
void RollRandom();
// The random roll is implemented in two variants, one using the default RNG and one using an own implementation that makes use of a seed.
// RollRandom is a wrapper that will select the approprate function to call.
void RollRandom(const C4Particle *forParticle);
void RollRandomUnseeded();
void RollRandomSeeded(const C4Particle *forParticle);
// divides by denominator
void Floatify(float denominator);
@ -178,6 +185,7 @@ private:
float Random(C4Particle *forParticle);
float KeyFrames(C4Particle *forParticle);
float Sin(C4Particle *forParticle);
float Cos(C4Particle *forParticle);
float Direction(C4Particle *forParticle);
float Step(C4Particle *forParticle);
float Speed(C4Particle *forParticle);

View File

@ -647,6 +647,7 @@ void StdMesh::UpdateIBO()
glDeleteBuffers(1, &ibo);
glGenBuffers(1, &ibo);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ibo);
pGL->ObjectLabel(GL_BUFFER, ibo, -1, (Label + "/IBO").c_str());
size_t total_faces = 0;
for (auto &submesh : SubMeshes)

View File

@ -45,8 +45,8 @@ private:
StdMeshBone* Parent; // Parent bone
std::vector<StdMeshBone*> Children; // Children. Not owned.
StdMeshBone(const StdMeshBone&); // non-copyable
StdMeshBone& operator=(const StdMeshBone&); // non-assignable
StdMeshBone(const StdMeshBone&) = delete;
StdMeshBone& operator=(const StdMeshBone&) = delete;
};
class StdMeshVertexBoneAssignment
@ -133,8 +133,8 @@ public:
private:
void AddMasterBone(StdMeshBone* bone);
StdMeshSkeleton(const StdMeshSkeleton& other); // non-copyable
StdMeshSkeleton& operator=(const StdMeshSkeleton& other); // non-assignable
StdMeshSkeleton(const StdMeshSkeleton& other) = delete;
StdMeshSkeleton& operator=(const StdMeshSkeleton& other) = delete;
std::vector<StdMeshBone*> Bones; // Master Bone Table
@ -220,8 +220,8 @@ private:
void UpdateIBO();
#endif
StdMesh(const StdMesh& other); // non-copyable
StdMesh& operator=(const StdMesh& other); // non-assignable
StdMesh(const StdMesh& other) = delete;
StdMesh& operator=(const StdMesh& other) = delete;
std::vector<Vertex> SharedVertices;
@ -298,8 +298,8 @@ protected:
// TODO: GLuint texenv_list; // NoSave, texture environment setup could be stored in a display list (w/ and w/o ClrMod). What about PlayerColor?
private:
StdSubMeshInstance(const StdSubMeshInstance& other); // noncopyable
StdSubMeshInstance& operator=(const StdSubMeshInstance& other); // noncopyable
StdSubMeshInstance(const StdSubMeshInstance& other) = delete;
StdSubMeshInstance& operator=(const StdSubMeshInstance& other) = delete;
};
class StdMeshInstance
@ -659,8 +659,8 @@ protected:
unsigned int vaoid;
#endif
private:
StdMeshInstance(const StdMeshInstance& other); // noncopyable
StdMeshInstance& operator=(const StdMeshInstance& other); // noncopyable
StdMeshInstance(const StdMeshInstance& other) = delete;
StdMeshInstance& operator=(const StdMeshInstance& other) = delete;
};
inline void CompileNewFuncCtx(StdMeshInstance::SerializableValueProvider *&pStruct, StdCompiler *pComp, const StdMeshInstance::SerializableValueProvider::IDBase& rID)

View File

@ -384,7 +384,7 @@ void C4ObjectList::Draw(C4TargetFacet &cgo, int iPlayer, int MinPlane, int MaxPl
// Draw objects (base)
for (clnk=first; clnk; clnk=clnk->Prev)
{
if (first->Obj->GetPlane() > MaxPlane)
if (clnk->Obj->GetPlane() > MaxPlane)
break;
if (clnk->Obj->Category & C4D_Foreground)
continue;
@ -393,7 +393,7 @@ void C4ObjectList::Draw(C4TargetFacet &cgo, int iPlayer, int MinPlane, int MaxPl
// Draw objects (top face)
for (clnk=first; clnk; clnk=clnk->Prev)
{
if (first->Obj->GetPlane() > MaxPlane)
if (clnk->Obj->GetPlane() > MaxPlane)
break;
if (clnk->Obj->Category & C4D_Foreground)
continue;

View File

@ -104,7 +104,7 @@ struct C4ValueArraySortStringscomp
{
if (v1.getStr() && v2.getStr())
return std::strcmp(v1._getStr()->GetCStr(), v2._getStr()->GetCStr()) < 0;
return v2.getStr();
return v2.getStr() != nullptr;
}
};