当前位置: 首页>>代码示例>>C++>>正文


C++ DebugRoutine函数代码示例

本文整理汇总了C++中DebugRoutine函数的典型用法代码示例。如果您正苦于以下问题:C++ DebugRoutine函数的具体用法?C++ DebugRoutine怎么用?C++ DebugRoutine使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DebugRoutine函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: FileGetSize

T_word32 FileGetSize(T_byte8 *p_filename)
{
    T_word32 size ;
#if defined(WIN32)
    FILE *fp;

    DebugRoutine("FileGetSize");
    fp = fopen(p_filename, "rb");
    size = filelength(fileno(fp));
    fclose(fp);
    DebugEnd() ;
#else
    struct find_t fileinfo ;

    DebugRoutine("FileGetSize") ;

    /* Get information about the file. */
    if (_dos_findfirst(p_filename, _A_NORMAL, &fileinfo) == 0)  {
        /* If we found the file, return the file size. */
        size = fileinfo.size ;
    } else {
        /* If we didn't find the file, return a zero. */
        size = 0 ;
    }

    DebugEnd() ;
#endif

    return size ;
}
开发者ID:LesInk,项目名称:Test,代码行数:30,代码来源:FILE.C

示例2: FormHandleKey

T_void FormHandleKey(E_keyboardEvent event, T_word16 scankey)
{
    T_formObjectStruct *p_object;
    T_word16 i;
    T_buttonID buttonID;
    E_buttonAction buttonAction;

    DebugRoutine("FormHandleKey");
    if (G_formHasButtons == TRUE)
        ButtonKeyControl(event, scankey);
    if (G_formHasTextBoxes == TRUE)
        TxtboxKeyControl(event, scankey);

    /* Make sure the gamma key is correct. */
    if (KeyMapGetScan(KEYMAP_GAMMA_CORRECT) == TRUE) {
        MessagePrintf("Gamma level %d", ColorGammaAdjust());
        ColorUpdate(1);
        while (KeyMapGetScan(KEYMAP_GAMMA_CORRECT) == TRUE) {
#ifdef WIN32
            extern void KeyboardUpdate(E_Boolean updateBuffers);
            KeyboardUpdate(TRUE);
#endif
        }
    }

    DebugEnd();
}
开发者ID:LesInk,项目名称:Test,代码行数:27,代码来源:FORM.C

示例3: IGetOurLocation

/**
 *  IGetOurLocation determines this players general location
 *
 *  @return General player location
 *
 *<!-----------------------------------------------------------------------*/
static T_playerIDLocation IGetOurLocation(T_void)
{
    T_playerIDLocation location = PLAYER_ID_LOCATION_NOWHERE;
    T_word16 place;

    DebugRoutine("IGetOurLocation");

    place = ClientGetCurrentPlace();

    switch (place) {
        case HARDFORM_GOTO_PLACE_OFFSET + HARD_FORM_GUILD:
            location = PLAYER_ID_LOCATION_GUILD;
            break;
        case HARDFORM_GOTO_PLACE_OFFSET + HARD_FORM_TOWN:
		case HARDFORM_GOTO_PLACE_OFFSET + HARD_FORM_BANK:
		case HARDFORM_GOTO_PLACE_OFFSET + HARD_FORM_STORE:
		case HARDFORM_GOTO_PLACE_OFFSET + HARD_FORM_INN:
            location = PLAYER_ID_LOCATION_TOWN;
            break;
    }

    if ((place < HARDFORM_GOTO_PLACE_OFFSET) && (place != 0))
        location = PLAYER_ID_LOCATION_GAME;

    DebugEnd();

    return location;
}
开发者ID:ExiguusEntertainment,项目名称:AmuletsArmor,代码行数:34,代码来源:PEOPHERE.C

示例4: GuildUIJoinGame

static T_void GuildUIJoinGame   (T_buttonID buttonID)
{
    T_word16 map ;
    T_gameGroupID groupID ;
	T_word16 quest;

    DebugRoutine ("GuildUIJoinGame");

    /* fake it */
//    GuildUIConfirmJoinGame();

    /* real it */
    GuildUIGetSelectedGame(&map, &groupID, &quest) ;

    if (map != 0)  {
        /* Request to join in the fun. */
        PeopleHereSetOurState(PLAYER_ID_STATE_JOINING_GAME) ;
        ClientSendRequestJoin(
            map,
            groupID) ;
		StatsSetCurrentQuestNumber(quest);
    } else {
        MessageAdd("No game session selected.") ;
    }

    DebugEnd();
}
开发者ID:ExiguusEntertainment,项目名称:AmuletsArmor,代码行数:27,代码来源:GUILDUI.C

