Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,018 changes: 2,097 additions & 1,921 deletions Client/App/App.vcproj

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions Client/App/include/script/Script.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,13 @@ namespace RBX
virtual ~LocalScript();
};

class IScriptOwner
class __declspec(novtable) IScriptOwner
{
friend class Script;

protected:
virtual IScriptOwner* scriptShouldRun(Script* script);
virtual void runScript(Script* script, ScriptContext* context);
virtual void releaseScript(Script* script);

public:
IScriptOwner();
};
}
10 changes: 10 additions & 0 deletions Client/App/include/util/Evaluator.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#pragma once

namespace RBX
{
class __declspec(novtable) Evaluator
{
public:
virtual std::string evaluate(const std::string&) const = 0;
};
}
30 changes: 26 additions & 4 deletions Client/App/include/util/ExponentialRunningAverage.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
#pragma once
#include <g3d/Vector3.h>

namespace RBX
{
// These classes are only used in ICharacterSubject (found in v8datamodel).
// Since the constructors of these classes are completely inlined in all builds of RBXGS, their implementation is guessed.

class floatERA
{
float weight;
float avg;

public:
floatERA(float);
floatERA();
floatERA(float weight)
: weight(weight)
{
reset();
}

floatERA()
: weight(1.0f)
{
reset();
}

void reset();
float pushAndGetAverage(float value);
Expand All @@ -22,8 +35,17 @@ namespace RBX
float x, y, z;

public:
Vector3ERA(float);
Vector3ERA();
Vector3ERA(float weight)
: weight(weight)
{
reset();
}

Vector3ERA()
: weight(1.0f)
{
reset();
}

void reset();
G3D::Vector3 pushAndGetAverage(G3D::Vector3 value);
Expand Down
7 changes: 7 additions & 0 deletions Client/App/include/util/Extents.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ namespace RBX
public:
bool operator==(const Extents&) const;
bool operator!=(const Extents&) const;
Extents& operator=(const Extents& other)
{
this->low = other.low;
this->high = other.high;

return *this;
}
const G3D::Vector3& min() const {return this->low;}
const G3D::Vector3& max() const {return this->high;}
G3D::Vector3 getCorner(int i) const;
Expand Down
14 changes: 9 additions & 5 deletions Client/App/include/util/Http.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@ namespace RBX
std::string additionalHeaders;

public:
//Http(const Http&);
Http(const std::string&);
Http(const char*);
Http(const std::string& url)
: url(url)
{
}

Http(const char* url)
: url(url)
{
}
public:
void post(std::istream&, bool, std::string&);
void get(std::string&);
public:
~Http();

public:
static bool trustCheck(const char*);
Expand Down
18 changes: 14 additions & 4 deletions Client/App/include/util/IRenderable.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include "RbxGraphics/Adorn.h"
#include "AppDraw/SelectState.h"
#include "util/IndexArray.h"
#include "AppDraw/SelectState.h"

namespace RBX
{
Expand Down Expand Up @@ -47,9 +46,20 @@ namespace RBX

void shouldRenderSetDirty();

virtual void render2d(Adorn* adorn);
virtual void render3dAdorn(Adorn* adorn);
virtual void render3dSelect(Adorn* adorn, SelectState selectState);
virtual void render2d(Adorn* adorn)
{
return;
}

virtual void render3dAdorn(Adorn* adorn)
{
return;
}

virtual void render3dSelect(Adorn* adorn, SelectState selectState)
{
return;
}
};


Expand Down
24 changes: 21 additions & 3 deletions Client/App/include/util/Name.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,28 @@ namespace RBX
{
public:
virtual const Name& getName() const = 0;
};

template<typename DerivedClass, const char** ClassName>
class Named : public DerivedClass
{
public:
//INamed(const INamed&);
INamed();
typedef Named<DerivedClass, ClassName> Base;

Named()
: DerivedClass()
{
}

template<typename Arg0Type>
Named(Arg0Type type)
: DerivedClass(type)
{
}

virtual const Name& getName() const;

public:
//INamed& operator=(const INamed&);
static const Name& name();
};
}
2 changes: 1 addition & 1 deletion Client/App/include/util/RunStateOwner.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace RBX

RunTransition(RunState oldState, RunState newState)
: oldState(oldState),
newState(newState)
newState(newState)
{
}

Expand Down
9 changes: 5 additions & 4 deletions Client/App/include/util/StateStack.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ namespace RBX
int currentState;
std::vector<StateEntry> stack;
public:
//StateStack(const StateStack&);
//StateStack();
StateStack()
: currentState(-1)
{
}

~StateStack();

void pushState(const Name&, T*, T*);
Expand All @@ -36,7 +39,5 @@ namespace RBX
virtual bool isStackTooBig() const;
private:
void clearStackAfter(int);

//StateStack& operator=(const StateStack&);
};
}
94 changes: 94 additions & 0 deletions Client/App/include/v8datamodel/Accoutrement.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#pragma once
#include "v8tree/Instance.h"
#include "v8datamodel/IEquipable.h"
#include "util/IRenderable.h"
#include "util/ICameraSubject.h"
#include "util/ISelectable3d.h"

