コード例 #1
0
char* FdoCommonOSUtil::mbscat(char *strDestination, const char *strSource)
{
#ifdef _WIN32
    return (char*)_mbscat((unsigned char *) strDestination, (const unsigned char*) strSource);
#else
    return strcat(strDestination, strSource);
#endif
}
コード例 #2
0
ファイル: SpellPickups.cpp プロジェクト: Arc0re/lithtech
DDWORD SpellPickup::EngineMessageFn(DDWORD messageID, void *pData, DFLOAT lData)
{
	CServerDE* pServerDE = GetServerDE();
	if (!pServerDE) return DFALSE;

	switch(messageID)
	{
		case MID_POSTPROPREAD:
		{
			ObjectCreateStruct *pStruct = (ObjectCreateStruct*)pData;
			
			// Set the model filename
			_mbscpy((unsigned char*)pStruct->m_Filename, (const unsigned char*)"Models/Powerups/");
			_mbscat((unsigned char*)pStruct->m_Filename, (const unsigned char*)m_szFile);
			_mbscat((unsigned char*)pStruct->m_Filename, (const unsigned char*)".abc");

			// Set the skin filename
			_mbscpy((unsigned char*)pStruct->m_SkinName, (const unsigned char*)"Skins/Powerups/");
			_mbscat((unsigned char*)pStruct->m_SkinName, (const unsigned char*)m_szFile);
			_mbscat((unsigned char*)pStruct->m_SkinName, (const unsigned char*)".dtx");

			break;
		}

		case MID_INITIALUPDATE:
		{
			DVector vDims;
			VEC_SET(vDims, 20.0f, 25.0f, 10.0f);

			pServerDE->SetObjectDims(m_hObject, &vDims);
		}

		default : break;
	}

	return PickupObject::EngineMessageFn(messageID, pData, lData);
}
コード例 #3
0
ファイル: STD_File.cpp プロジェクト: 0xrofi/Aquaplus
// ---------------------------------------------------------------------------
//	iniファイルに文字を書き込む
// ---------------------------------------------------------------------------
int WriteIniFileStr( char *vname, char *str, char *sec_name, char *ini_fname )
{
	int		ret;
	char	buf[1024];

	strcpy( buf, "_" );
	_mbscat( (BYTE*)buf, (BYTE*)str );//空白回避
//	_mbscpy( (BYTE*)buf, (BYTE*)str );

	if( ini_fname==NULL){
		if(IniFileName[0]==0){
			ini_fname = "default.ini";
		}else{
			ini_fname = IniFileName;
		}
	}
	
	ret = !WritePrivateProfileString( sec_name, vname, buf, ini_fname );
	return ret;
}
コード例 #4
0
ファイル: NewStatusBar.cpp プロジェクト: bsmr-games/Blood2
void CNewStatusBar::UpdateInv(DBOOL bShow, HSTRING name, HSTRING c, HSTRING cH, DDWORD cN, HSTRING p, DDWORD pN, HSTRING n, DDWORD nN)
{
	if(!m_pClientDE) return;

	char	string1[100] = "interface/statusbar/items/";
	char	string2[100];

	// Fill in the name of the current object
	m_pClientDE->FillRect(m_hItemName, DNULL, m_hTransColor);

	if(name)
	{
		m_pStatCursor->SetFont(m_pStatFont1);
		m_pStatCursor->SetDest(m_hItemName);
		m_pStatCursor->SetJustify(CF_JUSTIFY_LEFT);
		m_pStatCursor->SetLoc(0, 0);
		m_pStatCursor->Draw(m_pClientDE->GetStringData(name));
	}

	// Currently selected item
	if(m_stCurrentItem.hIcon)
	{
		m_pClientDE->DeleteSurface(m_stCurrentItem.hIcon);
		m_stCurrentItem.hIcon = 0;
	}

	if(c)
	{
		_mbscpy((unsigned char*)string2, (const unsigned char*)string1);
		_mbscat((unsigned char*)string2, (const unsigned char*)m_pClientDE->GetStringData(c));

		m_stCurrentItem.hIcon = m_pClientDE->CreateSurfaceFromBitmap(string2);
		m_stCurrentItem.value = cN;
	}

	// Currently highlighted item in the inv tabs
	if(m_stItems[1].hIcon)
	{
		m_pClientDE->DeleteSurface(m_stItems[1].hIcon);
		m_stItems[1].hIcon = 0;
	}

	if(cH)
	{
		_mbscpy((unsigned char*)string2, (const unsigned char*)string1);
		_mbscat((unsigned char*)string2, (const unsigned char*)m_pClientDE->GetStringData(cH));

		m_stItems[1].hIcon = m_pClientDE->CreateSurfaceFromBitmap(string2);
		m_stItems[1].value = cN;
	}

	// Previous item in the inv tabs
	if(m_stItems[0].hIcon)
	{
		m_pClientDE->DeleteSurface(m_stItems[0].hIcon);
		m_stItems[0].hIcon = 0;
	}

	if(p)
	{
		_mbscpy((unsigned char*)string2, (const unsigned char*)string1);
		_mbscat((unsigned char*)string2, (const unsigned char*)m_pClientDE->GetStringData(p));

		m_stItems[0].hIcon = m_pClientDE->CreateSurfaceFromBitmap(string2);
		m_stItems[0].value = pN;
	}

	// Next item in the inv tabs
	if(m_stItems[2].hIcon)
	{
		m_pClientDE->DeleteSurface(m_stItems[2].hIcon);
		m_stItems[2].hIcon = 0;
	}

	if(n)
	{
		_mbscpy((unsigned char*)string2, (const unsigned char*)string1);
		_mbscat((unsigned char*)string2, (const unsigned char*)m_pClientDE->GetStringData(n));

		m_stItems[2].hIcon = m_pClientDE->CreateSurfaceFromBitmap(string2);
		m_stItems[2].value = nN;
	}

	
	// Update the time so it stays on the screen for a while
	switch(m_nInvLevel)
	{
		case	INVTAB_INVISIBLE:
			if( bShow )
			{
				m_nInvLevel = INVTAB_SCROLL_IN;
				m_fInvUpdateTime = m_pClientDE->GetTime();
			}
			break;

		case	INVTAB_SCROLL_IN:
			break;

		case	INVTAB_STOPPED:
			m_fInvUpdateTime = m_pClientDE->GetTime();
			break;

		case	INVTAB_SCROLL_OUT:
			m_nInvLevel = INVTAB_SCROLL_IN;
			m_fInvUpdateTime = m_pClientDE->GetTime();
			break;
	}

	// Setup the items tabs with the new information
	for(int i = 0; i < 3; i++)
		if(m_stItems[i].hIcon)
			SetupTab(m_stItems[i], m_pStatFont1, TAB_INC_HIGH);
}
コード例 #5
0
ファイル: BAD_STRING_MANAGEMENT.c プロジェクト: sohn126/torch
void f(char * str1, int size, char * str2) {
	_mbscpy(str1, str2); // @violation BAD_STRING_MANAGEMENT
	_mbscpy_s(str1, size, str2);
	_mbscat(str1, str2); // @violation BAD_STRING_MANAGEMENT
	_mbscat_s(str1, str2);
}
コード例 #6
0
ファイル: PickupObject.cpp プロジェクト: bsmr-games/Blood2
void PickupObject::PostPropRead(ObjectCreateStruct *pStruct)
{
	if (!pStruct) return;

	pStruct->m_Flags |= FLAG_TOUCH_NOTIFY | FLAG_VISIBLE | FLAG_GRAVITY;
	pStruct->m_Flags &= ~FLAG_SHADOW;
	m_dwFlags = pStruct->m_Flags;

	if (!m_hstrObjectName && m_szObjectName)
		m_hstrObjectName = g_pServerDE->CreateString(m_szObjectName);

#ifdef _ADD_ON
	if(m_nType == WEAP_COMBATSHOTGUN || m_nType == WEAP_FLAYER)
	{
		if (m_szFile)
		{
			_mbscpy((unsigned char*)pStruct->m_Filename, (const unsigned char*)"Models_ao/Powerups_ao/");
			_mbscat((unsigned char*)pStruct->m_Filename, (const unsigned char*)m_szFile);
			_mbscat((unsigned char*)pStruct->m_Filename, (const unsigned char*)".abc");
		}

		// Set the skin filename
		if (m_szFile)
		{
			_mbscpy((unsigned char*)pStruct->m_SkinName, (const unsigned char*)"Skins_ao/Powerups_ao/");
			_mbscat((unsigned char*)pStruct->m_SkinName, (const unsigned char*)m_szFile);
			_mbscat((unsigned char*)pStruct->m_SkinName, (const unsigned char*)".dtx");
		}
	}
	else
	{
		if (m_szFile)
		{
			_mbscpy((unsigned char*)pStruct->m_Filename, (const unsigned char*)"Models/Powerups/");
			_mbscat((unsigned char*)pStruct->m_Filename, (const unsigned char*)m_szFile);
			_mbscat((unsigned char*)pStruct->m_Filename, (const unsigned char*)".abc");
		}

		// Set the skin filename
		if (m_szFile)
		{
			_mbscpy((unsigned char*)pStruct->m_SkinName, (const unsigned char*)"Skins/Powerups/");
			_mbscat((unsigned char*)pStruct->m_SkinName, (const unsigned char*)m_szFile);
			_mbscat((unsigned char*)pStruct->m_SkinName, (const unsigned char*)".dtx");
		}
	}
#else
	// Set the model filename
	if (m_szFile)
	{
		_mbscpy((unsigned char*)pStruct->m_Filename, (const unsigned char*)"Models/Powerups/");
		_mbscat((unsigned char*)pStruct->m_Filename, (const unsigned char*)m_szFile);
		_mbscat((unsigned char*)pStruct->m_Filename, (const unsigned char*)".abc");
	}

	// Set the skin filename
	if (m_szFile)
	{
		_mbscpy((unsigned char*)pStruct->m_SkinName, (const unsigned char*)"Skins/Powerups/");
		_mbscat((unsigned char*)pStruct->m_SkinName, (const unsigned char*)m_szFile);
		_mbscat((unsigned char*)pStruct->m_SkinName, (const unsigned char*)".dtx");
	}
#endif
}
コード例 #7
0
/* second-phase constructor */
bool WinMapControl::construct(LPCREATESTRUCTW cParams, 
                              const char* mapServer, int portNum,
                              const char* sessionId,
                              const char* sessionKey)
{
   /* get the dimensions of the window */
   m_width = cParams->cx;
   m_height = cParams->cy;

   /* create the toolkit */
   m_toolkit = new WinTileMapToolkit(m_hwnd, cParams->hInstance);
   if(m_toolkit == NULL) return(false);

   /* create the plotter */
   m_plotter = isab::WinMapPlotter::allocate(m_width, m_height, 
                                             m_hwnd);
   if(m_plotter == NULL) return(false);
   /* set the blitting position for the plotter */
   m_plotter->setBlitPoint(cParams->x, cParams->y);

   /* create the TCP Connection handler */
   m_connHandler = WinTCPConnectionHandler::allocate(cParams->hInstance);
   if(m_connHandler == NULL) return(false);

   /* create the HTTP client connection */
   m_httpConn = new HttpClientConnection(mapServer, 
                                         portNum,
                                         NULL,
                                         m_connHandler);
   if(m_httpConn == NULL) return(false);

   /* check if session params needed */
   if( (sessionId == NULL) || (sessionKey == NULL) ||
       (sessionId == "") || (sessionKey == "") ) {
      /* create the Internet Requester without session info */
      m_httpReq = new SharedHttpDBufRequester(m_httpConn, "/TMap");
   }
   else {
      /* create the session params */
      char sessionParam[256];
      _mbscpy((unsigned char*)sessionParam, (unsigned char*)"?");
      _mbscat((unsigned char*)sessionParam, (unsigned char*)"si=");
      _mbscat((unsigned char*)sessionParam, (unsigned char*)sessionId);
      _mbscat((unsigned char*)sessionParam, (unsigned char*)"&sk=");
      _mbscat((unsigned char*)sessionParam, (unsigned char*)sessionKey);
      /* create the Internet Requester */
      m_httpReq = new SharedHttpDBufRequester(m_httpConn, "/TMap",
                                              sessionParam);
   }
   if(m_httpReq == NULL) return(false);

   /* create the caching requester */
   m_memReq = new MemoryDBufRequester(m_httpReq, 8*1024*1024);
   if(m_memReq == NULL) {
      /* delete the requester, since it wont get deleted thru 
         the TileMapHandler's destructor */
      delete m_httpReq;
      return(false);
   }

   /* create the map handler */
   m_mapHandler = new TileMapHandler(m_plotter,
                                     m_memReq,
                                     m_toolkit);
   if(m_mapHandler == NULL) return(false);

   /* initiate the first redraw */
   m_mapHandler->repaint(0);

   /* success */
   return(true);
}