本文整理汇总了C++中Array::GetItemCount方法的典型用法代码示例。如果您正苦于以下问题:C++ Array::GetItemCount方法的具体用法?C++ Array::GetItemCount怎么用?C++ Array::GetItemCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Array
的用法示例。
在下文中一共展示了Array::GetItemCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PixiePVTMain
void PixiePVTMain()
{
ImageFormat_PNG::Register();
ImageFormat_JPG::Register();
ImageFormat_GIF::Register();
ImageFormat_TGA::Register();
Platform::GetPlatform_Screen()->SetFullscreen(false);
ResourceManager resourceManager;
InputManager inputManager;
inputManager.HideCursor();
CommandLine cmd;
StringId filename=cmd.GetCommandLineString(0);
if (Platform::GetPlatform_FileSystem())
{
Platform_FileSystem_File* file=Platform::GetPlatform_FileSystem()->CreateFileObject(filename.GetString());
if (!file->Exists())
{
return;
}
delete file;
}
else
{
return;
}
if (!VerifyFilename(filename.GetString()))
{
return;
}
bool fullscreen=false;
int screenWidth=Platform::GetPlatform_Screen()->GetWidth();
int screenHeight=Platform::GetPlatform_Screen()->GetHeight();
Array<StringId> files;
StringId path=GetPath(filename);
StringId filenameOnly=GetFilename(filename);
Platform_FileSystem_Directory* directory=Platform::GetPlatform_FileSystem()->CreateDirectoryObject(path.GetString());
int fileIndex=0;
for (int i=0; i<directory->GetFileCount(); i++)
{
const char* name=directory->GetFile(i);
if (VerifyFilename(name))
{
char buffer[4096];
SNPrintF(buffer,4096,"%s/%s",path.GetString(),name);
files.Add(StringId(buffer));
if (filenameOnly==StringId(name))
{
fileIndex=i;
}
}
}
delete directory;
float cel=0;
Resource_BitmapStrip bitmap;
Screen* screen=LoadImage(0,filename, bitmap, fullscreen);
FrameTime frameTime;
bool exitFlag=false;
while (!exitFlag)
{
cel+=frameTime.Update()*5;
DrawBackground(screen->GetBackBuffer());
int x=(screen->GetBackBuffer().GetWidth()-bitmap.GetWidth((int)cel))/2;
int y=(screen->GetBackBuffer().GetHeight()-bitmap.GetHeight((int)cel))/2;
if (x>0 || y>0)
{
int w=screen->GetBackBuffer().GetWidth();
int h=screen->GetBackBuffer().GetHeight();
screen->GetBackBuffer().Fill(0,0,x,h,0);
screen->GetBackBuffer().Fill(w-x,0,w,h,0);
screen->GetBackBuffer().Fill(x,0,w-x,y,0);
screen->GetBackBuffer().Fill(x,h-y,w-x,h,0);
}
bitmap.Blit((int)cel,screen->GetBackBuffer(),x,y);
screen->Present();
inputManager.Update();
if (inputManager.WasKeyPressed(KEY_ESCAPE))
{
exitFlag=true;
}
if (inputManager.WasKeyPressed(KEY_SPACE))
{
fileIndex++;
if (fileIndex>=files.GetItemCount())
{
fileIndex=0;
}
screen=LoadImage(screen, files.Get(fileIndex),bitmap, fullscreen);
//.........这里部分代码省略.........