本文整理汇总了C++中PrintDebug函数的典型用法代码示例。如果您正苦于以下问题:C++ PrintDebug函数的具体用法?C++ PrintDebug怎么用?C++ PrintDebug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PrintDebug函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: CalculatePositionForCenter
/**
Calculates the x and y coordinates so that the given image
would be displayed in screen center at the current resolution.
Image width and height are given explicitly to allow for arbitrary
calculations useful for sprites.
@param[in] ImageWidth Image width.
@param[in] ImageHeight Image height.
@param[out] PositionX Screen X coordinate of the top left corner
of the centered image.
@param[out] PositionX Screen Y coordinate of the top left corner
of the centered image.
@retval EFI_SUCCESS Screen center values were successfully
calculated for the current resolution
and specified image.
@retval other Either no graphics adapter was found,
the image was too big to fit on the
screen at current resolution or some
other problem was encountered.
**/
EFI_STATUS
CalculatePositionForCenter(
IN UINTN ImageWidth,
IN UINTN ImageHeight,
OUT UINTN *PositionX,
OUT UINTN *PositionY)
{
if (EFI_ERROR(EnsureDisplayAvailable())) {
PrintDebug(L"No display adapters found, unable to calculate centered position\n");
return EFI_DEVICE_ERROR;
}
if (ImageWidth == 0 || ImageHeight == 0
|| ImageWidth > DisplayInfo.HorizontalResolution
|| ImageHeight > DisplayInfo.VerticalResolution) {
PrintDebug(L"Wrong image size (%ux%u) for this screen resolution (%ux%u)\n",
ImageWidth, ImageHeight, DisplayInfo.HorizontalResolution, DisplayInfo.VerticalResolution);
return EFI_INVALID_PARAMETER;
}
*PositionX = (DisplayInfo.HorizontalResolution / 2) - (ImageWidth / 2);
*PositionY = (DisplayInfo.VerticalResolution / 2) - (ImageHeight / 2);
if (*PositionX + ImageWidth > DisplayInfo.HorizontalResolution)
*PositionX = DisplayInfo.HorizontalResolution - ImageWidth;
if (*PositionY + ImageHeight > DisplayInfo.VerticalResolution)
*PositionY = DisplayInfo.VerticalResolution - ImageHeight;
//PrintDebug(L"Top left corner position for centered image: %u,%u\n", *PositionX, *PositionY);
return EFI_SUCCESS;
}
开发者ID:vista980622,项目名称:VgaShim,代码行数:54,代码来源:Display.c
示例2: makeReservation
static int makeReservation(MultiTrainDriver* me, int stoppingDistance) {
if (me->tailMode) {
PrintDebug(me->ui, "Cannot make reservation in tail mode");
return RESERVE_SUCESS;
} else if (!me->reserveTrackMode) {
PrintDebug(me->ui, "No reservation mode");
return RESERVE_SUCESS;
}
int isStationary = me->stoppedCount == me->numTrainInGroup;
TrackLandmark sensors[MAX_TRAIN_IN_GROUP * 10];
int sensorIndex = 0;
// bad merging code here
for (int i = 0; i < me->numTrainInGroup; i++) {
int numSensor = isStationary ? 1 : me->numSensorToReserve[i];
for (int j = 0; j < numSensor; j++) {
int isInQueue = 0;
for (int k = 0; k < sensorIndex; k++) {
if (sensors[k].type == me->sensorToReserve[i][j].type &&
sensors[k].num1 == me->sensorToReserve[i][j].num1 &&
sensors[k].num2 == me->sensorToReserve[i][j].num2) {
isInQueue = 1;
break;
}
}
if (!isInQueue) {
sensors[sensorIndex++] = me->sensorToReserve[i][j];
}
}
}
ReleaseOldAndReserveNewTrackMsg qMsg;
qMsg.type = RELEASE_OLD_N_RESERVE_NEW;
qMsg.trainNum = me->trainNum;
qMsg.stoppingDistance = isStationary ? 1 : stoppingDistance;
qMsg.lastSensor = sensors[0];
//TrainDebug(me, "Reserving track");
qMsg.numPredSensor = sensorIndex - 1;
for (int i = 1; i < sensorIndex; i++) {
qMsg.predSensor[i-1] = sensors[i];
//printLandmark(me, &qMsg.predSensor[i-1]);
}
int previousLandmarkState = me->reserveFailedLandmark.type;
// reserveFailedlandmark is not really being used right now
int len = Send(
me->trackManager,
(char*)&qMsg, sizeof(ReleaseOldAndReserveNewTrackMsg),
(char*)&(me->reserveFailedLandmark), sizeof(TrackLandmark));
if (len > 0) {
printLandmark(me, &me->reserveFailedLandmark);
return RESERVE_FAIL;
} else if (!isStationary &&
previousLandmarkState != LANDMARK_BAD &&
me->reserveFailedLandmark.type != LANDMARK_BAD){
//TrainDebug(me, "Got landmark bad.");
me->reserveFailedLandmark.type = LANDMARK_BAD;
}
return RESERVE_SUCESS;
}
开发者ID:ShaoYuZhang,项目名称:choochoo,代码行数:60,代码来源:MultiTrainDriver.c
示例3: PrintVideoInfo
/**
Prints important information about the currently running video
mode. Initializes adapters if they have not yet been detected.
**/
VOID
PrintVideoInfo()
{
UINT32 MaxMode;
UINT32 i;
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *ModeInfo;
UINTN SizeOfInfo;
EFI_STATUS Status;
if (EFI_ERROR(EnsureDisplayAvailable())) {
PrintDebug(L"No display adapters found, unable to print display information\n");
return;
}
PrintDebug(L"Current mode:\n");
PrintDebug(L" HorizontalResolution = %u\n", DisplayInfo.HorizontalResolution);
PrintDebug(L" VerticalResolution = %u\n", DisplayInfo.VerticalResolution);
PrintDebug(L" PixelFormat = %u\n", DisplayInfo.PixelFormat);
PrintDebug(L" PixelsPerScanLine = %u\n", DisplayInfo.PixelsPerScanLine);
PrintDebug(L" FrameBufferBase = %x\n", DisplayInfo.FrameBufferBase);
PrintDebug(L" FrameBufferSize = %u\n", DisplayInfo.FrameBufferSize);
// Query available modes.
MaxMode = DisplayInfo.GOP->Mode->MaxMode;
PrintDebug(L"Available modes (MaxMode = %u):\n", MaxMode);
for (i = 0; i < MaxMode; i++) {
Status = DisplayInfo.GOP->QueryMode(DisplayInfo.GOP, i, &SizeOfInfo, &ModeInfo);
if (!EFI_ERROR(Status)) {
PrintDebug(L" Mode%u: %ux%u\n", i, ModeInfo->HorizontalResolution, ModeInfo->VerticalResolution);
}
}
}
开发者ID:vista980622,项目名称:VgaShim,代码行数:38,代码来源:Display.c
示例4: PrintErrorDebug
void PrintErrorDebug(char *msg)
{
LPVOID lpMsgBuf;
char *buf;
/* Get last error message */
if (!FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPTSTR) &lpMsgBuf,
0,
NULL ))
{
/* FormatMessage failed! */
PrintDebug("FormatMessage() failed. %s ", msg);
return;
}
/* Cut of CR/LFs */
buf = (char *)lpMsgBuf;
buf[strlen(buf) - 3] = '\0';
PrintDebug("%s %s", msg, (LPCTSTR)lpMsgBuf);
}
开发者ID:Danixu,项目名称:OpenVPN-Portable,代码行数:29,代码来源:main.c
示例5: v3_handle_svm_halt
int v3_handle_svm_halt(struct guest_info * info)
{
if (info->cpl!=0) {
v3_raise_exception(info, GPF_EXCEPTION);
} else {
// What we should do is starting waiting on an OS event that will
// result in an injection of an interrupt.
// What we will hackishly do instead is resume on any event
// Plus is this totally GeekOS specific
ullong_t yield_start = 0;
ullong_t yield_stop = 0;
uint32_t gap = 0;
PrintDebug("GeekOS Yield\n");
rdtscll(yield_start);
V3_Yield();
rdtscll(yield_stop);
//v3_update_time(info, yield_stop - yield_start);
gap = yield_stop - yield_start;
v3_raise_irq(info, 0);
PrintDebug("GeekOS Yield Done (%d cycles)\n", gap);
info->rip+=1;
}
return 0;
}
开发者ID:epowers,项目名称:palacios,代码行数:35,代码来源:svm_halt.c
示例6: TerminateOpenVPN
/* force-kill as a last resort */
static BOOL
TerminateOpenVPN (connection_t *c)
{
DWORD exit_code = 0;
BOOL retval = TRUE;
if (!c->hProcess)
return retval;
if (!GetExitCodeProcess (c->hProcess, &exit_code))
{
PrintDebug (L"In TerminateOpenVPN: failed to get process status: error = %lu", GetLastError());
return FALSE;
}
if (exit_code == STILL_ACTIVE)
{
retval = TerminateProcess (c->hProcess, 1);
if (retval)
PrintDebug (L"Openvpn Process for config '%s' terminated", c->config_name);
else
PrintDebug (L"Failed to terminate openvpn Process for config '%s'", c->config_name);
}
else
PrintDebug(L"In TerminateOpenVPN: Process is not active");
return retval;
}
开发者ID:selvanair,项目名称:openvpn-gui,代码行数:27,代码来源:openvpn.c
示例7: read_data_port
static int read_data_port(ushort_t port, void * dst, uint_t length, struct vm_device * dev) {
struct serial_state * state = (struct serial_state *)dev->private_data;
char * val = (char *)dst;
PrintDebug("Read from Data Port 0x%x\n", port);
if (length != 1) {
PrintDebug("Invalid length(%d) in write to 0x%x\n", length, port);
return -1;
}
switch (port) {
case COM1_DATA_PORT:
dequeue_data(&(state->com1.tx_buffer), val);
break;
case COM2_DATA_PORT:
dequeue_data(&(state->com2.tx_buffer), val);
break;
case COM3_DATA_PORT:
dequeue_data(&(state->com3.tx_buffer), val);
break;
case COM4_DATA_PORT:
dequeue_data(&(state->com4.tx_buffer), val);
break;
default:
return -1;
}
return length;
}
开发者ID:epowers,项目名称:palacios,代码行数:30,代码来源:serial.c
示例8: write_ctrl_port
static int write_ctrl_port(ushort_t port, void * src, uint_t length, struct vm_device * dev) {
struct serial_state * state = (struct serial_state *)dev->private_data;
char * val = (char *)src;
PrintDebug("Write to Control Port (val=%x)\n", *(char *)src);
if (length != 1) {
PrintDebug("Invalid Write length to control port %d\n", port);
return -1;
}
switch (port) {
case COM1_IRQ_ENABLE_PORT:
if (handle_ier_write(&(state->com1), (struct irq_enable_reg *)val) == -1) {
return -1;
}
break;
case COM2_IRQ_ENABLE_PORT:
if (handle_ier_write(&(state->com2), (struct irq_enable_reg *)val) == -1) {
return -1;
}
break;
case COM3_IRQ_ENABLE_PORT:
if (handle_ier_write(&(state->com3), (struct irq_enable_reg *)val) == -1) {
return -1;
}
break;
case COM4_IRQ_ENABLE_PORT:
if (handle_ier_write(&(state->com4), (struct irq_enable_reg *)val) == -1) {
return -1;
}
break;
case COM1_FIFO_CTRL_PORT:
case COM2_FIFO_CTRL_PORT:
case COM3_FIFO_CTRL_PORT:
case COM4_FIFO_CTRL_PORT:
case COM1_LINE_CTRL_PORT:
case COM2_LINE_CTRL_PORT:
case COM3_LINE_CTRL_PORT:
case COM4_LINE_CTRL_PORT:
case COM1_MODEM_CTRL_PORT:
case COM2_MODEM_CTRL_PORT:
case COM3_MODEM_CTRL_PORT:
case COM4_MODEM_CTRL_PORT:
default:
return -1;
}
return -1;
}
开发者ID:epowers,项目名称:palacios,代码行数:56,代码来源:serial.c
示例9: EvalPartition
//
// EvalPartition
//
// -AJA- Evaluate a partition seg & determine the cost, taking into
// account the number of splits, difference between left &
// right, and linedefs that are tagged 'precious'.
//
// Returns the computed cost, or a negative value if the seg should be
// skipped altogether.
//
static int EvalPartition(superblock_t *seg_list, seg_t *part,
int best_cost)
{
eval_info_t info;
/* initialise info structure */
info.cost = 0;
info.splits = 0;
info.iffy = 0;
info.near_miss = 0;
info.real_left = 0;
info.real_right = 0;
info.mini_left = 0;
info.mini_right = 0;
if (EvalPartitionWorker(seg_list, part, best_cost, &info))
return -1;
/* make sure there is at least one real seg on each side */
if (info.real_left == 0 || info.real_right == 0)
{
# if DEBUG_PICKNODE
PrintDebug("Eval : No real segs on %s%sside\n",
info.real_left ? "" : "left ",
info.real_right ? "" : "right ");
# endif
return -1;
}
/* increase cost by the difference between left & right */
info.cost += 100 * ABS(info.real_left - info.real_right);
// -AJA- allow miniseg counts to affect the outcome, but only to a
// lesser degree than real segs.
info.cost += 50 * ABS(info.mini_left - info.mini_right);
// -AJA- Another little twist, here we show a slight preference for
// partition lines that lie either purely horizontally or
// purely vertically.
if (part->pdx != 0 && part->pdy != 0)
info.cost += 25;
# if DEBUG_PICKNODE
PrintDebug("Eval %p: splits=%d iffy=%d near=%d left=%d+%d right=%d+%d "
"cost=%d.%02d\n", part, info.splits, info.iffy, info.near_miss,
info.real_left, info.mini_left, info.real_right, info.mini_right,
info.cost / 100, info.cost % 100);
# endif
return info.cost;
}
开发者ID:Crowbar-Sledgehammer,项目名称:glbsp,代码行数:65,代码来源:seg.c
示例10: v3_get_intr_type
intr_type_t v3_get_intr_type(struct guest_info * info) {
struct v3_intr_state * intr_state = &(info->intr_state);
if (intr_state->excp_pending) {
PrintDebug("[get_intr_type] Exception\n");
return EXCEPTION;
} else if (intr_state->controller->intr_pending(intr_state->controller_state)) {
PrintDebug("[get_intr_type] External_irq\n");
return EXTERNAL_IRQ;
}
PrintDebug("[get_intr_type] Invalid_Intr\n");
return INVALID_INTR;
}
开发者ID:epowers,项目名称:palacios,代码行数:13,代码来源:vmm_intr.c
示例11: InitEndian
//
// InitEndian
//
// Parts inspired by the Yadex endian.cc code.
//
void InitEndian(void)
{
volatile union
{
uint8_g mem[32];
uint32_g val;
}
u;
/* sanity-check type sizes */
if (sizeof(uint8_g) != 1)
FatalError("Sanity check failed: sizeof(uint8_g) = %d",
(int)sizeof(uint8_g));
if (sizeof(uint16_g) != 2)
FatalError("Sanity check failed: sizeof(uint16_g) = %d",
(int)sizeof(uint16_g));
if (sizeof(uint32_g) != 4)
FatalError("Sanity check failed: sizeof(uint32_g) = %d",
(int)sizeof(uint32_g));
/* check endianness */
memset((uint32_g *) u.mem, 0, sizeof(u.mem));
u.mem[0] = 0x70; u.mem[1] = 0x71;
u.mem[2] = 0x72; u.mem[3] = 0x73;
# if DEBUG_ENDIAN
PrintDebug("Endianness magic value: 0x%08x\n", u.val);
# endif
if (u.val == 0x70717273)
cpu_big_endian = 1;
else if (u.val == 0x73727170)
cpu_big_endian = 0;
else
FatalError("Sanity check failed: weird endianness (0x%08x)", u.val);
# if DEBUG_ENDIAN
PrintDebug("Endianness = %s\n", cpu_big_endian ? "BIG" : "LITTLE");
PrintDebug("Endianness check: 0x1234 --> 0x%04x\n",
(int) Endian_U16(0x1234));
PrintDebug("Endianness check: 0x11223344 --> 0x%08x\n",
Endian_U32(0x11223344));
# endif
}
开发者ID:Crowbar-Sledgehammer,项目名称:glbsp,代码行数:56,代码来源:system.c
示例12: SetDebug
// ==============================================================================
// Enables and disables debug mode
// ==============================================================================
void SetDebug(bool value) {
if(value == true) {
Globals.DebugMode = true;
}
if(value == true) {
PrintDebug("SYSTEM: Debug mode: Enabled.");
}
else {
PrintDebug("SYSTEM: Debug mode: Disabled.");
}
if(value == false) {
Globals.DebugMode = false;
}
}
开发者ID:KIAaze,项目名称:iteam_hacking,代码行数:17,代码来源:core.cpp
示例13: WriteLumpData
//
// WriteLumpData
//
static void WriteLumpData(lump_t *lump)
{
size_t len;
int align_size;
cur_comms->file_pos++;
DisplaySetBar(1, cur_comms->file_pos);
DisplayTicker();
# if DEBUG_LUMP
if (lump->flags & LUMP_COPY_ME)
PrintDebug("Copying... %s (%d)\n", lump->name, lump->length);
else
PrintDebug("Writing... %s (%d)\n", lump->name, lump->length);
# endif
if (ftell(out_file) != lump->new_start)
PrintWarn("Consistency failure writing %s (%08lX, %08X\n",
lump->name, ftell(out_file), lump->new_start);
if (lump->length == 0)
return;
if (lump->flags & LUMP_COPY_ME)
{
lump->data = UtilCalloc(lump->length);
fseek(in_file, lump->start, SEEK_SET);
len = fread(lump->data, lump->length, 1, in_file);
if (len != 1)
PrintWarn("Trouble reading lump %s to copy\n", lump->name);
}
len = fwrite(lump->data, lump->length, 1, out_file);
if (len != 1)
PrintWarn("Trouble writing lump %s\n", lump->name);
align_size = ALIGN_LEN(lump->length) - lump->length;
if (align_size > 0)
fwrite(align_filler, align_size, 1, out_file);
UtilFree(lump->data);
lump->data = NULL;
}
开发者ID:samboy,项目名称:Oblige,代码行数:52,代码来源:wad.c
示例14: CalculateWallTips
void CalculateWallTips(void)
{
int i;
float_g x1;
float_g y1;
float_g x2;
float_g y2;
sector_t *left;
sector_t *right;
DisplayTicker();
for (i=0; i < num_linedefs; i++)
{
linedef_t *line = lev_linedefs[i];
if (line->self_ref && cur_info->skip_self_ref)
continue;
x1 = line->start->x;
y1 = line->start->y;
x2 = line->end->x;
y2 = line->end->y;
left = (line->left) ? line->left->sector : NULL;
right = (line->right) ? line->right->sector : NULL;
VertexAddWallTip(line->start, x2-x1, y2-y1, left, right);
VertexAddWallTip(line->end, x1-x2, y1-y2, right, left);
}
# if DEBUG_WALLTIPS
for (i=0; i < num_vertices; i++)
{
vertex_t *vert = LookupVertex(i);
wall_tip_t *tip;
PrintDebug("WallTips for vertex %d:\n", i);
for (tip=vert->tip_set; tip; tip=tip->next)
{
PrintDebug(" Angle=%1.1f left=%d right=%d\n", tip->angle,
tip->left ? tip->left->index : -1,
tip->right ? tip->right->index : -1);
}
}
# endif
}
开发者ID:alexey-lysiuk,项目名称:doom64ex-osx,代码行数:49,代码来源:analyze.c
示例15: Init
// ==============================================================================
// Initializes everything
// ==============================================================================
int Init() {
if(SDL_Init(SDL_INIT_EVERYTHING) != 0) {
PrintDebug("<ERROR> Init() -> Error in SDL_Init(SDL_INIT_EVERYTHING).\nError string:\n\n",SDL_GetError());
} else {
PrintDebug("VIDEO: [Good] SDL initialized");
VideoInfo = SDL_GetVideoInfo();
if ( !VideoInfo ) {
PrintDebug("<ERROR> ::Init () -> Video query failed.\nError string:\n\n",SDL_GetError());
return -1;
} else {
return 1;
}
}
return 0;
}
开发者ID:KIAaze,项目名称:iteam_hacking,代码行数:18,代码来源:core.cpp
示例16: SplitDeadEnds
// If a block has multiple entries but no exits, and it is small enough, it is useful to split it.
// A common example is a C++ function where everything ends up at a final exit block and does some
// RAII cleanup. Without splitting, we will be forced to introduce labelled loops to allow
// reaching the final block
void SplitDeadEnds() {
unsigned TotalCodeSize = 0;
for (BlockSet::iterator iter = Live.begin(); iter != Live.end(); iter++) {
Block *Curr = *iter;
TotalCodeSize += strlen(Curr->Code);
}
BlockSet Splits;
BlockSet Removed;
//DebugDump(Live, "before");
for (BlockSet::iterator iter = Live.begin(); iter != Live.end(); iter++) {
Block *Original = *iter;
if (Original->BranchesIn.size() <= 1 || Original->BranchesOut.size() > 0) continue; // only dead ends, for now
if (contains(Original->BranchesOut, Original)) continue; // cannot split a looping node
if (strlen(Original->Code)*(Original->BranchesIn.size()-1) > TotalCodeSize/5) continue; // if splitting increases raw code size by a significant amount, abort
// Split the node (for simplicity, we replace all the blocks, even though we could have reused the original)
PrintDebug("Splitting block %d\n", Original->Id);
for (BlockSet::iterator iter = Original->BranchesIn.begin(); iter != Original->BranchesIn.end(); iter++) {
Block *Prior = *iter;
Block *Split = new Block(Original->Code, Original->BranchVar);
Parent->AddBlock(Split);
PrintDebug(" to %d\n", Split->Id);
Split->BranchesIn.insert(Prior);
Branch *Details = Prior->BranchesOut[Original];
Prior->BranchesOut[Split] = new Branch(Details->Condition, Details->Code);
Prior->BranchesOut.erase(Original);
for (BlockBranchMap::iterator iter = Original->BranchesOut.begin(); iter != Original->BranchesOut.end(); iter++) {
Block *Post = iter->first;
Branch *Details = iter->second;
Split->BranchesOut[Post] = new Branch(Details->Condition, Details->Code);
Post->BranchesIn.insert(Split);
}
Splits.insert(Split);
Removed.insert(Original);
}
for (BlockBranchMap::iterator iter = Original->BranchesOut.begin(); iter != Original->BranchesOut.end(); iter++) {
Block *Post = iter->first;
Post->BranchesIn.erase(Original);
}
//DebugDump(Live, "mid");
}
for (BlockSet::iterator iter = Splits.begin(); iter != Splits.end(); iter++) {
Live.insert(*iter);
}
for (BlockSet::iterator iter = Removed.begin(); iter != Removed.end(); iter++) {
Live.erase(*iter);
}
//DebugDump(Live, "after");
}
开发者ID:SinSiXX,项目名称:emscripten,代码行数:52,代码来源:Relooper.cpp
示例17: FileSetPosition
/**
* Set file position
*
* @v This File handle
* @v Position New file position
* @ret Status EFI status code
*/
static EFI_STATUS EFIAPI
FileSetPosition(EFI_FILE_HANDLE This, UINT64 Position)
{
EFI_GRUB_FILE *File = _CR(This, EFI_GRUB_FILE, EfiFile);
UINT64 FileSize;
PrintInfo(L"SetPosition(%llx|'%s', %lld) %s\n", (UINT64) This,
FileName(File), Position, (File->IsDir)?L"<DIR>":L"");
/* If this is a directory, reset the Index to the start */
if (File->IsDir) {
if (Position != 0)
return EFI_INVALID_PARAMETER;
File->DirIndex = 0;
return EFI_SUCCESS;
}
/* Fail if we attempt to seek past the end of the file (since
* we do not support writes).
*/
FileSize = GrubGetFileSize(File);
if (Position > FileSize) {
PrintError(L"'%s': Cannot seek to %#llx of %llx\n",
FileName(File), Position, FileSize);
return EFI_UNSUPPORTED;
}
/* Set position */
GrubSetFileOffset(File, Position);
PrintDebug(L"'%s': Position set to %llx\n",
FileName(File), Position);
return EFI_SUCCESS;
}
开发者ID:tribals,项目名称:efifs,代码行数:41,代码来源:file.c
示例18: EvaluateFastWorker
static seg_t *FindFastSeg(superblock_t *seg_list, const bbox_t *bbox)
{
seg_t *best_H = NULL;
seg_t *best_V = NULL;
int mid_x = (bbox->minx + bbox->maxx) / 2;
int mid_y = (bbox->miny + bbox->maxy) / 2;
EvaluateFastWorker(seg_list, &best_H, &best_V, mid_x, mid_y);
int H_cost = -1;
int V_cost = -1;
if (best_H)
H_cost = EvalPartition(seg_list, best_H, 99999999);
if (best_V)
V_cost = EvalPartition(seg_list, best_V, 99999999);
# if DEBUG_PICKNODE
PrintDebug("FindFastSeg: best_H=%p (cost %d) | best_V=%p (cost %d)\n",
best_H, H_cost, best_V, V_cost);
# endif
if (H_cost < 0 && V_cost < 0)
return NULL;
if (H_cost < 0) return best_V;
if (V_cost < 0) return best_H;
return (V_cost < H_cost) ? best_V : best_H;
}
开发者ID:Crowbar-Sledgehammer,项目名称:glbsp,代码行数:32,代码来源:seg.c
示例19: PrintDebug
//==============================================================================
// Brief : 更新処理
// Return : void : なし
// Arg : void : なし
//==============================================================================
void CSceneRanking::Update( void )
{
// デバッグ表示
PrintDebug( _T( "ランキング\n" ) );
// カメラの更新
D3DXMATRIX mtxView; // ビュー行列
D3DXMATRIX mtxOrtho; // 正射影行列
for( int cntCamera = 0; cntCamera < MAX_CAMERA; ++cntCamera )
{
m_ppCamera[ cntCamera ]->Update();
}
mtxView = m_ppCamera[ 0 ]->GetView();
mtxOrtho = m_ppCamera[ 0 ]->GetOrtho();
// 描画用変換行列の更新
m_pArgument->m_pRenderMatrix2D->SetProjection( &mtxOrtho );
m_pArgument->m_pRenderMatrix3D->SetView( &mtxView );
// シーン遷移
if( m_pArgument->m_pFade->GetState() == CObjectFade::STATE_OUT_END )
{
SetSceneNext( CManagerScene::SCENE_TITLE );
EndScene();
}
if( m_pArgument->m_pInput->IsTrigger( CManagerInput::KEY_DECISION ) )
{
if( m_pArgument->m_pFade->GetState() != CObjectFade::STATE_OUT_WHILE )
{
m_pArgument->m_pFade->FadeOut( 20 );
}
}
}
开发者ID:mxt819,项目名称:H405,代码行数:38,代码来源:SceneRanking.cpp
示例20: ReadDirEntry
//
// ReadDirEntry
//
static void ReadDirEntry(void)
{
size_t len;
raw_wad_entry_t entry;
lump_t *lump;
DisplayTicker();
len = fread(&entry, sizeof(entry), 1, in_file);
if (len != 1)
FatalError("Trouble reading wad directory");
lump = NewLump(UtilStrNDup(entry.name, 8));
lump->start = UINT32(entry.start);
lump->length = UINT32(entry.length);
# if DEBUG_DIR
PrintDebug("Read dir... %s\n", lump->name);
# endif
// link it in
lump->next = NULL;
lump->prev = wad.dir_tail;
if (wad.dir_tail)
wad.dir_tail->next = lump;
else
wad.dir_head = lump;
wad.dir_tail = lump;
}
开发者ID:samboy,项目名称:Oblige,代码行数:36,代码来源:wad.c
注:本文中的PrintDebug函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论