示例5: GuildUIRemoveGame

/* removes a game from the list of active 'open' games */
T_void GuildUIRemoveGame (T_word16 mapNumber, T_gameGroupID groupID)
{
    T_gameDescriptionStruct *p_game;
    T_doubleLinkListElement element,nextElement;
    DebugRoutine ("GuildUIRemoveGame");

    element=DoubleLinkListGetFirst(G_gameList);

    while (element != DOUBLE_LINK_LIST_ELEMENT_BAD)
    {
        nextElement=DoubleLinkListElementGetNext(element);
        p_game=(T_gameDescriptionStruct *)DoubleLinkListElementGetData(element);

        if ((p_game->mapNumber==mapNumber) &&
            (CompareGameGroupIDs(p_game->groupID, groupID)))
        {
            /* remove this one */
            MemFree(p_game);
            DoubleLinkListRemoveElement(element);
            break;
        }

        element=nextElement;
    }

    /* Only redraw the list if we are not joining or creating a game. */
    if (PeopleHereGetOurState() == 0)
        GuildUIDrawGameList();

    DebugEnd();
}
开发者ID:ExiguusEntertainment,项目名称:AmuletsArmor,代码行数:32,代码来源:GUILDUI.C

示例6: GuildUIPlayerCanVisitMap

/* to our current player */
static E_Boolean GuildUIPlayerCanVisitMap (T_word16 which)
{
    T_doubleLinkListElement element;
    E_Boolean canGo=FALSE;
    T_word16 count=0;
    T_mapDescriptionStruct *p_mapDesc;

    DebugRoutine ("GuildUIPlayerCanVisitMap");
    element=DoubleLinkListGetFirst (G_mapList);
    while (element != DOUBLE_LINK_LIST_ELEMENT_BAD)
    {
        if (count==which)
        {
            /* check this map */
            p_mapDesc=(T_mapDescriptionStruct *)DoubleLinkListElementGetData(element);
            if (p_mapDesc->mapKey==0) canGo=TRUE;
            else if (StatsPlayerHasNotePage(p_mapDesc->mapKey)) canGo=TRUE;
            break;
        }
        count++;
        element=DoubleLinkListElementGetNext(element);
    }

    DebugEnd();
    return (canGo);
}
开发者ID:ExiguusEntertainment,项目名称:AmuletsArmor,代码行数:27,代码来源:GUILDUI.C

示例7: GuildUIGetSelectedAdventure

static T_word16 GuildUIGetSelectedAdventure(T_void)
{
    T_word16 adventure ;
    T_word16 i, index ;
    T_mapDescriptionStruct *p_map ;
    T_doubleLinkListElement element ;

    DebugRoutine("GuildUIGetSelectedAdventure") ;

    /* Just the appropriate text line on the list. */
    index = TxtboxGetSelectionNumber(G_displayBoxes[GUILD_MAPS_LIST]) ;
    StatsSetCurrentQuestNumber(index);

    element = DoubleLinkListGetFirst(G_mapList) ;
    for (i=0; i<index; i++)  {
        element = DoubleLinkListElementGetNext(element) ;
    }
    if (element != DOUBLE_LINK_LIST_ELEMENT_BAD)  {
        p_map = (T_mapDescriptionStruct *)
                    DoubleLinkListElementGetData(element) ;
        adventure = p_map->mapIndex ;
    } else {
        /* Element not found? */
        DebugCheck(FALSE) ;
        adventure = 0 ;
    }

    DebugEnd() ;

    return adventure ;
}
开发者ID:ExiguusEntertainment,项目名称:AmuletsArmor,代码行数:31,代码来源:GUILDUI.C

示例8: ScheduleUpdateEvents

