2009-05-08 13:28:41 +00:00
|
|
|
/*
|
|
|
|
* OpenClonk, http://www.openclonk.org
|
|
|
|
*
|
2013-12-17 20:01:09 +00:00
|
|
|
* Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de/
|
2019-01-01 20:29:19 +00:00
|
|
|
* Copyright (c) 2009-2019, The OpenClonk Team and contributors
|
2009-05-08 13:28:41 +00:00
|
|
|
*
|
2013-12-17 20:01:09 +00:00
|
|
|
* Distributed under the terms of the ISC license; see accompanying file
|
|
|
|
* "COPYING" for details.
|
2009-05-08 13:28:41 +00:00
|
|
|
*
|
2013-12-17 20:01:09 +00:00
|
|
|
* "Clonk" is a registered trademark of Matthes Bender, used with permission.
|
|
|
|
* See accompanying file "TRADEMARK" for details.
|
2009-05-08 13:28:41 +00:00
|
|
|
*
|
2013-12-17 20:01:09 +00:00
|
|
|
* To redistribute this file separately, substitute the full license texts
|
|
|
|
* for the above references.
|
2009-05-08 13:28:41 +00:00
|
|
|
*/
|
|
|
|
/* string table: holds all strings used by script engine */
|
|
|
|
|
|
|
|
#ifndef C4STRINGTABLE_H
|
|
|
|
#define C4STRINGTABLE_H
|
|
|
|
|
2014-06-01 19:21:10 +00:00
|
|
|
class C4RefCnt
|
|
|
|
{
|
|
|
|
public:
|
2017-05-07 11:50:00 +00:00
|
|
|
C4RefCnt() = default;
|
|
|
|
virtual ~C4RefCnt() = default;
|
2014-06-01 19:21:10 +00:00
|
|
|
// Add/Remove Reference
|
|
|
|
void IncRef() { RefCnt++; }
|
|
|
|
void DecRef() { if (!--RefCnt) delete this; }
|
|
|
|
protected:
|
|
|
|
// Reference counter
|
2017-05-07 11:50:00 +00:00
|
|
|
unsigned int RefCnt{0};
|
2014-06-01 19:21:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class C4String: public C4RefCnt
|
2010-03-28 17:58:21 +00:00
|
|
|
{
|
2010-12-08 22:27:02 +00:00
|
|
|
public:
|
|
|
|
unsigned int Hash;
|
|
|
|
private:
|
|
|
|
StdCopyStrBuf Data; // string data
|
|
|
|
|
2009-04-01 21:36:58 +00:00
|
|
|
explicit C4String(StdStrBuf strString);
|
2010-12-06 15:24:41 +00:00
|
|
|
C4String();
|
|
|
|
void operator=(const char * s);
|
2009-04-01 21:36:58 +00:00
|
|
|
|
2009-05-08 13:28:41 +00:00
|
|
|
friend class C4StringTable;
|
|
|
|
public:
|
2017-05-07 11:50:00 +00:00
|
|
|
~C4String() override;
|
2009-05-08 13:28:41 +00:00
|
|
|
|
|
|
|
const char * GetCStr() const { return Data.getData(); }
|
|
|
|
StdStrBuf GetData() const { return Data.getRef(); }
|
|
|
|
|
2010-03-28 17:58:21 +00:00
|
|
|
};
|
2009-05-08 13:28:41 +00:00
|
|
|
|
2011-09-25 19:09:16 +00:00
|
|
|
template <class T>
|
|
|
|
class C4RefCntPointer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
C4RefCntPointer(T* p): p(p) { IncRef(); }
|
2017-05-07 11:50:00 +00:00
|
|
|
C4RefCntPointer(): p(nullptr) { }
|
2016-04-09 18:20:31 +00:00
|
|
|
C4RefCntPointer(const C4RefCntPointer<T> & r) : p(r.p) { IncRef(); }
|
2011-09-25 19:09:16 +00:00
|
|
|
template <class U> C4RefCntPointer(const C4RefCntPointer<U> & r): p(r.p) { IncRef(); }
|
|
|
|
// Move constructor
|
2017-05-07 11:50:00 +00:00
|
|
|
C4RefCntPointer(C4RefCntPointer<T> &&r) : p(r.p) { r.p = nullptr; }
|
2015-09-20 11:26:43 +00:00
|
|
|
template <class U> C4RefCntPointer(C4RefCntPointer<U> &&r): p(r.p) { r.p = 0; }
|
2011-09-25 19:09:16 +00:00
|
|
|
// Move assignment
|
2016-04-09 18:20:31 +00:00
|
|
|
C4RefCntPointer& operator = (C4RefCntPointer<T> &&r)
|
|
|
|
{
|
|
|
|
if (p != r.p)
|
|
|
|
{
|
|
|
|
DecRef();
|
|
|
|
p = r.p;
|
2017-05-07 11:50:00 +00:00
|
|
|
r.p = nullptr;
|
2016-04-09 18:20:31 +00:00
|
|
|
}
|
|
|
|
return *this;
|
|
|
|
}
|
2015-09-20 11:26:43 +00:00
|
|
|
template <class U> C4RefCntPointer& operator = (C4RefCntPointer<U> &&r)
|
2011-09-25 19:09:16 +00:00
|
|
|
{
|
|
|
|
if (p != r.p)
|
|
|
|
{
|
|
|
|
DecRef();
|
|
|
|
p = r.p;
|
|
|
|
r.p = 0;
|
|
|
|
}
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
~C4RefCntPointer() { DecRef(); }
|
|
|
|
template <class U> C4RefCntPointer& operator = (U* new_p)
|
|
|
|
{
|
|
|
|
if (p != new_p)
|
|
|
|
{
|
|
|
|
DecRef();
|
|
|
|
p = new_p;
|
|
|
|
IncRef();
|
|
|
|
}
|
|
|
|
return *this;
|
|
|
|
}
|
2016-04-09 18:20:31 +00:00
|
|
|
C4RefCntPointer& operator = (const C4RefCntPointer<T>& r)
|
|
|
|
{
|
|
|
|
return *this = r.p;
|
|
|
|
}
|
2011-09-25 19:09:16 +00:00
|
|
|
template <class U> C4RefCntPointer& operator = (const C4RefCntPointer<U>& r)
|
|
|
|
{
|
|
|
|
return *this = r.p;
|
|
|
|
}
|
|
|
|
T& operator * () { return *p; }
|
|
|
|
const T& operator * () const { return *p; }
|
|
|
|
T* operator -> () { return p; }
|
|
|
|
const T* operator -> () const { return p; }
|
|
|
|
operator T * () { return p; }
|
|
|
|
operator const T * () const { return p; }
|
2016-02-12 04:37:13 +00:00
|
|
|
T *Get() const { return p; }
|
2011-09-25 19:09:16 +00:00
|
|
|
private:
|
|
|
|
void IncRef() { if (p) p->IncRef(); }
|
|
|
|
void DecRef() { if (p) p->DecRef(); }
|
|
|
|
T * p;
|
|
|
|
};
|
|
|
|
|
2009-04-01 21:36:58 +00:00
|
|
|
template<typename T> class C4Set
|
2010-03-28 17:58:21 +00:00
|
|
|
{
|
2017-05-07 11:50:00 +00:00
|
|
|
unsigned int Capacity{2};
|
|
|
|
unsigned int Size{0};
|
2009-04-01 21:36:58 +00:00
|
|
|
T * Table;
|
2012-07-25 23:21:15 +00:00
|
|
|
T * GetPlaceFor(T const & e)
|
2010-03-28 17:58:21 +00:00
|
|
|
{
|
2009-04-01 21:36:58 +00:00
|
|
|
unsigned int h = Hash(e);
|
|
|
|
T * p = &Table[h % Capacity];
|
2011-10-18 19:57:52 +00:00
|
|
|
while (*p && !Equals(*p, e))
|
2010-03-28 17:58:21 +00:00
|
|
|
{
|
2009-04-01 21:36:58 +00:00
|
|
|
p = &Table[++h % Capacity];
|
2010-03-28 17:58:21 +00:00
|
|
|
}
|
2012-07-25 23:21:15 +00:00
|
|
|
return p;
|
|
|
|
}
|
|
|
|
T * AddInternal(T const & e)
|
|
|
|
{
|
|
|
|
T * p = GetPlaceFor(e);
|
2009-04-01 21:36:58 +00:00
|
|
|
*p = e;
|
2010-03-23 22:56:59 +00:00
|
|
|
return p;
|
2010-03-28 17:58:21 +00:00
|
|
|
}
|
2012-07-25 23:21:15 +00:00
|
|
|
T * AddInternal(T && e)
|
|
|
|
{
|
|
|
|
T * p = GetPlaceFor(e);
|
|
|
|
*p = std::move(e);
|
|
|
|
return p;
|
|
|
|
}
|
2016-01-24 23:54:58 +00:00
|
|
|
void ClearTable()
|
|
|
|
{
|
|
|
|
for (unsigned int i = 0; i < Capacity; ++i)
|
2019-01-01 20:29:19 +00:00
|
|
|
Table[i] = T{};
|
2016-01-24 23:54:58 +00:00
|
|
|
}
|
2012-07-25 23:21:15 +00:00
|
|
|
void MaintainCapacity()
|
|
|
|
{
|
2015-11-15 12:53:01 +00:00
|
|
|
if (Capacity - Size < std::max(2u, Capacity / 4))
|
2012-07-25 23:21:15 +00:00
|
|
|
{
|
|
|
|
unsigned int OCapacity = Capacity;
|
|
|
|
Capacity *= 2;
|
|
|
|
T * OTable = Table;
|
|
|
|
Table = new T[Capacity];
|
2016-01-24 23:54:58 +00:00
|
|
|
ClearTable();
|
2012-07-25 23:21:15 +00:00
|
|
|
for (unsigned int i = 0; i < OCapacity; ++i)
|
|
|
|
{
|
|
|
|
if (OTable[i])
|
|
|
|
AddInternal(std::move(OTable[i]));
|
|
|
|
}
|
|
|
|
delete [] OTable;
|
|
|
|
}
|
|
|
|
}
|
2009-04-01 21:36:58 +00:00
|
|
|
public:
|
2012-07-25 23:21:15 +00:00
|
|
|
template<typename H> static unsigned int Hash(const H &);
|
|
|
|
template<typename H> static bool Equals(const T &, const H &);
|
|
|
|
static bool Equals(const T & a, const T & b) { return a == b; }
|
2017-05-07 11:50:00 +00:00
|
|
|
C4Set(): Table(new T[Capacity])
|
2010-03-28 17:58:21 +00:00
|
|
|
{
|
2016-01-24 23:54:58 +00:00
|
|
|
ClearTable();
|
2010-03-28 17:58:21 +00:00
|
|
|
}
|
2009-04-01 21:36:58 +00:00
|
|
|
~C4Set()
|
2010-03-28 17:58:21 +00:00
|
|
|
{
|
2009-04-01 21:36:58 +00:00
|
|
|
delete[] Table;
|
2010-03-28 17:58:21 +00:00
|
|
|
}
|
2011-10-18 19:56:10 +00:00
|
|
|
C4Set(const C4Set & b): Capacity(0), Size(0), Table(0)
|
|
|
|
{
|
|
|
|
*this = b;
|
|
|
|
}
|
|
|
|
C4Set & operator = (const C4Set & b)
|
|
|
|
{
|
|
|
|
Capacity = b.Capacity;
|
|
|
|
Size = b.Size;
|
|
|
|
delete[] Table;
|
|
|
|
Table = new T[Capacity];
|
|
|
|
for (unsigned int i = 0; i < Capacity; ++i)
|
|
|
|
Table[i] = b.Table[i];
|
2012-10-14 12:39:22 +00:00
|
|
|
return *this;
|
2011-10-18 19:56:10 +00:00
|
|
|
}
|
2016-02-12 04:37:13 +00:00
|
|
|
void CompileFunc(class StdCompiler *pComp, class C4ValueNumbers *);
|
2009-04-01 21:36:58 +00:00
|
|
|
void Clear()
|
2010-03-28 17:58:21 +00:00
|
|
|
{
|
2016-01-24 23:54:58 +00:00
|
|
|
ClearTable();
|
|
|
|
Size = 0;
|
2010-03-28 17:58:21 +00:00
|
|
|
}
|
2010-03-23 22:56:59 +00:00
|
|
|
template<typename H> T & Get(H e) const
|
2010-03-28 17:58:21 +00:00
|
|
|
{
|
2009-04-01 21:36:58 +00:00
|
|
|
unsigned int h = Hash(e);
|
2009-05-19 22:12:11 +00:00
|
|
|
T * r = &Table[h % Capacity];
|
|
|
|
while (*r && !Equals(*r, e))
|
2010-03-28 17:58:21 +00:00
|
|
|
{
|
2009-05-19 22:12:11 +00:00
|
|
|
r = &Table[++h % Capacity];
|
|
|
|
}
|
2010-03-28 17:58:21 +00:00
|
|
|
return *r;
|
|
|
|
}
|
2010-03-23 22:56:59 +00:00
|
|
|
template<typename H> bool Has(H e) const
|
2010-03-28 17:58:21 +00:00
|
|
|
{
|
2009-05-19 22:12:11 +00:00
|
|
|
unsigned int h = Hash(e);
|
|
|
|
T * r = &Table[h % Capacity];
|
|
|
|
while (*r && !Equals(*r, e))
|
2010-03-28 17:58:21 +00:00
|
|
|
{
|
2009-05-19 22:12:11 +00:00
|
|
|
r = &Table[++h % Capacity];
|
2009-04-01 21:36:58 +00:00
|
|
|
}
|
2010-03-28 17:58:21 +00:00
|
|
|
return !!*r;
|
|
|
|
}
|
2010-09-10 21:01:30 +00:00
|
|
|
unsigned int GetSize() const { return Size; }
|
2012-07-25 23:21:15 +00:00
|
|
|
T * Add(T const & e)
|
2010-03-28 17:58:21 +00:00
|
|
|
{
|
2012-07-25 23:21:15 +00:00
|
|
|
MaintainCapacity();
|
2010-03-23 22:56:59 +00:00
|
|
|
T * r = AddInternal(e);
|
2009-04-01 21:36:58 +00:00
|
|
|
++Size;
|
2010-03-23 22:56:59 +00:00
|
|
|
return r;
|
2010-03-28 17:58:21 +00:00
|
|
|
}
|
2012-07-25 23:21:15 +00:00
|
|
|
T * Add(T && e)
|
|
|
|
{
|
|
|
|
MaintainCapacity();
|
|
|
|
T * r = AddInternal(std::move(e));
|
|
|
|
++Size;
|
|
|
|
return r;
|
|
|
|
}
|
2009-04-01 21:36:58 +00:00
|
|
|
template<typename H> void Remove(H e)
|
2010-03-28 17:58:21 +00:00
|
|
|
{
|
2009-04-01 21:36:58 +00:00
|
|
|
unsigned int h = Hash(e);
|
|
|
|
T * r = &Table[h % Capacity];
|
|
|
|
while (*r && !Equals(*r, e))
|
2010-03-28 17:58:21 +00:00
|
|
|
{
|
2009-04-01 21:36:58 +00:00
|
|
|
r = &Table[++h % Capacity];
|
2010-03-28 17:58:21 +00:00
|
|
|
}
|
2009-04-01 21:36:58 +00:00
|
|
|
assert(*r);
|
2019-01-01 20:29:19 +00:00
|
|
|
*r = T{};
|
2009-04-01 21:36:58 +00:00
|
|
|
--Size;
|
|
|
|
// Move entries which might have collided with e
|
|
|
|
while (*(r = &Table[++h % Capacity]))
|
2010-03-28 17:58:21 +00:00
|
|
|
{
|
2009-04-01 21:36:58 +00:00
|
|
|
T m = *r;
|
2019-01-01 20:29:19 +00:00
|
|
|
*r = T{};
|
2012-07-25 23:21:15 +00:00
|
|
|
AddInternal(std::move(m));
|
2009-04-01 21:36:58 +00:00
|
|
|
}
|
2010-03-28 17:58:21 +00:00
|
|
|
}
|
2009-04-01 21:36:58 +00:00
|
|
|
T const * First() const { return Next(Table - 1); }
|
|
|
|
T const * Next(T const * p) const
|
2010-03-28 17:58:21 +00:00
|
|
|
{
|
2009-04-01 21:36:58 +00:00
|
|
|
while (++p != &Table[Capacity])
|
2010-03-28 17:58:21 +00:00
|
|
|
{
|
2009-04-01 21:36:58 +00:00
|
|
|
if (*p) return p;
|
|
|
|
}
|
2017-05-07 11:50:00 +00:00
|
|
|
return nullptr;
|
2010-03-28 17:58:21 +00:00
|
|
|
}
|
2012-05-27 22:31:55 +00:00
|
|
|
void Swap(C4Set<T> * S2)
|
|
|
|
{
|
|
|
|
unsigned int Capacity2 = S2->Capacity;
|
|
|
|
unsigned int Size2 = S2->Size;
|
|
|
|
T * Table2 = S2->Table;
|
|
|
|
S2->Capacity = Capacity;
|
|
|
|
S2->Size = Size;
|
|
|
|
S2->Table = Table;
|
|
|
|
Capacity = Capacity2;
|
|
|
|
Size = Size2;
|
|
|
|
Table = Table2;
|
|
|
|
}
|
2012-10-16 13:47:56 +00:00
|
|
|
static bool SortFunc(const T *p1, const T*p2)
|
2012-10-14 12:39:22 +00:00
|
|
|
{
|
2016-11-02 23:58:02 +00:00
|
|
|
// elements are guarantueed to be non-nullptr
|
2012-10-16 13:47:56 +00:00
|
|
|
return *p1<*p2;
|
|
|
|
}
|
|
|
|
std::list<const T *> GetSortedListOfElementPointers() const
|
|
|
|
{
|
|
|
|
// return a list of pointers to all elements in this set sorted by the standard less-than operation
|
|
|
|
// of the elements
|
2016-11-02 23:58:02 +00:00
|
|
|
// elements of resulting lists are guarantueed to be non-nullptr
|
2012-10-16 13:47:56 +00:00
|
|
|
// list remains valid as long as this set is not changed
|
|
|
|
std::list<const T *> result;
|
|
|
|
for (const T *p = First(); p; p = Next(p)) result.push_back(p);
|
|
|
|
result.sort(C4Set<T>::SortFunc);
|
|
|
|
return result;
|
2012-10-14 12:39:22 +00:00
|
|
|
}
|
2010-03-28 17:58:21 +00:00
|
|
|
};
|
2009-05-08 13:28:41 +00:00
|
|
|
|
2009-04-01 21:36:58 +00:00
|
|
|
template<> template<>
|
2012-07-25 23:21:15 +00:00
|
|
|
inline unsigned int C4Set<C4String *>::Hash<const C4String *>(const C4String * const & e)
|
2010-03-28 17:58:21 +00:00
|
|
|
{
|
2009-04-01 21:36:58 +00:00
|
|
|
return e->Hash;
|
2010-03-28 17:58:21 +00:00
|
|
|
}
|
2009-04-01 21:36:58 +00:00
|
|
|
template<> template<>
|
2012-07-25 23:21:15 +00:00
|
|
|
inline unsigned int C4Set<C4String *>::Hash<C4String *>(C4String * const & e)
|
2010-03-28 17:58:21 +00:00
|
|
|
{
|
2009-04-01 21:36:58 +00:00
|
|
|
return e->Hash;
|
2010-03-28 17:58:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
enum C4PropertyName
|
|
|
|
{
|
2013-11-29 17:39:29 +00:00
|
|
|
// TODO: documentation comments can be removed
|
|
|
|
// as soon as all properties are documented
|
|
|
|
|
2010-03-28 17:58:21 +00:00
|
|
|
P_Prototype,
|
|
|
|
P_Name,
|
2010-12-24 14:10:39 +00:00
|
|
|
P_Priority,
|
|
|
|
P_Interval,
|
|
|
|
P_CommandTarget,
|
|
|
|
P_Time,
|
2015-12-23 00:17:31 +00:00
|
|
|
P_Construction,
|
|
|
|
P_Destruction,
|
2015-12-22 23:40:16 +00:00
|
|
|
P_Start,
|
|
|
|
P_Stop,
|
|
|
|
P_Timer,
|
|
|
|
P_Effect,
|
|
|
|
P_Damage,
|
2010-03-28 17:58:21 +00:00
|
|
|
P_Collectible,
|
2011-01-02 22:55:48 +00:00
|
|
|
P_Touchable,
|
2010-03-28 17:58:21 +00:00
|
|
|
P_ActMap,
|
|
|
|
P_Attach,
|
|
|
|
P_Visibility,
|
|
|
|
P_Parallaxity,
|
|
|
|
P_LineColors,
|
|
|
|
P_LineAttach,
|
|
|
|
P_PictureTransformation,
|
|
|
|
P_MeshTransformation,
|
|
|
|
P_Procedure,
|
2010-12-11 20:10:05 +00:00
|
|
|
P_Speed,
|
|
|
|
P_Accel,
|
|
|
|
P_Decel,
|
2010-03-28 17:58:21 +00:00
|
|
|
P_Directions,
|
|
|
|
P_FlipDir,
|
|
|
|
P_Length,
|
|
|
|
P_Delay,
|
|
|
|
P_X,
|
|
|
|
P_Y,
|
2015-07-31 03:13:31 +00:00
|
|
|
P_x,
|
|
|
|
P_y,
|
2010-03-28 17:58:21 +00:00
|
|
|
P_Wdt,
|
|
|
|
P_Hgt,
|
2016-05-23 23:22:49 +00:00
|
|
|
P_wdt,
|
|
|
|
P_hgt,
|
2016-11-02 13:24:14 +00:00
|
|
|
P_Vertices,
|
|
|
|
P_Edges,
|
|
|
|
P_LineWidth,
|
2010-03-28 17:58:21 +00:00
|
|
|
P_OffX,
|
|
|
|
P_OffY,
|
2016-11-02 13:24:14 +00:00
|
|
|
P_proplist,
|
|
|
|
P_Proplist,
|
2010-03-28 17:58:21 +00:00
|
|
|
P_FacetBase,
|
|
|
|
P_FacetTopFace,
|
|
|
|
P_FacetTargetStretch,
|
|
|
|
P_NextAction,
|
|
|
|
P_Hold,
|
|
|
|
P_Idle,
|
|
|
|
P_NoOtherAction,
|
|
|
|
P_StartCall,
|
|
|
|
P_EndCall,
|
|
|
|
P_AbortCall,
|
|
|
|
P_PhaseCall,
|
|
|
|
P_Sound,
|
|
|
|
P_ObjectDisabled,
|
|
|
|
P_DigFree,
|
|
|
|
P_InLiquidAction,
|
|
|
|
P_TurnAction,
|
|
|
|
P_Reverse,
|
|
|
|
P_Step,
|
2011-12-28 18:33:19 +00:00
|
|
|
P_MouseDrag,
|
2010-03-28 17:58:21 +00:00
|
|
|
P_MouseDragImage,
|
|
|
|
P_Animation,
|
|
|
|
P_Action,
|
2010-12-12 20:49:47 +00:00
|
|
|
P_BreatheWater,
|
|
|
|
P_CorrosionResist,
|
2010-12-12 21:38:15 +00:00
|
|
|
P_MaxEnergy,
|
2010-12-12 22:01:08 +00:00
|
|
|
P_MaxBreath,
|
2010-12-13 01:17:21 +00:00
|
|
|
P_ThrowSpeed,
|
2013-11-29 17:39:29 +00:00
|
|
|
P_Mode, // unused?
|
|
|
|
P_CausedBy, // unused?
|
|
|
|
P_Blasted, // unused?
|
|
|
|
P_IncineratingObj, // unused?
|
2010-12-27 19:15:55 +00:00
|
|
|
P_Plane,
|
2016-01-01 17:53:34 +00:00
|
|
|
P_BorderBound,
|
2016-02-08 20:16:11 +00:00
|
|
|
P_ContactCalls,
|
2014-05-04 12:14:42 +00:00
|
|
|
P_SolidMaskPlane,
|
2012-04-15 10:09:54 +00:00
|
|
|
P_Tooltip,
|
2012-04-16 20:17:05 +00:00
|
|
|
P_Placement,
|
2015-01-14 19:30:55 +00:00
|
|
|
P_ContainBlast,
|
2012-04-28 14:17:38 +00:00
|
|
|
P_BlastIncinerate,
|
|
|
|
P_ContactIncinerate,
|
2017-10-31 23:49:26 +00:00
|
|
|
P_MaterialIncinerate,
|
2012-08-19 20:43:32 +00:00
|
|
|
P_Global,
|
2013-03-22 21:56:02 +00:00
|
|
|
P_Scenario,
|
2012-12-09 17:42:52 +00:00
|
|
|
P_JumpSpeed,
|
2013-02-12 19:39:20 +00:00
|
|
|
P_BackgroundColor,
|
|
|
|
P_Decoration,
|
|
|
|
P_Symbol,
|
|
|
|
P_Target,
|
|
|
|
P_Std,
|
|
|
|
P_Text,
|
2015-03-23 14:34:09 +00:00
|
|
|
P_GraphicsName,
|
2013-02-12 19:39:20 +00:00
|
|
|
P_ID,
|
|
|
|
P_OnClick,
|
2013-04-04 16:12:34 +00:00
|
|
|
P_OnMouseIn,
|
|
|
|
P_OnMouseOut,
|
2013-04-07 20:52:45 +00:00
|
|
|
P_OnClose,
|
2013-04-04 16:12:34 +00:00
|
|
|
P_Style,
|
2014-02-15 17:30:21 +00:00
|
|
|
P_Player,
|
2014-02-26 21:37:02 +00:00
|
|
|
P_Margin,
|
2013-03-18 23:35:00 +00:00
|
|
|
P_Algo,
|
|
|
|
P_Layer,
|
|
|
|
P_Seed,
|
|
|
|
P_Ratio,
|
|
|
|
P_FixedOffset,
|
|
|
|
P_Op,
|
|
|
|
P_R,
|
|
|
|
P_Scale,
|
|
|
|
P_Amplitude,
|
|
|
|
P_Iterations,
|
|
|
|
P_Empty,
|
|
|
|
P_Open,
|
|
|
|
P_Left,
|
|
|
|
P_Top,
|
|
|
|
P_Right,
|
|
|
|
P_Bottom,
|
|
|
|
P_Filter,
|
2013-09-21 14:48:28 +00:00
|
|
|
P_ForceX,
|
|
|
|
P_ForceY,
|
|
|
|
P_G,
|
|
|
|
P_B,
|
|
|
|
P_Alpha,
|
|
|
|
P_DampingX,
|
|
|
|
P_DampingY,
|
|
|
|
P_Size,
|
2013-09-24 18:36:49 +00:00
|
|
|
P_Rotation,
|
2013-09-24 19:15:24 +00:00
|
|
|
P_BlitMode,
|
2013-09-25 11:30:06 +00:00
|
|
|
P_Phase,
|
2013-09-27 11:28:38 +00:00
|
|
|
P_Stretch,
|
2013-09-27 13:27:53 +00:00
|
|
|
P_CollisionVertex,
|
2015-09-12 08:53:23 +00:00
|
|
|
P_CollisionDensity,
|
2013-09-27 14:06:25 +00:00
|
|
|
P_OnCollision,
|
2013-10-12 17:28:22 +00:00
|
|
|
P_Distance,
|
2013-12-14 11:09:31 +00:00
|
|
|
P_Smoke,
|
2014-07-05 13:25:30 +00:00
|
|
|
P_Source,
|
|
|
|
P_Color,
|
2015-01-03 22:21:36 +00:00
|
|
|
P_EditCursorCommands,
|
2015-07-31 03:13:31 +00:00
|
|
|
P_IsPointContained,
|
|
|
|
P_GetRandomPoint,
|
2015-08-28 01:44:23 +00:00
|
|
|
P_Type,
|
|
|
|
P_Reverb_Density,
|
|
|
|
P_Reverb_Diffusion,
|
|
|
|
P_Reverb_Gain,
|
|
|
|
P_Reverb_GainHF,
|
|
|
|
P_Reverb_Decay_Time,
|
|
|
|
P_Reverb_Decay_HFRatio,
|
|
|
|
P_Reverb_Reflections_Gain,
|
|
|
|
P_Reverb_Reflections_Delay,
|
|
|
|
P_Reverb_Late_Reverb_Gain,
|
|
|
|
P_Reverb_Late_Reverb_Delay,
|
|
|
|
P_Reverb_Air_Absorption_GainHF,
|
|
|
|
P_Reverb_Room_Rolloff_Factor,
|
|
|
|
P_Reverb_Decay_HFLimit,
|
|
|
|
P_Echo_Delay,
|
|
|
|
P_Echo_LRDelay,
|
|
|
|
P_Echo_Damping,
|
|
|
|
P_Echo_Feedback,
|
|
|
|
P_Echo_Spread,
|
|
|
|
P_Equalizer_Low_Gain,
|
|
|
|
P_Equalizer_Low_Cutoff,
|
|
|
|
P_Equalizer_Mid1_Gain,
|
|
|
|
P_Equalizer_Mid1_Center,
|
|
|
|
P_Equalizer_Mid1_Width,
|
|
|
|
P_Equalizer_Mid2_Gain,
|
|
|
|
P_Equalizer_Mid2_Center,
|
|
|
|
P_Equalizer_Mid2_Width,
|
|
|
|
P_Equalizer_High_Gain,
|
|
|
|
P_Equalizer_High_Cutoff,
|
2015-09-17 01:13:00 +00:00
|
|
|
P_LightOffset,
|
2015-10-01 02:49:47 +00:00
|
|
|
P_PlayList,
|
|
|
|
P_MusicBreakMin,
|
|
|
|
P_MusicBreakMax,
|
|
|
|
P_MusicBreakChance,
|
2015-12-04 00:17:14 +00:00
|
|
|
P_MusicMaxPositionMemory,
|
2015-10-09 20:24:16 +00:00
|
|
|
P_InflameLandscape,
|
2016-04-04 03:46:58 +00:00
|
|
|
P_OptionKey,
|
|
|
|
P_ValueKey,
|
|
|
|
P_Value,
|
2016-09-01 22:32:24 +00:00
|
|
|
P_DefaultValueFunction,
|
2016-04-04 03:46:58 +00:00
|
|
|
P_Delegate,
|
2016-11-11 02:43:03 +00:00
|
|
|
P_VertexDelegate,
|
|
|
|
P_EdgeDelegate,
|
2016-11-13 02:23:00 +00:00
|
|
|
P_HorizontalFix,
|
|
|
|
P_VerticalFix,
|
|
|
|
P_StructureFix,
|
2016-11-13 03:19:42 +00:00
|
|
|
P_OnUpdate,
|
2017-02-26 15:45:38 +00:00
|
|
|
P_EditorPropertyChanged,
|
2016-04-09 18:20:31 +00:00
|
|
|
P_Min,
|
|
|
|
P_Max,
|
|
|
|
P_Set,
|
2016-07-21 04:20:44 +00:00
|
|
|
P_SetGlobal,
|
|
|
|
P_SetRoot,
|
2016-04-09 18:20:31 +00:00
|
|
|
P_Options,
|
2016-04-17 02:02:24 +00:00
|
|
|
P_Key,
|
|
|
|
P_AsyncGet,
|
2016-07-04 01:16:07 +00:00
|
|
|
P_Get,
|
2016-04-25 20:17:10 +00:00
|
|
|
P_Relative,
|
|
|
|
P_CanMoveCenter,
|
2017-02-20 18:39:46 +00:00
|
|
|
P_StartFromObject,
|
2016-05-23 23:22:49 +00:00
|
|
|
P_Storage,
|
2016-06-03 05:20:43 +00:00
|
|
|
P_Elements,
|
|
|
|
P_EditOnSelection,
|
2016-07-13 21:18:08 +00:00
|
|
|
P_EditorProps,
|
2016-06-03 05:20:43 +00:00
|
|
|
P_DefaultEditorProp,
|
2016-07-14 04:17:53 +00:00
|
|
|
P_EditorActions,
|
2016-06-03 05:20:43 +00:00
|
|
|
P_CopyDefault,
|
2016-06-06 05:54:05 +00:00
|
|
|
P_Display,
|
|
|
|
P_DefaultValue,
|
2016-06-07 22:22:43 +00:00
|
|
|
P_DefinitionPriority,
|
2016-06-15 04:15:08 +00:00
|
|
|
P_Group,
|
2016-06-19 04:08:09 +00:00
|
|
|
P_Command,
|
2016-07-07 05:36:58 +00:00
|
|
|
P_Select,
|
2016-07-06 04:56:08 +00:00
|
|
|
P_DescendPath,
|
2016-07-22 04:28:01 +00:00
|
|
|
P_EmptyName,
|
2016-07-30 18:50:07 +00:00
|
|
|
P_ShortName,
|
2016-07-25 03:10:43 +00:00
|
|
|
P_EditorHelp,
|
2016-07-24 04:25:46 +00:00
|
|
|
P_Description,
|
2016-07-28 04:24:28 +00:00
|
|
|
P_AllowEditing,
|
2016-08-05 02:12:10 +00:00
|
|
|
P_EditorInitialize,
|
2016-08-06 06:36:53 +00:00
|
|
|
P_EditorPlacementLimit,
|
2017-01-01 21:57:19 +00:00
|
|
|
P_EditorCollection,
|
2016-08-27 20:46:38 +00:00
|
|
|
P_Sorted,
|
2016-11-12 20:57:10 +00:00
|
|
|
P_Uniforms,
|
2017-02-20 00:07:51 +00:00
|
|
|
P_ForceSerialization,
|
2017-02-20 19:05:24 +00:00
|
|
|
P_DrawArrows,
|
2017-02-21 20:14:43 +00:00
|
|
|
P_SCENPAR,
|
2017-05-07 18:25:03 +00:00
|
|
|
P_Translatable,
|
|
|
|
P_Function,
|
|
|
|
P_Translate,
|
2010-12-08 22:17:00 +00:00
|
|
|
// Default Action Procedures
|
|
|
|
DFA_WALK,
|
|
|
|
DFA_FLIGHT,
|
|
|
|
DFA_KNEEL,
|
|
|
|
DFA_SCALE,
|
|
|
|
DFA_HANGLE,
|
|
|
|
DFA_DIG,
|
|
|
|
DFA_SWIM,
|
|
|
|
DFA_THROW,
|
|
|
|
DFA_BRIDGE,
|
|
|
|
DFA_PUSH,
|
|
|
|
DFA_LIFT,
|
|
|
|
DFA_FLOAT,
|
|
|
|
DFA_ATTACH,
|
|
|
|
DFA_CONNECT,
|
|
|
|
DFA_PULL,
|
2010-03-28 17:58:21 +00:00
|
|
|
P_LAST
|
|
|
|
};
|
2009-05-19 22:12:11 +00:00
|
|
|
|
2010-07-06 00:10:54 +00:00
|
|
|
// There is only one Stringtable
|
2009-05-08 13:28:41 +00:00
|
|
|
class C4StringTable
|
2010-03-28 17:58:21 +00:00
|
|
|
{
|
2009-05-08 13:28:41 +00:00
|
|
|
public:
|
|
|
|
C4StringTable();
|
|
|
|
virtual ~C4StringTable();
|
|
|
|
|
|
|
|
C4String *RegString(StdStrBuf String);
|
|
|
|
C4String *RegString(const char * s) { return RegString(StdStrBuf(s)); }
|
2009-04-01 21:36:58 +00:00
|
|
|
// Find existing C4String
|
2016-01-15 21:23:58 +00:00
|
|
|
C4String *FindString(const char *strString) const;
|
2009-05-08 13:28:41 +00:00
|
|
|
|
2010-12-06 15:24:41 +00:00
|
|
|
private:
|
2009-04-01 21:36:58 +00:00
|
|
|
C4Set<C4String *> Set;
|
2010-12-06 15:24:41 +00:00
|
|
|
friend class C4String;
|
2011-01-06 23:52:53 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
// After the set, so these are destroyed with the set still alive
|
|
|
|
C4String P[P_LAST];
|
2010-03-28 17:58:21 +00:00
|
|
|
};
|
2009-05-08 13:28:41 +00:00
|
|
|
|
2009-04-03 21:53:48 +00:00
|
|
|
extern C4StringTable Strings;
|
|
|
|
|
2009-05-08 13:28:41 +00:00
|
|
|
#endif
|