本文整理汇总了C++中dbgAssert函数的典型用法代码示例。如果您正苦于以下问题:C++ dbgAssert函数的具体用法?C++ dbgAssert怎么用?C++ dbgAssert使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dbgAssert函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: sendChatMessage
void sendChatMessage(udword users, char *message, uword player_index)
{
ChatPacket packetPtr;
udword stringlength = strlen(message);
udword sizeofpacket;
wchar_t aWideStringP[MAX_CHAT_MESSAGE_LENGTH];
size_t aNumChars;
dbgAssert(stringlength < MAX_CHAT_MESSAGE_LENGTH);
dbgAssert(message[stringlength]==0);
// now convert message, stringlength to widestring:
aNumChars = mbstowcs(aWideStringP, message, stringlength+1);
if (aNumChars != (size_t)-1)
{
aNumChars++;
sizeofpacket = (sizeof(ChatPacket) - MAX_CHAT_MESSAGE_LENGTH*sizeof(wchar_t)) + (aNumChars<<1);
//contruct packet by concatinating the message and the actual packet header
packetPtr.packetheader.type = PACKETTYPE_CHAT;
packetPtr.packetheader.frame = player_index;
memcpy( packetPtr.message, aWideStringP, aNumChars<<1);
packetPtr.users = (uword)users;
packetPtr.messageType = CHAT_PACKET;
SendChatPacketPacket(&packetPtr, sizeofpacket,users);
}
}
开发者ID:spippolatore,项目名称:homeworld-1,代码行数:29,代码来源:chatting.c
示例2: dbgAssert
void
AsyncLoop::removeCanceledRequests()
{
dbgAssert( m_lock.dbgHoldLock() );
if( !m_canceledRequests.empty() )
{
for( size_t i = 0; i < m_canceledRequests.size(); ++i )
{
CURL *const request = m_canceledRequests[ i ];
dbgAssert( request );
AsyncState *const asyncState = AsyncState::getFromCurl( request );
dbgAssert( asyncState );
m_canceledRequests[ i ] = NULL;
if( !asyncState->isCompleted() )
{
dbgVerify( m_socketPool.remove( asyncState->socket ) );
dbgVerify( curl_multi_remove_handle( m_multiCurl, request ) == CURLM_OK );
dbgAssert( m_runningRequestCount );
m_runningRequestCount--;
asyncState->setCompleted();
}
}
m_canceledRequests.clear();
}
}
开发者ID:Bhushan1002,项目名称:SFrame,代码行数:29,代码来源:asyncurl.cpp
示例3: dbgAssert
lod *lodLevelGet(void *spaceObj, vector *camera, vector *ship)
{
real32 distance;
SpaceObj *obj = (SpaceObj *)spaceObj;
lodinfo *info = obj->staticinfo->staticheader.LOD;
dbgAssert(info != NULL); //verify the LOD table exists
vecSub(obj->cameraDistanceVector,*camera,*ship);
obj->cameraDistanceSquared = distance = vecMagnitudeSquared(obj->cameraDistanceVector);
#if LOD_SCALE_DEBUG
if (lodDebugScaleFactor != 0.0f)
{
lodScaleFactor = lodDebugScaleFactor;
}
#endif
if (distance > info->level[obj->currentLOD].bOff * lodScaleFactor)
{ //if drop a level of detail
do
{
obj->currentLOD++; //go to lower level
if (obj->currentLOD >= info->nLevels)
{
obj->currentLOD = info->nLevels-1;
break;
}
}
while (distance > info->level[obj->currentLOD].bOff * lodScaleFactor);
}
else
{
while (obj->currentLOD > 0 && distance < info->level[obj->currentLOD - 1].bOn * lodScaleFactor)
{ //if go higher level of detail
obj->currentLOD--; //go to higher level
}
}
dbgAssert(obj->currentLOD >= 0);
dbgAssert(obj->currentLOD < info->nLevels); //verify we are within the available levels of detail
#if LOD_PRINT_DISTANCE
if (keyIsStuck(WKEY))
{
keyClearSticky(WKEY);
lodScaleFactor *= 0.99f;
dbgMessagef("\nlodScaleFactor = %.3f", lodScaleFactor);
}
if (keyIsStuck(OKEY))
{
keyClearSticky(OKEY);
lodScaleFactor *= 1.01f;
dbgMessagef("\nlodScaleFactor = %.3f", lodScaleFactor);
}
if (lodTuningMode)
{
obj->currentLOD = min(rndLOD, info->nLevels - 1);
return(&info->level[min(rndLOD, info->nLevels - 1)]);
}
#endif
return(&info->level[obj->currentLOD]); //return pointer to lod structure
}
开发者ID:spippolatore,项目名称:homeworld-1,代码行数:60,代码来源:LOD.c
示例4: dbgAssert
AITeamMove *aimCreateFancyGetShipsNoAdd(AITeam *team, ShipType shiptype, sbyte num_ships, AlternativeShips *alternatives, sdword priority, bool8 wait, bool8 remove)
{
TypeOfFormation formation = SAME_FORMATION;
AITeamMove *newMove = (AITeamMove *)memAlloc(sizeof(AITeamMove), "getshipsmove", 0);
dbgAssert(num_ships > 0);
#ifndef HW_Release
{
sdword i;
for (i=0;i<alternatives->numNextPicks;i++)
{
dbgAssert(alternatives->shipNumEquivNextPicks[i] > 0);
}
}
#endif
InitNewMove(newMove,MOVE_FANCYGETSHIPS,wait,remove,formation,Neutral,aimProcessFancyGetShips,NULL,aimCloseFancyGetShips);
newMove->params.fancyGetShips.shipType = shiptype;
newMove->params.fancyGetShips.numShips = num_ships;
newMove->params.fancyGetShips.priority = priority;
newMove->params.fancyGetShips.alternatives = *alternatives;
newMove->params.fancyGetShips.doneVar = NULL;
// aiplayerLog((aiIndex,"Created Fancy Getships Move"));
return newMove;
}
开发者ID:Almamu,项目名称:homeworld,代码行数:29,代码来源:AIMoves2.c
示例5: liLayerColorAverage
/*-----------------------------------------------------------------------------
Name : liLayerColorAverage
Description : Returns the average color of a layer
Inputs : layer - layer to find average color of
Outputs :
Return : average color
----------------------------------------------------------------------------*/
color liLayerColorAverage(lilayer *layer)
{
udword red = 0, green = 0, blue = 0, alpha = 0, count, totalPixels;
color *pColor;
dbgAssert(layer->decompressed != NULL);
dbgAssert(!bitTest(layer->flags, LFF_Channeled));
totalPixels = count = (layer->bounds.x1 - layer->bounds.x0) *
(layer->bounds.y1 - layer->bounds.y0);
pColor = layer->decompressed;
while (count > 0)
{
red += colRed(*pColor);
green += colGreen(*pColor);
blue += colBlue(*pColor);
alpha += colAlpha(*pColor);
count--;
pColor++;
}
red /= totalPixels;
green /= totalPixels;
blue /= totalPixels;
alpha /= totalPixels;
return(colRGBA(red, green, blue, alpha));
}
开发者ID:codethulu,项目名称:HomeworldSDL,代码行数:33,代码来源:layerimg.c
示例6: aihKamikazeHealthLowHandler
/*-----------------------------------------------------------------------------
Name : aihKamikazeHealthLowHandler
Description : Finds the ship who's health is low and kamikaze's it into the enemy
Inputs : team - the team with the suicide bombers
Outputs : Forces pilots to kill themselves in the name of greater good
Return : void
----------------------------------------------------------------------------*/
void aihKamikazeHealthLowHandler(AITeam *team)
{
MaxSelection shipsToDie;
udword i;
ShipPtr ship;
dbgAssert(team->shipList.selection->numShips);
shipsToDie.numShips = 0;
for (i=0;i<team->shipList.selection->numShips;i++)
{
ship = team->shipList.selection->ShipPtr[i];
if ((isShipOfClass(ship, CLASS_Fighter) || isShipOfClass(ship, CLASS_Corvette)) &&
((100 * ship->health) <
(team->curMove->events.healthLow.watchPercentage * ship->staticinfo->maxhealth)))
{
selSelectionAddSingleShip(&shipsToDie, ship);
}
}
dbgAssert(shipsToDie.numShips);
aiuWrapSetKamikaze((SelectCommand *)&shipsToDie);
}
开发者ID:Almamu,项目名称:homeworld,代码行数:33,代码来源:AIHandler.c
示例7: channel
/*-----------------------------------------------------------------------------
Name : liInsertChannelCompose
Description : Takes a single channel from a source layer and sticks into a
channel in desination buffer.
Inputs : destBuffer - where to stick the channel. Must be same size as image.
layerIndex - index of layer to get channel from
image - image to get layer from
sChannel - index of shource channel (0 = red, 1 = green,
2 = blue, 3 = alpha)
dChannel - index of dest channel
Outputs : copies channel from image to destBuffer
Return : void
----------------------------------------------------------------------------*/
void liInsertChannelCompose(color *destBuffer, sdword layerIndex, layerimage *image, udword sChannel, udword dChannel)
{
lilayer *layer = &image->layers[layerIndex];
color *source, *dest;
ubyte *pSource, *pDest;
sdword width, height, sourceStride, count;
#if LI_VERBOSE_LEVEL >= 2
dbgMessagef("\liInsertChannelCompose: inserting channel %d of layer %d ('%s') into channel %d", sChannel, layerIndex, layer->name, dChannel);
#endif //LI_VERBOSE_LEVEL
dbgAssert(layer->decompressed != NULL && ((layer->flags & LFF_Channeled) == 0));
dbgAssert(liBlender[layer->blendMode]);
dbgAssert(sChannel < 4);
dbgAssert(dChannel < 4);
source = layer->decompressed; //first layer pixel
dest = destBuffer + image->width * layer->bounds.y0 + layer->bounds.x0; //first dest pixel
liClipLayer(layer, image, &source, &dest, &width, &height, &sourceStride);
for (; height > 0; height--)
{ //for each scanline in our range
pSource = (ubyte *)source + sChannel; //get byte-pointers
pDest = (ubyte *)dest + dChannel;
for (count = 0; count < width; count++, pDest += 4, pSource += 4)
{ //copy line of channel
*pDest = *pSource;
}
dest += image->width;
source += sourceStride;
}
}
开发者ID:codethulu,项目名称:HomeworldSDL,代码行数:43,代码来源:layerimg.c
示例8: SetChannel
void SetChannel(wchar_t *channel, wchar_t *description)
{
dbgAssert(wcslen(channel) <= MAX_CHANNEL_NAME_LEN);
wcscpy(CurrentChannel,channel);
dbgAssert(wcslen(description) <= MAX_CHANNEL_DESCRIPTION_LEN);
wcscpy(CurrentChannelDescription,description);
}
开发者ID:spippolatore,项目名称:homeworld-1,代码行数:7,代码来源:titannet.c
示例9: aiePreFixAIEvents
void aiePreFixAIEvents(struct AITeamMove *move)
{
if (move->events.interrupt.handler)
{
// convert pointer to offset into AIPlayer structure
dbgAssert(move->events.interrupt.intvar);
move->events.interrupt.intvar = ((ubyte *)move->events.interrupt.intvar) - ((ubyte *)fixingThisAIPlayer);
dbgAssert(move->events.interrupt.intvar < sizeof(AIPlayer));
}
move->events.gettingRocked.handler = aieHandlerToNum((aieHandlerSimple)move->events.gettingRocked.handler);
move->events.enemyNearby.handler = aieHandlerToNum((aieHandlerSimple)move->events.enemyNearby.handler);
move->events.enemyNotNearby.handler = aieHandlerToNum(move->events.enemyNotNearby.handler);
move->events.firing.handler = aieHandlerToNum(move->events.firing.handler);
move->events.disengage.handler = aieHandlerToNum(move->events.disengage.handler);
move->events.healthLow.handler = aieHandlerToNum(move->events.healthLow.handler);
move->events.healthHigh.handler = aieHandlerToNum(move->events.healthHigh.handler);
move->events.numbersLow.handler = aieHandlerToNum(move->events.numbersLow.handler);
move->events.numbersHigh.handler = aieHandlerToNum(move->events.numbersHigh.handler);
move->events.fuelLow.handler = aieHandlerToNum(move->events.fuelLow.handler);
move->events.fuelHigh.handler = aieHandlerToNum(move->events.fuelHigh.handler);
move->events.shipDied.handler = aieHandlerToNum((aieHandlerSimple)move->events.shipDied.handler);
move->events.teamDied.handler = aieHandlerToNum(move->events.teamDied.handler);
move->events.interrupt.handler = aieHandlerToNum((aieHandlerSimple)move->events.interrupt.handler);
}
开发者ID:Almamu,项目名称:homeworld,代码行数:25,代码来源:AIEvents.c
示例10: ProposeNewCaptain
void ProposeNewCaptain(void)
{
dbgAssert(captainProposal < sigsNumPlayers);
captaincyLog(FALSE,"Cap:Proposing new captain %d",captainProposal);
SendTransferCaptaincyPacket(-2,XFERCAP_CAPTAIN_PROPOSAL,captainProposal,NULL);
captainProposal = (captainProposal + 1) % sigsNumPlayers;
dbgAssert(captainProposal < sigsNumPlayers);
}
开发者ID:Almamu,项目名称:homeworld,代码行数:8,代码来源:Captaincy.c
示例11: offset
/*-----------------------------------------------------------------------------
Name : liChannelDecompressRLE
Description : Decompress a single RLE channel into a RGBA buffer
Inputs : buffer - where to decode image to
scanLength - array of number of bytes per scanline
data - RLE compressed data
width - width of buffer
height - height of buffer
offset - color-element offset (0..3)
Outputs : fills buffer with decompressed channel data
Return : void
----------------------------------------------------------------------------*/
void liChannelDecompressRLE(ubyte *buffer, uword *scanLength, ubyte *data, sdword width, sdword height, sdword offset)
{
sdword index, x, y;
#if LI_ERROR_CHECKING
sdword nRead;
#endif
sbyte opCode;
buffer += offset;
for (y = 0; y < height; y++)
{
#if LI_ERROR_CHECKING
nRead = 0;
#endif
for (x = 0; x < width;)
{
opCode = *data;
data++;
#if LI_ERROR_CHECKING
nRead++;
#endif
if (opCode >= 0)
{ //literal run
for (index = 0; index < (sdword)opCode + 1; index++)
{
*buffer = (ubyte)*data;
buffer += 4;
data++;
#if LI_ERROR_CHECKING
nRead++;
#endif
x++;
}
}
else if (opCode > -128)
{
opCode = -opCode;
for (index = 0; index < (sdword)opCode + 1; index++)
{
*buffer = (ubyte)*data;
buffer += 4;
x++;
}
data++;
#if LI_ERROR_CHECKING
nRead++;
#endif
}
}
// buffer += (width - x) * 4; //skip straggler pixels at end
#if LI_ERROR_CHECKING
dbgAssert(x == width);
dbgAssert(nRead == scanLength[y]);
#endif
}
}
开发者ID:codethulu,项目名称:HomeworldSDL,代码行数:68,代码来源:layerimg.c
示例12: AcknowledgeNewCaptain
void AcknowledgeNewCaptain(sdword newcaptainIndex)
{
captaincyLog(FALSE,"Cap:New captain acknowledged %d",newcaptainIndex);
dbgAssert(newcaptainIndex < sigsNumPlayers);
captainIndex = newcaptainIndex;
receiveSyncPacketsFrom = captainIndex;
explicitlyRequestingPackets = FALSE; // captaincy transferred, cancel explicitly requested packets
dbgAssert(!IAmCaptain);
CaptaincyChangedNotify();
}
开发者ID:Almamu,项目名称:homeworld,代码行数:10,代码来源:Captaincy.c
示例13: MiningBaseDied
void MiningBaseDied(Ship *ship)
{
Ship *deleteme;
Node *node;
MiningBaseSpec *spec = (MiningBaseSpec *)ship->ShipSpecifics;
dbgAssert(ship->shiptype == MiningBase);
if (ship->flags & SOF_NISShip)
{
return;
}
if (spec->dontRecurseKill)
{
return;
}
// first pass: Set all other MiningBases to dontRecurseKill so we don't get weird recursion
for (node = universe.ShipList.head; node != NULL; node = node->next)
{
deleteme = (Ship *)listGetStructOfNode(node);
dbgAssert(deleteme->objtype == OBJ_ShipType);
if ((deleteme->shiptype == MiningBase) && (deleteme != ship) && ((deleteme->flags & (SOF_Dead|SOF_NISShip)) == 0))
{
spec = (MiningBaseSpec *)deleteme->ShipSpecifics;
spec->dontRecurseKill = TRUE;
}
}
// delete all other mining bases
for (node = universe.ShipList.head; node != NULL; node = node->next)
{
deleteme = (Ship *)listGetStructOfNode(node);
dbgAssert(deleteme->objtype == OBJ_ShipType);
if ((deleteme->shiptype == MiningBase) && (deleteme != ship) && ((deleteme->flags & (SOF_Dead|SOF_NISShip)) == 0))
{
deleteme->howDidIDie = ship->howDidIDie;
deleteme->whoKilledMe = ship->whoKilledMe;
univDeleteDeadShip(deleteme,EDT_AccumDamage);
listRemoveNode(&deleteme->shiplink);
listRemoveNode(&deleteme->impactablelink);
#if ETG_DISABLEABLE
if (!etgEffectsEnabled)
{
univWipeShipOutOfExistence(deleteme);
}
#endif
}
}
}
开发者ID:Almamu,项目名称:homeworld,代码行数:55,代码来源:DefaultShip.c
示例14: TransferCaptaincyUpdate
void TransferCaptaincyUpdate(void)
{
udword numPackets;
udword sizeofPacket;
ubyte *packet;
ubyte *copypacket;
if ((transferCaptaincyDisabled) || (sigsNumPlayers < 2))
{
return;
}
TimeoutTimerUpdateAll();
LockQueue(&ProcessCaptaincyPktQ);
numPackets = queueNumberEntries(ProcessCaptaincyPktQ);
while (numPackets > 0)
{
sizeofPacket = Dequeue(&ProcessCaptaincyPktQ,&packet);
dbgAssert(sizeofPacket > 0);
copypacket = memAlloc(sizeofPacket,"cp(miscpacket)",Pyrophoric);
memcpy(copypacket,packet,sizeofPacket);
UnLockQueue(&ProcessCaptaincyPktQ);
dbgAssert(((HWPacketHeader *)copypacket)->type == PACKETTYPE_TRANSFERCAPTAINCY);
ProcessTransferCaptaincyPacket((TransferCaptaincyPacket *)copypacket);
memFree(copypacket);
LockQueue(&ProcessCaptaincyPktQ);
numPackets = queueNumberEntries(ProcessCaptaincyPktQ);
}
UnLockQueue(&ProcessCaptaincyPktQ);
#if 0
if (numPackets == 0)
{
UnLockQueue(&ProcessCaptaincyPktQ);
}
else
{
sizeofPacket = Dequeue(&ProcessCaptaincyPktQ,&packet);
dbgAssert(sizeofPacket > 0);
copypacket = memAlloc(sizeofPacket,"cp(miscpacket)",Pyrophoric);
memcpy(copypacket,packet,sizeofPacket);
UnLockQueue(&ProcessCaptaincyPktQ);
dbgAssert(((HWPacketHeader *)copypacket)->type == PACKETTYPE_TRANSFERCAPTAINCY);
ProcessTransferCaptaincyPacket((TransferCaptaincyPacket *)copypacket);
memFree(copypacket);
}
#endif
}
开发者ID:Almamu,项目名称:homeworld,代码行数:54,代码来源:Captaincy.c
示例15: aimProcessLaunch
sdword aimProcessLaunch(AITeam *team)
{
AITeamMove *thisMove = team->curMove;
SelectCommand *selection = team->shipList.selection;
Ship *ship;
Ship *shipIAmInside;
sdword i;
if (selection->numShips == 0)
{
return FALSE;
}
ship = selection->ShipPtr[0];
shipIAmInside = univFindShipIAmInside(ship);
if (shipIAmInside != NULL)
{
SelectCommand *selectcopy = memAlloc(sizeofSelectCommand(selection->numShips),"selectcopy",0);
selectcopy->numShips = 0;
dbgAssert(!thisMove->processing);
for (i=0;i<selection->numShips;i++)
{
if (univAmIInsideThisShip(selection->ShipPtr[i],shipIAmInside))
{
selectcopy->ShipPtr[selectcopy->numShips++] = selection->ShipPtr[i];
}
}
dbgAssert(selectcopy->numShips > 0);
// Falko, don't replace this with aiuWrap because many ships in selectcopy are hidden, but this is okay in this case
clWrapLaunchMultipleShips(&universe.mainCommandLayer,selectcopy,shipIAmInside);
memFree(selectcopy);
thisMove->processing = TRUE;
return TRUE;
}
else if ((ship->specialFlags & SPECIAL_STAY_TILL_EXPLICITLAUNCH) && (ShipIsWaitingForSoftLaunch(ship)))
{
// we're on the ASF, so let's do a "soft" launch
for (i=0;i<selection->numShips;i++)
{
bitClear(selection->ShipPtr[i]->specialFlags,SPECIAL_STAY_TILL_EXPLICITLAUNCH);
}
thisMove->processing = TRUE;
return TRUE;
}
return FALSE;
}
开发者ID:Almamu,项目名称:homeworld,代码行数:52,代码来源:AIMoves2.c
示例16: titanGameStartup
/*-----------------------------------------------------------------------------
Name : titanGameStartup
Description : initializes the titan game networking interface variables.
Inputs : none
Outputs : none
Return : void
----------------------------------------------------------------------------*/
void titanGameStartup(void)
{
tpChannelList.numChannels = 0;
tpChannelList.newDataArrived = FALSE;
tpChannelList.mutex = (void *)CreateMutex(NULL,FALSE,NULL);
dbgAssert(tpChannelList.mutex != NULL);
tpServerList.numServers = 0;
tpServerList.newDataArrived = FALSE;
tpServerList.mutex = (void *)CreateMutex(NULL,FALSE,NULL);
dbgAssert(tpServerList.mutex != NULL);
titanResetGameCreated();
}
开发者ID:spippolatore,项目名称:homeworld-1,代码行数:20,代码来源:titannet.c
示例17: spScenarioBitmap
/*-----------------------------------------------------------------------------
Name : spScenarioBitmap
Description :
Inputs :
Outputs :
Return :
----------------------------------------------------------------------------*/
void spScenarioBitmap(featom *atom, regionhandle region)
{
rectangle textureRect;
sdword index, y;
fonthandle oldFont;
textureRect.x0 = region->rect.x0 + SCP_TEXTURE_INSET;
textureRect.y0 = region->rect.y0 + SCP_TEXTURE_INSET;
textureRect.x1 = region->rect.x1 - SCP_TEXTURE_INSET;
textureRect.y1 = region->rect.y1 - SCP_TEXTURE_INSET;
//draw the bitmap...
if (scenarioTexture != TR_InvalidInternalHandle)
{
if (glcActive())
{
glcRectSolidTexturedScaled2(&textureRect,
spTextureWidth, spTextureHeight,
spTextureData, NULL, TRUE);
}
else
{
trRGBTextureMakeCurrent(scenarioTexture);
rndPerspectiveCorrection(FALSE);
primRectSolidTextured2(&textureRect); //draw the bitmap
}
feStaticRectangleDraw(region); //draw a border
}
//draw the description text...
if (spDescription != NULL)
{ //if there is description text
dbgAssert(spDescriptionFont != FONT_InvalidFontHandle);
oldFont = fontMakeCurrent(spDescriptionFont); //set the font
if (spDescriptionShadow)
{ //optionally enable dropshadow
fontShadowSet(FS_SE, colBlack);
}
for (index = 0, y = textureRect.y0; index < spNDescriptionLines; index++)
{ //draw each line
dbgAssert(spDescriptionLines[index] != NULL);
if (y + fontHeight(" ") >= textureRect.y1)
{ //if this line will extend off bottom of region
break;
}
fontPrint(textureRect.x0, y, spDescriptionColor, spDescriptionLines[index]);
y += fontHeight(" ") + 1;
}
fontShadowSet(FS_NONE, colBlack);
fontMakeCurrent(oldFont);
}
}
开发者ID:Almamu,项目名称:homeworld,代码行数:58,代码来源:scenpick.c
示例18: taskStartAsync
void
taskStartAsync( TaskFn *taskFn, void *arg, TaskCtrl *pctrl )
{
dbgAssert( taskFn );
dbgAssert( pctrl );
DWORD id;
HANDLE const h = CreateThread( 0, 0, taskFn, arg, 0, &id );
if( !h )
throwSystemError( GetLastError(), "starttask" );
pctrl->reset( h );
}
开发者ID:Bhushan1002,项目名称:SFrame,代码行数:14,代码来源:sysutils.cpp
示例19: LaunchDrone
void LaunchDrone(Ship *ship,Ship *drone)
{
DroneSpec *dronespec = (DroneSpec *)drone->ShipSpecifics;
dbgAssert(ship->shiptype == DDDFrigate);
dbgAssert(drone->shiptype == Drone);
dockPrepareSingleShipForLaunch(drone,ship);
dockInitShipForLaunch(drone);
dronespec->droneState = DRONESTATE_LAUNCHING;
InitShipAI(drone,TRUE);
}
开发者ID:spippolatore,项目名称:homeworld-1,代码行数:14,代码来源:DDDFrigate.c
示例20: rmSetTechDependCB
/*-----------------------------------------------------------------------------
Name : rmSetTechDependCB
Description : sets the technology dependancies based on a list of strings
Inputs : standard callback inputs
Outputs : none
Return : void
----------------------------------------------------------------------------*/
void rmSetTechDependCB(char *directory, char *field, void *dataToFillIn)
{
sdword index;
char temp[64];
TechnologyType techtype, techset;
udword mask=0;
for (index=0; *field != ' '; index++,field++)
{
temp[index]=*field;
}
temp[index]=0;
while ((*field == ' ') && (*field != 0))
field++;
if (*field == 0) return;
if (*field != 0)
{
RemoveCommasFromString(field);
techset = StrToTechType(temp);
dbgAssert(techset!=-1);
while (*field != 0)
{
for (index=0; (*field != ' ')&&(*field != 0); index++,field++)
{
temp[index]=*field;
}
temp[index]=0;
techtype = StrToTechType(temp);
dbgAssert(techtype != -1);
mask |= TechToBit(techtype);
while (*field == ' ')
field++;
}
}
((udword *)dataToFillIn)[techset] = mask;
}
开发者ID:bowlofstew,项目名称:homeworld,代码行数:56,代码来源:researchapi.c
注:本文中的dbgAssert函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论