E_Boolean ScheduleUpdateEvents(T_void)
{
    T_scheduleEvent *p_event ;
    E_Boolean f_eventOccured = FALSE ;
    TICKER_TIME_ROUTINE_PREPARE() ;

    TICKER_TIME_ROUTINE_START() ;

    DebugRoutine("ScheduleUpdateEvents") ;

    /* Loop while there are events that can be processed. */
    while ((G_firstScheduleEvent != NULL) &&
           (G_firstScheduleEvent->when <= SyncTimeGet()))  {
        /* An event is now going off.  Get that event. */
        p_event = G_firstScheduleEvent ;

        /* Call the handler for this event. */
        DebugCheck(p_event->handler != NULL) ;
        p_event->handler(p_event->data) ;

        /* Remove the event from the list. */
        G_firstScheduleEvent = p_event->next ;
        MemFree(p_event) ;

        /* Note that some event occured. */
        f_eventOccured = TRUE ;
    }

    DebugEnd() ;

    TICKER_TIME_ROUTINE_END(stdout, "ScheduleUpdateEvents", 500) ;
    return f_eventOccured ;
}
开发者ID:LesInk,项目名称:Test,代码行数:33,代码来源:SCHEDULE.C

示例9: ScheduleAddEvent

T_void ScheduleAddEvent(
           T_word32 when,
           T_scheduleEventHandler handler,
           T_word32 data)
{
    T_scheduleEvent *p_event ;

    DebugRoutine("ScheduleAddEvent") ;

    /* Allocate memory for this new event. */
    p_event = MemAlloc(sizeof(T_scheduleEvent)) ;

    DebugCheck(p_event != NULL) ;

    /* Make sure it was allocated. */
    if (p_event != NULL)  {
        /* Store the data in the structure. */
        p_event->when = when ;
        p_event->handler = handler ;
        p_event->data = data ;

        /* Insert sort this item into our linked list of events. */
        IScheduleInsertSortEvent(p_event, when) ;
    }
    DebugEnd() ;
}
开发者ID:LesInk,项目名称:Test,代码行数:26,代码来源:SCHEDULE.C

示例10: IPacketComputeChecksum

static T_word16 IPacketComputeChecksum(T_packetEitherShortOrLong *packet)
{
    T_word16 checksum ;
    T_word16 i ;

    DebugRoutine("IPacketComputeChecksum") ;
    DebugCheck(packet != NULL) ;

    /* Start out the checksum to equal the id of the block. */
    checksum = packet->header.id ;

    /* Add in the packet type. */
    checksum += packet->header.packetLength ;

    /* Loop the length of the data. */
    for (i=0; i<packet->header.packetLength; i++)  {
        /* If i is odd, then add.  Otherwise, do an exclusive-or to mix */
        /* up the bits. */
        if (i&1)
            checksum += packet->data[i] ;
        else
            checksum ^= packet->data[i] ;
    }

    DebugEnd() ;

    return checksum ;
}
开发者ID:LesInk,项目名称:Test,代码行数:28,代码来源:PACKET.C

示例11: PacketSendShort

T_sword16 PacketSendShort(T_packetShort *p_shortPacket)
{
    T_sword16 code = -1 ;

    DebugRoutine("PacketSendShort") ;
    DebugCheck(p_shortPacket != NULL) ;

    /* Store the header information in the packet. */
    p_shortPacket->header.prefix = PACKET_PREFIX ;

    /* Make this a short packet. */
    p_shortPacket->header.packetLength = SHORT_PACKET_LENGTH ;

    /* Put the id for this packet in the packet. */
    p_shortPacket->header.id = G_packetID++ ;

    /* Compute the checksum for this packet. */
    p_shortPacket->header.checksum =
        IPacketComputeChecksum((T_packetEitherShortOrLong *)p_shortPacket) ;

    /* Actually send the data out the port. */
    CommSendData((T_byte8 *)p_shortPacket, sizeof(T_packetShort)) ;
    /* Note that the packet was sent. */
    code = 0 ;

    DebugEnd() ;

    return code ;
}
开发者ID:LesInk,项目名称:Test,代码行数:29,代码来源:PACKET.C

示例12: PacketSendAnyLength

