本文整理汇总了C++中ClearAll函数的典型用法代码示例。如果您正苦于以下问题:C++ ClearAll函数的具体用法?C++ ClearAll怎么用?C++ ClearAll使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ClearAll函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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()));
}
}
开发者ID:AEM7,项目名称:openspades-1,代码行数:50,代码来源:HurtRingView.cpp
示例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;
}
开发者ID:YI-YING,项目名称:Algorithm,代码行数:16,代码来源:Knapsack.cpp
示例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;
}
开发者ID:RVictor,项目名称:EmbeddedLite,代码行数:26,代码来源:svncommand.cpp
示例4: ClearAll
void SubversionView::OnSolutionClosed(wxCommandEvent& event)
{
event.Skip();
m_textCtrlRootDir->SetValue(wxT(""));
ClearAll();
m_plugin->GetConsole()->Clear();
}
开发者ID:RVictor,项目名称:EmbeddedLite,代码行数:7,代码来源:subversion_view.cpp
示例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;
}
开发者ID:ansonn,项目名称:amr,代码行数:34,代码来源:ExcDlgPowerTotal.cpp
示例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;
}
开发者ID:05storm26,项目名称:codelite,代码行数:34,代码来源:svncommand.cpp
示例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();
}
}
开发者ID:JunHwanHuh,项目名称:MNC-Bachelor-2015-Dontbe,代码行数:8,代码来源:AP_PerfMon.cpp
示例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();
}
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:26,代码来源:filedlgg.cpp
示例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;
}
开发者ID:ybabel,项目名称:Go4D,代码行数:31,代码来源:car.cpp
示例10: throw
CODBCContextRegistry::~CODBCContextRegistry(void) throw()
{
try {
ClearAll();
}
NCBI_CATCH_ALL_X( 1, NCBI_CURRENT_FUNCTION )
}
开发者ID:swuecho,项目名称:igblast,代码行数:7,代码来源:context.cpp
示例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();
}
开发者ID:fdiskcn,项目名称:LollyMFC,代码行数:12,代码来源:UGCell.cpp
示例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;
}
开发者ID:macressler,项目名称:SLADE,代码行数:36,代码来源:TextEditor.cpp
示例13: ClearAll
bool NFCElementInfoModule::Clear()
{
ClearAll();
mbLoaded = false;
return true;
}
开发者ID:Kiddinglife,项目名称:NoahGameFrame,代码行数:7,代码来源:NFCElementInfoModule.cpp
示例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;
}
开发者ID:afabbro,项目名称:gecko-dev,代码行数:26,代码来源:LookupCache.cpp
示例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;
}
开发者ID:ansonn,项目名称:amr,代码行数:36,代码来源:ExcDlgWelcome.cpp
示例16: ClearAll
bool Edit::LoadFile (const wxString &filename) {
// load file in edit and clear undo
if (!filename.empty()) m_filename = filename;
// wxFile file (m_filename);
// if (!file.IsOpened()) return false;
ClearAll ();
// long lng = file.Length ();
// if (lng > 0) {
// wxString buf;
// wxChar *buff = buf.GetWriteBuf (lng);
// file.Read (buff, lng);
// buf.UngetWriteBuf ();
// InsertText (0, buf);
// }
// file.Close();
wxStyledTextCtrl::LoadFile(m_filename);
EmptyUndoBuffer();
// determine lexer language
wxFileName fname (m_filename);
InitializePrefs (DeterminePrefs (fname.GetFullName()));
return true;
}
开发者ID:nealey,项目名称:vera,代码行数:27,代码来源:edit.cpp
示例17: ClearAll
ParticleManager::~ParticleManager()
{
ClearAll();
ClearInUse();
while (!_unused.empty())
{
delete _unused.top();
_unused.pop();
}
/*
for (auto it = _inUse.begin(); it != _inUse.end(); ++it)
{
for (auto it2 = it->begin(); it2 != it->end(); ++it2)
{
for (auto it3 = it2->begin(); it3 != it2->end(); ++it3)
{
delete *it3;
}
}
}
for (auto it = _effects.begin(); it != _effects.end(); ++it)
{
for (auto it2 = it->begin(); it2 != it->end(); ++it2)
{
delete *it2;
}
}
*/
}
开发者ID:ken49,项目名称:timelinefx,代码行数:30,代码来源:TLFXParticleManager.cpp
示例18: UG_MULTISELECT_OFF
/***************************************************
SelectMode
function is called to set new multiselection mode,
this mode can be one of following:
UG_MULTISELECT_OFF (0) - sindle selection mode
UG_MULTISELECT_CELL(1) - cell multiselection mode enabled
UG_MULTISELECT_ROW (2) - row multiselection mode enabled
The SelectMode can be called directly or as a result
of a call to the CUGCtrl::SetMultiSelectMode.
Params:
mode - indicates the new selection mode to set.
Returns:
UG_SUCCESS, this function will never fail.
*****************************************************/
int CUGMultiSelect::SelectMode(int mode)
{
ClearAll();
m_mode = mode;
return UG_SUCCESS;
}
开发者ID:whybe,项目名称:Ultimate-Grid,代码行数:23,代码来源:UGMultiS.cpp
示例19: ClearAll
void wxBitmapDataObject::SetBitmap( const wxBitmap &bitmap )
{
ClearAll();
wxBitmapDataObjectBase::SetBitmap(bitmap);
DoConvertToPng();
}
开发者ID:chromylei,项目名称:third_party,代码行数:8,代码来源:dataobj.cpp
示例20: SetMode
void
DataTransfer::Disconnect()
{
SetMode(Mode::Protected);
if (PrefProtected()) {
ClearAll();
}
}
开发者ID:artines1,项目名称:gecko-dev,代码行数:8,代码来源:DataTransfer.cpp
注:本文中的ClearAll函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论