Paste number 48646: c++ constructors

Paste number 48646: c++ constructors
Pasted by: turbo24prg
1 year, 3 days ago
#dylan | Context in IRC logs
Paste contents:
Raw Source | XML | Display As

  class SColor
  {
  public:

    //! Constructor of the Color. Does nothing. The color value
    //! is not initialized to save time.
    inline SColor() {}

    //! Constructs the color from 4 values representing the alpha, red, green and
    //! blue components of the color. Must be values between 0 and 255.
    inline SColor (u32 a, u32 r, u32 g, u32 b)
      : color(((a & 0xff)<<24) | ((r & 0xff)<<16) | ((g & 0xff)<<8) | (b & 0xff)) {}

    //! Constructs the color from a 32 bit value. Could be another color.
    inline SColor(u32 clr)
      : color(clr) {}
 ...

=>

 define C-function new_SColor
  c-name: "_wrap_new_SColor__SWIG_0";
  result _result :: :pointer;
end;

define C-function new_SColor
  c-name: "_wrap_new_SColor__SWIG_1";
  result _result :: :pointer;
  parameter a :: :pointer;
  parameter r :: :pointer;
  parameter g :: :pointer;
  parameter b :: :pointer;
end;

define C-function new_SColor
  c-name: "_wrap_new_SColor__SWIG_2";
  result _result :: :pointer;
  parameter clr :: :pointer;
end;

=>

define class <irr-video-scolor> (<c++-class>) end;

define method initialize (object :: <irr-video-scolor>, #key )
  object.foreign-object := new_SColor();
end;
  
define method initialize (object :: <irr-video-scolor>, #key a, r, g, b)
  object.foreign-object := new_SColor(a, r, g, b);
end;
  
define method initialize (object :: <irr-video-scolor>, #key clr)
  object.foreign-object := new_SColor(clr);
end;

This paste has no annotations.

Colorize as:
Show Line Numbers

Ads absolutely not by Google

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.