namespace RBX
{
class IReferenceBinder;
class ModelInstance;
class PartInstance;

extern const char* sAccoutrement;

class Accoutrement : public DescribedCreatable<Accoutrement, Instance, &sAccoutrement>,
public IEquipable,
public IRenderable,
public virtual ICameraSubject,
public virtual ISelectable3d
{
enum AccoutrementState
{
NOTHING,
HAS_HANDLE,
IN_WORKSPACE,
IN_CHARACTER,
EQUIPPED
};

protected:
AccoutrementState backendAccoutrementState;
G3D::CoordinateFrame attachmentPoint;
boost::signals::scoped_connection handleTouched;
boost::signals::scoped_connection characterChildAdded;
boost::signals::scoped_connection characterChildRemoved;
public:
static bool writeUnlocked;

protected:
void onEvent_AddedBackend(boost::shared_ptr<Instance>);
void onEvent_RemovedBackend(boost::shared_ptr<Instance>);
void onEvent_HandleTouched(boost::shared_ptr<Instance>);
AccoutrementState computeDesiredState(Instance*);
AccoutrementState computeDesiredState();
void setDesiredState(AccoutrementState, const ServiceProvider*);
void setBackendAccoutrementStateNoReplicate(int);
void rebuildBackendState();
void connectTouchEvent();
void upTo_Equipped();
void upTo_InCharacter();
void upTo_InWorkspace();
void upTo_HasHandle();
void downFrom_Equipped();
void downFrom_InCharacter();
void downFrom_InWorkspace();
void downFrom_HasHandle();
void onChildAdded();
void onChildRemoved();
virtual void onAncestorChanged(const AncestorChanged&);
virtual bool askSetParent(const Instance*) const;
virtual bool askAddChild(const Instance*) const;
virtual void readProperty(const XmlElement*, IReferenceBinder&);
virtual const G3D::CoordinateFrame getLocation() const;
bool drawSelected() const;
virtual void render3dSelect(Adorn*, SelectState);
public:
Accoutrement();
virtual ~Accoutrement();
virtual XmlElement* write();
PartInstance* getHandle();
const PartInstance* getHandleConst() const;
void setBackendAccoutrementState(int);
int getBackendAccoutrementState() const;
const G3D::CoordinateFrame& getAttachmentPoint() const;
void setAttachmentPoint(const G3D::CoordinateFrame&);
virtual void onCameraNear(float);
const G3D::Vector3 getAttachmentPos() const;
const G3D::Vector3 getAttachmentForward() const;
const G3D::Vector3 getAttachmentUp() const;
const G3D::Vector3 getAttachmentRight() const;
void setAttachmentPos(const G3D::Vector3&);
void setAttachmentForward(const G3D::Vector3&);
void setAttachmentUp(const G3D::Vector3&);
void setAttachmentRight(const G3D::Vector3&);

protected:
static AccoutrementState characterCanPickUpAccoutrement(Instance*);
static void UnequipThis(boost::shared_ptr<Instance>);
public:
static void dropAll(ModelInstance*);
static void dropAllOthers(ModelInstance*, Accoutrement*);
};
}
10 changes: 3 additions & 7 deletions Client/App/include/v8datamodel/Backpack.h
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
#pragma once
#include "v8datamodel/Hopper.h"
#include "script/Script.h"
#include "v8datamodel/Hopper.h"

namespace RBX
{
extern const char* sBackpack;
class Backpack : public RBX::DescribedCreatable<Backpack, Hopper, &sBackpack>,
public IScriptOwner
public IScriptOwner
{
private:
virtual IScriptOwner* scriptShouldRun(Script*);
virtual IScriptOwner* scriptShouldRun(Script* script);
public:
//Backpack(const Backpack&);
Backpack();
virtual ~Backpack();
public:
//Backpack& operator=(const Backpack&);
};
}
Loading