[code] Fixed Gfx Engine

All Helbreath Client Source Discussion here.
Post Reply
Drajwer
<3 bd long time
Posts: 841
Joined: Fri Dec 10, 2004 3:24 pm

Post by Drajwer »

Everyone knows, hb gfx engine is gay... it checks what mode is on and updates screen everytime. It can be fixed by one pointer :

Game.cpp:

find:

Code: Select all

short _tmp_sOwnerType, _tmp_sAppr1, _tmp_sAppr2, _tmp_sAppr3, _tmp_sAppr4;//, _tmp_iStatus;
//CInt _tmp_iStatus;
int _tmp_iStatus;
char  _tmp_cAction, _tmp_cDir, _tmp_cFrame, _tmp_cName[12];
int   _tmp_iChatIndex, _tmp_dx, _tmp_dy, _tmp_iApprColor, _tmp_iEffectType, _tmp_iEffectFrame, _tmp_dX, _tmp_dY; // 21.171 2002-6-14
WORD  _tmp_wObjectID;
char cDynamicObjectData1, cDynamicObjectData2, cDynamicObjectData3, cDynamicObjectData4;
WORD  wFocusObjectID;
short sFocus_dX, sFocus_dY;
char  cFocusAction, cFocusFrame, cFocusDir, cFocusName[12];
short sFocusX, sFocusY, sFocusOwnerType, sFocusAppr1, sFocusAppr2, sFocusAppr3, sFocusAppr4;
int iFocuiStatus;
int   iFocusApprColor;
add after:

Code: Select all

void (CGame::*UpdateScreen_ptr)(void);

UpdateScreen replace by:

Code: Select all

void CGame::UpdateScreen()
{  
G_dwGlobalTime = timeGetTime();
(*this.*UpdateScreen_ptr)();
#ifdef DEF_USING_WIN_IME

	if (GetAsyncKeyState(VK_RETURN) != NULL) m_cEnterCheck = 1;
	if ((m_cEnterCheck == 1) && (GetAsyncKeyState(VK_RETURN) == NULL))
	{	m_bEnterPressed = TRUE;
  m_cEnterCheck = NULL;
	}
	if (GetAsyncKeyState(VK_TAB) != NULL) m_cTabCheck = 1;
  if ((m_cTabCheck == 1) && (GetAsyncKeyState(VK_TAB) == NULL))
	{	m_cCurFocus++;
  if( m_cCurFocus > m_cMaxFocus) m_cCurFocus = 1;
  if (m_cGameMode == DEF_GAMEMODE_ONMAINGAME) bSendCommand(MSGID_COMMAND_COMMON, DEF_COMMONTYPE_TOGGLECOMBATMODE, NULL, NULL, NULL, NULL, NULL);
  m_cTabCheck = NULL;
	}
	if( m_bInputStatus )
	{	if (GetAsyncKeyState(VK_LEFT) != NULL) m_cLeftArrowCheck = 1;
  if ((m_cLeftArrowCheck == 1) && (GetAsyncKeyState(VK_LEFT) == NULL))
  {	m_cLeftArrowCheck = NULL;
  	if( G_hEditWnd != NULL )
  	{	int iStrLen = strlen(m_pInputBuffer);
    SendMessage( G_hEditWnd, EM_SETSEL, iStrLen, iStrLen );
	}	}	}
#endif
}
Replace ChangeGameMode to:

Code: Select all

void CGame::ChangeGameMode(char cMode)
{
	m_cGameMode = cMode;
	m_cGameModeCount = 0;
	m_dwTime = G_dwGlobalTime;
switch (m_cGameMode) {
#ifdef DEF_MAKE_ACCOUNT
	case DEF_GAMEMODE_ONAGREEMENT:
  // UpdateScreen_OnAgreement(); //unused by HBx server..
  break;

	case DEF_GAMEMODE_ONCREATENEWACCOUNT:
  UpdateScreen_ptr=UpdateScreen_OnCreateNewAccount;
  break;
#endif

	case DEF_GAMEMODE_ONVERSIONNOTMATCH:
  UpdateScreen_ptr=UpdateScreen_OnVersionNotMatch;
  break;

	case DEF_GAMEMODE_ONCONNECTING:
  UpdateScreen_ptr=UpdateScreen_OnConnecting;
  break;

	case DEF_GAMEMODE_ONMAINMENU:
  UpdateScreen_ptr=UpdateScreen_OnMainMenu;
  break;

	case DEF_GAMEMODE_ONLOADING: //bug
  UpdateScreen_OnLoading_Progress;//(TRUE);
  break;

	case DEF_GAMEMODE_ONMAINGAME:
  UpdateScreen_ptr=UpdateScreen_OnGame;
  break;

	case DEF_GAMEMODE_ONWAITINGINITDATA:
  UpdateScreen_ptr=UpdateScreen_OnWaitInitData;
  break;

	case DEF_GAMEMODE_ONCONNECTIONLOST:
  UpdateScreen_ptr=UpdateScreen_OnConnectionLost;
  break;

	case DEF_GAMEMODE_ONMSG:
  UpdateScreen_ptr=UpdateScreen_OnMsg;
  break;

	case DEF_GAMEMODE_ONLOGIN:
  UpdateScreen_ptr=UpdateScreen_OnLogin;
  break;

	case DEF_GAMEMODE_ONSELECTSERVER:
  UpdateScreen_ptr=UpdateScreen_OnSelectServer;
  break;

	case DEF_GAMEMODE_ONQUIT:
  UpdateScreen_ptr=UpdateScreen_OnQuit;
  break;

	case DEF_GAMEMODE_ONQUERYFORCELOGIN:
  UpdateScreen_ptr=UpdateScreen_OnQueryForceLogin;
  break;

	case DEF_GAMEMODE_ONSELECTCHARACTER:
  UpdateScreen_ptr=UpdateScreen_OnSelectCharacter;
  break;

	case DEF_GAMEMODE_ONCREATENEWCHARACTER:
  UpdateScreen_ptr=UpdateScreen_OnCreateNewCharacter;
  break;

	case DEF_GAMEMODE_ONWAITINGRESPONSE:
  UpdateScreen_ptr=UpdateScreen_OnWaitingResponse;
  break;

	case DEF_GAMEMODE_ONQUERYDELETECHARACTER:
  UpdateScreen_ptr=UpdateScreen_OnQueryDeleteCharacter;
  break;

	case DEF_GAMEMODE_ONLOGRESMSG:
  UpdateScreen_ptr=UpdateScreen_OnLogResMsg;
  break;

	case DEF_GAMEMODE_ONCHANGEPASSWORD:
  UpdateScreen_ptr=UpdateScreen_OnChangePassword;
  break;

}

(*this.*UpdateScreen_ptr)();

#ifndef DEF_SELECTSERVER
	if( cMode == DEF_GAMEMODE_ONSELECTSERVER )
	{	ZeroMemory(m_cWorldServerName, sizeof(m_cWorldServerName));
  strcpy(m_cWorldServerName, NAME_WORLDNAME1);
  m_cGameMode = DEF_GAMEMODE_ONLOGIN;
  UpdateScreen_ptr = UpdateScreen_OnLogin;
	}
#endif
}
in CGame find