T_sword16 PacketSendAnyLength(T_packetEitherShortOrLong *p_anyPacket)
{
    T_sword16 code = -1 ;

    DebugRoutine("PacketSendAnyLength") ;
    DebugCheck(p_anyPacket != NULL) ;
    DebugCheck(p_anyPacket->header.packetLength <= LONG_PACKET_LENGTH) ;

    /* Store the header information in the packet. */
    p_anyPacket->header.prefix = PACKET_PREFIX ;

    /* Make this a long packet. */
//    p_anyPacket->header.packetLength = LONG_PACKET_LENGTH ;

    /* Put the id for this packet in the packet. */
    p_anyPacket->header.id = G_packetID++ ;

    /* Compute the checksum for this packet. */
    p_anyPacket->header.checksum = IPacketComputeChecksum(p_anyPacket) ;

    /* See if there is room to send the packet. */
    /* Actually send the data out the port. */
    CommSendData(
        (T_byte8 *)p_anyPacket,
        (T_word16)(sizeof(T_packetHeader) + p_anyPacket->header.packetLength)) ;

    /* Note that the packet was sent. */
    code = 0 ;

    DebugEnd() ;

    return code ;
}
开发者ID:LesInk,项目名称:Test,代码行数:33,代码来源:PACKET.C

示例13: MemCheckData

T_void MemCheckData(T_void *p_data)
{
    T_memBlockHeader *p_header ;
    T_byte8 *p_bytes ;

    DebugRoutine("MemCheckData") ;
    DebugCheck(p_data != NULL) ;

    p_bytes = p_data ;
    p_bytes -= sizeof(T_memBlockHeader) ;
    p_header = (T_memBlockHeader *)p_bytes ;

    if (strcmp (p_header->blockTag, "TaG") != 0)  {
        printf("bad memory block at %p\n", p_data) ;
        printf("tag: %-4s\n", p_header->blockTag) ;
        printf("id: %ld\n", p_header->blockId) ;
        printf("next: %p\n", p_header->p_nextBlock) ;
        printf("prev: %p\n", p_header->p_prevBlock) ;
        printf("disc: %p\n", p_header->p_callback) ;
#ifdef _MEM_RECORD_ROUTINES_
        printf("rout: %s\n", p_header->routine) ;
        printf("line: %d\n", p_header->line) ;
#endif
        printf("size: %ld\n", p_header->size) ;
    }
    DebugCheck(strcmp (p_header->blockTag, "TaG") == 0) ;

    DebugEnd() ;
}
开发者ID:ExiguusEntertainment,项目名称:AmuletsArmor,代码行数:29,代码来源:MEMORY.C

示例14: FormGetObjID

T_formObjectID FormGetObjID(T_word32 numID)
{
    T_word16 i;
    T_formObjectID retvalue = NULL;
    T_formObjectStruct *p_object;

    DebugRoutine("FormGetObjID");
    for (i = 0; i < MAX_FORM_OBJECTS; i++) {
        if (G_formObjectArray[i] != NULL ) {
            /* get the pointer to the object structure */
            p_object = (T_formObjectStruct*)G_formObjectArray[i];
            /* check to see if the numerical ID matches */
            if (numID == p_object->numID) {
                /* found one, return the pointer to the object in question */
                retvalue = p_object->objID;
                break;
            }
        }
    }
#ifndef NDEBUG
    if (retvalue == NULL ) {
        printf("bad form obj ID = %d\n", numID);
        fflush(stdout);
    }
#endif
    DebugCheck(retvalue != NULL);
    DebugEnd();
    return (retvalue);
}
开发者ID:LesInk,项目名称:Test,代码行数:29,代码来源:FORM.C

示例15: MessageSetAlternateOutputOn

/* for store / bank / inn ui screens */
T_void MessageSetAlternateOutputOn(T_void)
{
    DebugRoutine ("MessageSetAlternateOutputOn");

    if (G_alternateOutput==FALSE)
    {
        /* create alternate textbox */
        G_altOutputBox = TxtboxCreate  (OUTPUT_BOX_X1,
                                        OUTPUT_BOX_Y1,
                                        OUTPUT_BOX_X2,
                                        OUTPUT_BOX_Y2,
                                        "FontMedium",
                                        0,
                                        0,
                                        FALSE,
                                        Txtbox_JUSTIFY_CENTER,
                                        Txtbox_MODE_VIEW_NOSCROLL_FORM,
                                        NULL);

        TxtboxSetData(G_altOutputBox,"");
        G_alternateOutput=TRUE;
    }

    DebugEnd();
}
开发者ID:ExiguusEntertainment,项目名称:AmuletsArmor,代码行数:26,代码来源:MESSAGE.C


注:本文中的DebugRoutine函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。