本文整理汇总了C++中ClearAll函数的典型用法代码示例。如果您正苦于以下问题:C++ ClearAll函数的具体用法?C++ ClearAll怎么用?C++ ClearAll使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ClearAll函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SPADES_MARK_FUNCTION
void HurtRingView::Draw(){
SPADES_MARK_FUNCTION();
Vector3 playerFront;
World *w = client->GetWorld();
if(!w){
ClearAll();
return;
}
Player *p = w->GetLocalPlayer();
if(p == NULL || !p->IsAlive()){
ClearAll();
return;
}
playerFront = p->GetFront2D();
float hurtRingSize = renderer->ScreenHeight() * .3f;
float cx = renderer->ScreenWidth() * .5f;
float cy = renderer->ScreenHeight() * .5f;
static const float coords[][2]={
{-1,-1},{1,-1},{-1,1}
};
std::list<Item>::iterator it;
for(it = items.begin(); it != items.end(); it++){
Item& item = *it;
float fade = item.fade * 2.f;
if(fade > 1.f)fade = 1.f;
Vector4 color = {1,1,1,fade};
renderer->SetColor(color);
Vector3 dir = -item.dir;
float c = dir.x * playerFront.x + dir.y * playerFront.y;
float s = dir.y * playerFront.x - dir.x * playerFront.y;
Vector2 verts[3];
for(int i = 0; i < 3; i++){
verts[i] = MakeVector2(coords[i][0] * c - coords[i][1] * s,
coords[i][0] * s + coords[i][1] * c);
verts[i] = verts[i] * hurtRingSize + MakeVector2(cx, cy);
}
renderer->DrawImage(image,
verts[0], verts[1], verts[2],
AABB2(0, 0, image->GetWidth(), image->GetHeight()));
}
}
示例2: ClearAll
//---------------------------------------------------------------------------
//遞迴刪除資料
Item* ClearAll(Item *node) {
if (node != NULL) {
node->itmLeft = ClearAll(node->itmLeft);
node->itmRight = ClearAll(node->itmRight);
Item *itm = node;
node = NULL;
free(itm);
iTotalNum--;
}
return node;
}
示例3: ClearAll
bool SvnCommand::Execute(const wxString& command, const wxString& workingDirectory, SvnCommandHandler *handler)
{
// Dont run 2 commands at the same time
if(m_process) {
if(handler) {
//handler->GetPlugin()->GetShell()->AppendText(svnANOTHER_PROCESS_RUNNING);
delete handler;
}
return false;
}
ClearAll();
// Wrap the command in the OS Shell
wxString cmdShell (command);
WrapInShell(cmdShell);
m_process = CreateAsyncProcess(this, command, workingDirectory);
if ( !m_process ) {
return false;
}
m_workingDirectory = workingDirectory.c_str();
m_command = command.c_str();
m_handler = handler;
return true;
}
示例4: ClearAll
void SubversionView::OnSolutionClosed(wxCommandEvent& event)
{
event.Skip();
m_textCtrlRootDir->SetValue(wxT(""));
ClearAll();
m_plugin->GetConsole()->Clear();
}
示例5: ClearAll
/* init Dlg */
void ExcDlgPowerTotal::InitDlg(void)
{
int i = 0;
//unsigned char str[1] = { 'L' };
unsigned char buff[32] = {0};
ClearAll();
SetMemAera(16, 0, GPS_16X32_8BIT, DISPLAY, false);
SetRectangle(0, 18, 160, 2, false);
SetRectangle(0, 142, 160, 2, false);
SetRectangle(138, 147, 16, 8, false);
SetRectangle(136, 149, 2, 4, false);
//DISPLAY_8x16_SR(64, 2, false);
DISPLAY_16x16_DIANNENGLIANG(55, 25, false);
DISPLAY_ZHENGXIANGYOUGONG(0, 45, false);
DISPLAY_ZHENGXIANGWUGONG(0, 63, false);
DISPLAY_FANXIANGYOUGONG(0, 81, false);
DISPLAY_FANXIANGWUGONG(0, 99, false);
DISPLAY_8x16_KWH(120, 45, false);
DISPLAY_8x16_KVARH(120, 63, false);
DISPLAY_8x16_KWH(120, 81, false);
DISPLAY_8x16_KVARH(120, 99, false);
DISPLAY_8x16_000000000210(0, 144, false);
DisplayTime(120, 2);
return;
}
示例6: ClearAll
bool SvnCommand::Execute(const wxString &command, const wxString &workingDirectory, SvnCommandHandler *handler, Subversion2 *plugin)
{
// Dont run 2 commands at the same time
if(m_process) {
if(handler) {
//handler->GetPlugin()->GetShell()->AppendText(svnANOTHER_PROCESS_RUNNING);
delete handler;
}
return false;
}
ClearAll();
// Wrap the command in the OS Shell
wxString cmdShell (command);
WrapInShell(cmdShell);
// Apply the environment variables before executing the command
wxStringMap_t om;
om.insert( std::make_pair("LC_ALL", "C"));
bool useOverrideMap = m_plugin->GetSettings().GetFlags() & SvnUsePosixLocale;
EnvSetter env(m_plugin->GetManager()->GetEnv(), useOverrideMap ? &om : NULL);
m_process = CreateAsyncProcess(this, command, IProcessCreateDefault, workingDirectory);
if ( !m_process ) {
return false;
}
m_workingDirectory = workingDirectory.c_str();
m_command = command.c_str();
m_handler = handler;
return true;
}
示例7: DisplayResults
// DisplayAndClear - will display results after this many milliseconds. should be called regularly
void AP_PerfMon::DisplayAndClear(uint32_t display_after_seconds)
{
if( (AP_HAL::micros() - allStartTime) > (uint32_t)(display_after_seconds * 1000000) ) {
DisplayResults();
ClearAll();
}
}
示例8: ClearAll
void wxFileCtrl::ChangeToReportMode()
{
ClearAll();
SetSingleStyle( wxLC_REPORT );
// do this since WIN32 does mm/dd/yy UNIX does mm/dd/yyyy
// don't hardcode since mm/dd is dd/mm elsewhere
int w, h;
wxDateTime dt(22, wxDateTime::Dec, 2002, 22, 22, 22);
wxString txt = dt.FormatDate() + wxT("22") + dt.Format(wxT("%I:%M:%S %p"));
GetTextExtent(txt, &w, &h);
InsertColumn( 0, _("Name"), wxLIST_FORMAT_LEFT, w );
InsertColumn( 1, _("Size"), wxLIST_FORMAT_LEFT, w/2 );
InsertColumn( 2, _("Type"), wxLIST_FORMAT_LEFT, w/2 );
InsertColumn( 3, _("Modified"), wxLIST_FORMAT_LEFT, w );
#if defined(__UNIX__)
GetTextExtent(wxT("Permissions 2"), &w, &h);
InsertColumn( 4, _("Permissions"), wxLIST_FORMAT_LEFT, w );
#elif defined(__WIN32__)
GetTextExtent(wxT("Attributes 2"), &w, &h);
InsertColumn( 4, _("Attributes"), wxLIST_FORMAT_LEFT, w );
#endif
UpdateFiles();
}
示例9: srand
void Scenery::Generate(int nb, int h)
{
int nbboxes = nb;
Box * boxes = new Box [nbboxes];
int boxh = h;
srand(time(NULL));
ClearAll();
for (int i=0; i<nbboxes; i++)
{
do
{
XB(i) = random(fWidth-boxh);
YB(i) = random(fHeight-boxh);
}
while ( (XB(i)<40 && YB(i)<40) );
XE(i) = XB(i)+boxh;
YE(i) = YB(i)+boxh;
}
#ifndef wrap
Line(0,0,fWidth-1,0, kColor);
Line(0,0,0,fHeight-1, kColor);
Line(fWidth-1,0,fWidth-1,fHeight-1, kColor);
Line(fWidth-1,fHeight-1,0,fHeight-1, kColor);
#endif
for (int i1=0; i1<nbboxes; i1++)
{
Fill4(XB(i1), YB(i1), XE(i1), YB(i1),
XE(i1), YE(i1), XB(i1), YE(i1), kColor);
}
if (boxes != NULL) delete boxes;
}
示例10: throw
CODBCContextRegistry::~CODBCContextRegistry(void) throw()
{
try {
ClearAll();
}
NCBI_CATCH_ALL_X( 1, NCBI_CURRENT_FUNCTION )
}
示例11: variables
/********************************************
Constructor
Inits all of the cell variables (properties)
Calls ClearAll which clears all cell properties
*********************************************/
CUGCell::CUGCell()
{
m_useThemes = true;
m_extraMem = NULL;
m_cellInitialState = NULL;
ClearAll();
}
示例12: ClearAll
/* TextEditor::loadEntry
* Reads the contents of [entry] into the text area, returns false
* if the given entry is invalid
*******************************************************************/
bool TextEditor::loadEntry(ArchiveEntry* entry)
{
// Clear current text
ClearAll();
// Check that the entry exists
if (!entry)
{
Global::error = "Invalid archive entry given";
return false;
}
// Check that the entry has any data, if not do nothing
if (entry->getSize() == 0 || !entry->getData())
return true;
// Get character entry data
//string text = wxString::From8BitData((const char*)entry->getData(), entry->getSize());
string text = wxString::FromUTF8((const char*)entry->getData(), entry->getSize());
// If opening as UTF8 failed for some reason, try again as 8-bit data
if (text.length() == 0)
text = wxString::From8BitData((const char*)entry->getData(), entry->getSize());
// Load text into editor
SetText(text);
// Update line numbers margin width
string numlines = S_FMT("0%d", GetNumberOfLines());
SetMarginWidth(0, TextWidth(wxSTC_STYLE_LINENUMBER, numlines));
return true;
}
示例13: ClearAll
bool NFCElementInfoModule::Clear()
{
ClearAll();
mbLoaded = false;
return true;
}
示例14: LOG
nsresult
LookupCache::Reset()
{
LOG(("LookupCache resetting"));
nsCOMPtr<nsIFile> storeFile;
nsCOMPtr<nsIFile> prefixsetFile;
nsresult rv = mStoreDirectory->Clone(getter_AddRefs(storeFile));
NS_ENSURE_SUCCESS(rv, rv);
rv = mStoreDirectory->Clone(getter_AddRefs(prefixsetFile));
NS_ENSURE_SUCCESS(rv, rv);
rv = storeFile->AppendNative(mTableName + NS_LITERAL_CSTRING(CACHE_SUFFIX));
NS_ENSURE_SUCCESS(rv, rv);
rv = prefixsetFile->AppendNative(mTableName + NS_LITERAL_CSTRING(PREFIXSET_SUFFIX));
NS_ENSURE_SUCCESS(rv, rv);
rv = storeFile->Remove(false);
NS_ENSURE_SUCCESS(rv, rv);
rv = prefixsetFile->Remove(false);
NS_ENSURE_SUCCESS(rv, rv);
ClearAll();
return NS_OK;
}
示例15: ClearAll
/* init Dlg */
void ExcDlgWelcome::InitDlg(void)
{
int i = 0;
//unsigned char str[1] = { 'L' };
unsigned char buff[32] = {0};
ClearAll();
//logo
//SetMemAera(144, 0, LOONGSON_LOGO16X16_8BIT, DISPLAY, false);
SetMemAera(10, 40, LOONGSON_LOGO32X32_8BIT, DISPLAY, false);
SetMemAera(16, 0, GPS_16X32_8BIT, DISPLAY, false);
SetRectangle(0, 18, 160, 2, false);
SetRectangle(0, 142, 160, 2, false);
SetRectangle(138, 147, 16, 8, false);
SetRectangle(136, 149, 2, 4, false);
//DISPLAY_8x16_SR(64, 2, false);
#if 0 // title
m_AmrDisplay.ZKDisplayConvert((char *)"L" , ASCII12, buff);
SetZIFUAera(50, 10, ASCII12, buff, DISPLAY, false);
#else
DISPLAY_16x16_BEIJINGSHENZHOULONGXIN(50, 40, false);
DISPLAY_8x16_000000000210(0, 144, false);
DISPLAY_16x16_DIANLIZHUANBIANXITONG(25, 76, false);
DisplayTime(120, 2);
#endif
return;
}