本文整理汇总了C++中SetColor函数的典型用法代码示例。如果您正苦于以下问题:C++ SetColor函数的具体用法?C++ SetColor怎么用?C++ SetColor使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetColor函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: bar
/*
==============================
==============================
*/
TwLimb::TwLimb(IKALimb* l, const char* name, const ivec2& pos, const ivec2& size, const vec4& color) : bar(0), limb(0)
{
limb = l;
if(limb)
{
limb->AddRef();
}
bar = TwNewBar(name);
TwStructs* twStructs = TwStructs::GetInstance();
ASSERT(twStructs);
// Ball
TwAddVarCB(bar, "BallRestRotation", twStructs->GetType(TW_STRUCT_EULER), &TwLimb::SetBallRestRotation, &TwLimb::GetBallRestRotation,
reinterpret_cast<void*>(limb->ball), "group='Ball & Socket' label='Rest Rotation'");
TwAddVarCB(bar, "BallRotation", twStructs->GetType(TW_STRUCT_EULER), &TwLimb::SetBallRotation, &TwLimb::GetBallRotation,
reinterpret_cast<void*>(limb->ball), "group='Ball & Socket' label='Rotation'");
TwAddVarCB(bar, "BallPosition", twStructs->GetType(TW_STRUCT_POSITION), &TwLimb::SetJointPosition, &TwLimb::GetJointPosition,
reinterpret_cast<void*>(limb->ball), "group='Ball & Socket' label='Position'");
// Hinge
TwAddVarCB(bar, "HingeAxis", TW_TYPE_DIR3F, &TwLimb::SetHingeAxis, &TwLimb::GetHingeAxis,
reinterpret_cast<void*>(limb->hinge), "group='Hinge' label='Axis'");
TwAddVarCB(bar, "HingeRestAngle", TW_TYPE_FLOAT, &TwLimb::SetHingeRestAngle, &TwLimb::GetHingeRestAngle,
reinterpret_cast<void*>(limb->hinge), "group='Hinge' label='Rest Angle'");
TwAddVarCB(bar, "HingeAngle", TW_TYPE_FLOAT, &TwLimb::SetHingeAngle, &TwLimb::GetHingeAngle,
reinterpret_cast<void*>(limb->hinge), "group='Hinge' label='Angle'");
TwAddVarCB(bar, "HingePosition", twStructs->GetType(TW_STRUCT_POSITION), &TwLimb::SetJointPosition, &TwLimb::GetJointPosition,
reinterpret_cast<void*>(limb->hinge), "group='Hinge' label='Position'");
// Universal
TwAddVarCB(bar, "UniversalAxis1", TW_TYPE_DIR3F, &TwLimb::SetUniversalAxis1, &TwLimb::GetUniversalAxis1,
reinterpret_cast<void*>(limb->universal), "group='Universal' label='Axis 1'");
TwAddVarCB(bar, "UniversalRestAngle1", TW_TYPE_FLOAT, &TwLimb::SetUniversalRestAngle1, &TwLimb::GetUniversalRestAngle1,
reinterpret_cast<void*>(limb->universal), "group='Universal' label='Rest Angle 1'");
TwAddVarCB(bar, "UniversalAngle1", TW_TYPE_FLOAT, &TwLimb::SetUniversalAngle1, &TwLimb::GetUniversalAngle1,
reinterpret_cast<void*>(limb->universal), "group='Universal' label='Angle 1'");
TwAddVarCB(bar, "UniversalAxis2", TW_TYPE_DIR3F, &TwLimb::SetUniversalAxis2, &TwLimb::GetUniversalAxis2,
reinterpret_cast<void*>(limb->universal), "group='Universal' label='Axis 2'");
TwAddVarCB(bar, "UniversalRestAngle2", TW_TYPE_FLOAT, &TwLimb::SetUniversalRestAngle2, &TwLimb::GetUniversalRestAngle2,
reinterpret_cast<void*>(limb->universal), "group='Universal' label='Rest Angle 2'");
TwAddVarCB(bar, "UniversalAngle2", TW_TYPE_FLOAT, &TwLimb::SetUniversalAngle2, &TwLimb::GetUniversalAngle2,
reinterpret_cast<void*>(limb->universal), "group='Universal' label='Angle 2'");
TwAddVarCB(bar, "UniversalPosition", twStructs->GetType(TW_STRUCT_POSITION), &TwLimb::SetJointPosition, &TwLimb::GetJointPosition,
reinterpret_cast<void*>(limb->universal), "group='Universal' label='Position'");
SetPos(pos);
SetSize(size);
SetColor(color);
}
示例2: SetColor
void mitk::ColorProperty::SetValue(const mitk::Color & color )
{
SetColor(color);
}
示例3: TouchCalibration
/*********************************************************************
* Function: void TouchCalibration()
*
* PreCondition: InitGraph() must be called before
*
* Input: none
*
* Output: none
*
* Side Effects: none
*
* Overview: calibrates touch screen
*
* Note: none
*
********************************************************************/
void TouchCalibration(){
static const XCHAR scr1StrLn1[] = {'I','M','P','O','R','T','A','N','T','.',0};
static const XCHAR scr1StrLn2[] = {'N','o','w',' ','t','o','u','c','h',' ','s','c','r','e','e','n',' ','c','a','l','i','b','r','a','t','i','o','n',0};
static const XCHAR scr1StrLn3[] = {'w','i','l','l',' ','b','e',' ','p','e','r','f','o','m','e','d','.','T','o','u','c','h',' ','p','o','i','n','t','s',0};
static const XCHAR scr1StrLn4[] = {'E','X','A','C','T','L','Y',' ','a','t',' ','t','h','e',' ','p','o','s','i','t','i','o','n','s',0};
static const XCHAR scr1StrLn5[] = {'s','h','o','w','n',' ','b','y',' ','a','r','r','o','w','s','.',0};
static const XCHAR scr1StrLn6[] = {'T','o','u','c','h',' ','s','c','r','e','e','n',' ','t','o',' ','c','o','n','t','i','n','u','e','.',0};
static const XCHAR scr2StrLn1[] = {'H','o','l','d',' ','S','3',' ','b','u','t','t','o','n',' ','a','n','d',0};
static const XCHAR scr2StrLn2[] = {'p','r','e','s','s',' ','M','C','L','R',' ','r','e','s','e','t','(','S','1',')',0};
static const XCHAR scr2StrLn3[] = {'t','o',' ','R','E','P','E','A','T',' ','t','h','e',' ','c','a','l','i','b','r','a','t','i','o','n',0};
static const XCHAR scr2StrLn4[] = {'p','r','o','c','e','d','u','r','e','.',0};
SHORT x,y;
SHORT textHeight;
SetFont((void*)&GOLFontDefault);
textHeight = GetTextHeight((void*)&GOLFontDefault);
SetColor(WHITE);
ClearDevice();
SetColor(BRIGHTRED);
WAIT_UNTIL_FINISH(OutTextXY(0,0*textHeight, (XCHAR*)scr1StrLn1));
SetColor(BLACK);
WAIT_UNTIL_FINISH(OutTextXY(0,1*textHeight, (XCHAR*)scr1StrLn2));
WAIT_UNTIL_FINISH(OutTextXY(0,2*textHeight, (XCHAR*)scr1StrLn3));
WAIT_UNTIL_FINISH(OutTextXY(0,3*textHeight, (XCHAR*)scr1StrLn4));
WAIT_UNTIL_FINISH(OutTextXY(0,4*textHeight, (XCHAR*)scr1StrLn5));
SetColor(BRIGHTRED);
WAIT_UNTIL_FINISH(OutTextXY(0,6*textHeight, (XCHAR*)scr1StrLn6));
// Wait for touch
do{
x=ADCGetX(); y=ADCGetY();
}while((y==-1)||(x==-1));
Beep();
DelayMs(500);
SetColor(WHITE);
ClearDevice();
SetColor(BRIGHTRED);
#ifdef SWAP_X_AND_Y
WAIT_UNTIL_FINISH(Line(GetMaxX()-5,5,GetMaxX()-5,15));
WAIT_UNTIL_FINISH(Line(GetMaxX()-4,5,GetMaxX()-4,15));
WAIT_UNTIL_FINISH(Line(GetMaxX()-6,5,GetMaxX()-6,15));
WAIT_UNTIL_FINISH(Line(GetMaxX()-5,5,GetMaxX()-15,5));
WAIT_UNTIL_FINISH(Line(GetMaxX()-5,4,GetMaxX()-15,4));
WAIT_UNTIL_FINISH(Line(GetMaxX()-5,6,GetMaxX()-15,6));
WAIT_UNTIL_FINISH(Line(GetMaxX()-5,6,GetMaxX()-15,16));
WAIT_UNTIL_FINISH(Line(GetMaxX()-5,4,GetMaxX()-15,14));
WAIT_UNTIL_FINISH(Line(GetMaxX()-5,5,GetMaxX()-15,15));
#else
WAIT_UNTIL_FINISH(Line(5,5,5,15));
WAIT_UNTIL_FINISH(Line(4,5,4,15));
WAIT_UNTIL_FINISH(Line(6,5,6,15));
WAIT_UNTIL_FINISH(Line(5,5,15,5));
WAIT_UNTIL_FINISH(Line(5,4,15,4));
WAIT_UNTIL_FINISH(Line(5,6,15,6));
WAIT_UNTIL_FINISH(Line(5,6,15,16));
WAIT_UNTIL_FINISH(Line(5,4,15,14));
WAIT_UNTIL_FINISH(Line(5,5,15,15));
#endif
_calXMin = 0xFFFF;
_calXMax = 0;
_calYMin = 0xFFFF;
_calYMax = 0;
TouchGetCalPoints();
//.........这里部分代码省略.........
示例4: dbg_assert
void CGraphics_OpenGL::LinesBegin()
{
dbg_assert(m_Drawing == 0, "called begin twice");
m_Drawing = DRAWING_LINES;
SetColor(1,1,1,1);
}
示例5: va_start
void Log::outCommand(uint32 account, const char * str, ...)
{
if (!str)
return;
// TODO: support accountid
if (m_enableLogDB && m_dbGM)
{
va_list ap2;
va_start(ap2, str);
char nnew_str[MAX_QUERY_LEN];
vsnprintf(nnew_str, MAX_QUERY_LEN, str, ap2);
outDB(LOG_TYPE_GM, nnew_str);
va_end(ap2);
}
if (m_logLevel > LOGL_NORMAL)
{
if (m_colored)
SetColor(true, m_colors[LOGL_BASIC]);
va_list ap;
va_start(ap, str);
vutf8printf(stdout, str, &ap);
va_end(ap);
if (m_colored)
ResetColor(true);
printf("\n");
if (logfile)
{
outTimestamp(logfile);
va_list ap2;
va_start(ap2, str);
vfprintf(logfile, str, ap2);
fprintf(logfile, "\n" );
va_end(ap2);
fflush(logfile);
}
}
if (m_gmlog_per_account)
{
if (FILE* per_file = openGmlogPerAccount (account))
{
outTimestamp(per_file);
va_list ap;
va_start(ap, str);
vfprintf(per_file, str, ap);
fprintf(per_file, "\n" );
va_end(ap);
fclose(per_file);
}
}
else if (gmLogfile)
{
outTimestamp(gmLogfile);
va_list ap;
va_start(ap, str);
vfprintf(gmLogfile, str, ap);
fprintf(gmLogfile, "\n" );
va_end(ap);
fflush(gmLogfile);
}
fflush(stdout);
}
示例6: SetColor
void Label::OnPaint()
{
SetColor(color->GetColor().r, color->GetColor().g, color->GetColor().b);
DrawString(text, X, Y);
}
示例7: SetCurrentLineWidth
void PS_PLOTTER::Text( const wxPoint& aPos,
enum EDA_COLOR_T aColor,
const wxString& aText,
double aOrient,
const wxSize& aSize,
enum EDA_TEXT_HJUSTIFY_T aH_justify,
enum EDA_TEXT_VJUSTIFY_T aV_justify,
int aWidth,
bool aItalic,
bool aBold )
{
SetCurrentLineWidth( aWidth );
SetColor( aColor );
// Draw the native postscript text (if requested)
if( m_textMode == PLOTTEXTMODE_NATIVE )
{
const char *fontname = aItalic ? (aBold ? "/KicadFont-BoldOblique"
: "/KicadFont-Oblique")
: (aBold ? "/KicadFont-Bold"
: "/KicadFont");
// Compute the copious tranformation parameters
double ctm_a, ctm_b, ctm_c, ctm_d, ctm_e, ctm_f;
double wideningFactor, heightFactor;
computeTextParameters( aPos, aText, aOrient, aSize, aH_justify,
aV_justify, aWidth, aItalic, aBold,
&wideningFactor, &ctm_a, &ctm_b, &ctm_c,
&ctm_d, &ctm_e, &ctm_f, &heightFactor );
// The text must be escaped correctly, the others are the various
// parameters. The CTM is formatted with %f since sin/cos tends
// to make %g use exponential notation (which is not supported)
fputsPostscriptString( outputFile, aText );
fprintf( outputFile, " %g [%f %f %f %f %f %f] %g %s textshow\n",
wideningFactor, ctm_a, ctm_b, ctm_c, ctm_d, ctm_e, ctm_f,
heightFactor, fontname );
/* The textshow operator retained the coordinate system, we use it
* to plot the overbars. See the PDF sister function for more
* details */
std::vector<int> pos_pairs;
postscriptOverlinePositions( aText, aSize.x, aItalic, aBold, &pos_pairs );
int overbar_y = KiROUND( aSize.y * 1.1 );
for( unsigned i = 0; i < pos_pairs.size(); i += 2)
{
DPOINT dev_from = userToDeviceSize( wxSize( pos_pairs[i], overbar_y ) );
DPOINT dev_to = userToDeviceSize( wxSize( pos_pairs[i + 1], overbar_y ) );
fprintf( outputFile, "%g %g %g %g line ",
dev_from.x, dev_from.y, dev_to.x, dev_to.y );
}
// Restore the CTM
fputs( "grestore\n", outputFile );
}
// Draw the hidden postscript text (if requested)
if( m_textMode == PLOTTEXTMODE_PHANTOM )
{
fputsPostscriptString( outputFile, aText );
DPOINT pos_dev = userToDeviceCoordinates( aPos );
fprintf( outputFile, " %g %g phantomshow\n",
pos_dev.x, pos_dev.y );
}
// Draw the stroked text (if requested)
if( m_textMode != PLOTTEXTMODE_NATIVE )
{
PLOTTER::Text( aPos, aColor, aText, aOrient, aSize, aH_justify, aV_justify,
aWidth, aItalic, aBold );
}
}
示例8: GotoXY
void KeyBar::DisplayObject()
{
GotoXY(X1,Y1);
AltState=CtrlState=ShiftState=0;
#if 1
//Maximus: на таблетках лучше бы все кнопки показать, для пальцетыканья
int KeyWidth=(X2-X1+2)/12;
#else
int KeyWidth=(X2-X1-1)/12;
#endif
#if 1
//Maximus: на таблетках лучше бы все кнопки показать, для пальцетыканья
if (KeyWidth<3)
KeyWidth=3;
#else
if (KeyWidth<8)
KeyWidth=8;
#endif
int LabelWidth=KeyWidth-2;
for (int i=0; i<KEY_COUNT; i++)
{
#if 1
//Maximus: на таблетках лучше бы все кнопки показать, для пальцетыканья
if (WhereX()+2>X2)
break;
else if ((i+1)==KEY_COUNT)
LabelWidth=X2-WhereX()-1;
#else
if (WhereX()+LabelWidth>=X2)
break;
#endif
SetColor(COL_KEYBARNUM);
FS<<i+1;
SetColor(COL_KEYBARTEXT);
const wchar_t *Label=L"";
if (IntKeyState.ShiftPressed)
{
ShiftState=IntKeyState.ShiftPressed;
if (IntKeyState.CtrlPressed)
{
CtrlState=IntKeyState.CtrlPressed;
if (!IntKeyState.AltPressed) // Ctrl-Alt-Shift - это особый случай :-)
{
if (i<KeyCounts [KBL_CTRLSHIFT])
Label=KeyTitles [KBL_CTRLSHIFT][i];
}
else if (!(Opt.CASRule&1) || !(Opt.CASRule&2))
{
if (i<KeyCounts [KBL_CTRLALTSHIFT])
Label=KeyTitles [KBL_CTRLALTSHIFT][i];
}
}
else if (IntKeyState.AltPressed)
{
if (i<KeyCounts [KBL_ALTSHIFT])
Label=KeyTitles [KBL_ALTSHIFT][i];
AltState=IntKeyState.AltPressed;
}
else
{
if (i<KeyCounts [KBL_SHIFT])
Label=KeyTitles [KBL_SHIFT][i];
}
}
else if (IntKeyState.CtrlPressed)
{
CtrlState=IntKeyState.CtrlPressed;
if (IntKeyState.AltPressed)
{
if (i<KeyCounts [KBL_CTRLALT])
Label=KeyTitles [KBL_CTRLALT][i];
AltState=IntKeyState.AltPressed;
}
else
{
if (i<KeyCounts [KBL_CTRL])
Label=KeyTitles [KBL_CTRL][i];
}
}
else if (IntKeyState.AltPressed)
{
AltState=IntKeyState.AltPressed;
if (i<KeyCounts [KBL_ALT])
Label=KeyTitles [KBL_ALT][i];
}
else if (i<KeyCounts [KBL_MAIN] && !(DisableMask & (1<<i)))
Label=KeyTitles [KBL_MAIN][i];
//.........这里部分代码省略.........
示例9: color
void AnimaMappedValues::SetColor(const AnimaString& propertyName, AFloat r, AFloat g, AFloat b, AFloat a)
{
AnimaColor4f color(r, g, b, a);
SetColor(propertyName, color);
}
示例10: main
int main(int args[])
{
srand(time(0));
//auto window = Window::CreateSDLWindow();
auto application = new FWApplication();
if (!application->GetWindow())
{
LOG("Couldn't create window...");
return EXIT_FAILURE;
}
application->SetTargetFPS(60);
application->SetColor(Color(255, 10, 40, 255));
Game* game = new Game(application);
//while (true){}
while (application->IsRunning())
{
application->StartTick();
SDL_Event event;
while (SDL_PollEvent(&event))
{
switch (event.type)
{
case SDL_QUIT:
application->Quit();
break;
case SDL_KEYDOWN:
switch (event.key.keysym.scancode){
case SDL_SCANCODE_SPACE:
game->Pause();
break;
default:
break;
}
}
}
application->UpdateGameObjects();
if (!game->IsPause()){
game->Update(application->GetDeltaTime());
}
application->RenderGameObjects();
application->SetColor(Color(0, 0, 0, 255));// For the letter colour
application->DrawTextWithWhiteBorder("[Round] " + std::to_string(game->GetRoundNumber()), SCREEN_WIDTH / 2, 20);
application->DrawTextWithWhiteBorder("[Seconds Remaining] " + std::to_string(game->GetTimeRemaining()), SCREEN_WIDTH / 2, 40);
if (game->IsPause()){
application->DrawTextWithWhiteBorder("[PAUSE]", SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2);
application->SetColor(Color(238, 233, 233, 255));// For the background
}
else{
application->SetColor(Color(255, 255, 255, 255));// For the background
}
if (game->GameOver()){
application->Quit();
}
application->EndTick();
}
return EXIT_SUCCESS;
}
示例11: SetName
bool AnimaMappedValues::ReadObject(const ptree& objectTree, AnimaScene* scene, bool readName)
{
try
{
if(readName)
SetName(objectTree.get<AnimaString>("AnimaMappedValues.Name"));
for (auto& property : objectTree.get_child("AnimaMappedValues.Properties"))
{
if (property.first == "Property")
{
AnimaString name = property.second.get<AnimaString>("Name");
AnimaString type = property.second.get<AnimaString>("Type");
if(type == "bool")
{
bool value = property.second.get<bool>("Value");
SetBoolean(name, value);
}
else if(type == "float")
{
AFloat value = property.second.get<AFloat>("Value");
SetFloat(name, value);
}
else if(type == "integer")
{
AInt value = property.second.get<AInt>("Value");
SetInteger(name, value);
}
else if(type == "matrix")
{
AnimaMatrix value = property.second.get<AnimaMatrix>("Value");
SetMatrix(name, value);
}
else if(type == "vector")
{
for(auto& valueTree : property.second.get_child("Value"))
{
if(valueTree.first == "AnimaVectorGenerator")
{
ptree generatorTree;
generatorTree.add_child("AnimaVectorGenerator", valueTree.second);
AnimaString generatorName = _uniqueName + generatorTree.get<AnimaString>("AnimaVectorGenerator.Name");
AnimaVectorGenerator* generator = _dataGeneratorManager->GetDataGeneratorOfTypeFromName<AnimaVectorGenerator>(generatorName);
if(generator == nullptr)
generator = _dataGeneratorManager->CreateVectorGenerator(generatorName);
if(generator)
{
if(!generator->ReadObject(generatorTree, scene, false))
return false;
generator->SetGeneratedFromMappedValues(true);
SetVector(name, generator);
}
}
}
}
else if(type == "color")
{
for(auto& valueTree : property.second.get_child("Value"))
{
if(valueTree.first == "AnimaColorGenerator")
{
ptree generatorTree;
generatorTree.add_child("AnimaColorGenerator", valueTree.second);
AnimaString generatorName = _uniqueName + generatorTree.get<AnimaString>("AnimaColorGenerator.Name");
AnimaColorGenerator* generator = _dataGeneratorManager->GetDataGeneratorOfTypeFromName<AnimaColorGenerator>(generatorName);
if(generator == nullptr)
generator = _dataGeneratorManager->CreateColorGenerator(generatorName);
if(generator)
{
if(!generator->ReadObject(generatorTree, scene, false))
return false;
generator->SetGeneratedFromMappedValues(true);
SetColor(name, generator);
}
}
}
}
else if(type == "texture")
{
for(auto& valueTree : property.second.get_child("Value"))
{
if(valueTree.first == "AnimaTextureGenerator")
{
ptree generatorTree;
generatorTree.add_child("AnimaTextureGenerator", valueTree.second);
AnimaString generatorName = _uniqueName + generatorTree.get<AnimaString>("AnimaTextureGenerator.Name");
AnimaTextureGenerator* generator = _dataGeneratorManager->GetDataGeneratorOfTypeFromName<AnimaTextureGenerator>(generatorName);
//.........这里部分代码省略.........
示例12: SetColor
//<Script module="Base" filedefs="Lights.xscript">
void Light::native_SetColor(CallStruct &cs)
{
DWORD newColor = (DWORD)cs.GetInt(0);
SetColor(newColor);
}
示例13: PerformBoardTest
void PerformBoardTest( void )
{
static int elapsedSeconds = 0;
static void *picture;
RTCCProcessEvents();
if (previousSecond != _time_str[11])
{
switch ( elapsedSeconds )
{
case 0:
// We will test to see if we are plugged into the PC as a
// device (on the right side of the board) or if the debugger
// side is plugged in (on the left side of the board). If
// we are plugged in as a device, we will receive SOF tokens,
// which sets the SOF interrupt.
picture = &intro;
// Turn on the USB module in device mode. First, disable all
// USB interrupts, since we are just doing a local test. Then
// enable the module in default device mode and turn on the
// power. We will let the module take care of pulling up the
// correct lines. Note that the interrupt flags in U1IR are
// cleared by writing a "1" to each flag.
U1IE = 0;
U1IR = 0xFF;
U1CONbits.USBEN = 1;
U1PWRCbits.USBPWR = 1;
// Fall through
case 2:
GOLFree();
SetColor( WHITE );
ClearDevice();
break;
case 1:
case 3:
GOLFree();
SetColor( BLACK );
ClearDevice();
break;
case 4:
// See if we are plugged into the PC as a device. If so, we
// will display a slightly different picture.
if (U1IRbits.SOFIF)
{
// We are receiving SOF tokens, so we must be plugged
// into a host.
picture = &introDevice;
}
// Disable and power off the USB module.
U1CONbits.USBEN = 1;
U1PWRCbits.USBPWR = 0;
// Display the selected graphic.
PictCreate( ID_ICON, // ID
0,0,GetMaxX(),GetMaxY(), // dimension
PICT_DRAW, // will be dislayed, has frame
1, // scale factor is x1
picture, // bitmap
NULL ); // default GOL scheme
break;
case 5:
RGBTurnOnLED( RGB_SATURATION_MINIMUM, RGB_SATURATION_MINIMUM, RGB_SATURATION_MINIMUM );
break;
case 6:
// Red
RGBSetRed( RGB_SATURATION_MAXIMUM );
break;
case 7:
// Yellow
RGBSetGreen( RGB_SATURATION_MAXIMUM );
break;
case 8:
// Green
RGBSetRed( RGB_SATURATION_MINIMUM );
break;
case 9:
// Aqua
RGBSetBlue( RGB_SATURATION_MAXIMUM );
break;
case 10:
// Blue
RGBSetGreen( RGB_SATURATION_MINIMUM );
break;
case 11:
// Fuschia
//.........这里部分代码省略.........
示例14: ClearScreen
void ClearScreen(){
// Preenchemos a janela de branco
al_clear_to_color(SetColor(255, 255, 255,1));
}
示例15: SetColor
void P3DMaterialDef::Load
(P3DInputStringFmtStream
*SourceStream,
const P3DFileVersion
*Version)
{
float R1,G1,B1;
char StrValue[255 + 1];
unsigned int Layer;
SourceStream->ReadFmtStringTagged("BaseColor","fff",&R1,&G1,&B1);
SetColor(R1,G1,B1);
for (Layer = 0; Layer < P3D_MAX_TEX_LAYERS; Layer++)
{
if (TexNames[Layer] != NULL)
{
free(TexNames[Layer]);
}
}
if ((Version->Major == 0) && (Version->Minor < 4))
{
SourceStream->ReadFmtStringTagged("BaseTexture","s",StrValue,sizeof(StrValue));
if (strcmp(StrValue,"__None__") == 0)
{
}
else
{
SetTexName(P3D_TEX_DIFFUSE,StrValue);
}
}
else
{
for (Layer = 0; Layer < P3D_MAX_TEX_LAYERS; Layer++)
{
SourceStream->ReadFmtStringTagged(TexLayersNames[Layer],"s",StrValue,sizeof(StrValue));
if (strcmp(StrValue,"__None__") == 0)
{
}
else
{
SetTexName(Layer,StrValue);
}
}
}
SourceStream->ReadFmtStringTagged("DoubleSided","b",&DoubleSided);
SourceStream->ReadFmtStringTagged("Transparent","b",&Transparent);
if ((Version->Major == 0) && (Version->Minor < 3))
{
bool Billboard;
SourceStream->ReadFmtStringTagged("Billboard","b",&Billboard);
if (Billboard)
{
BillboardMode = P3D_BILLBOARD_MODE_SPHERICAL;
}
else
{
BillboardMode = P3D_BILLBOARD_MODE_NONE;
}
}
else
{
SourceStream->ReadFmtStringTagged("BillboardMode","s",StrValue,sizeof(StrValue));
if (strcmp(StrValue,"spherical") == 0)
{
BillboardMode = P3D_BILLBOARD_MODE_SPHERICAL;
}
else if (strcmp(StrValue,"cylindrical") == 0)
{
BillboardMode = P3D_BILLBOARD_MODE_CYLINDRICAL;
}
else
{
BillboardMode = P3D_BILLBOARD_MODE_NONE;
}
}
if ((Version->Major == 0) && (Version->Minor > 2))
{
SourceStream->ReadFmtStringTagged("AlphaCtrlEnabled","b",&AlphaCtrlEnabled);
SourceStream->ReadFmtStringTagged("AlphaFadeIn","f",&AlphaFadeIn);
SourceStream->ReadFmtStringTagged("AlphaFadeOut","f",&AlphaFadeOut);
AlphaFadeIn = P3DMath::Clampf(0.0f,1.0f,AlphaFadeIn);
AlphaFadeOut = P3DMath::Clampf(0.0f,1.0f,AlphaFadeOut);
}
}