Beispiel #1
0
CLibOI::CLibOI(cl_device_type type)
{
	// init datamembers
	mOCL = COpenCLPtr(new COpenCL(type));

	InitMembers();
}
Beispiel #2
0
//
//--- Copy constructor 
//
CAStar::CAStar(const CAStar & in_aStar)
{
	m_maxPathSize = 4;
	InitMembers();

	//--- Call the copy operator
	*this = in_aStar;
}
Beispiel #3
0
//
//--- To clean everything
//
void CAStar::Clean()
{
	if (m_mapArray) delete [] m_mapArray;
	if (m_mapNodesRef) delete [] m_mapNodesRef;

	//--- Delete the nodes
	ASTAR_DELETE_LIST(m_lstNodes, CPathNode);

	//--- We reinit the members now
	InitMembers();
}
Beispiel #4
0
void CPieView::GetDiskInfo(CString driveLetter)
{
    ULARGE_INTEGER AvailableToCaller;

    ZeroMemory(&AvailableToCaller, sizeof(ULARGE_INTEGER));

    InitMembers();

    GetDiskFreeSpaceExW((driveLetter).Left(3), &AvailableToCaller,
                        &pCapacity, &pFree);
    pUsed.QuadPart = pCapacity.QuadPart - pFree.QuadPart;

}
Beispiel #5
0
//------------------------------------------------------------------------
CEditorGame::CEditorGame()
{
    InitMembers(0);
}
Beispiel #6
0
CLicenseKey::CLicenseKey(LPCTSTR szKey)
{
	InitMembers();
	InitFromStr (szKey);
}
Beispiel #7
0
CLicenseKey::CLicenseKey() 
{
	InitMembers();
}
bool	Satori::load(const string& iBaseFolder)
{
	GetSender().next_event();

	setlocale(LC_ALL, "Japanese");
#ifdef _WINDOWS
	_setmbcp(_MB_CP_LOCALE);
#endif

	mBaseFolder = iBaseFolder;
	GetSender().sender() << "■SATORI::Load on " << mBaseFolder << "" << std::endl;

#if POSIX
	// 「/」で終わっていなければ付ける。
	if (mBaseFolder[mBaseFolder.size() - 1] != '/') {
	    mBaseFolder += '/';
	}
#else
	// 「\」で終わっていなければ付ける。
	if (mBaseFolder[mBaseFolder.size() - 1] != '\\') {
	    mBaseFolder += '\\';
	}
#endif


#ifdef	_MSC_VER
	// 本体のあるフォルダをサーチ
	{
		TCHAR	buf[MAX_PATH+1];
		::GetModuleFileName(NULL, buf, MAX_PATH);
		char*	p = FindFinalChar(buf, DIR_CHAR);
		if ( p==NULL )
			mExeFolder = "";
		else {
			*(++p) = '\0';
			mExeFolder = buf;
		}
	}
	GetSender().sender() << "本体の所在: " << mExeFolder << "" << std::endl;
#endif // _MSC_VER

	// メンバ初期化
	InitMembers();

#ifdef	_MSC_VER
	// システムの設定を読んでおく
    OSVERSIONINFO	ovi;
    ovi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
	::GetVersionEx(&ovi);
	string	os;
	if ( ovi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ) {
		if ( ovi.dwMinorVersion == 0 ) { mOSType=SATORI_OS_WIN95; os="Windows 95"; }
		else if ( ovi.dwMinorVersion == 10 ) { mOSType=SATORI_OS_WIN98; os="Windows 98"; }
		else if ( ovi.dwMinorVersion == 90 ) { mOSType=SATORI_OS_WINME; os="Windows Me"; }
		else { mOSType = SATORI_OS_UNDEFINED; os="undefined"; }
	} else {
		if ( ovi.dwMinorVersion == 0 ) {
			if ( ovi.dwMajorVersion == 4 ) { mOSType=SATORI_OS_WINNT; os="Windows NT"; }
			else if ( ovi.dwMajorVersion == 5 ) { mOSType=SATORI_OS_WIN2K; os="Windows 2000"; }
		}
		else { mOSType = SATORI_OS_WINXP; os="Windows XP or later"; }
	}
	GetSender().sender() << "OS種別: " << os << std::endl;
	if ( mOSType==SATORI_OS_WIN95 ) {
		is_single_monitor = true;
	} else {
		BOOL (WINAPI* pEnumDisplayMonitors)(HDC,LPRECT,MONITORENUMPROC,LPARAM);
		(FARPROC&)pEnumDisplayMonitors = ::GetProcAddress(::GetModuleHandle("user32.dll"), "EnumDisplayMonitors");
		if ( pEnumDisplayMonitors==NULL ) {
			is_single_monitor = true;
		}
		else {
			RECT rectData[2];
			memset(rectData,0,sizeof(rectData));
			(*pEnumDisplayMonitors)(NULL,NULL,(MONITORENUMPROC)MonitorEnumFunc,(LPARAM)(rectData));

			max_screen_rect = rectData[0];
			desktop_rect = rectData[1];

			RECT*	rect;
			rect = &desktop_rect;
			GetSender().sender() << "プライマリデスクトップ: (" << 
				rect->left << "," << rect->top << "," << rect->right << "," << rect->bottom << ")" << std::endl;
			rect = &max_screen_rect;
			GetSender().sender() << "仮想デスクトップ: (" << 
				rect->left << "," << rect->top << "," << rect->right << "," << rect->bottom << ")" << std::endl;
			is_single_monitor = ( ::EqualRect(&max_screen_rect, &desktop_rect)!=FALSE );
			GetSender().sender() << (is_single_monitor ? 
				"モニタは一つだけと判断、見切れ判定を呼び出し元に任せます。" : 
				"複数のモニタが接続されていると判断、見切れ判定は里々が行います。") << std::endl;
		}
	}
#endif // _MSC_VER

	// 置換辞書読み取り
	strmap_from_file(replace_before_dic, mBaseFolder+"replace.txt", "\t");
	strmap_from_file(replace_after_dic, mBaseFolder+"replace_after.txt", "\t");

	// キャラデータ読み込み
	mCharacters.load(mBaseFolder + "characters.ini");
	for ( inimap::const_iterator i=mCharacters.begin() ; i!=mCharacters.end() ; ++i ) {
		const strmap& m = i->second;
		strmap::const_iterator j;

		// 置換辞書に追加
		j = m.find("popular-name");
		if ( j != m.end() && j->second.size()>0 ) 
			replace_before_dic[j->second + ":"] = string("\xff\x01") + zen2han(i->first); //0xff0x01はあとで変換
		j = m.find("initial-letter");
		if ( j != m.end() && j->second.size()>0 ) 
			replace_before_dic[j->second + ":"] = string("\xff\x01") + zen2han(i->first); //0xff0x01はあとで変換

		j = m.find("base-surface");
		if ( j != m.end() && j->second.size()>0 )
			system_variable_operation( string("サーフェス加算値") + i->first, j->second);
	}

	//for ( strmap::const_iterator j=replace_before_dic.begin() ; j!=replace_before_dic.end() ; ++j )
	//	cout << j->first << ": " << j->second << endl;

	// ランダマイズ
	randomize();


	//------------------------------------------

	// コンフィグ読み込み
	LoadDictionary(mBaseFolder + "satori_conf.txt", false);

	// 変数初期化実行
	GetSentence("初期化");	

	// SAORI読み込み
	Family<Word>* f = words.get_family("SAORI");

	mShioriPlugins->load(mBaseFolder);
	
	if ( f != NULL )
	{
		std::vector<const Word*> els;
		f->get_elements_pointers(els);

		for (std::vector<const Word*>::const_iterator i=els.begin(); i!=els.end() ; ++i)
		{
			if ( (*i)->size()>0 && !mShioriPlugins->load_a_plugin(**i) )
			{
				GetSender().sender() << "SAORI読み込み中にエラーが発生: " << **i << std::endl;
			}
		}

	}
	mShioriPlugins->load_default_entry();

	talks.clear();
	words.clear();

	//------------------------------------------

	// セーブデータ読み込み
	//bool oldConf = fEncodeSavedata;

	bool loadResult = LoadDictionary(mBaseFolder + "satori_savedata." + (fEncodeSavedata?"sat":"txt"), false);
	GetSentence("セーブデータ");
	bool execResult = talks.get_family("セーブデータ") != NULL;

	if ( ! loadResult || ! execResult ) {
		loadResult = LoadDictionary(mBaseFolder + "satori_savebackup." + (fEncodeSavedata?"sat":"txt"), false);
		GetSentence("セーブデータ");
		execResult = talks.get_family("セーブデータ") != NULL;
	}

	talks.clear();
	
	reload_flag = false;

	if ( variables.find("ゴースト起動時間累計秒") != variables.end() ) {
		sec_count_total = zen2ul(variables["ゴースト起動時間累計秒"]);
	}
	else if ( variables.find("ゴースト起動時間累計ミリ秒") != variables.end() ) {
		sec_count_total = zen2ul(variables["ゴースト起動時間累計ミリ秒"]) / 1000;
	}
	else {
		sec_count_total = zen2ul(variables["ゴースト起動時間累計(ms)"]) / 1000;
	}
	variables["起動回数"] = itos( zen2int(variables["起動回数"])+1 );

	// 「単語の追加」で登録された単語を覚えておく
	const std::map< string, Family<Word> >& m = words.compatible();
	for (std::map< string, Family<Word> >::const_iterator it = m.begin() ; it != m.end() ; ++it )
	{
		std::vector<const Word*> v;
		it->second.get_elements_pointers(v);
		for (std::vector<const Word*>::const_iterator itx = v.begin() ; itx < v.end() ; ++itx ) {
			mAppendedWords[it->first].push_back(**itx);
		}
	}

	//------------------------------------------

	// 指定フォルダの辞書を読み込み
	int loadcount = 0;
	strvec::iterator i = dic_folder.begin();
	if ( i==dic_folder.end() ) {
		loadcount += LoadDicFolder(mBaseFolder);	// ルートフォルダの辞書
	} else {
		for ( ; i!=dic_folder.end() ; ++i )
			loadcount += LoadDicFolder(mBaseFolder + *i + DIR_CHAR);	// サブフォルダの辞書
	}

	is_dic_loaded = loadcount != 0;

	//------------------------------------------

	secure_flag = true;

	system_variable_operation("単語群「*」の重複回避", "有効、トーク中");
	system_variable_operation("文「*」の重複回避", "有効");
	//system_variable_operation("単語群「季節の食べ物」の重複回避", "有効、トーク中");

	GetSentence("OnSatoriLoad");
	on_loaded_script = GetSentence("OnSatoriBoot");
	diet_script(on_loaded_script);

	GetSender().sender() << "loaded." << std::endl;

	GetSender().flush();
	return	true;
}
Beispiel #9
0
GManager::GManager()
{
    InitMembers();
    m_Texture.SetName( "GManager_Texture" );
}
Beispiel #10
0
//
//--- Default Constructor
//
CAStar::CAStar()
{
	m_maxPathSize = 4;
	InitMembers();
}
Beispiel #11
0
CPieView::CPieView()
    : folderCount(0)
    , fileCount(0)
{
    InitMembers();
}
Beispiel #12
0
//=========================================================================================================================
// DTextParser
DTextParser::DTextParser( void )
: m_bTokenInit(false), m_TokenString(NULL), m_TokenEnd(0)
{
	InitMembers();
}
Beispiel #13
0
DNameTable::DNameTable()
{
	InitMembers();
}
Beispiel #14
0
VMware::VMware()
:	m_cGELock("VMware_ge_lock")
{
	int pciItor, chipItor;
	bool vidCardFound = false;

	/* Give safe values to all the class data members */
	InitMembers();

	for(pciItor = 0; get_pci_info(&m_cPciInfo, pciItor) == 0; pciItor++)
	{
		m_vmChipInfo.nChipId = (m_cPciInfo.nVendorID << 16) | (m_cPciInfo.nDeviceID);

		for(chipItor = 0; chipItor < numSupportedChips; chipItor++)
		{
			if(m_vmChipInfo.nChipId == supportedChips[chipItor].nChipId)
			{
				vidCardFound = true;
				m_vmChipInfo.nArchRev = supportedChips[chipItor].nArchRev;
				m_vmChipInfo.pzName = supportedChips[chipItor].pzName;
				break;
			}
		}

		if(vidCardFound)
			break;
	}

	if(!vidCardFound)
	{
		printf("VMware - Did not find any VMware video cards.\n");
		return;
	}

	dbprintf("VMware - Found match - PCI %d: Vendor 0x%04x "
				"Device 0x%04x - Rev 0x%04x\n", pciItor,
				m_cPciInfo.nVendorID, m_cPciInfo.nDeviceID,
				m_cPciInfo.nRevisionID);

	/* Initialize the hardware.  This will setup the
	 * IO ports and write to m_regId */
	if(!InitHardware())
	{
		dbprintf("VMware - Unable to initialize hardware.\n");
		vmwareWriteReg(SVGA_REG_CONFIG_DONE, 0);
		vmwareWriteReg(SVGA_REG_ENABLE, 0);
		return;
	}

	dbprintf("VMware - Host bpp is %d\n", (int) m_regHostBPP);
	dbprintf("VMware - Current Guest bpp is set to %d\n", (int) m_regBitsPerPixel);
	dbprintf("VMware - Only allowing %d bpp\n", (int) m_regBitsPerPixel);

	int bpp;
	color_space colspace;
	float rf[] = {60.0f};
	if(m_regBitsPerPixel == 16)
	{
		bpp = 2;
		colspace = CS_RGB16;
	}
	else if(m_regBitsPerPixel == 32)
	{
		bpp = 4;
		colspace = CS_RGB32;
	}
	else
	{
		dbprintf("VMware - m_regBitsPerPixel is unexpected value of %d\n",
					(int) m_regBitsPerPixel);
		return;
	}

	for(int j = 0; j < 4; j++)
	{
		m_cScreenModeList.push_back(os::screen_mode(640, 480, 640 * bpp, colspace, rf[j]));
		m_cScreenModeList.push_back(os::screen_mode(800, 600, 800 * bpp, colspace, rf[j]));
		m_cScreenModeList.push_back(os::screen_mode(1024, 768, 1024 * bpp, colspace, rf[j]));
	}

	m_bIsInitiated = true;
	return;
}
Beispiel #15
0
CEditorGame::CEditorGame(const char* binariesDir)
{
    InitMembers(binariesDir);
}
Beispiel #16
0
CLibOI::CLibOI(COpenCLPtr open_cl)
{
	mOCL = open_cl;
	InitMembers();
}
Beispiel #17
0
CLibOI::CLibOI(cl_device_id device, cl_context context, cl_command_queue queue, bool cl_gl_interop_enabled)
{
	mOCL = COpenCLPtr(new COpenCL(device, context, queue, cl_gl_interop_enabled));
	InitMembers();
}
Beispiel #18
0
CLibOI::CLibOI(cl_device_id device, cl_context context, cl_command_queue queue)
{
	mOCL = COpenCLPtr(new COpenCL(device, context, queue));
	InitMembers();
}
void mitk::AffineBaseDataInteractor3D::InitRotate(StateMachineAction*, InteractionEvent* interactionEvent)
{
  InitMembers(interactionEvent);
}