void GUIChannel::update() { char str[7]; clear(); sprintf(str, "%2d", channel->duty); if ( number < 6 ) fontPrint(surface, str, 29, 0, paletteColor(6)); sprintf(str, "%2d", channel->dec); fontPrint(surface, str, 29, 8, paletteColor(6)); if ( selectBegin >= 0 && selectBegin < offset+48 ) { int b = selectBegin - offset; int e = selectEnd - offset; if ( b < 0 ) b = 0; else if ( b >= 47 ) b = 47; if ( e < 0 ) e = 0; else if ( e >= 48 ) e = 48; unsigned int c = paletteColor(2); unsigned int * pix = (unsigned int *) surface->pixels + b * 8*8*6 + 8*6*21; if ( e - b > 0 ) for ( int i = (e-b)*8*8*6 ; i > 0 ; i-- ) *pix++ = c; } for ( int i = 0 ; i < 48 ; i++ ) { if ( channel->notes[i+offset].active ) { sprintf(str, "%s %2d", midiNoteName(channel->notes[i+offset].note), channel->notes[i+offset].volume); fontPrint(surface, str, 0, 21+i*8, paletteColor(4)); } else { fontPrint(surface, "___ __", 0, 21+i*8, paletteColor(1)); } } }
static mFloat print_message( const wchar_t* message, mFloat x, mFloat* y) { mFloat sy; fontSize(message, NULL, &sy); fontPrint(x, *y, 0, message); *y += sy; return sy; }
/*----------------------------------------------------------------------------- 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); } }
/*----------------------------------------------------------------------------- Name : spScenarioItemDraw Description : Draw the list of available scenarios Inputs : Outputs : Return : ----------------------------------------------------------------------------*/ void spScenarioItemDraw(rectangle *rect, listitemhandle data) { char temp[64]; sdword x, y; color c; fonthandle oldfont; spscenario *spScenario = (spscenario *)data->data; oldfont = fontMakeCurrent(spListFont); if (data->flags&UICLI_Selected) c = FEC_ListItemSelected; else c = FEC_ListItemStandard; x = rect->x0;//+MG_HorzSpacing; y = rect->y0;//+MG_VertSpacing/2; sprintf(temp,"%s",spScenario->title); fontPrint(x,y,c,temp); fontMakeCurrent(oldfont); }
/*----------------------------------------------------------------------------- Name : gpGameItemDraw Description : Draw the list of available games Inputs : Outputs : Return : ----------------------------------------------------------------------------*/ void gpGameItemDraw(rectangle *rect, listitemhandle data) { char temp[64]; sdword x, y; color c; fonthandle oldfont; gpgame *gpGame = (gpgame *)data->data; oldfont = fontMakeCurrent(gpListFont); if (data->flags&UICLI_Selected) c = FEC_ListItemSelected; else c = FEC_ListItemStandard; x = rect->x0; y = rect->y0; sprintf(temp,"%s",gpGame->title); fontPrint(x,y,c,temp); fontMakeCurrent(oldfont); }
/*----------------------------------------------------------------------------- Name : trkTrackValuesDisplayFn Description : Renders all the track values Inputs : Outputs : Return : ----------------------------------------------------------------------------*/ void trkTrackValuesDisplayFn(void) { sdword index, range; sdword x, y, xMin, xMax, xMed, width, height; real32 delta, timeElapsed; rectangle rect; if (keyIsStuck(TRK_ToggleKey)) { keyClearSticky(TRK_ToggleKey); trkTrackingVisual ^= TRUE; } if (!trkTrackingVisual || trkTrackIndex == 0) { return; } /* if (timeElapsed == 0.0f) { return; } */ height = fontHeight(" ") + 1; y = (MAIN_WindowHeight - (height * trkTrackIndex)) / 2; width = fontWidth("+100M") + 1; x = MAIN_WindowWidth - width * 2 - TRK_TrackWidth; xMin = x + width; xMax = xMin + TRK_TrackWidth; xMed = (xMin + xMax) / 2; for (index = 0; index < trkTrackIndex; index++, y += height) { timeElapsed = *trkValue[index].timer - trkValue[index].lastTime; trkValue[index].lastTime = *trkValue[index].timer; if (timeElapsed == 0.0f) { continue; } //print the name of the value fontPrint(x - fontWidth(trkValue[index].name), y, trkValue[index].c, trkValue[index].name); delta = abs(*trkValue[index].value - trkValue[index].lastValue) / timeElapsed;//see how much it has changed if (delta == 0.0f) { //don't do anything else if it has not changed continue; } //find what range to print in if (delta / trkRangeString[0].base > 10.0f) { //if it's bigger than the biggest range continue; } for (range = 0; trkRangeString[range].minusString; range++) { if (delta / trkRangeString[range].base >= 1.0f) { //if this is the right range //get the real delta and bias it against the base delta = (trkValue[index].lastValue - *trkValue[index].value) / timeElapsed / trkRangeString[range].base; rect.y0 = y; rect.y1 = y + height - 1; if (delta < 0.0f) { rect.x0 = xMed + (sdword)(delta * (real32)TRK_TrackWidth / 20.0f); rect.x1 = xMed; } else { rect.x0 = xMed; rect.x1 = xMed + (sdword)(delta * (real32)TRK_TrackWidth / 20.0f); } dbgAssert(rect.x0 != rect.x1); primRectSolid2(&rect, trkValue[index].c); fontPrint(xMin - fontWidth(trkRangeString[range].minusString) - 1, y, colWhite, trkRangeString[range].minusString); fontPrint(xMax + 1, y, colWhite, trkRangeString[range].plusString); break; } } trkValue[index].lastValue = *trkValue[index].value; } }
void tmTechListDraw(featom *atom, regionhandle region) { sdword x, y, index; color c; fonthandle currentFont; bool newline = FALSE; sdword numlines, buyable=0; sdword price; if (tmTechSelected == -1) { sdword i, price; for (i = 0; i < TM_NUM_TECHS; i++) { if (tmTechForSale[i] == TM_TECH_IS_FOR_SALE) { price = (tmTechPrice[i] * tmPriceScale) / 100; if (universe.curPlayerPtr->resourceUnits >= price) { tmTechSelected = i; tmtechinfo = i; tmDirtyTechInfo(); break; } } } } tmTechListRegion = region; currentFont = fontMakeCurrent(tmTechListFont); if (region->flags == 0 || region->flags == RPE_DrawFunctionAdded) { //if region not processed yet region->flags = RPE_PressLeft | RPE_PressRight | RPE_WheelUp | RPE_WheelDown; //receive mouse presses from now on regFunctionSet(region, (regionfunction)tmSelectAvailable); //set new region handler function } feStaticRectangleDraw(region); //draw standard rectangle numlines = 0; for (index=0; index<TM_NUM_TECHS; index++) { if (tmTechForSale[index] == TM_TECH_IS_FOR_SALE) newline=TRUE; if (newline) { newline = FALSE; numlines++; } } y = region->rect.y0 + TM_ASMarginTop; newline=FALSE; numlines=0; for (index=0; index < TM_NUM_TECHS; index++) { price = (tmTechPrice[index] * tmPriceScale) / 100; if (y + fontHeight(" ") >= region->rect.y1) { break; } if (tmTechForSale[index] == TM_TECH_IS_FOR_SALE) { if (universe.curPlayerPtr->resourceUnits < price) { //if this tech already selected c = TM_CantAffordTextColor; } else { c = TM_StandardTextColor; buyable++; } if (index == tmTechSelected) { c = TM_SelectionTextColor; } //tech fancy name x = region->rect.x0 + TM_ASMarginLeft; fontPrint(x, y, c, RaceSpecificTechTypeToNiceString(index,universe.curPlayerPtr->race)); newline = TRUE; tmDirtyTechInfo(); } if (newline) { newline = FALSE; y+= fontHeight(" ") + TM_ASInterSpacing; numlines++; } } tmStuffToBuy = buyable; fontMakeCurrent(currentFont); //tmDirtyTechInfo(); }
/*----------------------------------------------------------------------------- Name : gcChatTextDraw Description : draws the chat history window and prompts for text entry. Inputs : standard draw callbacks. Outputs : none Return : void ----------------------------------------------------------------------------*/ void gcChatTextDraw(featom *atom, regionhandle region) { fonthandle oldfont; sdword x,y=region->rect.y0,lines=0; char temp[512], *string; Node *walk=NULL; chathistory *chat; if (!mrRenderMainScreen) return; oldfont = fontMakeCurrent(chathistoryfont); fontShadowSet(FS_SE, colBlack); if (InChatMode) { switch (MessageToAllies) { case GC_ChatToAllies: //sprintf(temp,"To Allies: "); string = strGetString(strToAllies); break; case GC_ChatToAll: //sprintf(temp,"Say: "); string = strGetString(strSay); break; case GC_RUTransfer: //sprintf(temp,"RU Amount: "); string = strGetString(strRUAmount); break; } x = region->rect.x0; fontPrint(x,y,colWhite,string); y+= fontHeight(" "); lines++; } if (curPosition != NULL) { walk = curPosition; } if (walk!=NULL) { do { x = region->rect.x0; chat = listGetStructOfNode(walk); switch (chat->messageType) { case GC_NORMALMESSAGE: { sprintf(temp,"<%s>",playerNames[chat->playerindex]); fontPrint(x,y,tpGameCreated.playerInfo[chat->playerindex].baseColor,temp); x+=fontWidth(temp); sprintf(temp," %s",chat->chatstring); fontPrint(x,y,gcGameNormalChatColor,temp); } break; case GC_WHISPEREDMESSAGE: { sprintf(temp,"<%s>",playerNames[chat->playerindex]); fontPrint(x,y,tpGameCreated.playerInfo[chat->playerindex].baseColor,temp); x+=fontWidth(temp); sprintf(temp, strGetString(strWhisperedMessage)); fontPrint(x,y,gcGameWhisperedColor, temp); x+=fontWidth(temp); sprintf(temp," %s",chat->chatstring); fontPrint(x,y,gcGamePrivateChatColor,temp); } break; case GC_TEXTMESSAGE: { fontPrint(x,y,chat->col,chat->chatstring); } break; case GC_BUFFERSTART: { if (ViewingBuffer) { //sprintf(temp,"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^"); fontPrint(x,y,gcGameNormalChatColor,strGetString(strStartOfBuffer)); } } break; case GC_BUFFEREND: { if (ViewingBuffer) { //sprintf(temp,"v v v v v v v v v v v v v v v v v v v v v v v v"); fontPrint(x,y,gcGameNormalChatColor,strGetString(strEndOfBuffer)); } } break; case GC_WRAPMESSAGE: { x+= chat->indent; fontPrint(x,y,chat->col,chat->chatstring); } break; } y += fontHeight(" "); lines++; walk = walk->next; } while ((walk!=NULL) && (lines < maxlines)); if ((ScrollDownAutoBaby==NULL) && (!ViewingBuffer) && (curPosition->next != NULL)) { ScrollDownAutoBaby = taskCallBackRegister(gcScrollDownAuto, 0, NULL, GC_SCROLL_TIME); } } fontShadowSet(FS_NONE, colBlack); fontMakeCurrent(oldfont); }
static void worldmap_draw (EntComponent comp, EntSpeech speech) { float zNear = video_getZnear () - 0.001; unsigned int width, height; int i = 0, frameMargin = 32, sMargin = 8, sWidth = 55, sHeight = 34, maxWidth, maxHeight, mapSize, mapXMargin, mapYMargin; worldmapData map; const char * type; hexPos position; if (!Worldmap || !input_hasFocus (Worldmap)) return; map = component_getData (entity_getAs (Worldmap, "worldmap")); video_getDimensions (&width, &height); glColor4ub (0xff, 0xff, 0xff, 0xff); glBindTexture (GL_TEXTURE_2D, 0); glBegin (GL_QUADS); i = 0; while (i <= map->worldSpan) { glVertex3f ( video_xMap (width - (frameMargin + sWidth)), video_yMap (i * (sHeight + sMargin) + frameMargin), zNear ); glVertex3f ( video_xMap (width - (frameMargin + sWidth)), video_yMap (i * (sHeight + sMargin) + sHeight + frameMargin), zNear ); glVertex3f ( video_xMap (width - frameMargin), video_yMap (i * (sHeight + sMargin) + sHeight + frameMargin), zNear ); glVertex3f ( video_xMap (width - frameMargin), video_yMap (i * (sHeight + sMargin) + frameMargin), zNear ); i++; } glColor3ub (0xff, 0x00, 0x99); if (map->spanTypeFocus == FOCUS_SPAN) { glVertex3f (video_xMap (width - (frameMargin - 8)), video_yMap ((map->worldSpan - map->spanFocus) * (sHeight + sMargin) + frameMargin + (sHeight / 2.0) + 8), zNear); glVertex3f (video_xMap (width - (frameMargin - 8)), video_yMap ((map->worldSpan - map->spanFocus) * (sHeight + sMargin) + frameMargin + (sHeight / 2.0) - 8), zNear); glVertex3f (video_xMap (width - (frameMargin + 8)), video_yMap ((map->worldSpan - map->spanFocus) * (sHeight + sMargin) + frameMargin + (sHeight / 2.0) - 8), zNear); glVertex3f (video_xMap (width - (frameMargin + 8)), video_yMap ((map->worldSpan - map->spanFocus) * (sHeight + sMargin) + frameMargin + (sHeight / 2.0) + 8), zNear); } else { int fh = fontLineHeight (); glVertex3f (video_xMap (frameMargin - 8), video_yMap (frameMargin + (map->typeFocus + 1) * fh + ((fh - 16) / 2) + 8), zNear); glVertex3f (video_xMap (frameMargin + 8), video_yMap (frameMargin + (map->typeFocus + 1) * fh + ((fh - 16) / 2) + 8), zNear); glVertex3f (video_xMap (frameMargin + 8), video_yMap (frameMargin + (map->typeFocus + 1) * fh + ((fh - 16) / 2) - 8), zNear); glVertex3f (video_xMap (frameMargin - 8), video_yMap (frameMargin + (map->typeFocus + 1) * fh + ((fh - 16) / 2) - 8), zNear); } glEnd (); position = position_get (entity_getByName ("PLAYER")); if (map->types != NULL) { i = 0; fontPrintAlign (ALIGN_LEFT); while ((type = *(const char **)dynarr_at (map->types, i++))) { if (i - 1 == map->typeFocus) glColor4ub (0xff, 0xff, 0xff, 0xff); else glColor4ub (0xaf, 0xaf, 0xaf, 0xff); fontPrint (type, frameMargin, frameMargin + fontLineHeight () * (i - 1)); } } if (map->spanTextures[map->spanFocus] == NULL) { printf ("generating map texture for span %d using pos %p\n", map->spanFocus, position); if (map->types) map->spanTextures[map->spanFocus] = mapGenerateMapTexture (position, map->spanFocus, 0, *(const char **)dynarr_at (map->types, map->typeFocus)); else map->spanTextures[map->spanFocus] = mapGenerateMapTexture (position, map->spanFocus, 0, NULL); } glBindTexture (GL_TEXTURE_2D, textureName (map->spanTextures[map->spanFocus])); glColor4ub (0xff, 0xff, 0xff, 0xff); maxWidth = width - (frameMargin * 2 + sWidth + sMargin); maxHeight = height - (frameMargin * 2); mapSize = maxWidth < maxHeight ? maxWidth : maxHeight; mapXMargin = (width - mapSize) / 2; mapYMargin = (height - mapSize) / 2; glBegin (GL_QUADS); glTexCoord2f (0.00, 0.00); glVertex3f (video_xMap (mapXMargin), video_yMap (mapYMargin), zNear); glTexCoord2f (0.00, 1.00); glVertex3f (video_xMap (mapXMargin), video_yMap (mapYMargin + mapSize), zNear); glTexCoord2f (1.00, 1.00); glVertex3f (video_xMap (mapXMargin + mapSize), video_yMap (mapYMargin + mapSize), zNear); glTexCoord2f (1.00, 0.00); glVertex3f (video_xMap (mapXMargin + mapSize), video_yMap (mapYMargin), zNear); glEnd (); glBindTexture (GL_TEXTURE_2D, 0); }
/*----------------------------------------------------------------------------- Name : pingListDraw Description : Draw all pings from farthest to nearest. Inputs : camera - the camera we're rendering from modelView, projection - current matrices viewPort - rectangle we're rending in, for the TO legend Outputs : Return : Note : The renderer should be in 2D mode at this point. ----------------------------------------------------------------------------*/ void pingListDraw(Camera *camera, hmatrix *modelView, hmatrix *projection, rectangle *viewPort) { real32 pingAge, pingCycle, pingMod, pingSize; real32 x, y, radius; Node *thisNode, *nextNode; ping *thisPing; vector distSquared; sdword nSegments, index, rowHeight, xScreen, yScreen; oval o; udword TOFlags = 0; fonthandle fhSave; toicon *icon; color col; real32 realMargin; ShipClass shipClass; static real32 lastProximityPing = REALlyBig; static real32 lastAnomolyPing = REALlyBig; static real32 lastBattlePing = REALlyBig; static real32 lastHyperspacePing = REALlyBig; static real32 lastNewshipPing = REALlyBig; bool pingset; //start by sorting the ping list from farthest to nearest thisNode = pingList.head; while (thisNode != NULL) { //scan all pings nextNode = thisNode->next; thisPing = listGetStructOfNode(thisNode); if (thisPing->owner != NULL) { thisPing->centre = thisPing->owner->posinfo.position; } vecSub(distSquared, camera->eyeposition, thisPing->centre); thisPing->cameraDistanceSquared = vecMagnitudeSquared(distSquared); TOFlags |= thisPing->TOMask; thisNode = nextNode; } listMergeSortGeneral(&pingList, pingListSortCallback); //now the list is sorted; proceed to draw all the pings thisNode = pingList.head; pingset = FALSE; while (thisNode != NULL) { //scan all pings nextNode = thisNode->next; thisPing = listGetStructOfNode(thisNode); pingCycle = thisPing->pingDuration + thisPing->interPingPause; pingAge = universe.totaltimeelapsed - thisPing->creationTime; pingMod = (real32)fmod((double)pingAge, (double)pingCycle); if (pingMod <= thisPing->pingDuration) { pingSize = (thisPing->size - thisPing->minSize) * pingMod / thisPing->pingDuration + thisPing->minSize; selCircleComputeGeneral(modelView, projection, &thisPing->centre, max(thisPing->size,thisPing->minSize), &x, &y, &radius); if (radius > 0.0f) { radius = max(radius, thisPing->minScreenSize); radius *= pingSize / max(thisPing->size,thisPing->minSize); o.centreX = primGLToScreenX(x); o.centreY = primGLToScreenY(y); o.radiusX = o.radiusY = primGLToScreenScaleX(radius); nSegments = pieCircleSegmentsCompute(radius); primOvalArcOutline2(&o, 0.0f, 2*PI, 1, nSegments, thisPing->c); /* starting to draw a new ping so play the sound */ if (!smZoomingIn && !smZoomingOut && !pingset) { switch (thisPing->TOMask) { case PTOM_Anomaly: if (pingSize <=lastAnomolyPing) { soundEvent(NULL, UI_SensorsPing); pingset = TRUE; lastAnomolyPing = pingSize; } break; case PTOM_Battle: if (pingSize <= lastBattlePing) { soundEvent(NULL, UI_PingBattle); pingset = TRUE; lastBattlePing = pingSize; } break; case PTOM_Hyperspace: if (pingSize <= lastHyperspacePing) { soundEvent(NULL, UI_PingHyperspace); pingset = TRUE; lastHyperspacePing = pingSize; } break; case PTOM_Proximity: if (pingSize <= lastProximityPing) { soundEvent(NULL, UI_PingProximity); pingset = TRUE; lastProximityPing = pingSize; } break; case PTOM_NewShips: if (pingSize <= lastNewshipPing) { soundEvent(NULL, UI_PingNewShips); pingset = TRUE; lastNewshipPing = pingSize; } break; default: break; } } } } thisNode = nextNode; } //draw the blip TO if (smTacticalOverlay) { realMargin = primScreenToGLScaleX(viewPort->x0); fhSave = fontCurrentGet(); //save the current font fontMakeCurrent(selGroupFont2); // use a common, fairly small font rowHeight = fontHeight("M"); // used to space the legend yScreen = viewPort->y0 + rowHeight; //leave some space at the top to start radius = primScreenToGLScaleX(rowHeight)/2; xScreen = viewPort->x0 + (sdword)(rowHeight * 2.5); for (index = 0; index < PTO_NumberTOs; index++) { if ((TOFlags & pingTOList[index].bitMask)) { // fontPrint(xScreen, yScreen, *pingTOList[index].c, "O"); pingTOList[index].lastTimeDrawn = universe.totaltimeelapsed; } if (universe.totaltimeelapsed - pingTOList[index].lastTimeDrawn <= pingTOLingerTime) { o.centreX = viewPort->x0 + rowHeight * 3 / 2; o.centreY = yScreen + rowHeight / 2; o.radiusX = o.radiusY = rowHeight / 2; primOvalArcOutline2(&o, 0.0f, TWOPI, 1, pingTONSegments, *pingTOList[index].c); fontPrint(xScreen, yScreen, TO_TextColor, strGetString(pingTOList[index].stringEnum)); yScreen += rowHeight + 1; } } for (shipClass = 0; shipClass < NUM_CLASSES; shipClass++) { if (!toClassUsed[shipClass][0]) { continue; } icon = toClassIcon[shipClass]; fontPrint(xScreen, yScreen + (rowHeight>>2), TO_TextColor, ShipClassToNiceStr(shipClass)); #if TO_STANDARD_COLORS col = teFriendlyColor; #else col = teColorSchemes[universe.curPlayerIndex].tacticalColor; #endif col = colRGB(colRed(col)/TO_IconColorFade, colGreen(col)/TO_IconColorFade, colBlue(col)/TO_IconColorFade); primLineLoopStart2(1, col); for (index = icon->nPoints - 1; index >= 0; index--) { primLineLoopPoint3F(realMargin + primScreenToGLX(rowHeight*1.5) + icon->loc[index].x * radius, primScreenToGLY(yScreen + rowHeight/2) + icon->loc[index].y * radius); } primLineLoopEnd2(); yScreen += rowHeight + 1; } fontMakeCurrent(fhSave); } }
int main(int argc, char *argv[]) { int fd_video,buf_len_video; int event = 0; int count = 0 ; int cnt = 0,flag=0; char *pcontent; unsigned long ulIPOldeth1 = -1, ulIPOldppp0 = -1; BOOL bIPEth1Change = FALSE, bIPPPP0Change = FALSE; //for font--> FONT_DEVICE_T fd; FONT_RECT_T rc; FONT_SIZE_T sz; cyg_interrupt_disable(); cyg_interrupt_disable(); cyg_interrupt_disable(); cyg_interrupt_enable(); VideoPhoneInit(); fontAttrInit(&font_attr); //fontGetConf(&font_attr, FONT_CONF_PATH); fontFontSet(&fd, &font_attr); //for font end<-- ControlBackLight(6, 0); wb702ConfigureLCM(320, 240, 2, 1, 3, 0, TRUE, 1); //wb702SetOSDColor(5, 0x00, 0x00, 0x00, 0xF8, 0xFC, 0xF8); ControlLcmTvPower(2); ControlBackLight(6, 1); #ifdef FONT_STANDALONE //wb702SetIoctlRW(fd_video, TRUE);//select ioctl method wb702EnableMotionDetect(TRUE, CMD_MOTION_DETECT_LOW); wb702Init(fd_video); #endif drawLCDRGB(buf_video,font_attr.iScreenWidth*font_attr.iScreenHeight*2); //wb702BypassBitmap(font_attr.iScreen, buf_video, font_attr.iScreenWidth*font_attr.iScreenHeight*2); while(1) { drawLCDRGB(buf_video,font_attr.iScreenWidth*font_attr.iScreenHeight*2); //if(font_attr.bBackground == TRUE) { bmpconv(BMP_BACKGROUND_PATH, buf_video, font_attr.iScreenWidth, font_attr.iScreenHeight); } fontPrintContent(&fd, &font_attr, FONT_CONF_PATH); /* if(font_attr.bVersion == TRUE) { char versionbuf[32]; char cmd[32]; if(fontGetVersion(fd_video, versionbuf) == TRUE) { sprintf(cmd, "V%s", versionbuf); pcontent = cmd; } else pcontent = VERSION_DEFAULT; fontGetSize(&fd, (unsigned char*)pcontent, &sz); fontGetRC(&font_attr, &rc, &sz); #ifdef FONT_DEBUG printf("Size: %d %d\n", sz.nWidth, sz.nHeight); #endif fontPrint(&fd, (unsigned char*)pcontent, &rc, &sz); font_attr.rcThis.nTop += (sz.nHeight + LINE_SPACE); } */ /* if(font_attr.bIpaddress == TRUE) { unsigned long ulIPeth1, ulIPppp0; BOOL ipresult; ulIPeth1 = GetIPAddress("eth1"); if(ulIPeth1 != ulIPOldeth1) { bIPEth1Change = TRUE; ulIPOldeth1 = ulIPeth1; if(ulIPeth1 != 0) { pcontent = malloc(20); #ifdef SOCKET_BRIDGE sprintf(pcontent, "ETH1: %s", inet_ntoa(*(struct in_addr*)&ulIPeth1, g_FontFuncBuffer, FONTFUNCBUFFER_SIZE)); #else sprintf(pcontent, "ETH1: %s", inet_ntoa(*(struct in_addr*)&ulIPeth1)); #endif fontGetSize(&fd, (unsigned char*)pcontent, &sz); fontGetRC(&font_attr, &rc, &sz); #ifdef FONT_DEBUG printf("Size: %d %d\n", sz.nWidth, sz.nHeight); #endif fontPrint(&fd, (unsigned char*)pcontent, &rc, &sz); font_attr.rcThis.nTop += (sz.nHeight + LINE_SPACE); free(pcontent); } } ulIPppp0 = GetIPAddress("ppp0"); if(ulIPppp0 != ulIPOldppp0) { bIPPPP0Change = TRUE; ulIPOldppp0 = ulIPppp0; if(ulIPppp0 != 0) { pcontent = malloc(20); #ifdef SOCKET_BRIDGE sprintf(pcontent, "PPP: %s", inet_ntoa(*(struct in_addr*)ulIPppp0, g_FontFuncBuffer, FONTFUNCBUFFER_SIZE)); #else sprintf(pcontent, "PPP: %s", inet_ntoa(*(struct in_addr*)ulIPppp0)); #endif fontGetSize(&fd, (unsigned char*)pcontent, &sz); fontGetRC(&font_attr, &rc, &sz); #ifdef FONT_DEBUG printf("Size: %d %d\n", sz.nWidth, sz.nHeight); #endif fontPrint(&fd, (unsigned char*)pcontent, &rc, &sz); font_attr.rcThis.nTop += (sz.nHeight + LINE_SPACE); free(pcontent); } } } */ { bIPEth1Change = TRUE; pcontent = malloc(20); sprintf(pcontent, "ETH1: %s", "10.132.11.11"); fontGetSize(&fd, (unsigned char*)pcontent, &sz); fontGetRC(&font_attr, &rc, &sz); fontPrint(&fd, (unsigned char*)pcontent, &rc, &sz); font_attr.rcThis.nTop += (sz.nHeight + LINE_SPACE); free(pcontent); } //if((bIPEth1Change==TRUE) || (bIPPPP0Change==TRUE)) { #ifdef FONT_DEBUG printf("wb702BypassBitmap!!!\n"); #endif memcpy(vlcmGetLCMBuffer ()->aucData, buf_video, font_attr.iScreenWidth*font_attr.iScreenHeight*2); // wb702BypassBitmap(font_attr.iScreen, buf_video, font_attr.iScreenWidth*font_attr.iScreenHeight*2); bIPEth1Change = FALSE; bIPPPP0Change = FALSE; } fontRecoverRC(&font_attr); tt_msleep(5000); } return 0; }