Code: Select all

	m_cGameMode = DEF_GAMEMODE_ONLOADING;
after add:

Code: Select all

	UpdateScreen_ptr=UpdateScreen_OnLoading_Progress;
	(*this.*UpdateScreen_ptr)();
Now what i want to be fixed by You:

- Mouse isnt showing
- Keyboard (?)
- If I login into game then client crash.

Help and post your fixes here
:rolleyes:
<img src='http://img440.imageshack.us/img440/2627/15pt.jpg' border='0' alt='user posted image' /><br><br>HBPolska characters:<br><br>Hellios 150+ Aresden Hero Mage<br>TheBill 120 Aresden plrider<br>Kill_Me 100 Full-Hero plrider<br>Rockeater 110+ Aresden Plate Mage<br><br><a href='http://www.helbreath.org' target='_blank'>http://www.helbreath.org</a> come and play (250 ppl online)
juggalo2
Spamtastic
Posts: 1144
Joined: Sun Jul 17, 2005 5:28 pm

Post by juggalo2 »

good job looks nice will take a look into it latetr on and ad it :P ty
<img src='http://lifeplaysu420.com/unknow/nightsign.png' border='0' alt='user posted image' /><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>Wanna make money for surfing the net sing up at <br><a href='http://www.cashfiesta.com/php/join.php? ... yprivitera' target='_blank'>cash fiesta</a><br>its all free hey why ntot make money while fucking around on the computer<br><br><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drajwer
&lt;3 bd long time
Posts: 841
Joined: Fri Dec 10, 2004 3:24 pm

Post by Drajwer »

I dont want you to add it and use, i want you to fix these bugs :(
i forgot...

CGame:

Code: Select all

 UpdateScreen_ptr=UpdateScreen_OnLoading_Progress;
(*this.*UpdateScreen_ptr)();
remove last line.
<img src='http://img440.imageshack.us/img440/2627/15pt.jpg' border='0' alt='user posted image' /><br><br>HBPolska characters:<br><br>Hellios 150+ Aresden Hero Mage<br>TheBill 120 Aresden plrider<br>Kill_Me 100 Full-Hero plrider<br>Rockeater 110+ Aresden Plate Mage<br><br><a href='http://www.helbreath.org' target='_blank'>http://www.helbreath.org</a> come and play (250 ppl online)
juggalo2
Spamtastic
Posts: 1144
Joined: Sun Jul 17, 2005 5:28 pm

Post by juggalo2 »

o idk it looked leik u fixed i was just sciming thro ill take a look when i get my comoputer all set back up
<img src='http://lifeplaysu420.com/unknow/nightsign.png' border='0' alt='user posted image' /><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>Wanna make money for surfing the net sing up at <br><a href='http://www.cashfiesta.com/php/join.php? ... yprivitera' target='_blank'>cash fiesta</a><br>its all free hey why ntot make money while fucking around on the computer<br><br><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Drazz
Regular
Posts: 52
Joined: Mon Dec 08, 2003 4:10 pm
Contact:

Post by Drazz »

juggalo2 wrote: o idk it looked leik u fixed i was just sciming thro ill take a look when i get my comoputer all set back up
plz speak in english!
<img src='http://drazzt.iespana.es/Drazzt/logo2.jpg' border='0' alt='user posted image' />
Windy
Member
Posts: 157
Joined: Tue Nov 18, 2003 8:31 am
Location: wishing I was somewhere else

Post by Windy »

most people dont believe in english here
<span style='color:blue'>Coding with Evil Intentions....Evil at its Best....</span>
Post Reply