本文整理汇总了C++中AssetLoader::start方法的典型用法代码示例。如果您正苦于以下问题:C++ AssetLoader::start方法的具体用法?C++ AssetLoader::start怎么用?C++ AssetLoader::start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AssetLoader
的用法示例。
在下文中一共展示了AssetLoader::start方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
void main() {
loader.init();
config1.append(slot, grp1);
config2.append(slot, grp2);
Events::cubeConnect.set(onConnect);
for(CubeID cid : CubeSet::connected()) {
init(cid);
}
TimeDelta time(0.f);
for(;;) {
System::keepAwake();
auto startTime = SystemTime::now();
loader.start(config1);
for(CubeID cid : CubeSet::connected()) {
String<32> s;
s << FixedFP(time.seconds(), 3, 3) << "s";
g[cid].bg0rom.fill(vec(0,0), vec(16,16), BG0ROMDrawable::SOLID_BG);
g[cid].bg0rom.text(vec(1,1), s.c_str(), BG0ROMDrawable::BLUE);
g[cid].bg0rom.text(vec(1,14), "Loading GRP1", BG0ROMDrawable::BLUE);
}
while(!loader.isComplete()) {
for(CubeID cid : CubeSet::connected()) {
g[cid].bg0rom.hBargraph(vec(0, 4), loader.cubeProgress(cid, 128), BG0ROMDrawable::ORANGE, 8);
}
System::paint();
}
loader.finish();
time = SystemTime::now() - startTime;
startTime = SystemTime::now();
loader.start(config2);
for(CubeID cid : CubeSet::connected()) {
String<32> s;
s << FixedFP(time.seconds(), 3, 3) << "s";
g[cid].bg0rom.fill(vec(0,0), vec(16,16), BG0ROMDrawable::SOLID_BG);
g[cid].bg0rom.text(vec(1,1), s.c_str(), BG0ROMDrawable::BLUE);
g[cid].bg0rom.text(vec(1,14), "Loading GRP2", BG0ROMDrawable::BLUE);
}
while(!loader.isComplete()) {
for(CubeID cid : CubeSet::connected()) {
g[cid].bg0rom.hBargraph(vec(0, 4), loader.cubeProgress(cid, 128), BG0ROMDrawable::ORANGE, 8);
}
System::paint();
}
loader.finish();
time = SystemTime::now() - startTime;
startTime = SystemTime::now();
}
}
示例2: paintWrapper
static void paintWrapper() {
// clear the palette
newCubes.clear();
lostCubes.clear();
reconnectedCubes.clear();
dirtyCubes.clear();
// fire events
System::paint();
// dynamically load assets just-in-time
if (!(newCubes | reconnectedCubes).empty()) {
loader.start(config);
while(!loader.isComplete()) {
for(CubeID cid : (newCubes | reconnectedCubes)) {
vbuf[cid].bg0rom.hBargraph(
vec(0, 4), loader.cubeProgress(cid, 128), BG0ROMDrawable::ORANGE, 8
);
}
// fire events while we wait
System::paint();
}
loader.finish();
}
// repaint cubes
for(CubeID cid : dirtyCubes) {
activateCube(cid, taskCubes[cid].task);
}
// also, handle lost cubes, if you so desire :)
}
示例3: onConnect
void onConnect(void *x, unsigned int cube)
{
loader.start(assetConfig);
loader.finish();
auto &vid = gVideo[cube];
vid.initMode(BG0);
vid.attach(cube);
vid.bg0.erase(StripeTile);
}
示例4: paintWrapper
static void paintWrapper() {
// clear the palette
newCubes.clear();
lostCubes.clear();
reconnectedCubes.clear();
dirtyCubes.clear();
if(previousLearningTask != currentLearningTask){
previousLearningTask++;
}
// fire events
System::paint();
// dynamically load assets just-in-time
if (!(newCubes | reconnectedCubes).empty()) {
AudioTracker::pause();
playSfx(SfxConnect);
loader.start(config);
while(!loader.isComplete()) {
for(CubeID cid : (newCubes | reconnectedCubes)) {
vbuf[cid].bg0rom.hBargraph(
vec(0, 4), loader.cubeProgress(cid, 128), BG0ROMDrawable::ORANGE, 8
);
}
// fire events while we wait
System::paint();
}
loader.finish();
AudioTracker::resume();
}
// // repaint cubes (will this paint right? If not, try repainting all of them)
// for(CubeID cid : dirtyCubes) {
// activateCube(cid);
// }
//If the shaken timer flag is too old, turn it off again here.
if(distractTime.isValid() && (currentLearningTask==2)) {
TimeDelta timeSinceShook = SystemTime::now() - distractTime;
double duration = timeSinceShook.milliseconds() / 1000;
if((duration > 11) && isDistracted) {
currentBackgrounds[2] = 3;
currentBackgrounds[1] = 1;
isDistracted = false;
}
}
//update art to new task
int j = 0;
for(CubeID cid : CubeSet::connected()) {
vbuf[cid].attach(cid);
activateCube(cid);
cbs [j] = cid;
j++;
}
// also, handle lost cubes, if you so desire :)
}