mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-10 12:36:45 +03:00
Clean up GameScriptColor.
Give it default member initialisers and a delegating constructor and expose the four-component version to Lua.
This commit is contained in:
parent
9b29de8dda
commit
23e1ab0f50
2 changed files with 6 additions and 10 deletions
|
@ -12,7 +12,7 @@ Components are specified in bytes; all values are clamped to [0, 255].
|
|||
void GameScriptColor::Register(sol::state* state)
|
||||
{
|
||||
state->new_usertype<GameScriptColor>("Color",
|
||||
sol::constructors<GameScriptColor(int, int, int)>(),
|
||||
sol::constructors<GameScriptColor(byte, byte, byte), GameScriptColor(byte, byte, byte, byte)>(),
|
||||
|
||||
/// (int) red component
|
||||
//@mem r
|
||||
|
@ -44,7 +44,6 @@ GameScriptColor::GameScriptColor(byte r, byte g, byte b)
|
|||
SetR(r);
|
||||
SetG(g);
|
||||
SetB(b);
|
||||
SetA(255);
|
||||
}
|
||||
|
||||
/***
|
||||
|
@ -55,11 +54,8 @@ GameScriptColor::GameScriptColor(byte r, byte g, byte b)
|
|||
@return A Color object.
|
||||
@function Color.new
|
||||
*/
|
||||
GameScriptColor::GameScriptColor(byte r, byte g, byte b, byte a)
|
||||
GameScriptColor::GameScriptColor(byte r, byte g, byte b, byte a) : GameScriptColor(r, g, b)
|
||||
{
|
||||
SetR(r);
|
||||
SetG(g);
|
||||
SetB(b);
|
||||
SetA(a);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue