Example #1
0
  /*
   * Inherited resources.
   */
  {
    XmNshadowThickness, XmCShadowThickness, XmRHorizontalDimension,
    sizeof(Dimension), ManagerOffset(shadow_thickness),
    XmRImmediate, (XtPointer) 1
  },

  /*
   * SimpleSpinBox resources.
   */

  {
    XmNarrowSensitivity, XmCArrowSensitivity, XmRArrowSensitivity,
    sizeof(unsigned char), Offset(arrow_sensitivity),
    XmRImmediate, (XtPointer) XmARROWS_DEFAULT_SENSITIVITY
  },

  {
    XmNcolumns, XmCColumns, XmRShort,
    sizeof(short), Offset(columns), 
    XmRImmediate, (XtPointer) 20
  },

  {
    XmNdecimalPoints, XmCDecimalPoints, XmRShort,
    sizeof(short), Offset(decimal_points), 
    XmRImmediate, (XtPointer) 0
  },
Example #2
0
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
#include <X11/Xmu/Converters.h>
#include <X11/Xmu/CharSet.h>
#include <X11/Xaw/XawInit.h>
#include <X11/Xaw/FormP.h>

/* Private Definitions */

static int default_value = -99999;

#define Offset(field) XtOffsetOf(FormRec, form.field)
static XtResource resources[] = {
    {   XtNdefaultDistance, XtCThickness, XtRInt, sizeof(int),
        Offset(default_spacing), XtRImmediate, (XtPointer)4
    }
};
#undef Offset

static XtEdgeType defEdge = XtRubber;

#define Offset(field) XtOffsetOf(FormConstraintsRec, form.field)
static XtResource formConstraintResources[] = {
    {   XtNtop, XtCEdge, XtREdgeType, sizeof(XtEdgeType),
        Offset(top), XtREdgeType, (XtPointer)&defEdge
    },
    {   XtNbottom, XtCEdge, XtREdgeType, sizeof(XtEdgeType),
        Offset(bottom), XtREdgeType, (XtPointer)&defEdge
    },
    {   XtNleft, XtCEdge, XtREdgeType, sizeof(XtEdgeType),
 void OnPaint()
 {
     wxPaintDC dc(this);
     
     auto rect = GetClientRect();
     
     dc.SetPen(wxPen(wxColor(0x26, 0x1E, 0x00)));
     dc.SetBrush(wxBrush(wxColor(0x26, 0x1E, 0x00)));
     dc.DrawRectangle(rect);
     
     int const disp_half = rect.GetWidth() / 2;
     int const disp_shift = kFullKeysWidth / 2 - disp_half;
     
     auto draw_key = [&](auto note_num, auto const &prop, auto const &img) {
         int const octave = note_num / 12;
         auto key_rect = prop.rect_;
         key_rect.Offset(octave * kKeyWidth * 7 - disp_shift, 0);
         
         if(key_rect.GetLeft() >= rect.GetWidth()) { return; }
         if(key_rect.GetRight() < 0) { return; }
         
         dc.DrawBitmap(wxBitmap(img), key_rect.GetTopLeft());
         
         //            if(is_playing) {
         //                col_pen = kKeyBorderColorPlaying;
         //                col_brush = kPlayingNoteColor;
         //                dc.SetPen(wxPen(col_pen));
         //                dc.SetBrush(wxBrush(col_brush));
         //            }
         //            dc.DrawRoundedRectangle(key_rect, 2);
     };
     
     for(int i = 0; i < kNumKeys; ++i) {
         if(IsWhiteKey(i) == false) { continue; }
         
         bool const is_playing = playing_notes_[i];
         bool next_pushed = false;
         if(i < kNumKeys - 2) {
             if(IsWhiteKey(i+1) && playing_notes_[i+1]) { next_pushed = true; }
             else if(IsWhiteKey(i+2) && playing_notes_[i+2]) { next_pushed = true; }
         }
         
         auto const &img
         = (is_playing && next_pushed)
         ? img_white_pushed_contiguous_
         : (is_playing ? img_white_pushed_ : img_white_);
         
         draw_key(i, kKeyPropertyList[i % 12], img);
     }
     
     for(int i = 0; i < kNumKeys; ++i) {
         if(IsBlackKey(i) == false) { continue; }
         
         bool const is_playing = playing_notes_[i];
         
         auto const &img = (is_playing ? img_black_pushed_ : img_black_);
         draw_key(i, kKeyPropertyList[i % 12], img);
     }
     
     auto font = wxFont(wxFontInfo(wxSize(8, 10)).Family(wxFONTFAMILY_DEFAULT));
     dc.SetFont(font);
     for(int i = 0; i < kNumKeys; i += 12) {
         int const octave = i / 12;
         dc.DrawLabel(wxString::Format("C%d", i / 12 - 2),
                      wxBitmap(),
                      wxRect(wxPoint(octave * kKeyWidth * 7 - disp_shift, rect.GetHeight() * 0.8),
                             wxSize(kKeyWidth, 10)),
                      wxALIGN_CENTER
                      );
     }
 }
void MessageForwarder::initPersistFields()
{
   addField("toQueue", TypeCaseString, Offset(mToQueue, MessageForwarder), "Queue to forward to");

   Parent::initPersistFields();
}
Example #5
0
	void Location (int link, int lane, int offset) 
									{ Link (link); Lane (lane); Offset (offset); }
Example #6
0
static void dump_codeview_headers(unsigned long base, unsigned long len)
{
    const OMFDirHeader* dirHeader;
    const char*         signature;
    const OMFDirEntry*  dirEntry;
    const OMFSignature* sig;
    unsigned		i;
    int modulecount = 0, alignsymcount = 0, srcmodulecount = 0, librariescount = 0;
    int globalsymcount = 0, globalpubcount = 0, globaltypescount = 0;
    int segmapcount = 0, fileindexcount = 0, staticsymcount = 0;

    cv_base = PRD(base, len);
    if (!cv_base) {printf("Can't get full debug content, aborting\n");return;}

    signature = cv_base;

    printf("    CodeView Data\n");
    printf("      Signature:         %.4s\n", signature);

    if (memcmp(signature, "NB10", 4) == 0)
    {
	const CODEVIEW_PDB_DATA* pdb_data;
	pdb_data = (const void *)cv_base;

        printf("      Filepos:           0x%08lX\n", pdb_data->filepos);
	printf("      TimeStamp:         %08X (%s)\n",
	       pdb_data->timestamp, get_time_str(pdb_data->timestamp));
	printf("      Age:               %08X\n", pdb_data->age);
	printf("      Filename:          %s\n", pdb_data->name);
	return;
    }
    if (memcmp(signature, "RSDS", 4) == 0)
    {
	const OMFSignatureRSDS* rsds_data;

	rsds_data = (const void *)cv_base;
	printf("      Guid:              %s\n", get_guid_str(&rsds_data->guid));
	printf("      Age:               %08X\n", rsds_data->age);
	printf("      Filename:          %s\n", rsds_data->name);
	return;
    }

    if (memcmp(signature, "NB09", 4) != 0 && memcmp(signature, "NB11", 4) != 0)
    {
	printf("Unsupported signature (%.4s), aborting\n", signature);
	return;
    }

    sig = cv_base;

    printf("      Filepos:           0x%08lX\n", sig->filepos);

    dirHeader = PRD(Offset(cv_base) + sig->filepos, sizeof(OMFDirHeader));
    if (!dirHeader) {printf("Can't get debug header, aborting\n"); return;}

    printf("      Size of header:    0x%4X\n", dirHeader->cbDirHeader);
    printf("      Size per entry:    0x%4X\n", dirHeader->cbDirEntry);
    printf("      # of entries:      0x%8X (%d)\n", dirHeader->cDir, dirHeader->cDir);
    printf("      Offset to NextDir: 0x%8X\n", dirHeader->lfoNextDir);
    printf("      Flags:             0x%8X\n", dirHeader->flags);

    if (!dirHeader->cDir) return;

    dirEntry = PRD(Offset(dirHeader + 1), sizeof(OMFDirEntry) * dirHeader->cDir);
    if (!dirEntry) {printf("Can't get DirEntry array, aborting\n");return;}

    for (i = 0; i < dirHeader->cDir; i++)
    {
	switch (dirEntry[i].SubSection)
	{
	case sstModule:		modulecount++;		break;
	case sstAlignSym:	alignsymcount++;	break;
	case sstSrcModule:	srcmodulecount++;	break;
	case sstLibraries:	librariescount++;	break;
	case sstGlobalSym:	globalsymcount++;	break;
	case sstGlobalPub:	globalpubcount++;	break;
	case sstGlobalTypes:	globaltypescount++;	break;
	case sstSegMap:		segmapcount++;		break;
	case sstFileIndex:	fileindexcount++;	break;
	case sstStaticSym:	staticsymcount++;	break;
	}
    }

    /* This one has to be > 0
     */
    printf ("\nFound: %d sstModule subsections\n", modulecount);

    if (alignsymcount > 0)    printf ("       %d sstAlignSym subsections\n", alignsymcount);
    if (srcmodulecount > 0)   printf ("       %d sstSrcModule subsections\n", srcmodulecount);
    if (librariescount > 0)   printf ("       %d sstLibraries subsections\n", librariescount);
    if (globalsymcount > 0)   printf ("       %d sstGlobalSym subsections\n", globalsymcount);
    if (globalpubcount > 0)   printf ("       %d sstGlobalPub subsections\n", globalpubcount);
    if (globaltypescount > 0) printf ("       %d sstGlobalTypes subsections\n", globaltypescount);
    if (segmapcount > 0)      printf ("       %d sstSegMap subsections\n", segmapcount);
    if (fileindexcount > 0)   printf ("       %d sstFileIndex subsections\n", fileindexcount);
    if (staticsymcount > 0)   printf ("       %d sstStaticSym subsections\n", staticsymcount);

    dump_codeview_all_modules(dirHeader);
}
Example #7
0
inline mx_float NDArray::At(size_t c, size_t h, size_t w) const {
  return GetData()[Offset(c, h, w)];
}
Example #8
0
   void NavMesh::initPersistFields()
   {
      addGroup("NavMesh Build");

      addField("saveIntermediates", TypeBool, Offset(mSaveIntermediates, NavMesh),
         "Store intermediate results for debug rendering.");

      addField("buildThreaded", TypeBool, Offset(mBuildThreaded, NavMesh),
         "Does this NavMesh build in a separate thread?");

      addProtectedField("build", TypeBool, NULL,
         &editorBuildFlag, &getBuild,
         "Check this box to build the NavMesh.");

      endGroup("NavMesh Build");

      addGroup("NavMesh Options");

      addField("fileName", TypeString, Offset(mFileName, NavMesh),
         "Name of the data file to store this navmesh in (relative to engine executable).");

      addFieldV("borderSize", TypeS32, Offset(mBorderSize, NavMesh), &PositiveInt,
         "Size of the non-walkable border around the navigation mesh (in voxels).");

      addFieldV("cellSize", TypeF32, Offset(mCellSize, NavMesh), &ValidCellSize,
         "Length/width of a voxel.");
      addFieldV("cellHeight", TypeF32, Offset(mCellHeight, NavMesh), &ValidCellSize,
         "Height of a voxel.");

      addFieldV("actorHeight", TypeF32, Offset(mWalkableHeight, NavMesh), &CommonValidators::PositiveFloat,
         "Height of an actor.");
      addFieldV("actorClimb", TypeF32, Offset(mWalkableClimb, NavMesh), &CommonValidators::PositiveFloat,
         "Maximum climbing height of an actor.");
      addFieldV("actorRadius", TypeF32, Offset(mWalkableRadius, NavMesh), &CommonValidators::PositiveFloat,
         "Radius of an actor.");
      addFieldV("walkableSlope", TypeF32, Offset(mWalkableSlope, NavMesh), &ValidSlopeAngle,
         "Maximum walkable slope in degrees.");

      endGroup("NavMesh Options");

      addGroup("NavMesh Advanced Options");

      addProtectedField("detailSampleDist", TypeF32, Offset(mDetailSampleDist, NavMesh),
         &setProtectedDetailSampleDist, &defaultProtectedGetFn,
         "Sets the sampling distance to use when generating the detail mesh.");
      addFieldV("detailSampleError", TypeF32, Offset(mDetailSampleMaxError, NavMesh), &CommonValidators::PositiveFloat,
         "The maximum distance the detail mesh surface should deviate from heightfield data.");
      addFieldV("maxEdgeLen", TypeS32, Offset(mDetailSampleDist, NavMesh), &PositiveInt,
         "The maximum allowed length for contour edges along the border of the mesh.");
      addFieldV("simplificationError", TypeF32, Offset(mMaxSimplificationError, NavMesh), &CommonValidators::PositiveFloat,
         "The maximum distance a simplfied contour's border edges should deviate from the original raw contour.");
      addFieldV("minRegionArea", TypeS32, Offset(mMinRegionArea, NavMesh), &PositiveInt,
         "The minimum number of cells allowed to form isolated island areas.");
      addFieldV("mergeRegionArea", TypeS32, Offset(mMergeRegionArea, NavMesh), &PositiveInt,
         "Any regions with a span count smaller than this value will, if possible, be merged with larger regions.");
      addFieldV("tileSize", TypeS32, Offset(mTileSize, NavMesh), &PositiveInt,
         "The horizontal size of tiles.");

      endGroup("NavMesh Advanced Options");

      addGroup("NavMesh Rendering");

      addField("renderMode", TYPEID<RenderMode>(), Offset(mRenderMode, NavMesh),
         "Sets the rendering mode of this navmesh.");
      addField("renderInput", TypeBool, Offset(mRenderInput, NavMesh),
         "Render the input geometry used to create the mesh.");
      addField("renderConnections", TypeBool, Offset(mRenderConnections, NavMesh),
         "Render the connections between regions in the mesh.");

      endGroup("NavMesh Rendering");

      Parent::initPersistFields();
   }
"<Btn2Down>:"	"StartScroll(Continuous) MoveThumb() NotifyThumb()\n"
"<Btn3Down>:"	"StartScroll(Backward)\n"
"<Btn2Motion>:"	"MoveThumb() NotifyThumb()\n"
"<BtnUp>:"	"NotifyScroll(Proportional) EndScroll()\n";

static float floatZero = 0.0;

#define Offset(field) XtOffsetOf(ScrollbarRec, field)

static XtResource resources[] = {
  {
    XtNlength,
    XtCLength,
    XtRDimension,
    sizeof(Dimension),
    Offset(scrollbar.length),
    XtRImmediate,
    (XtPointer)1
  },
  {
    XtNthickness,
    XtCThickness,
    XtRDimension,
    sizeof(Dimension),
    Offset(scrollbar.thickness),
    XtRImmediate,
    (XtPointer)14
  },
  {
    XtNorientation,
    XtCOrientation,
Example #10
0
static void SendByte(Widget w);
static Boolean Connect(Widget W);
static int SockOpen(char *HostName, char *Service);
static void InputHandler(Widget W, int *Fd, XtInputId *Id);

/*
   Widget default resources
 */

#define Offset(field) XtOffsetOf(XltHostRec, host.field)
static XtResource resources[] =
{
    {
	XltNdelay, XltCDelay, XtRInt,
	sizeof(int), Offset(Delay),
	XtRImmediate, 0
    },
    {
	XltNterminator, XltCTerminator, XtRString,
	sizeof(String), Offset(Terminator),
	XtRImmediate, NULL
    },
    {
	XltNname, XltCName, XtRString,
	sizeof(String), Offset(Name),
	XtRImmediate, NULL
    },
    {
	XltNinputCallback, XtCCallback, XtRCallback,
	sizeof(XtCallbackList), Offset(InputCallback),
// public Fuse.Drawing.Polygon get_Output() [instance] :185
::g::Fuse::Drawing::Polygon* Stroke::Output()
{
    uStackFrame __("Fuse.Entities.Processing.Stroke", "get_Output()");
    ::g::Fuse::Drawing::Polygon* ret2;
    ::g::Fuse::Drawing::Polygon* ret3;

    if (_output != NULL)
        return _output;

    if ((_source == NULL) || ((::g::Fuse::IOutput::get_Output_ex(uInterface(uPtr(_source), ::TYPES[2/*Fuse.IOutput<Fuse.Drawing.Polygon>*/]), &ret2), ret2) == NULL))
        return NULL;

    _output = uPtr((::g::Fuse::IOutput::get_Output_ex(uInterface(uPtr(Source()), ::TYPES[2/*Fuse.IOutput<Fuse.Drawing.Polygon>*/]), &ret3), ret3))->Stroke(::g::Uno::Math::Max1(0.1f, Width()), Offset(), StartCap(), EndCap());
    return _output;
}
#include <AxeEditor.h>
#include <AxeText.h>
#include <FileNom.h>
#include <sys/param.h>
#include <stdio.h>

#include <AxeTextDeckP.h>

#define CLASS(field) axeTextDeckClassRec.axeTextDeck_class.field
#define PRIVATE(w,field) (((AxeTextDeckWidget) w)->axeTextDeck.field)

#define Offset(field) XtOffsetOf(AxeTextDeckRec, axeTextDeck.field)

static XtResource resources[] = {
    {XtNfile, XtCFile, XtRString, sizeof(String),
         Offset(file), XtRString, NULL},
    {XtNchangeCallback, XtCCallback, XtRCallback, sizeof(XtCallbackList), 
         Offset(change_callbacks), XtRCallback, (XtPointer) NULL},
    {XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct*),
	 Offset(font), XtRFontStruct, (XtPointer) NULL},
};

#undef Offset

static void Initialize();
static void Realize(), Resize(), InsertChild(), DeleteChild();
static Boolean SetValues();
static XtGeometryResult GeometryManager();

static void DeckChange(), Message(), Where(), Size();
Example #13
0
#include "xgas.h"
#include "xgas.icon"
#include <X11/Shell.h>

static String FallbackResources[] = {
"*lab.height: 300",
"*lab.width: 300",
"*Scrollbar.height: 300",
"*help.label: Missing app-defaults!",
NULL
};

#define Offset(field) XtOffsetOf(LabData, field)
static XtResource resources[] = {
  { "timestepSize", "TimestepSize", XtRFloat, sizeof(float),
      Offset(timestepSize), XtRString, "3.0" },
  { "delay", "Delay", XtRInt, sizeof(int),
      Offset(delay), XtRImmediate, (XtPointer) 50 },
  { "randomBounce", "RandomBounce", XtRFloat, sizeof(float),
      Offset(randomBounce), XtRString, "0.1" },
  { "equilibrium", "Equilibrium", XtRFloat, sizeof(float),
      Offset(equilibrium), XtRString, "0.5" },
  { "maxMolecules", "MaxMolecules", XtRInt, sizeof(int),
      Offset(maxMolecules), XtRImmediate, (XtPointer) 100 },
  { XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
      Offset(foreground), XtRString, XtDefaultForeground },
  { XtNbackground, XtCBackground, XtRPixel, sizeof(Pixel),
      Offset(background), XtRString, XtDefaultBackground },
};
#undef Offset
Example #14
0
void ProjectileData::initPersistFields()
{
   addField("particleEmitter", TYPEID< ParticleEmitterData >(), Offset(particleEmitter, ProjectileData),
      "@brief Particle emitter datablock used to generate particles while the projectile is outside of water.\n\n"
      "@note If datablocks are defined for both particleEmitter and particleWaterEmitter, both effects will play "
      "as the projectile enters or leaves water.\n\n"
      "@see particleWaterEmitter\n");
   addField("particleWaterEmitter", TYPEID< ParticleEmitterData >(), Offset(particleWaterEmitter, ProjectileData),
      "@brief Particle emitter datablock used to generate particles while the projectile is submerged in water.\n\n"
      "@note If datablocks are defined for both particleWaterEmitter and particleEmitter , both effects will play "
      "as the projectile enters or leaves water.\n\n"
      "@see particleEmitter\n");

   addField("projectileShapeName", TypeShapeFilename, Offset(projectileShapeName, ProjectileData),
      "@brief File path to the model of the projectile.\n\n");
   addField("scale", TypePoint3F, Offset(scale, ProjectileData),
      "@brief Scale to apply to the projectile's size.\n\n"
      "@note This is applied after SceneObject::scale\n");

   addField("sound", TypeSFXTrackName, Offset(sound, ProjectileData),
      "@brief SFXTrack datablock used to play sounds while in flight.\n\n");

   addField("explosion", TYPEID< ExplosionData >(), Offset(explosion, ProjectileData),
      "@brief Explosion datablock used when the projectile explodes outside of water.\n\n");
   addField("waterExplosion", TYPEID< ExplosionData >(), Offset(waterExplosion, ProjectileData),
      "@brief Explosion datablock used when the projectile explodes underwater.\n\n");

   addField("splash", TYPEID< SplashData >(), Offset(splash, ProjectileData),
      "@brief Splash datablock used to create splash effects as the projectile enters or leaves water\n\n");

   addField("decal", TYPEID< DecalData >(), Offset(decal, ProjectileData),
      "@brief Decal datablock used for decals placed at projectile explosion points.\n\n");

   addField("lightDesc", TYPEID< LightDescription >(), Offset(lightDesc, ProjectileData),
      "@brief LightDescription datablock used for lights attached to the projectile.\n\n");

   addField("isBallistic", TypeBool, Offset(isBallistic, ProjectileData),
      "@brief Detetmines if the projectile should be affected by gravity and whether or not "
      "it bounces before exploding.\n\n");

   addField("velInheritFactor", TypeF32, Offset(velInheritFactor, ProjectileData),
      "@brief Amount of velocity the projectile recieves from the source that created it.\n\n"
      "Use an amount between 0 and 1 for the best effect. "
      "This value is never modified by the engine.\n"
      "@note This value by default is not transmitted between the server and the client.");
   addField("muzzleVelocity", TypeF32, Offset(muzzleVelocity, ProjectileData),
      "@brief Amount of velocity the projectile recieves from the \"muzzle\" of the gun.\n\n"
      "Used with velInheritFactor to determine the initial velocity of the projectile. "
      "This value is never modified by the engine.\n\n"
      "@note This value by default is not transmitted between the server and the client.\n\n"
      "@see velInheritFactor");
   
   addField("impactForce", TypeF32, Offset(impactForce, ProjectileData));

   addProtectedField("lifetime", TypeS32, Offset(lifetime, ProjectileData), &setLifetime, &getScaledValue, 
      "@brief Amount of time, in milliseconds, before the projectile is removed from the simulation.\n\n"
      "Used with fadeDelay to determine the transparency of the projectile at a given time. "
      "A projectile may exist up to a maximum of 131040ms (or 4095 ticks) as defined by Projectile::MaxLivingTicks in the source code."
      "@see fadeDelay");

   addProtectedField("armingDelay", TypeS32, Offset(armingDelay, ProjectileData), &setArmingDelay, &getScaledValue, 
      "@brief Amount of time, in milliseconds, before the projectile will cause damage or explode on impact.\n\n"
      "This value must be equal to or less than the projectile's lifetime.\n\n"
      "@see lifetime");
   addProtectedField("fadeDelay", TypeS32, Offset(fadeDelay, ProjectileData), &setFadeDelay, &getScaledValue,
      "@brief Amount of time, in milliseconds, before the projectile begins to fade out.\n\n"
      "This value must be smaller than the projectile's lifetime to have an affect.");

   addField("bounceElasticity", TypeF32, Offset(bounceElasticity, ProjectileData), 
      "@brief Influences post-bounce velocity of a projectile that does not explode on contact.\n\n"
      "Scales the velocity from a bounce after friction is taken into account. "
      "A value of 1.0 will leave it's velocity unchanged while values greater than 1.0 will increase it.\n");
   addField("bounceFriction", TypeF32, Offset(bounceFriction, ProjectileData),
      "@brief Factor to reduce post-bounce velocity of a projectile that does not explode on contact.\n\n"
      "Reduces bounce velocity by this factor and a multiple of the tangent to impact. "
      "Used to simulate surface friction.\n");
   addField("gravityMod", TypeF32, Offset(gravityMod, ProjectileData ),
      "@brief Scales the influence of gravity on the projectile.\n\n"
      "The larger this value is, the more that gravity will affect the projectile. "
      "A value of 1.0 will assume \"normal\" influence upon it.\n"
      "The magnitude of gravity is assumed to be 9.81 m/s/s\n\n"
      "@note ProjectileData::isBallistic must be true for this to have any affect.");

   Parent::initPersistFields();
}
void GFXStateBlockData::initPersistFields()
{
   addGroup( "Alpha Blending" );

      addField( "blendDefined", TypeBool, Offset(mState.blendDefined, GFXStateBlockData),
         "Set to true if the alpha blend state is not all defaults." );

      addField( "blendEnable", TypeBool, Offset(mState.blendEnable, GFXStateBlockData),
         "Enables alpha blending.  The default is false." );

      addField( "blendSrc", TypeGFXBlend, Offset(mState.blendSrc, GFXStateBlockData),
         "The source blend state.  The default is GFXBlendOne." );

      addField("blendDest", TypeGFXBlend, Offset(mState.blendDest, GFXStateBlockData),
         "The destination blend state.  The default is GFXBlendZero." );

      addField("blendOp", TypeGFXBlendOp, Offset(mState.blendOp, GFXStateBlockData),
         "The arithmetic operation applied to alpha blending.  The default is GFXBlendOpAdd." );   

   endGroup( "Alpha Blending" );


   addGroup( "Separate Alpha Blending" );

      addField( "separateAlphaBlendDefined", TypeBool, Offset(mState.separateAlphaBlendDefined, GFXStateBlockData),
         "Set to true if the seperate alpha blend state is not all defaults." );

      addField( "separateAlphaBlendEnable", TypeBool, Offset(mState.separateAlphaBlendEnable, GFXStateBlockData),
         "Enables the separate blend mode for the alpha channel.  The default is false." );

      addField( "separateAlphaBlendSrc", TypeGFXBlend, Offset(mState.separateAlphaBlendSrc, GFXStateBlockData),
         "The source blend state.  The default is GFXBlendOne." );

      addField( "separateAlphaBlendDest", TypeGFXBlend, Offset(mState.separateAlphaBlendDest, GFXStateBlockData),
         "The destination blend state.  The default is GFXBlendZero." );

      addField( "separateAlphaBlendOp", TypeGFXBlendOp, Offset(mState.separateAlphaBlendOp, GFXStateBlockData),
         "The arithmetic operation applied to separate alpha blending.  The default is GFXBlendOpAdd." );   

   endGroup( "Separate Alpha Blending" );


   addGroup( "Alpha Test" );

      addField( "alphaDefined", TypeBool, Offset(mState.alphaDefined, GFXStateBlockData),
         "Set to true if the alpha test state is not all defaults." );

      addField( "alphaTestEnable", TypeBool, Offset(mState.alphaTestEnable, GFXStateBlockData),
         "Enables per-pixel alpha testing.  The default is false." );

      addField( "alphaTestFunc", TypeGFXCmpFunc, Offset(mState.alphaTestFunc, GFXStateBlockData),
         "The test function used to accept or reject a pixel based on its alpha value.  The default is GFXCmpGreaterEqual." );

      addField( "alphaTestRef", TypeS32, Offset(mState.alphaTestRef, GFXStateBlockData),
         "The reference alpha value against which pixels are tested.  The default is zero." );

   endGroup( "Alpha Test" );


   addGroup( "Color Write" );

      addField( "colorWriteDefined", TypeBool, Offset(mState.colorWriteDefined, GFXStateBlockData),
         "Set to true if the color write state is not all defaults." );

      addField( "colorWriteRed", TypeBool, Offset(mState.colorWriteRed, GFXStateBlockData),
         "Enables red channel writes.  The default is true." );

      addField( "colorWriteBlue", TypeBool, Offset(mState.colorWriteBlue, GFXStateBlockData),
         "Enables blue channel writes.  The default is true." );

      addField( "colorWriteGreen", TypeBool, Offset(mState.colorWriteGreen, GFXStateBlockData),
         "Enables green channel writes.  The default is true." );

      addField( "colorWriteAlpha", TypeBool, Offset(mState.colorWriteAlpha, GFXStateBlockData),
         "Enables alpha channel writes.  The default is true." );

   endGroup( "Color Write" );


   addGroup( "Culling" );

      addField("cullDefined", TypeBool, Offset(mState.cullDefined, GFXStateBlockData),
         "Set to true if the culling state is not all defaults." );

      addField("cullMode", TypeGFXCullMode, Offset(mState.cullMode, GFXStateBlockData),        
         "Defines how back facing triangles are culled if at all.  The default is GFXCullCCW." );

   endGroup( "Culling" );


   addGroup( "Depth" );

      addField( "zDefined", TypeBool, Offset(mState.zDefined, GFXStateBlockData),
         "Set to true if the depth state is not all defaults." );

      addField( "zEnable", TypeBool, Offset(mState.zEnable, GFXStateBlockData),
         "Enables z-buffer reads.  The default is true." );

      addField( "zWriteEnable", TypeBool, Offset(mState.zWriteEnable, GFXStateBlockData),
         "Enables z-buffer writes.  The default is true." );

      addField( "zFunc", TypeGFXCmpFunc, Offset(mState.zFunc, GFXStateBlockData),
         "The depth comparision function which a pixel must pass to be written to the z-buffer.  The default is GFXCmpLessEqual." );

      addField( "zBias", TypeF32, Offset(mState.zBias, GFXStateBlockData),
         "A floating-point bias used when comparing depth values.  The default is zero." );

      addField( "zSlopeBias", TypeF32, Offset(mState.zSlopeBias, GFXStateBlockData),
         "An additional floating-point bias based on the maximum depth slop of the triangle being rendered.  The default is zero." );

   endGroup( "Depth" );


   addGroup( "Stencil" );

      addField( "stencilDefined", TypeBool, Offset(mState.stencilDefined, GFXStateBlockData),
         "Set to true if the stencil state is not all defaults." );

      addField( "stencilEnable", TypeBool, Offset(mState.stencilEnable, GFXStateBlockData),
         "Enables stenciling.  The default is false." );

      addField( "stencilFailOp", TypeGFXStencilOp, Offset(mState.stencilFailOp, GFXStateBlockData),
         "The stencil operation to perform if the stencil test fails.  The default is GFXStencilOpKeep." );
      
      addField( "stencilZFailOp", TypeGFXStencilOp, Offset(mState.stencilZFailOp, GFXStateBlockData),
         "The stencil operation to perform if the stencil test passes and the depth test fails.  The default is GFXStencilOpKeep." );
      
      addField( "stencilPassOp", TypeGFXStencilOp, Offset(mState.stencilPassOp, GFXStateBlockData), 
         "The stencil operation to perform if both the stencil and the depth tests pass.  The default is GFXStencilOpKeep." );
      
      addField( "stencilFunc", TypeGFXCmpFunc, Offset(mState.stencilFunc, GFXStateBlockData),
         "The comparison function to test the reference value to a stencil buffer entry.  The default is GFXCmpNever." );

      addField( "stencilRef", TypeS32, Offset(mState.stencilRef, GFXStateBlockData),
         "The reference value for the stencil test.  The default is zero." );

      addField( "stencilMask", TypeS32, Offset(mState.stencilMask, GFXStateBlockData),
         "The mask applied to the reference value and each stencil buffer entry to determine the significant bits for the stencil test. The default is 0xFFFFFFFF." );

      addField( "stencilWriteMask", TypeS32, Offset(mState.stencilWriteMask, GFXStateBlockData),
         "The write mask applied to values written into the stencil buffer. The default is 0xFFFFFFFF." );

   endGroup( "Stencil" );


   addGroup( "Fixed Function" );

      addField( "ffLighting", TypeBool, Offset(mState.ffLighting, GFXStateBlockData),
         "Enables fixed function lighting when rendering without a shader on geometry with vertex normals.  The default is false." );

      addField( "vertexColorEnable", TypeBool, Offset(mState.vertexColorEnable, GFXStateBlockData),
         "Enables fixed function vertex coloring when rendering without a shader.  The default is false." );

   endGroup( "Fixed Function" );


   addGroup( "Sampler States" );

      addField( "samplersDefined", TypeBool, Offset(mState.samplersDefined, GFXStateBlockData),
         "Set to true if the sampler states are not all defaults." );

      addField( "samplerStates", TYPEID<GFXSamplerStateData>(), Offset(mSamplerStates, GFXStateBlockData), TEXTURE_STAGE_COUNT,
         "The array of texture sampler states.\n"
         "@note Not all graphics devices support 16 samplers.  In general "
         "all systems support 4 samplers with most modern cards doing 8." );

      addField( "textureFactor", TypeColorI, Offset(mState.textureFactor, GFXStateBlockData),
         "The color used for multiple-texture blending with the GFXTATFactor texture-blending argument or "
         "the GFXTOPBlendFactorAlpha texture-blending operation.  The default is opaque white (255, 255, 255, 255)." );

   endGroup( "Sampler States" );

   Parent::initPersistFields();
}
Example #16
0
inline void IASRect::Center(const ADMRect& centerRect)
{
	Offset(centerRect.left + ((centerRect.right - centerRect.left) - Width()) / 2,
		   centerRect.top + ((centerRect.bottom - centerRect.top) - Height()) / 2);
}
Example #17
0
static BOOL dump_cv_sst_src_module(const OMFDirEntry* omfde)
{
    int 		        i, j;
    const BYTE*		        rawdata;
    const unsigned long*	seg_info_dw;
    const unsigned short*	seg_info_w;
    unsigned		        ofs;
    const OMFSourceModule*	sourceModule;
    const OMFSourceFile*	sourceFile;
    const OMFSourceLine*	sourceLine;

    rawdata = PRD(Offset(cv_base) + omfde->lfo, omfde->cb);
    if (!rawdata) {printf("Can't get srcModule subsection details, aborting\n");return FALSE;}

    /* FIXME: check ptr validity */
    sourceModule = (const void*)rawdata;
    printf ("    Module table: Found %d file(s) and %d segment(s)\n",
	    sourceModule->cFile, sourceModule->cSeg);
    for (i = 0; i < sourceModule->cFile; i++)
    {
	printf ("      File #%2d begins at an offset of 0x%lx in this section\n",
		i + 1, sourceModule->baseSrcFile[i]);
    }

    /* FIXME: check ptr validity */
    seg_info_dw = (const void*)((const char*)(sourceModule + 1) +
			  sizeof(unsigned long) * (sourceModule->cFile - 1));
    seg_info_w = (const unsigned short*)(&seg_info_dw[sourceModule->cSeg * 2]);
    for (i = 0; i <  sourceModule->cSeg; i++)
    {
	printf ("      Segment #%2d start = 0x%lx, end = 0x%lx, seg index = %u\n",
		i + 1, seg_info_dw[i * 2], seg_info_dw[(i * 2) + 1],
		seg_info_w[i]);
    }
    ofs = sizeof(OMFSourceModule) + sizeof(unsigned long) * (sourceModule->cFile - 1) +
	sourceModule->cSeg * (2 * sizeof(unsigned long) + sizeof(unsigned short));
    ofs = (ofs + 3) & ~3;

    /* the OMFSourceFile is quite unpleasant to use:
     * we have first:
     * 	unsigned short	number of segments
     *	unsigned short	reserved
     *	unsigned long	baseSrcLn[# segments]
     *  unsigned long	offset[2 * #segments]
     *				odd indices are start offsets
     *				even indices are end offsets
     * 	unsigned char	string length for file name
     *	char		file name (length is previous field)
     */
    /* FIXME: check ptr validity */
    sourceFile = (const void*)(rawdata + ofs);
    seg_info_dw = (const void*)((const char*)sourceFile + 2 * sizeof(unsigned short) +
			  sourceFile->cSeg * sizeof(unsigned long));

    ofs += 2 * sizeof(unsigned short) + 3 * sourceFile->cSeg * sizeof(unsigned long);

    printf("    File table: %.*s\n",
	   *(const BYTE*)((const char*)sourceModule + ofs), (const char*)sourceModule + ofs + 1);

    for (i = 0; i < sourceFile->cSeg; i++)
    {
	printf ("      Segment #%2d start = 0x%lx, end = 0x%lx, offset = 0x%lx\n",
		i + 1, seg_info_dw[i * 2], seg_info_dw[(i * 2) + 1], sourceFile->baseSrcLn[i]);
    }
    /* add file name length */
    ofs += *(const BYTE*)((const char*)sourceModule + ofs) + 1;
    ofs = (ofs + 3) & ~3;

    for (i = 0; i < sourceModule->cSeg; i++)
    {
        sourceLine = (const void*)(rawdata + ofs);
        seg_info_dw = (const void*)((const char*)sourceLine + 2 * sizeof(unsigned short));
        seg_info_w = (const void*)(&seg_info_dw[sourceLine->cLnOff]);

	printf ("    Line table #%2d: Found %d line numbers for segment index %d\n",
		i, sourceLine->cLnOff, sourceLine->Seg);

	for (j = 0; j < sourceLine->cLnOff; j++)
	{
	    printf ("      Pair #%2d: offset = [0x%8lx], linenumber = %d\n",
		    j + 1, seg_info_dw[j], seg_info_w[j]);
	}
	ofs += 2 * sizeof(unsigned short) +
	    sourceLine->cLnOff * (sizeof(unsigned long) + sizeof(unsigned short));
	ofs = (ofs + 3) & ~3;
    }

    return TRUE;
}
Example #18
0
File: ExtObject.c Project: att/uwin
			  ArgList args, Cardinal *num_args);

static Boolean set_values_prehook(Widget current, Widget request, Widget new_w,
				  ArgList args, Cardinal *num_args);

static void get_values_prehook(Widget new_w, ArgList args, Cardinal *num_args);


static void logical_parent(Widget w, int offset, XrmValue *val);

#define Offset(field) XtOffsetOf(XmExtRec, ext.field)
static XtResource resources[] =
{
    {
	XmNlogicalParent, XmCLogicalParent, XmRWidget,
	sizeof(Widget), Offset(logicalParent),
	XmRCallProc, (XtPointer)logical_parent
    },
    {
	XmNextensionType, XmCExtensionType, XmRExtensionType,
	sizeof(unsigned char), Offset(extensionType),
	XmRImmediate, (XtPointer)XmDEFAULT_EXTENSION
    }
};


static XmBaseClassExtRec _XmObjectClassExtRec = {
    /* next_extension            */ NULL,
    /* record_type               */ NULLQUARK,                             
    /* version                   */ XmBaseClassExtVersion,
    /* size                      */ sizeof(XmBaseClassExtRec),
void FSequencerTimeSliderController::DrawTicks( FSlateWindowElementList& OutDrawElements, const struct FScrubRangeToScreen& RangeToScreen, FDrawTickArgs& InArgs ) const
{
	const float Spacing = DetermineOptimalSpacing( RangeToScreen.PixelsPerInput, ScrubConstants::MinPixelsPerDisplayTick, ScrubConstants::MinDisplayTickSpacing );

	// Sub divisions
	// @todo Sequencer may need more robust calculation
	const int32 Divider = 10;
	// For slightly larger halfway tick mark
	const int32 HalfDivider = Divider / 2;
	// Find out where to start from
	int32 OffsetNum = FMath::FloorToInt(RangeToScreen.ViewInput.GetLowerBoundValue() / Spacing);
	
	FSlateFontInfo SmallLayoutFont( FPaths::EngineContentDir() / TEXT("Slate/Fonts/Roboto-Regular.ttf"), 8 );

	TArray<FVector2D> LinePoints;
	LinePoints.AddUninitialized(2);

	float Seconds = 0;
	while( (Seconds = OffsetNum*Spacing) < RangeToScreen.ViewInput.GetUpperBoundValue() )
	{
		// X position local to start of the widget area
		float XPos = RangeToScreen.InputToLocalX( Seconds );
		uint32 AbsOffsetNum = FMath::Abs(OffsetNum);

		if ( AbsOffsetNum % Divider == 0 )
		{
			FVector2D Offset( XPos, InArgs.TickOffset );
			FVector2D TickSize( 0.0f, InArgs.MajorTickHeight );

			LinePoints[0] = FVector2D( 0.0f,1.0f);
			LinePoints[1] = TickSize;

			// lines should not need anti-aliasing
			const bool bAntiAliasLines = false;

			// Draw each tick mark
			FSlateDrawElement::MakeLines(
				OutDrawElements,
				InArgs.StartLayer,
				InArgs.AllottedGeometry.ToPaintGeometry( Offset, TickSize ),
				LinePoints,
				InArgs.ClippingRect,
				InArgs.DrawEffects,
				InArgs.TickColor,
				bAntiAliasLines
				);

			if( !InArgs.bOnlyDrawMajorTicks )
			{
				FString FrameString = Spacing == ScrubConstants::MinDisplayTickSpacing ? FString::Printf( TEXT("%.3f"), Seconds ) : FString::Printf( TEXT("%.2f"), Seconds );

				// Space the text between the tick mark but slightly above
				const TSharedRef< FSlateFontMeasure > FontMeasureService = FSlateApplication::Get().GetRenderer()->GetFontMeasureService();
				FVector2D TextSize = FontMeasureService->Measure(FrameString, SmallLayoutFont);
				FVector2D TextOffset( XPos-(TextSize.X*0.5f), InArgs.bMirrorLabels ? TextSize.Y :  FMath::Abs( InArgs.AllottedGeometry.Size.Y - (InArgs.MajorTickHeight+TextSize.Y) ) );

				FSlateDrawElement::MakeText(
					OutDrawElements,
					InArgs.StartLayer+1, 
					InArgs.AllottedGeometry.ToPaintGeometry( TextOffset, TextSize ), 
					FrameString, 
					SmallLayoutFont, 
					InArgs.ClippingRect, 
					InArgs.DrawEffects,
					InArgs.TickColor 
				);
			}
		}
		else if( !InArgs.bOnlyDrawMajorTicks )
		{
			// Compute the size of each tick mark.  If we are half way between to visible values display a slightly larger tick mark
			const float MinorTickHeight = AbsOffsetNum % HalfDivider == 0 ? 7.0f : 4.0f;

			FVector2D Offset(XPos, InArgs.bMirrorLabels ? 0.0f : FMath::Abs( InArgs.AllottedGeometry.Size.Y - MinorTickHeight ) );
			FVector2D TickSize(0.0f, MinorTickHeight);

			LinePoints[0] = FVector2D(0.0f,1.0f);
			LinePoints[1] = TickSize;

			const bool bAntiAlias = false;
			// Draw each sub mark
			FSlateDrawElement::MakeLines(
				OutDrawElements,
				InArgs.StartLayer,
				InArgs.AllottedGeometry.ToPaintGeometry( Offset, TickSize ),
				LinePoints,
				InArgs.ClippingRect,
				InArgs.DrawEffects,
				InArgs.TickColor,
				bAntiAlias
			);
		}
		// Advance to next tick mark
		++OffsetNum;
	}
}
Example #20
0
void ItemData::initPersistFields()
{
   addField("friction",          TypeF32,       Offset(friction,           ItemData), "A floating-point value specifying how much velocity is lost to impact and sliding friction.");
   addField("elasticity",        TypeF32,       Offset(elasticity,         ItemData), "A floating-point value specifying how 'bouncy' this ItemData is.");
   addField("sticky",            TypeBool,      Offset(sticky,             ItemData), 
      "@brief If true, ItemData will 'stick' to any surface it collides with.\n\n"
      "When an item does stick to a surface, the Item::onStickyCollision() callback is called.  The Item has methods to retrieve "
      "the world position and normal the Item is stuck to.\n"
      "@note Valid objects to stick to must be of StaticShapeObjectType.\n");
   addField("gravityMod",        TypeF32,       Offset(gravityMod,         ItemData), "Floating point value to multiply the existing gravity with, just for this ItemData.");
   addField("maxVelocity",       TypeF32,       Offset(maxVelocity,        ItemData), "Maximum velocity that this ItemData is able to move.");

   addField("lightType",         TYPEID< Item::LightType >(),      Offset(lightType, ItemData), "Type of light to apply to this ItemData. Options are NoLight, ConstantLight, PulsingLight. Default is NoLight." );
   addField("lightColor",        TypeColorF,    Offset(lightColor,         ItemData),
      "@brief Color value to make this light. Example: \"1.0,1.0,1.0\"\n\n"
      "@see lightType\n");
   addField("lightTime",         TypeS32,       Offset(lightTime,          ItemData), 
      "@brief Time value for the light of this ItemData, used to control the pulse speed of the PulsingLight LightType.\n\n"
      "@see lightType\n");
   addField("lightRadius",       TypeF32,       Offset(lightRadius,        ItemData), 
      "@brief Distance from the center point of this ItemData for the light to affect\n\n"
      "@see lightType\n");
   addField("lightOnlyStatic",   TypeBool,      Offset(lightOnlyStatic,    ItemData), 
      "@brief If true, this ItemData will only cast a light if the Item for this ItemData has a static value of true.\n\n"
      "@see lightType\n");

   addField("simpleServerCollision",   TypeBool,  Offset(simpleServerCollision,    ItemData), 
      "@brief Determines if only simple server-side collision will be used (for pick ups).\n\n"
      "If set to true then only simple, server-side collision detection will be used.  This is often the case "
      "if the item is used for a pick up object, such as ammo.  If set to false then a full collision volume "
      "will be used as defined by the shape.  The default is true.\n"
      "@note Only applies when using a physics library.\n"
      "@see TurretShape and ProximityMine for examples that should set this to false to allow them to be "
      "shot by projectiles.\n");

   Parent::initPersistFields();
}
Example #21
0
void DebrisData::initPersistFields()
{
   addGroup("Display");
   addField("texture",              TypeString,                  Offset(textureName,         DebrisData), 
      "@brief Texture imagemap to use for this debris object.\n\nNot used any more.\n");
   addField("shapeFile",            TypeShapeFilename,           Offset(shapeName,           DebrisData), 
      "@brief Object model to use for this debris object.\n\nThis shape is optional.  You could have Debris made up of only particles.\n");
   endGroup("Display");

   addGroup("Datablocks");
   addField("emitters",             TYPEID< ParticleEmitterData >(),  Offset(emitterList,    DebrisData), DDC_NUM_EMITTERS, 
      "@brief List of particle emitters to spawn along with this debris object.\n\nThese are optional.  You could have Debris made up of only a shape.\n");
   addField("explosion",            TYPEID< ExplosionData >(),   Offset(explosion,           DebrisData), 
      "@brief ExplosionData to spawn along with this debris object.\n\nThis is optional as not all Debris explode.\n");
   endGroup("Datablocks");

   addGroup("Physical Properties");
   addField("elasticity",           TypeF32,                     Offset(elasticity,          DebrisData), 
      "@brief A floating-point value specifying how 'bouncy' this object is.\n\nMust be in the range of -10 to 10.\n");
   addField("friction",             TypeF32,                     Offset(friction,            DebrisData), 
      "@brief A floating-point value specifying how much velocity is lost to impact and sliding friction.\n\nMust be in the range of -10 to 10.\n");
   addField("numBounces",           TypeS32,                     Offset(numBounces,          DebrisData), 
      "@brief How many times to allow this debris object to bounce until it either explodes, becomes static or snaps (defined in explodeOnMaxBounce, staticOnMaxBounce, snapOnMaxBounce).\n\n"
      "Must be within the range of 0 to 10000.\n"
      "@see bounceVariance\n");
   addField("bounceVariance",       TypeS32,                     Offset(bounceVariance,      DebrisData), 
      "@brief Allowed variance in the value of numBounces.\n\nMust be less than numBounces.\[email protected] numBounces\n");
   addField("minSpinSpeed",         TypeF32,                     Offset(minSpinSpeed,        DebrisData), 
      "@brief Minimum speed that this debris object will rotate.\n\nMust be in the range of -10000 to 1000, and must be less than maxSpinSpeed.\[email protected] maxSpinSpeed\n");
   addField("maxSpinSpeed",         TypeF32,                     Offset(maxSpinSpeed,        DebrisData), 
      "@brief Maximum speed that this debris object will rotate.\n\nMust be in the range of -10000 to 10000.\[email protected] minSpinSpeed\n");
   addField("gravModifier",         TypeF32,                     Offset(gravModifier,        DebrisData), "How much gravity affects debris.");
   addField("terminalVelocity",     TypeF32,                     Offset(terminalVelocity,    DebrisData), "Max velocity magnitude.");
   addField("velocity",             TypeF32,                     Offset(velocity,            DebrisData), 
      "@brief Speed at which this debris object will move.\n\[email protected] velocityVariance\n");
   addField("velocityVariance",     TypeF32,                     Offset(velocityVariance,    DebrisData), 
      "@brief Allowed variance in the value of velocity\n\nMust be less than velocity.\[email protected] velocity\n");
   addField("lifetime",             TypeF32,                     Offset(lifetime,            DebrisData), 
      "@brief Amount of time until this debris object is destroyed.\n\nMust be in the range of 0 to 1000.\[email protected] lifetimeVariance");
   addField("lifetimeVariance",     TypeF32,                     Offset(lifetimeVariance,    DebrisData), 
      "@brief Allowed variance in the value of lifetime.\n\nMust be less than lifetime.\[email protected] lifetime\n");
   addField("useRadiusMass",        TypeBool,                    Offset(useRadiusMass,       DebrisData), 
      "@brief Use mass calculations based on radius.\n\nAllows for the adjustment of elasticity and friction based on the Debris size.\[email protected] baseRadius\n");
   addField("baseRadius",           TypeF32,                     Offset(baseRadius,          DebrisData), 
      "@brief Radius at which the standard elasticity and friction apply.\n\nOnly used when useRaduisMass is true.\[email protected] useRadiusMass.\n");
   endGroup("Physical Properties");

   addGroup("Behavior");
   addField("explodeOnMaxBounce",   TypeBool,                    Offset(explodeOnMaxBounce,  DebrisData), 
      "@brief If true, this debris object will explode after it has bounced max times.\n\nBe sure to provide an ExplosionData datablock for this to take effect.\[email protected] explosion\n");
   addField("staticOnMaxBounce",    TypeBool,                    Offset(staticOnMaxBounce,   DebrisData), "If true, this debris object becomes static after it has bounced max times.");
   addField("snapOnMaxBounce",      TypeBool,                    Offset(snapOnMaxBounce,     DebrisData), "If true, this debris object will snap into a resting position on the last bounce.");
   addField("fade",                 TypeBool,                    Offset(fade,                DebrisData), 
      "@brief If true, this debris object will fade out when destroyed.\n\nThis fade occurs over the last second of the Debris' lifetime.\n");
   addField("ignoreWater",          TypeBool,                    Offset(ignoreWater,         DebrisData), "If true, this debris object will not collide with water, acting as if the water is not there.");
   endGroup("Behavior");

   Parent::initPersistFields();
}
Example #22
0
/**
 * Do restore scene
 * @param n			Id
 */
static int DoRestoreSceneFrame(SAVED_DATA *sd, int n) {
	switch (n) {
	case RS_COUNT + COUNTOUT_COUNT:
		// Trigger pre-load and fade and start countdown
		FadeOutFast(NULL);
		break;

	case RS_COUNT:
		_vm->_sound->stopAllSamples();
		ClearScreen();

		if (TinselV2) {

			// Master script only affected on restore game, not restore scene
			if (sd == &sgData) {
				g_scheduler->killMatchingProcess(PID_MASTER_SCR);
				KillGlobalProcesses();
				FreeMasterInterpretContext();
			}

			RestorePolygonStuff(sd->SavedPolygonStuff);

			// Abandon temporarily if different CD
			if (sd == &sgData && restoreCD != GetCurrentCD()) {
				SRstate = SR_IDLE;

				EndScene();
				SetNextCD(restoreCD);
				CDChangeForRestore(restoreCD);

				return 0;
			}
		} else {
			RestoreDeadPolys(sd->SavedDeadPolys);
		}

		// Start up the scene
		StartNewScene(sd->SavedSceneHandle, NO_ENTRY_NUM);

		SetDoFadeIn(!bNoFade);
		bNoFade = false;
		StartupBackground(nullContext, sd->SavedBgroundHandle);

		if (TinselV2) {
			Offset(EX_USEXY, sd->SavedLoffset, sd->SavedToffset);
		} else {
			KillScroll();
			PlayfieldSetPos(FIELD_WORLD, sd->SavedLoffset, sd->SavedToffset);
			SetNoBlocking(sd->SavedNoBlocking);
		}

		RestoreNoScrollData(&sd->SavedNoScrollData);

		if (TinselV2) {
			// create process to sort out the moving actors
			g_scheduler->createProcess(PID_MOVER, SortMAProcess, NULL, 0);
			bNotDoneYet = true;

			RestoreActorZ(sd->savedActorZ);
			RestoreZpositions(sd->zPositions);
			RestoreSysVars(sd->SavedSystemVars);
			CreateGhostPalette(BgPal());
			RestoreActors(sd->NumSavedActors, sd->SavedActorInfo);
			RestoreSoundReels(sd->SavedSoundReels);
			return 1;
		}

		sortActors(sd);
		break;

	case 2:
		break;

	case 1:
		if (TinselV2) {
			if (bNotDoneYet)
				return n;

			if (sd == &sgData)
				HoldItem(thingHeld, true);
			if (sd->bTinselDim)
				_vm->_pcmMusic->dim(true);
			_vm->_pcmMusic->restoreThatTune(sd->SavedTune);
			ScrollFocus(sd->SavedScrollFocus);
		} else {
			RestoreMidiFacts(sd->SavedMidi, sd->SavedLoop);
		}

		if (sd->SavedControl)
			ControlOn();	// Control was on
		ResumeInterprets();
		break;

	default:
		break;
	}

	return n - 1;
}
void Material::initPersistFields()
{
   addField("mapTo", TypeRealString, Offset(mMapTo, Material),
      "Used to map this material to the material name used by TSShape." );

   addArray( "Stages", MAX_STAGES );

      addField("diffuseColor", TypeColorF, Offset(mDiffuse, Material), MAX_STAGES,
         "This color is multiplied against the diffuse texture color.  If no diffuse texture "
         "is present this is the material color." );

      addField("diffuseColorPaletteSlot", TypeS32, Offset(mDiffusePaletteSlot, Material), MAX_STAGES,
         "Color from the object's palette to be multiplied against the diffuse texture color." );

      addField("diffuseMap", TypeImageFilename, Offset(mDiffuseMapFilename, Material), MAX_STAGES,
         "The diffuse color texture map." );

      addField("overlayMap", TypeImageFilename, Offset(mOverlayMapFilename, Material), MAX_STAGES,
         "A secondary diffuse color texture map which will use the second texcoord of a mesh." );

      addField("lightMap", TypeImageFilename, Offset(mLightMapFilename, Material), MAX_STAGES,
         "The lightmap texture used with pureLight." );

      addField("toneMap", TypeImageFilename, Offset(mToneMapFilename, Material), MAX_STAGES,
         "The tonemap texture used with pureLight.");

      addField("detailMap", TypeImageFilename, Offset(mDetailMapFilename, Material), MAX_STAGES,
         "A typically greyscale detail texture additively blended into the material." );

      addField("detailScale", TypePoint2F, Offset(mDetailScale, Material), MAX_STAGES,
         "The scale factor for the detail map." );

      addField( "normalMap", TypeImageFilename, Offset(mNormalMapFilename, Material), MAX_STAGES,
         "The normal map texture.  You can use the DXTnm format only when per-pixel "
         "specular highlights are disabled, or a specular map is in use." );

      addField( "detailNormalMap", TypeImageFilename, Offset(mDetailNormalMapFilename, Material), MAX_STAGES,
         "A second normal map texture applied at the detail scale.  You can use the DXTnm "
         "format only when per-pixel specular highlights are disabled." );

      addField( "detailNormalMapStrength", TypeF32, Offset(mDetailNormalMapStrength, Material), MAX_STAGES,
         "Used to scale the strength of the detail normal map when blended with the base normal map." );

      addField("specular", TypeColorF, Offset(mSpecular, Material), MAX_STAGES,
         "The color of the specular highlight when not using a specularMap." );

      addField("specularPower", TypeF32, Offset(mSpecularPower, Material), MAX_STAGES,
         "The hardness of the specular highlight when not using a specularMap." );

		addField("specularStrength", TypeF32, Offset(mSpecularStrength, Material), MAX_STAGES,
         "The strength of the specular highlight when not using a specularMap." );

      addField("pixelSpecular", TypeBool, Offset(mPixelSpecular, Material), MAX_STAGES, 
         "This enables per-pixel specular highlights controlled by the alpha channel of the "
         "normal map texture.  Note that if pixel specular is enabled the DXTnm format will not "
         "work with your normal map, unless you are also using a specular map." );

      addField( "specularMap", TypeImageFilename, Offset(mSpecularMapFilename, Material), MAX_STAGES,
         "The specular map texture. The RGB channels of this texture provide a per-pixel replacement for the 'specular' parameter on the material. "
         "If this texture contains alpha information, the alpha channel of the texture will be used as the gloss map. "
         "This provides a per-pixel replacement for the 'specularPower' on the material" );

      addField( "parallaxScale", TypeF32, Offset(mParallaxScale, Material), MAX_STAGES,
         "Enables parallax mapping and defines the scale factor for the parallax effect.  Typically "
         "this value is less than 0.4 else the effect breaks down." );
      
      addField( "useAnisotropic", TypeBool, Offset(mUseAnisotropic, Material), MAX_STAGES,
         "Use anisotropic filtering for the textures of this stage." );

      addField("envMap", TypeImageFilename, Offset(mEnvMapFilename, Material), MAX_STAGES,
         "The name of an environment map cube map to apply to this material." );

      addField("vertLit", TypeBool, Offset(mVertLit, Material), MAX_STAGES,
         "If true the vertex color is used for lighting." );

      addField( "vertColor", TypeBool, Offset( mVertColor, Material ), MAX_STAGES,
         "If enabled, vertex colors are premultiplied with diffuse colors." );

      addField("minnaertConstant", TypeF32, Offset(mMinnaertConstant, Material), MAX_STAGES,
         "The Minnaert shading constant value.  Must be greater than 0 to enable the effect." );

      addField("subSurface", TypeBool, Offset(mSubSurface, Material), MAX_STAGES,
         "Enables the subsurface scattering approximation." );

      addField("subSurfaceColor", TypeColorF, Offset(mSubSurfaceColor, Material), MAX_STAGES,
         "The color used for the subsurface scattering approximation." );

      addField("subSurfaceRolloff", TypeF32, Offset(mSubSurfaceRolloff, Material), MAX_STAGES,
         "The 0 to 1 rolloff factor used in the subsurface scattering approximation." );

      addField("glow", TypeBool, Offset(mGlow, Material), MAX_STAGES,
         "Enables rendering this material to the glow buffer." );

      addField("glowOnly", TypeBool, Offset(mGlowOnly, Material), MAX_STAGES,
         "Only render glow." );

      addField("emissive", TypeBool, Offset(mEmissive, Material), MAX_STAGES,
         "Enables emissive lighting for the material." );

      addField("wireframe", TypeBool, Offset(mWireframe, Material), MAX_STAGES,
         "Enables wireframe rendering for the material." );

      addField("doubleSided", TypeBool, Offset(mDoubleSided, Material),
         "Disables backface culling casing surfaces to be double sided. "
         "Note that the lighting on the backside will be a mirror of the front "
         "side of the surface."  );

      addField("animFlags", TYPEID< AnimType >(), Offset(mAnimFlags, Material), MAX_STAGES,
         "The types of animation to play on this material." );

      addField("scrollDir", TypePoint2F, Offset(mScrollDir, Material), MAX_STAGES,
         "The scroll direction in UV space when scroll animation is enabled." );

      addField("scrollSpeed", TypeF32, Offset(mScrollSpeed, Material), MAX_STAGES,
         "The speed to scroll the texture in UVs per second when scroll animation is enabled." );

      addField("rotSpeed", TypeF32, Offset(mRotSpeed, Material), MAX_STAGES,
         "The speed to rotate the texture in degrees per second when rotation animation is enabled." );

      addField("rotPivotOffset", TypePoint2F, Offset(mRotPivotOffset, Material), MAX_STAGES,
         "The piviot position in UV coordinates to center the rotation animation." );

      addField("waveType", TYPEID< WaveType >(), Offset(mWaveType, Material), MAX_STAGES,
         "The type of wave animation to perform when wave animation is enabled." );

      addField("waveFreq", TypeF32, Offset(mWaveFreq, Material), MAX_STAGES,
         "The wave frequency when wave animation is enabled." );

      addField("waveAmp", TypeF32, Offset(mWaveAmp, Material), MAX_STAGES,
         "The wave amplitude when wave animation is enabled." );

      addField("sequenceFramePerSec", TypeF32, Offset(mSeqFramePerSec, Material), MAX_STAGES,
         "The number of frames per second for frame based sequence animations if greater than zero." );

      addField("sequenceSegmentSize", TypeF32, Offset(mSeqSegSize, Material), MAX_STAGES,
         "The size of each frame in UV units for sequence animations." );

      // Texture atlasing
      addField("cellIndex", TypePoint2I, Offset(mCellIndex, Material), MAX_STAGES,
         "@internal" );
      addField("cellLayout", TypePoint2I, Offset(mCellLayout, Material), MAX_STAGES,
         "@internal");
      addField("cellSize", TypeS32, Offset(mCellSize, Material), MAX_STAGES,
         "@internal");
      addField("bumpAtlas", TypeBool, Offset(mNormalMapAtlas, Material), MAX_STAGES,
         "@internal");

      // For backwards compatibility.  
      //
      // They point at the new 'map' fields, but reads always return
      // an empty string and writes only apply if the value is not empty.
      //
      addProtectedField("baseTex",        TypeImageFilename,   Offset(mDiffuseMapFilename, Material), 
         defaultProtectedSetNotEmptyFn, emptyStringProtectedGetFn, MAX_STAGES, 
         "For backwards compatibility.\[email protected] diffuseMap\n" ); 
      addProtectedField("detailTex",      TypeImageFilename,   Offset(mDetailMapFilename, Material), 
         defaultProtectedSetNotEmptyFn, emptyStringProtectedGetFn, MAX_STAGES, 
         "For backwards compatibility.\[email protected] detailMap\n"); 
      addProtectedField("overlayTex",     TypeImageFilename,   Offset(mOverlayMapFilename, Material),
         defaultProtectedSetNotEmptyFn, emptyStringProtectedGetFn, MAX_STAGES, 
         "For backwards compatibility.\[email protected] overlayMap\n"); 
      addProtectedField("bumpTex",        TypeImageFilename,   Offset(mNormalMapFilename, Material),
         defaultProtectedSetNotEmptyFn, emptyStringProtectedGetFn, MAX_STAGES, 
         "For backwards compatibility.\[email protected] normalMap\n"); 
      addProtectedField("envTex",         TypeImageFilename,   Offset(mEnvMapFilename, Material),
         defaultProtectedSetNotEmptyFn, emptyStringProtectedGetFn, MAX_STAGES,
         "For backwards compatibility.\[email protected] envMap\n"); 
      addProtectedField("colorMultiply",  TypeColorF,          Offset(mDiffuse, Material),
         defaultProtectedSetNotEmptyFn, emptyStringProtectedGetFn, MAX_STAGES,
         "For backwards compatibility.\[email protected] diffuseColor\n"); 

   endArray( "Stages" );

   addField( "castShadows", TypeBool, Offset(mCastShadows, Material),
      "If set to false the lighting system will not cast shadows from this material." );

   addField("planarReflection", TypeBool, Offset(mPlanarReflection, Material), "@internal" );

   addField("translucent", TypeBool, Offset(mTranslucent, Material),
      "If true this material is translucent blended." );

   addField("translucentBlendOp", TYPEID< BlendOp >(), Offset(mTranslucentBlendOp, Material),
      "The type of blend operation to use when the material is translucent." );

   addField("translucentZWrite", TypeBool, Offset(mTranslucentZWrite, Material),
      "If enabled and the material is translucent it will write into the depth buffer." );

   addField("alphaTest", TypeBool, Offset(mAlphaTest, Material),
      "Enables alpha test when rendering the material.\[email protected] alphaRef\n" );

   addField("alphaRef", TypeS32, Offset(mAlphaRef, Material),
      "The alpha reference value for alpha testing.  Must be between 0 to 255.\[email protected] alphaTest\n" );

   addField("cubemap", TypeRealString, Offset(mCubemapName, Material),
      "The name of a CubemapData for environment mapping." );

   addField("dynamicCubemap", TypeBool, Offset(mDynamicCubemap, Material),
      "Enables the material to use the dynamic cubemap from the ShapeBase object its applied to." );

   addGroup( "Behavioral" );

      addField( "showFootprints", TypeBool, Offset( mShowFootprints, Material ),
         "Whether to show player footprint decals on this material.\n\n"
         "@see PlayerData::decalData" );
         
      addField( "showDust", TypeBool, Offset( mShowDust, Material ),
         "Whether to emit dust particles from a shape moving over the material.  This is, for example, used by "
         "vehicles or players to decide whether to show dust trails." );
         
      addField( "effectColor", TypeColorF, Offset( mEffectColor, Material ), NUM_EFFECT_COLOR_STAGES,
         "If #showDust is true, this is the set of colors to use for the ParticleData of the dust "
         "emitter.\n\n"
         "@see ParticleData::colors" );
         
      addField( "footstepSoundId", TypeS32, Offset( mFootstepSoundId, Material ),
         "What sound to play from the PlayerData sound list when the player walks over the material.  -1 (default) to not play any sound.\n"
         "\n"
         "The IDs are:\n\n"
         "- 0: PlayerData::FootSoftSound\n"
         "- 1: PlayerData::FootHardSound\n"
         "- 2: PlayerData::FootMetalSound\n"
         "- 3: PlayerData::FootSnowSound\n"
         "- 4: PlayerData::FootShallowSound\n"
         "- 5: PlayerData::FootWadingSound\n"
         "- 6: PlayerData::FootUnderwaterSound\n"
         "- 7: PlayerData::FootBubblesSound\n"
         "- 8: PlayerData::movingBubblesSound\n"
         "- 9: PlayerData::waterBreathSound\n"
         "- 10: PlayerData::impactSoftSound\n"
         "- 11: PlayerData::impactHardSound\n"
         "- 12: PlayerData::impactMetalSound\n"
         "- 13: PlayerData::impactSnowSound\n"
         "- 14: PlayerData::impactWaterEasy\n"
         "- 15: PlayerData::impactWaterMedium\n"
         "- 16: PlayerData::impactWaterHard\n"
         "- 17: PlayerData::exitingWater\n" );
         
      addField( "customFootstepSound", TypeSFXTrackName, Offset( mFootstepSoundCustom, Material ),
         "The sound to play when the player walks over the material.  If this is set, it overrides #footstepSoundId.  This field is "
         "useful for directly assigning custom footstep sounds to materials without having to rely on the PlayerData sound assignment.\n\n"
         "@warn Be aware that materials are client-side objects.  This means that the SFXTracks assigned to materials must be client-side, too." );
      addField( "impactSoundId", TypeS32, Offset( mImpactSoundId, Material ),
         "What sound to play from the PlayerData sound list when the player impacts on the surface with a velocity equal or greater "
         "than PlayerData::groundImpactMinSpeed.\n\n"
         "For a list of IDs, see #footstepSoundId" );
      addField( "customImpactSound", TypeSFXTrackName,    Offset( mImpactSoundCustom, Material ),
         "The sound to play when the player impacts on the surface with a velocity equal or greater than PlayerData::groundImpactMinSpeed.  "
         "If this is set, it overrides #impactSoundId.  This field is useful for directly assigning custom impact sounds to materials "
         "without having to rely on the PlayerData sound assignment.\n\n"
         "@warn Be aware that materials are client-side objects.  This means that the SFXTracks assigned to materials must be client-side, too." );
      
      //Deactivate these for the moment as they are not used.
      
      #if 0
      addField( "friction", TypeF32, Offset( mFriction, Material ) );
      addField( "directSoundOcclusion", TypeF32, Offset( mDirectSoundOcclusion, Material ) );
      addField( "reverbSoundOcclusion", TypeF32, Offset( mReverbSoundOcclusion, Material ) );
      #endif

   endGroup( "Behavioral" );

   Parent::initPersistFields();
}
Example #24
0
void RuntimeRegisteredSimObject::initPersistFields()
{
   addField("fooField", TypeBool, Offset(mFoo, RuntimeRegisteredSimObject));
}
void ForestWindEmitter::initPersistFields()
{
   // Initialise parents' persistent fields.
   Parent::initPersistFields();

   addGroup( "ForestWind" );
      addField( "windEnabled",         TypeBool,      Offset( mEnabled, ForestWindEmitter ), "Determines if the emitter will be counted in wind calculations." );
      addField( "radialEmitter",       TypeBool,      Offset( mRadialEmitter, ForestWindEmitter ), "Determines if the emitter is a global direction or local radial emitter." );
      addField( "strength",            TypeF32,       Offset( mWindStrength, ForestWindEmitter ), "The strength of the wind force." );
      addField( "radius",              TypeF32,       Offset( mWindRadius, ForestWindEmitter ), "The radius of the emitter for local radial emitters." );
      addField( "gustStrength",        TypeF32,       Offset( mWindGustStrength, ForestWindEmitter ), "The maximum strength of a gust." );
      addField( "gustFrequency",       TypeF32,       Offset( mWindGustFrequency, ForestWindEmitter ), "The frequency of gusting in seconds." );
      addField( "gustYawAngle",        TypeF32,       Offset( mWindGustYawAngle, ForestWindEmitter ), "The amount of degrees the wind direction can drift (both positive and negative)." );
      addField( "gustYawFrequency",    TypeF32,       Offset( mWindGustYawFrequency, ForestWindEmitter ), "The frequency of wind yaw drift, in seconds." );
      addField( "gustWobbleStrength",  TypeF32,       Offset( mWindGustWobbleStrength, ForestWindEmitter ), "The amount of random wobble added to gust and turbulence vectors." );
      addField( "turbulenceStrength",  TypeF32,       Offset( mWindTurbulenceStrength, ForestWindEmitter ), "The strength of gust turbulence." ); 
      addField( "turbulenceFrequency", TypeF32,       Offset( mWindTurbulenceFrequency, ForestWindEmitter ), "The frequency of gust turbulence, in seconds." ); 
      addField( "hasMount", TypeBool, Offset( mHasMount, ForestWindEmitter ), "Determines if the emitter is mounted to another object." );
   endGroup( "ForestWind" );
}
Example #26
0
void VSlowMoEvent::initPersistFields( void )
{
    Parent::initPersistFields();

    addField( "TimeScale", TypeF32, Offset( mTimeScale, VSlowMoEvent ), "The Time Scale to be applied to the Root Controller." );
}
void HoverPodController::initPersistFields()
{
   addField("client",     TypeS32,     Offset(mClientId, HoverPodController));
void GFXSamplerStateData::initPersistFields()
{
   Parent::initPersistFields();

   addGroup( "Color Op" );

      addField("textureColorOp", TypeGFXTextureOp, Offset(mState.textureColorOp, GFXSamplerStateData),
         "The texture color blending operation.  The default value is GFXTOPDisable which disables the sampler." );

      addField("colorArg1", TYPEID< GFXTextureArgument >(), Offset(mState.colorArg1, GFXSamplerStateData),
         "The first color argument for the texture stage.  The default value is GFXTACurrent." );

      addField("colorArg2", TYPEID< GFXTextureArgument >(), Offset(mState.colorArg2, GFXSamplerStateData),
         "The second color argument for the texture stage.  The default value is GFXTATexture." );

      addField("colorArg3", TYPEID< GFXTextureArgument >(), Offset(mState.colorArg3, GFXSamplerStateData),
         "The third color argument for triadic operations (multiply, add, and linearly interpolate).  The default value is GFXTACurrent." );

   endGroup( "Color Op" );

   addGroup( "Alpha Op" );

      addField("alphaOp", TypeGFXTextureOp, Offset(mState.alphaOp, GFXSamplerStateData),
         "The texture alpha blending operation.  The default value is GFXTOPModulate." );

      addField("alphaArg1", TYPEID< GFXTextureArgument >(), Offset(mState.alphaArg1, GFXSamplerStateData),
         "The first alpha argument for the texture stage.  The default value is GFXTATexture." );

      addField("alphaArg2", TYPEID< GFXTextureArgument >(), Offset(mState.alphaArg2, GFXSamplerStateData),
         "The second alpha argument for the texture stage.  The default value is GFXTADiffuse." );

      addField("alphaArg3", TYPEID< GFXTextureArgument >(), Offset(mState.alphaArg3, GFXSamplerStateData),
         "The third alpha channel selector operand for triadic operations (multiply, add, and linearly interpolate).  The default value is GFXTACurrent." );

   endGroup( "Alpha Op" );

   addGroup( "Address Mode" );

      addField("addressModeU", TypeGFXTextureAddressMode, Offset(mState.addressModeU, GFXSamplerStateData),
         "The texture address mode for the u coordinate.  The default is GFXAddressWrap." );

      addField("addressModeV", TypeGFXTextureAddressMode, Offset(mState.addressModeV, GFXSamplerStateData),
         "The texture address mode for the v coordinate.  The default is GFXAddressWrap." );

      addField("addressModeW", TypeGFXTextureAddressMode, Offset(mState.addressModeW, GFXSamplerStateData),
         "The texture address mode for the w coordinate.  The default is GFXAddressWrap." );

   endGroup( "Address Mode" );

   addGroup( "Filter State" );

      addField("magFilter", TypeGFXTextureFilterType, Offset(mState.magFilter, GFXSamplerStateData),
         "The texture magnification filter.  The default is GFXTextureFilterLinear." );

      addField("minFilter", TypeGFXTextureFilterType, Offset(mState.minFilter, GFXSamplerStateData),
         "The texture minification filter.  The default is GFXTextureFilterLinear." );

      addField("mipFilter", TypeGFXTextureFilterType, Offset(mState.mipFilter, GFXSamplerStateData),
         "The texture mipmap filter used during minification.  The default is GFXTextureFilterLinear." );

      addField("mipLODBias", TypeF32, Offset(mState.mipLODBias, GFXSamplerStateData),
         "The mipmap level of detail bias.  The default value is zero." );

      addField("maxAnisotropy", TypeS32, Offset(mState.maxAnisotropy, GFXSamplerStateData),
         "The maximum texture anisotropy.  The default value is 1." );

   endGroup( "Filter State" );

   addField("textureTransform", TypeGFXTextureTransformFlags, Offset(mState.textureTransform, GFXSamplerStateData),
      "Sets the texture transform state.  The default is GFXTTFFDisable." );

   addField("resultArg", TypeGFXTextureArgument, Offset(mState.resultArg, GFXSamplerStateData),
      "The selection of the destination register for the result of this stage.  The default is GFXTACurrent." );
}
Example #29
0
//--------------------------------------------------------------------------
void HoverVehicleData::initPersistFields()
{
    addField( "dragForce", TypeF32, Offset(dragForce, HoverVehicleData),
              "Drag force factor that acts opposite to the vehicle velocity.\nAlso "
              "used to determnine the vehicle's maxThrustSpeed.\[email protected] mainThrustForce" );
    addField( "vertFactor", TypeF32, Offset(vertFactor, HoverVehicleData),
              "Scalar applied to the vertical portion of the velocity drag acting on "
              "the vehicle.\nFor the horizontal (X and Y) components of velocity drag, "
              "a factor of 0.25 is applied when the vehicle is floating, and a factor "
              "of 1.0 is applied when the vehicle is not floating. This velocity drag "
              "is multiplied by the vehicle's dragForce, as defined above, and the "
              "result is subtracted from it's movement force.\n"
              "@note The vertFactor must be between 0.0 and 1.0 (inclusive)." );
    addField( "floatingThrustFactor", TypeF32, Offset(floatingThrustFactor, HoverVehicleData),
              "Scalar applied to the vehicle's thrust force when the vehicle is floating.\n"
              "@note The floatingThrustFactor must be between 0.0 and 1.0 (inclusive)." );
    addField( "mainThrustForce", TypeF32, Offset(mainThrustForce, HoverVehicleData),
              "Force generated by thrusting the vehicle forward.\nAlso used to determine "
              "the maxThrustSpeed:\n\n"
              "@tsexample\n"
              "maxThrustSpeed = (mainThrustForce + strafeThrustForce) / dragForce;\n"
              "@endtsexample\n" );
    addField( "reverseThrustForce", TypeF32, Offset(reverseThrustForce, HoverVehicleData),
              "Force generated by thrusting the vehicle backward." );
    addField( "strafeThrustForce", TypeF32, Offset(strafeThrustForce, HoverVehicleData),
              "Force generated by thrusting the vehicle to one side.\nAlso used to "
              "determine the vehicle's maxThrustSpeed.\[email protected] mainThrustForce" );
    addField( "turboFactor", TypeF32, Offset(turboFactor, HoverVehicleData),
              "Scale factor applied to the vehicle's thrust force when jetting." );

    addField( "stabLenMin", TypeF32, Offset(stabLenMin, HoverVehicleData),
              "Length of the base stabalizer when travelling at minimum speed (0).\n"
              "Each tick, the vehicle performs 2 raycasts (from the center back and "
              "center front of the vehicle) to check for contact with the ground. The "
              "base stabalizer length determines the length of that raycast; if "
              "neither raycast hit the ground, the vehicle is floating, stabalizer "
              "spring and ground normal forces are not applied.\n\n"
              "<img src=\"images/hoverVehicle_forces.png\">\n"
              "@see stabSpringConstant" );
    addField( "stabLenMax", TypeF32, Offset(stabLenMax, HoverVehicleData),
              "Length of the base stabalizer when travelling at maximum speed "
              "(maxThrustSpeed).\n\[email protected] stabLenMin\n\[email protected] mainThrustForce" );

    addField( "stabSpringConstant", TypeF32, Offset(stabSpringConstant, HoverVehicleData),
              "Value used to generate stabalizer spring force. The force generated "
              "depends on stabilizer compression, that is how close the vehicle is "
              "to the ground proportional to current stabalizer length.\n\n"
              "@see stabLenMin" );
    addField( "stabDampingConstant", TypeF32, Offset(stabDampingConstant, HoverVehicleData),
              "Damping spring force acting against changes in the stabalizer length.\n\n"
              "@see stabLenMin" );

    addField( "gyroDrag", TypeF32, Offset(gyroDrag, HoverVehicleData),
              "Damping torque that acts against the vehicle's current angular momentum." );
    addField( "normalForce", TypeF32, Offset(normalForce, HoverVehicleData),
              "Force generated in the ground normal direction when the vehicle is not "
              "floating (within stabalizer length from the ground).\n\n"
              "@see stabLenMin" );
    addField( "restorativeForce", TypeF32, Offset(restorativeForce, HoverVehicleData),
              "Force generated to stabalize the vehicle (return it to neutral pitch/roll) "
              "when the vehicle is floating (more than stabalizer length from the "
              "ground.\n\[email protected] stabLenMin" );
    addField( "steeringForce", TypeF32, Offset(steeringForce, HoverVehicleData),
              "Yaw (rotation about the Z-axis) force applied when steering in the x-axis direction."
              "about the vehicle's Z-axis)" );
    addField( "rollForce", TypeF32, Offset(rollForce, HoverVehicleData),
              "Roll (rotation about the Y-axis) force applied when steering in the x-axis direction." );
    addField( "pitchForce", TypeF32, Offset(pitchForce, HoverVehicleData),
              "Pitch (rotation about the X-axis) force applied when steering in the y-axis direction." );

    addField( "jetSound", TYPEID< SFXProfile >(), Offset(sound[JetSound], HoverVehicleData),
              "Looping sound played when the vehicle is jetting." );
    addField( "engineSound", TYPEID< SFXProfile >(), Offset(sound[EngineSound], HoverVehicleData),
              "Looping engine sound.\nThe volume is dynamically adjusted based on the "
              "current thrust level." );
    addField( "floatSound", TYPEID< SFXProfile >(), Offset(sound[FloatSound], HoverVehicleData),
              "Looping sound played while the vehicle is floating.\n\[email protected] stabMinLen" );

    addField( "dustTrailEmitter", TYPEID< ParticleEmitterData >(), Offset(dustTrailEmitter, HoverVehicleData),
              "Emitter to generate particles for the vehicle's dust trail.\nThe trail "
              "of dust particles is generated only while the vehicle is moving." );
    addField( "dustTrailOffset", TypePoint3F, Offset(dustTrailOffset, HoverVehicleData),
              "\"X Y Z\" offset from the vehicle's origin from which to generate dust "
              "trail particles.\nBy default particles are emitted directly beneath the "
              "origin of the vehicle model." );
    addField( "triggerTrailHeight", TypeF32, Offset(triggerTrailHeight, HoverVehicleData),
              "Maximum height above surface to emit dust trail particles.\nIf the vehicle "
              "is less than triggerTrailHeight above a static surface with a material that "
              "has 'showDust' set to true, the vehicle will emit particles from the "
              "dustTrailEmitter." );
    addField( "dustTrailFreqMod", TypeF32, Offset(dustTrailFreqMod, HoverVehicleData),
              "Number of dust trail particles to generate based on vehicle speed.\nThe "
              "vehicle's speed is divided by this value to determine how many particles "
              "to generate each frame. Lower values give a more dense trail, higher "
              "values a more sparse trail." );

    addField( "floatingGravMag", TypeF32, Offset(floatingGravMag, HoverVehicleData),
              "Scale factor applied to the vehicle gravitational force when the vehicle "
              "is floating.\n\[email protected] stabLenMin" );
    addField( "brakingForce", TypeF32, Offset(brakingForce, HoverVehicleData),
              "Force generated by braking.\nThe vehicle is considered to be braking if "
              "it is moving, but the throttle is off, and no left or right thrust is "
              "being applied. This force is only applied when the vehicle's velocity is "
              "less than brakingActivationSpeed." );
    addField( "brakingActivationSpeed", TypeF32, Offset(brakingActivationSpeed, HoverVehicleData),
              "Maximum speed below which a braking force is applied.\n\[email protected] brakingForce" );

    addField( "forwardJetEmitter", TYPEID< ParticleEmitterData >(), Offset(jetEmitter[ForwardJetEmitter], HoverVehicleData),
              "Emitter to generate particles for forward jet thrust.\nForward jet "
              "thrust particles are emitted from model nodes JetNozzle0 and JetNozzle1." );

    Parent::initPersistFields();
}
Example #30
0
void DrawForPrintingHelper(wxDC& dc, const CalChartConfiguration& config, const CalChartDoc& show, const CC_sheet& sheet, unsigned ref, bool landscape)
{
    // set up everything to be restored after we print
    SaveAndRestore_DeviceOrigin orig_dev(dc);
    SaveAndRestore_UserScale orig_scale(dc);
    SaveAndRestore_Font orig_font(dc);

    // get the page dimensions
    int pageW, pageH;
    dc.GetSize(&pageW, &pageH);

    dc.Clear();
    dc.SetLogicalFunction(wxCOPY);

    // Print the field:
    // create a field for drawing:
    const auto pts = sheet.GetPoints();
    auto boundingBox = GetMarcherBoundingBox(pts);
    auto mode = CreateFieldForPrinting(Coord2Int(boundingBox.first.x), Coord2Int(boundingBox.second.x), landscape);

    // set the origin and scaling for drawing the field
    dc.SetDeviceOrigin(kFieldBorderOffset*pageW, kFieldTop*pageH);
    auto scale = (pageW-2*kFieldBorderOffset*pageW)/(double)mode->Size().x;
    dc.SetUserScale(scale, scale);

    // draw the field.
    DrawMode(dc, config, *mode, ShowMode_kPrinting);
    wxFont *pointLabelFont = wxTheFontList->FindOrCreateFont((int)Float2Coord(config.Get_DotRatio() * config.Get_NumRatio()), wxSWISS, wxNORMAL, wxNORMAL);
    dc.SetFont(*pointLabelFont);
    for (auto i = 0u; i < pts.size(); i++)
    {
        const auto point = pts.at(i);
        const auto pos = point.GetPos(ref) + mode->Offset();
        dc.SetBrush(*wxBLACK_BRUSH);
        DrawPointHelper(dc, config, pos, point, show.GetPointLabel(i));
    }

    // now reset everything to draw the rest of the text
    dc.SetDeviceOrigin(Int2Coord(0), Int2Coord(0));
    dc.SetBrush(*wxTRANSPARENT_BRUSH);

    // set the page for drawing:
    dc.GetSize(&pageW, &pageH);
    if (landscape)
    {
        dc.SetUserScale(pageW/kSizeXLandscape, pageH/kSizeYLandscape);
        pageW = kSizeXLandscape;
        pageH = kSizeYLandscape;
    }
    else
    {
        dc.SetUserScale(pageW/kSizeX, pageH/kSizeY);
        pageW = kSizeX;
        pageH = kSizeY;
    }

    // draw the header
    dc.SetFont(*wxTheFontList->FindOrCreateFont(16, wxROMAN, wxNORMAL, wxBOLD));
    dc.SetPen(*wxThePenList->FindOrCreatePen(*wxBLACK, 1, wxSOLID));

    DrawCenteredText(dc, kHeader, wxPoint(pageW*kHeaderLocation[landscape][0], pageH*kHeaderLocation[landscape][1]));

    DrawCenteredText(dc, sheet.GetNumber(), wxPoint(pageW*kUpperNumberPosition[landscape][0], pageH*kUpperNumberPosition[landscape][1]));
    DrawCenteredText(dc, sheet.GetNumber(), wxPoint(pageW*kLowerNumberPosition[landscape][0], pageH*kLowerNumberPosition[landscape][1]));
    dc.DrawRectangle(pageW*kLowerNumberBox[landscape][0], pageH*kLowerNumberBox[landscape][1], pageW*kLowerNumberBox[landscape][2], pageH*kLowerNumberBox[landscape][3]);

    dc.SetFont(*wxTheFontList->FindOrCreateFont(8, wxSWISS, wxNORMAL, wxNORMAL));

    DrawLineOverText(dc, kMusicLabel, wxPoint(pageW*kMusicLabelPosition[landscape][0], pageH*kMusicLabelPosition[landscape][1]), pageW*kMusicLabelPosition[landscape][2]);
    DrawLineOverText(dc, kFormationLabel, wxPoint(pageW*kFormationLabelPosition[landscape][0], pageH*kFormationLabelPosition[landscape][1]), pageW*kFormationLabelPosition[landscape][2]);
    DrawLineOverText(dc, kGameLabel, wxPoint(pageW*kGameLabelPosition[landscape][0], pageH*kGameLabelPosition[landscape][1]), pageW*kGameLabelPosition[landscape][2]);
    DrawLineOverText(dc, kPageLabel, wxPoint(pageW*kPageLabelPosition[landscape][0], pageH*kPageLabelPosition[landscape][1]), pageW*kPageLabelPosition[landscape][2]);
    DrawCenteredText(dc, kSideLabel, wxPoint(pageW*kSideLabelPosition[landscape][0], pageH*kSideLabelPosition[landscape][1]));

    // draw arrows
    DrawCenteredText(dc, kUpperSouthLabel, wxPoint(pageW*kUpperSouthPosition[landscape][0], pageH*kUpperSouthPosition[landscape][1]));
    DrawArrow(dc, wxPoint(pageW*kUpperSouthArrow[landscape][0], pageH*kUpperSouthArrow[landscape][1]), pageW*kUpperSouthArrow[landscape][2], false);
    DrawCenteredText(dc, kUpperNorthLabel, wxPoint(pageW*kUpperNorthPosition[landscape][0], pageH*kUpperNorthPosition[landscape][1]));
    DrawArrow(dc, wxPoint(pageW*kUpperNorthArrow[landscape][0], pageH*kUpperNorthArrow[landscape][1]), pageW*kUpperNorthArrow[landscape][2], true);
    DrawCenteredText(dc, kLowerSouthLabel, wxPoint(pageW*kLowerSouthPosition[landscape][0], pageH*kLowerSouthPosition[landscape][1]));
    DrawArrow(dc, wxPoint(pageW*kLowerSouthArrow[landscape][0], pageH*kLowerSouthArrow[landscape][1]), pageW*kLowerSouthArrow[landscape][2], false);
    DrawCenteredText(dc, kLowerNorthLabel, wxPoint(pageW*kLowerNorthPosition[landscape][0], pageH*kLowerNorthPosition[landscape][1]));
    DrawArrow(dc, wxPoint(pageW*kLowerNorthArrow[landscape][0], pageH*kLowerNorthArrow[landscape][1]), pageW*kLowerNorthArrow[landscape][2], true);

    DrawCont(dc, sheet.GetPrintableContinuity(), wxRect(wxPoint(10, pageH*kContinuityStart[landscape]), wxSize(pageW-20, pageH-pageH*kContinuityStart[landscape])), landscape);
}