RadioSubTitle::RadioSubTitle(const int MaximumMessageNum, const unsigned long TTL) { if (MaximumMessageNum != 0) MaxMessageNum = MaximumMessageNum; else MaxMessageNum = 20; if (TTL != 0) messageTTL = TTL; else messageTTL = MESSAGE_TTL; theRadioChatterList = new AList(); currentlyEditedNode = (SubTitleNode*)0; LinkedListCount = 0; #ifndef DYNAMIC_LINE_NUM // Retro 11Jan2004 for (int i = 0; i < MAX_FRAG_NUM; i++) { theStrings[i] = 0; } #endif // DYNAMIC_LINE_NUM colour_Flight = TOFROM_FLIGHT_COLOUR; colour_ToPackage = TO_PACKAGE_COLOUR; colour_ToFromPackage= TOFROM_PACKAGE_COLOUR; colour_Team = TO_TEAM_COLOUR; // this is the guard channel colour_Proximity = IN_PROXIMITY_COLOUR; colour_World = TO_WORLD_COLOUR; colour_Tower = TOFROM_TOWER_COLOUR; colour_Standard = STANDARD_COLOUR; // only used in default cases which (shouldn´t happen actually) #ifdef DYNAMIC_LINE_NUM // Retro 11Jan2004 FragCount = CountLinesInFile(THE_INPUT_FILE_NAME); if (FragCount == 0) { throw Init_Error("No frag lines in subtitles input file"); } else { theStrings = (csvLine**)calloc(sizeof(csvLine*),FragCount+100); // Retro 11Jan2004 - accounting for count-errors :p if (theStrings == (csvLine**)0) { throw Init_Error("Could not create strings"); } } #endif // DYNAMIC_LINE_NUM if (!ReadNewFile(THE_INPUT_FILE_NAME)) { throw Init_Error("Error reading the subtitles input file"); } #ifdef WRITE_BACK_STRING_FILE WriteOut(); #endif InitializeCriticalSection(&cs_radiosubtitle); }
Picture::Picture(const char* picfile):hdc(NULL),hbmp(NULL) { //图片的加载 if(!hInst || !horgdc) throw Init_Error("图片类未预初始化!"); hbmp=(HBITMAP)LoadImage(hInst,picfile,IMAGE_BITMAP,0,0,LR_CREATEDIBSECTION |LR_LOADFROMFILE); if(!hbmp)throw Outer_Error("加载图片失败!"); hdc=CreateCompatibleDC(horgdc); if(!hdc)throw Outer_Error("创建兼容设备失败!"); SelectObject(hdc,hbmp); BITMAP bmp; if(!GetObject(hbmp,sizeof(BITMAP),&bmp))throw Outer_Error("获取图片信息失败!"); w=bmp.bmWidth; h=bmp.bmHeight; }
void Init_Everything () { Init_Type (); Init_Cstring (); Init_String (); Init_Symbol (); Init_Env (); Init_Error (); Init_Exception (); Init_Io (); Init_Prim (); Init_Math (); Init_Print (); Init_Auto (); Init_Heap (); Init_Load (); Init_Proc (); Init_Special (); Init_Read (); Init_Features (); Init_Terminate (); #ifdef CAN_DUMP Init_Dump (); #endif }
SDL::SDL (uint32_t flags) { if (SDL_Init (static_cast<Uint32> (flags)) != 0) { throw Init_Error ("SDL_Init"); } }