本文整理汇总了C++中GLOBAL函数的典型用法代码示例。如果您正苦于以下问题:C++ GLOBAL函数的具体用法?C++ GLOBAL怎么用?C++ GLOBAL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GLOBAL函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GenerateIlwrath_generateOrbital
static bool
GenerateIlwrath_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
{
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
{
if (ActivateStarShip (ILWRATH_SHIP, SPHERE_TRACKING))
{
NotifyOthers (ILWRATH_SHIP, IPNL_ALL_CLEAR);
PutGroupInfo (GROUPS_RANDOM, GROUP_SAVE_IP);
ReinitQueue (&GLOBAL (ip_group_q));
assert (CountLinks (&GLOBAL (npc_built_ship_q)) == 0);
CloneShipFragment (ILWRATH_SHIP,
&GLOBAL (npc_built_ship_q), INFINITE_FLEET);
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
InitCommunication (ILWRATH_CONVERSATION);
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
{
GLOBAL (CurrentActivity) &= ~START_INTERPLANETARY;
ReinitQueue (&GLOBAL (npc_built_ship_q));
GetGroupInfo (GROUPS_RANDOM, GROUP_LOAD_IP);
}
return true;
}
else
{
LoadStdLanderFont (&solarSys->SysInfo.PlanetInfo);
solarSys->PlanetSideFrame[1] =
CaptureDrawable (
LoadGraphic (RUINS_MASK_PMAP_ANIM));
solarSys->SysInfo.PlanetInfo.DiscoveryString =
CaptureStringTable (LoadStringTable (RUINS_STRTAB));
}
}
GenerateDefault_generateOrbital (solarSys, world);
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
{
solarSys->SysInfo.PlanetInfo.Weather = 2;
solarSys->SysInfo.PlanetInfo.Tectonics = 3;
}
return true;
}
开发者ID:dczanik,项目名称:Hires-Shiver-Balance-Mod,代码行数:48,代码来源:genilw.c
示例2: GeneratePkunk_generateOrbital
static bool
GeneratePkunk_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
{
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
{
// JMS: No ships orbit Pkunk homeworld anymore.
//if (ActivateStarShip (PKUNK_SHIP, SPHERE_TRACKING))
if (0)
{
NotifyOthers (PKUNK_SHIP, IPNL_ALL_CLEAR);
PutGroupInfo (GROUPS_RANDOM, GROUP_SAVE_IP);
ReinitQueue (&GLOBAL (ip_group_q));
assert (CountLinks (&GLOBAL (npc_built_ship_q)) == 0);
CloneShipFragment (PKUNK_SHIP,
&GLOBAL (npc_built_ship_q), INFINITE_FLEET);
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
InitCommunication (PKUNK_CONVERSATION);
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
{
GLOBAL (CurrentActivity) &= ~START_INTERPLANETARY;
ReinitQueue (&GLOBAL (npc_built_ship_q));
GetGroupInfo (GROUPS_RANDOM, GROUP_LOAD_IP);
}
return true;
}
else
{
LoadStdLanderFont (&solarSys->SysInfo.PlanetInfo);
solarSys->PlanetSideFrame[1] =
CaptureDrawable (LoadGraphic (RUINS_MASK_PMAP_ANIM));
solarSys->SysInfo.PlanetInfo.DiscoveryString =
CaptureStringTable (LoadStringTable (PKUNK_RUINS_STRTAB));
// JMS: No more clear spindles!
//if (GET_GAME_STATE (CLEAR_SPINDLE))
solarSys->SysInfo.PlanetInfo.DiscoveryString =
SetAbsStringTableIndex (
solarSys->SysInfo.PlanetInfo.DiscoveryString, 1);
}
}
GenerateDefault_generateOrbital (solarSys, world);
return true;
}
开发者ID:jurchik,项目名称:project6014,代码行数:47,代码来源:genpku.c
示例3: sis_hyper_postprocess
static void
sis_hyper_postprocess (ELEMENT *ElementPtr)
{
STARSHIP *StarShipPtr;
GLOBAL (velocity) = ElementPtr->velocity;
GetElementStarShip (ElementPtr, &StarShipPtr);
if (((StarShipPtr->cur_status_flags & WEAPON) ||
PulsedInputState.menu[KEY_MENU_CANCEL])
&& StarShipPtr->special_counter == 0)
{
#define MENU_DELAY 10
DoMenuOptions ();
StarShipPtr->cur_status_flags &= ~SHIP_AT_MAX_SPEED;
StarShipPtr->special_counter = MENU_DELAY;
}
}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:18,代码来源:sis_ship.c
示例4: tick_rgbLeds
void tick_rgbLeds(void) {
if(GLOBAL(rgbleds)) {
if(frames > 0) {
if(ctr == 0) {
ws2812_sendarray(&leds[framectr*3*8+2], 3*8);
framectr++;
if(framectr >= frames)
framectr = 0;
}
ctr++;
// LED delay is in leds[0:1]
if(ctr >= ((leds[0]<<8) + leds[1]))
ctr = 0;
}
}
return;
}
开发者ID:cokesme,项目名称:f1rmware,代码行数:18,代码来源:rgb_leds.c
示例5: BattleSong
void
BattleSong (BOOLEAN DoPlay)
{
if (BattleRef == 0)
{
if (LOBYTE (GLOBAL (CurrentActivity)) != IN_HYPERSPACE)
BattleRef = LoadMusic (BATTLE_MUSIC);
else if (GET_GAME_STATE (ORZ_SPACE_SIDE) > 1) // BY JMS - this condition activates Orz space music
BattleRef = LoadMusic (ORZSPACE_MUSIC);
else if (GET_GAME_STATE (ARILOU_SPACE_SIDE) <= 1)
BattleRef = LoadMusic (HYPERSPACE_MUSIC);
else
BattleRef = LoadMusic (QUASISPACE_MUSIC);
}
if (DoPlay)
PlayMusic (BattleRef, TRUE, 1);
}
开发者ID:jurchik,项目名称:project6014,代码行数:18,代码来源:battle.c
示例6: GenerateSupox_generateOrbital
static bool
GenerateSupox_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
{
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
{
if (StartSphereTracking (SUPOX_SHIP))
{
NotifyOthers (SUPOX_SHIP, IPNL_ALL_CLEAR);
PutGroupInfo (GROUPS_RANDOM, GROUP_SAVE_IP);
ReinitQueue (&GLOBAL (ip_group_q));
assert (CountLinks (&GLOBAL (npc_built_ship_q)) == 0);
CloneShipFragment (SUPOX_SHIP, &GLOBAL (npc_built_ship_q),
INFINITE_FLEET);
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
InitCommunication (SUPOX_CONVERSATION);
if (!(GLOBAL (CurrentActivity) & (CHECK_ABORT | CHECK_LOAD)))
{
GLOBAL (CurrentActivity) &= ~START_INTERPLANETARY;
ReinitQueue (&GLOBAL (npc_built_ship_q));
GetGroupInfo (GROUPS_RANDOM, GROUP_LOAD_IP);
}
return true;
}
else
{
LoadStdLanderFont (&solarSys->SysInfo.PlanetInfo);
solarSys->PlanetSideFrame[1] =
CaptureDrawable (LoadGraphic (RUINS_MASK_PMAP_ANIM));
solarSys->SysInfo.PlanetInfo.DiscoveryString =
CaptureStringTable (LoadStringTable (SUPOX_RUINS_STRTAB));
if (GET_GAME_STATE (ULTRON_CONDITION))
{ // Already picked up the Ultron, skip the report
solarSys->SysInfo.PlanetInfo.DiscoveryString =
SetAbsStringTableIndex (
solarSys->SysInfo.PlanetInfo.DiscoveryString, 1);
}
}
}
GenerateDefault_generateOrbital (solarSys, world);
return true;
}
开发者ID:intgr,项目名称:sc2-uqm,代码行数:47,代码来源:gensup.c
示例7: PlayMusic
void
PlayMusic (MUSIC_REF MusicRef, BOOLEAN Continuous, BYTE Priority)
{
LastMusicRef = MusicRef;
LastContinuous = Continuous;
LastPriority = Priority;
if (
#ifdef NEVER
Priority > 1
||
#endif /* NEVER */
!(GLOBAL (glob_flags) & MUSIC_DISABLED)
)
{
PLRPlaySong (MusicRef, Continuous, Priority);
}
}
开发者ID:0xDEC0DE,项目名称:uqm-0.6.4-ee,代码行数:18,代码来源:settings.c
示例8: getFullPath
// Sets whether this actor should be thumbnailed at all, and if loadThumbnail
// is true, queues the thumbnail operation on the texture loader.
// If no thumbnail exists, it will use the default filesystem icon.
void FileSystemActor::enableThumbnail(bool enableThumbnail/*=true*/, bool loadThumbnail/*=true*/)
{
useThumbnail = enableThumbnail;
// Load this Thumbnail because it wasn't loaded before
if (useThumbnail)
{
GLTextureDetail detail = SampledImage;
// NOTE: workaround for keeping training images in hires
// also use hi-res if user wants to skip thumbs db usage
bool isTrainingImage = getFullPath().startsWith(native(winOS->GetTrainingDirectory()), Qt::CaseInsensitive);
if (!GLOBAL(settings).useThumbsDb || isTrainingImage)
detail = HiResImage;
if (loadThumbnail)
loadThumbnailTexture(GLTextureObject(Load|Reload, _alternateThumbnailId, getTargetPath(), detail, NormalPriority, true, isFileSystemType(Image)));
}
}
开发者ID:DX94,项目名称:BumpTop,代码行数:21,代码来源:BT_FileSystemActor.cpp
示例9: HasTech
static bool
HasTech (TechId_t techId)
{
const TechData* techData = GetTechData (techId);
if (!techData)
return false;
switch (techData->type)
{
case TECH_TYPE_MODULE:
return GLOBAL (ModuleCost[techData->subtype]) != 0;
case TECH_TYPE_LANDER_SHIELD:
return (GET_GAME_STATE (LANDER_SHIELDS) & (1 << techData->subtype)) != 0;
case TECH_TYPE_STATE:
return HasStateTech (techData->subtype);
}
return false;
}
开发者ID:intgr,项目名称:sc2-uqm,代码行数:18,代码来源:melnorm.c
示例10: tcm_init
/* initialize the Token Cache Manager */
int tcm_init(TokenCacheManager *tcm)
{
TLS_VARS;
tcm->active = 0;
tcm->token_caches = (TokenCache *) emalloc(sizeof(TokenCache) * TOKEN_CACHES_BLOCK_SIZE);
if (!tcm->token_caches) {
return FAILURE;
} else {
tcm->max = TOKEN_CACHES_BLOCK_SIZE;
}
if (tc_init(&tcm->token_caches[0],TOKEN_CACHE_BLOCK_SIZE) == FAILURE) {
return FAILURE;
}
tcm->initialized = 1;
GLOBAL(tc) = &tcm->token_caches[0];
last_token_type=-1;
return SUCCESS;
}
开发者ID:maiconschelter,项目名称:php-past,代码行数:20,代码来源:token_cache.c
示例11: screen_gameover
static bool screen_gameover() {
char key =0;
while(key==0) {
lcdFill(0x00);
setIntFont(&Font_7x8);
setTextColor(0x00,0b11100000);
lcdSetCrsr(14+15,32+15);lcdPrint("GAME OVER");
setTextColor(0x00,0xff);
lcdSetCrsr(0,0);lcdPrint(IntToStr(game.score,6,F_LONG));
if (highscore_set(game.score, GLOBAL(nickname))){
setTextColor(0x00,0b00011000);
lcdSetCrsr(0,9);lcdPrint("HIGHSCORE!");
};
lcdDisplay();
key=getInputWaitTimeout(5000);
}
//getInputWaitRelease();
return !(key==BTN_LEFT);
}
开发者ID:miloh,项目名称:f1rmware,代码行数:19,代码来源:invaders.c
示例12: highscore_set
static bool highscore_set(uint32_t score)
{
writeFile("snake.5cr", &score , sizeof(uint32_t));
// old r0ket code to get highscore from the world
#if 0
MPKT * mpkt= meshGetMessage('s');
if(MO_TIME(mpkt->pkt)>score)
return false;
MO_TIME_set(mpkt->pkt,score);
strcpy((char*)MO_BODY(mpkt->pkt),nick);
if(GLOBAL(privacy)==0) {
uint32touint8p(GetUUID32(),mpkt->pkt+26);
mpkt->pkt[25]=0;
};
#endif
return true;
}
开发者ID:cokesme,项目名称:f1rmware,代码行数:19,代码来源:snake.c
示例13: stream
bool PbPersistenceManager::saveScene(const QString& filePath)
{
PbBumpTop bumptop;
// save the header
if (bumptop.mutable_header())
{
PbHeader * header = bumptop.mutable_header();
QString buildStr;
QTextStream stream(&buildStr);
stream << "BumpTop,";
stream << winOS->BumpTopEditionName(winOS->GetBumpTopEdition()) << ",";
stream << ((GLOBAL(settings).freeOrProLevel == AL_PRO) ? "Pro," : "Free,");
stream << winOS->GetBuildNumber() << ",";
stream << winOS->GetLocaleLanguage() << ",";
stream << "win32";
header->set_build(stdString(buildStr));
header->set_version(atoi(SVN_VERSION_NUMBER));
}
// save the scene data
if (!scnManager->serializeToPb(bumptop.mutable_scene()))
{
assert(false);
return false;
}
// write the bumptop root to disk
std::ofstream fileOut(filePath.utf16(), ios::trunc | ios::binary);
if (!bumptop.SerializeToOstream(&fileOut))
{
fileOut.close();
return false;
}
fileOut.close();
bool ret = bumptop.IsInitialized();
if (ret)
LOG("PbPersistenceManager::saveScene successful");
return ret;
}
开发者ID:DX94,项目名称:BumpTop,代码行数:43,代码来源:BT_PbPersistenceManager.cpp
示例14: NameCaptain
BYTE
NameCaptain (PQUEUE pQueue, STARSHIPPTR StarShipPtr)
{
BYTE name_index;
HSTARSHIP hStarShip;
do
{
HSTARSHIP hNextShip;
name_index = PickCaptainName ();
for (hStarShip = GetHeadLink (pQueue); hStarShip; hStarShip = hNextShip)
{
STARSHIPPTR TestShipPtr;
TestShipPtr = LockStarShip (pQueue, hStarShip);
hNextShip = _GetSuccLink (TestShipPtr);
if (TestShipPtr->RaceResIndex == StarShipPtr->RaceResIndex)
{
BOOLEAN SameName;
if (LOBYTE (GLOBAL (CurrentActivity)) == SUPER_MELEE)
SameName = (BOOLEAN)(
name_index == TestShipPtr->captains_name_index
);
else
SameName = (BOOLEAN)(
name_index == StarShipCaptain (TestShipPtr)
);
if (SameName)
{
UnlockStarShip (pQueue, hStarShip);
break;
}
}
UnlockStarShip (pQueue, hStarShip);
}
} while (hStarShip);
return (name_index);
}
开发者ID:spippolatore,项目名称:starcontrol2,代码行数:42,代码来源:build.c
示例15: mesh_sendloop
void mesh_sendloop(void){
int ctr=0;
__attribute__ ((aligned (4))) uint8_t buf[32];
int status;
uint32_t rnd=0xffffffff;
if(meshnice)
rnd=getRandom();
nrf_config_get(&oldconfig);
nrf_set_channel(MESH_CHANNEL);
nrf_set_tx_mac(strlen(MESH_MAC),(uint8_t*)MESH_MAC);
// Update [T]ime packet
MO_TIME_set(meshbuffer[0].pkt,getSeconds());
MO_GEN_set(meshbuffer[0].pkt,meshgen);
if(GLOBAL(privacy)==0)
uint32touint8p(GetUUID32(),MO_BODY(meshbuffer[0].pkt));
else
uint32touint8p(0,MO_BODY(meshbuffer[0].pkt));
MO_BODY(meshbuffer[0].pkt)[4]=meshnice;
for (int i=0;i<MESHBUFSIZE;i++){
if(!meshbuffer[i].flags&MF_USED)
continue;
if(meshbuffer[i].flags&MF_LOCK)
continue;
if(meshnice&0xf){
if((rnd++)%0xf < (meshnice&0x0f)){
meshincctr++;
continue;
};
};
ctr++;
memcpy(buf,meshbuffer[i].pkt,MESHPKTSIZE);
status=nrf_snd_pkt_crc_encr(MESHPKTSIZE,buf,meshkey);
//Check status? But what would we do...
};
nrf_config_set(&oldconfig);
};
开发者ID:falkorichter,项目名称:r0ket,代码行数:42,代码来源:mesh.c
示例16: ZeroMemory
void BrowseFolderMenuItem::onSelect()
{
if (SUCCEEDED(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED)))
{
DropDownMenu* dropDownMenu = dynamic_cast<DropDownMenu*>(getParent());
if (dropDownMenu)
{
BROWSEINFO browseInfo;
ZeroMemory(&browseInfo, sizeof(browseInfo));
browseInfo.hwndOwner = winOS->GetWindowsHandle();
browseInfo.ulFlags = BIF_USENEWUI | BIF_RETURNONLYFSDIRS;
PIDLIST_ABSOLUTE pidl = SHBrowseForFolder(&browseInfo);
if (pidl)
{
if (winOS->GetLibraryManager())
{
QSharedPointer<Library> library = winOS->GetLibraryManager()->addFolderAsLibrary(pidl);
if (library)
{
LOG(QString("Library Directory: %1\n").arg(library->getFolderPaths().front()));
// Save the newly created library
QList<QString> otherLibs = winOS->GetLibraryManager()->getFolderLibraryDirectories();
GLOBAL(settings).otherLibraries = otherLibs;
winOS->SaveSettingsFile();
LibraryMenuItem* item = new LibraryMenuItem(library);
dropDownMenu->select(item);
SwitchToLibrary(library);
}
}
CoTaskMemFree(pidl);
}
else
{
// Reselect the last selected object, since this selection failed
dropDownMenu->select(dropDownMenu->items().front());
}
}
CoUninitialize();
}
}
开发者ID:DX94,项目名称:BumpTop,代码行数:42,代码来源:BT_LibraryOverlay.cpp
示例17: make_file
//Analogous to getUniqueNewFolderPathInWorkingDirectory, this function returns a unique file path using the parameter as a template
QFileInfo FileSystemManager::getUniqueNewFilePathInWorkingDirectory(QString fileName) {
QFileInfo newFile;
int file_extension_division = fileName.lastIndexOf(".");
QString ext = fileName.mid(file_extension_division,fileName.size()-file_extension_division);
QString fileBase = fileName.mid(0,file_extension_division);
QString oldBase = fileBase;
int x = 1;
do
{
QString counter = QString::number(x);
fileBase.append(counter);
fileBase.append(ext);
newFile = make_file(GLOBAL(getWorkingDirectory()), fileBase);
fileBase = oldBase;
x++;
}
while (exists(newFile));
return newFile;
}
开发者ID:DX94,项目名称:BumpTop,代码行数:21,代码来源:BT_FileSystemManager.cpp
示例18: DrawSISComWindow
static void
DrawSISComWindow (void)
{
CONTEXT OldContext;
if (LOBYTE (GLOBAL (CurrentActivity)) != WON_LAST_BATTLE)
{
RECT r;
OldContext = SetContext (SpaceContext);
r.corner.x = 0;
r.corner.y = SLIDER_Y + SLIDER_HEIGHT;
r.extent.width = SIS_SCREEN_WIDTH;
r.extent.height = SIS_SCREEN_HEIGHT - r.corner.y;
SetContextForeGroundColor (COMM_PLAYER_BACKGROUND_COLOR);
DrawFilledRectangle (&r);
SetContext (OldContext);
}
}
开发者ID:Serosis,项目名称:UQM-MegaMod,代码行数:21,代码来源:comm.c
示例19: RosterMenu
BOOLEAN
RosterMenu (void)
{
MENU_STATE MenuState;
ROSTER_STATE RosterState;
memset (&MenuState, 0, sizeof MenuState);
MenuState.privData = &RosterState;
memset (&RosterState, 0, sizeof RosterState);
RosterState.count = CountLinks (&GLOBAL (built_ship_q));
if (!RosterState.count)
return FALSE;
// Get the escort positions we will use and sort on X then Y
assert (sizeof (RosterState.shipPos) == sizeof (ship_pos));
memcpy (RosterState.shipPos, ship_pos, sizeof (ship_pos));
qsort (RosterState.shipPos, RosterState.count,
sizeof (RosterState.shipPos[0]), compShipPos);
LockMutex (GraphicsLock);
SetContext (StatusContext);
selectSupportShip (&RosterState, MenuState.CurState);
UnlockMutex (GraphicsLock);
SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT);
MenuState.InputFunc = DoModifyRoster;
DoInput (&MenuState, TRUE);
LockMutex (GraphicsLock);
SetContext (StatusContext);
// unselect the last ship
drawSupportShip (&RosterState, FALSE);
DrawStatusMessage (NULL);
UnlockMutex (GraphicsLock);
return TRUE;
}
开发者ID:SirDifferential,项目名称:Shiver-Balance-Mod,代码行数:40,代码来源:roster.c
示例20: seek_token
int seek_token(TokenCacheManager *tcm, int token_number, int *yychar)
{
int t_offset, tc_offset;
TLS_VARS;
clear_lookahead(yychar);
tc_offset = TC_OFFSET(token_number);
if (tc_offset >= tcm->initialized) {
return FAILURE;
}
t_offset = TOKEN_OFFSET(token_number);
if (t_offset > tcm->token_caches[tc_offset].count) {
return FAILURE;
}
tcm->active = tc_offset;
tcm->token_caches[tc_offset].pos = t_offset;
GLOBAL(tc) = &tcm->token_caches[tc_offset];
return SUCCESS;
}
开发者ID:maiconschelter,项目名称:php-past,代码行数:22,代码来源:token_cache.c
注:本文中的GLOBAL函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论