飞飞世界论坛
标题:
自动饮血和登录视频
[打印本页]
作者:
admin
时间:
2016-1-10 03:46
标题:
自动饮血和登录视频
食品车:
}9 q, G# v; \4 n2 k P( a2 _( Q6 `
尾翼:
9 b8 B- f0 @8 M& l
6 y. e% g/ _# Z3 z/ N3 d3 B
代码:
2 [2 U) Y9 w9 J4 y: c2 L0 ]& p, r
CWndAutoFood::CWndAutoFood()
, T( w9 \3 u. V% S+ o7 ~5 N
{
) O" e& `) G3 Z `2 r a2 G. u
m_pItemElem = NULL;
' ]2 P9 @6 [" R: A
m_pTexture = NULL;
6 h% v1 G- g" u' K4 `2 |- T' W
bStart = FALSE;
' s) T$ z, I3 n, U0 `5 b; K
}
! Z- _4 h5 T& Z0 }2 x
# p' p. e L7 Q, ~: H' ?, ?: _4 ?
CWndAutoFood::~CWndAutoFood()
9 M- _7 F7 p) A6 e2 t, [
{
% q) o/ i) n; t" z
AfxMessageBox( "AutoFood ist gestorben
" );
% ?! H( C, y& B5 d b; K
}
- I4 J l- a) i6 \2 n' }
BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
& p* H! z d: w3 T4 j% L; ^* h
{
" p$ [2 R P" }) k% \
return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
/ l+ J. j. z. k4 g" o
}
! ]- B/ H1 a1 ~
- @: i; t1 a. ]( l
BOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
z8 ?* U$ b. \# _7 s
{
$ z% p- t% W. j# C- B% a
LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
3 S6 ] i9 K3 V( w1 S% L
CRect rect = pWndCtrl->rect;
7 ~7 b; A( q7 G' F& k2 \# N$ W* H
if( rect && rect.PtInRect( point ) )
4 J; O5 r/ y0 _: o
{
: G* ?4 L9 x8 c4 [; _) S8 w" k
CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
3 _7 Z' I" ?8 X. \; t3 F; c
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )
7 A1 C6 I; O- Q( I* I Z" D/ H
{
1 F! [9 C: G2 X
if( m_pItemElem )
+ J2 }! P* @4 C7 }$ Y( Y
{
; s, B7 @+ L! j2 g8 u% m
m_pItemElem = NULL;
4 j5 |, o2 x' O7 G5 k2 t
}
* x7 T( k: `) e' W7 t5 H/ Z
m_pItemElem = pItemElem;
) X! R# S2 \6 _" g
m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );
# N. d8 S7 ` [% O) S) m
}else{
3 V/ X6 D0 p5 o% _
SetForbid( TRUE );
. l+ j7 Y. S W$ ]
}
4 s( N. |1 p" U5 l0 u# Y7 \4 J5 @
}else{
6 `& h+ X; G7 c" f% x
SetForbid( TRUE );
4 M: `5 `0 j2 f- Q
}
2 j8 b/ ~4 j& T2 Z( w
return TRUE;
5 F e; w1 t U/ M2 F; \
}
1 m8 N( i3 k6 V
. v, i9 u8 Y9 f9 u# O) S+ Y& {0 r
BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
$ c# k5 N* Y/ S; p
{
; N( n& j0 T5 k4 L; x
switch( nID )
9 J$ E9 a: j- N5 H- k! l
{
" R% K+ O' Z% c: C1 {
case WIDC_BUTTON3:
- k, W3 u* l/ t) t/ [% I% w! O
{
0 ~2 p' N* B [0 u1 Z3 ~$ n
bStart = TRUE;
) _1 x2 c7 e7 ^( k- ^% A$ B5 G
break;
7 T# q: j) j( s, a4 K: l
}
) b: A4 j' M- h, F! d4 `/ m
case WIDC_BUTTON4:
( s$ L% m) Y$ A) R4 u% n$ {/ |- c5 n) q1 _
{
}9 i4 q0 I2 ?3 o# L3 j0 I! B# D
bStart = FALSE;
5 G- w% y. f6 U. ?" Z
break;
& R, I1 v# h: `1 ?
}
N. F6 Q! g7 k- r5 m) N; V* S9 g
}
& S. V; u- M# U+ h$ a* u+ B
return CWndNeuz::OnChildNotify( message, nID, pLResult );
% Q* _( E. m& h
}
% v! i, l# s+ V
void CWndAutoFood::OnDraw( C2DRender* p2DRender )
$ ?2 O! @7 @0 a
{
- F1 V; g N- N4 f! e) x
CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );
% r* K3 J; h( m P$ p
if( bStart || !m_pItemElem )
7 L* j: }9 U* U
{
7 l0 D& T t- A' ]- k
pBtn->EnableWindow( FALSE );
! o" e+ r' _+ H& \
}else
6 O# k$ B' w3 @3 @$ ?
pBtn->EnableWindow( TRUE );
/ v. G8 [0 S% {7 @! R7 @
if( m_pTexture )
4 r/ r! S0 P+ G! ^% L
{
8 J& o- P; j4 B- I
LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
% \# O5 r9 ]0 K
if( wndCtrl && wndCtrl->rect )
F( [: t! J2 e' }1 c l u# t' w
{
7 h2 z; I# U+ b2 F" h/ t0 o
m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
) `$ m: `$ |- c- ~; I. Y
}
* z) D$ t3 q/ X- P" q
}
8 b# U: C) q/ Z# z" d
}
. i/ q0 L+ @/ F% E, J! m# q
! }* f" k( @6 S1 N y J
BOOL CWndAutoFood:
rocess()
; {' K: {/ K3 H" w, A1 ?6 l
{
: n I5 C) S" A, }7 V
if( bStart )
* w0 p0 H$ Y6 v0 N4 I
{
9 H! P0 Y- a: o5 J$ d
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )
9 t9 ~ n4 c$ l# W7 b% R
{
$ }+ @% d/ e I% A# S6 R: [* D
if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )
' t' r& M5 l3 e& ~0 Q' l3 h1 }
g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );
4 H( c4 g8 h" Y c$ D% I
}else{
n/ y* B& i( I3 G0 X, S
bStart = FALSE;
) A s; p: A. [8 _4 E W- x7 d; I! u
m_pItemElem = NULL;
( R) H+ o' X2 K1 C
}
# i/ C; _# O2 V. m
}
9 H/ N& Z* m6 \3 F! |" z4 H$ i
return TRUE;
$ P- G, x+ b5 V9 p
}
. ?9 G* ?* f* E: \3 g
* A! p3 u+ L0 K" b
登录视频废话:
0 r7 `4 X1 s d3 e" `
尾翼:
# X# Y) [8 F J
: _5 S, r$ u! M
代码:
; Y$ l4 X* l* f! |
3 _, b( b; y7 _# U& r
void CWorld::SetLight( BOOL bLight )
- s q6 e0 M E% W! d3 L) I
durch
9 c- {9 q4 u/ [3 T i
Code:
$ R! l* c- C: Q& f4 Q6 b0 x. H
void CWorld::SetLight( BOOL bLight )
% R" O% T/ |/ P" _3 }. t) d; ?
{
- H/ C" L* }! R; c
//ACE("SetLight %d \n", bLight);
5 c8 }. m r9 b% D
3 z2 }7 b8 A( @1 W0 R' ~ \
#ifndef __WORLDSERVER
1 H: M! ]" R% A: {' v- n o/ U0 K( r
DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
2 c/ e) e9 P5 h; Q8 c
CLight* pLight = NULL;
5 q) U% b! F* Q4 q. ] D
' Z1 z+ T* T5 Z1 `9 r
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
& N. j$ D+ s4 ~5 x. D: U2 F. I: o
9 d, l1 D: b8 h0 s( @* _3 S
pLight = GetLight( "direction" );
" _4 W+ K5 }' J
. p5 T9 n8 V+ t: y1 r
#if __VER >= 15 // __BS_CHANGING_ENVIR
! d5 K( l J8 V9 c% f. m) K
if( g_pPlayer ){
( ]6 I! C) e2 b1 y: t, ^6 o
ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );
! W& u- A9 I ?5 J- V& E
if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!
7 d, y `7 w: d' o) f
{
) D2 t* \8 B+ C6 l
if( pLight )
+ G0 A8 F7 H& B5 p
{
f7 U4 ]- V$ l6 g. R/ H t5 Q
pLight->Ambient.r = pInfo->_fAmbient[ 0 ];
9 O ?/ K& A+ g
pLight->Ambient.g = pInfo->_fAmbient[ 1 ];
8 G" R& X {* E3 v+ y0 v$ R' o
pLight->Ambient.b = pInfo->_fAmbient[ 2 ];
: N' G. b |8 _8 }/ S/ w+ `
% p e0 O' e$ n5 B- C
pLight->Specular.r = 2.0f;
$ v {1 W9 s5 x- o/ a- D
pLight->Specular.g = 2.0f;
; d- ]- d2 H9 C( g
pLight->Specular.b = 2.0f;
7 G. m0 j! d3 P# L, Q: K+ @0 K
1 v& H, b- q9 ^) O. J: N3 i% d" q: U
pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];
2 F2 Y | G# s' q5 L, b+ k
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];
) p* L' a! e4 o& s7 [ p
pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
9 o9 D* V! Z5 Q- _$ I) M
4 z- @" m& d7 ?! O6 C9 r
HookUpdateLight( pLight );
% [) s5 c/ L; k% q( s
2 T/ r: m! M: d
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
# m Z; J3 l& z0 d0 f. h
5 V9 z/ ?* v/ |5 F& i* l
pLight->Diffuse.r *= 1.2f;
+ U( m9 A% X) q o4 H; E! m* n# i
pLight->Diffuse.g *= 1.2f;
4 D% b) d" m- j+ i1 g# J8 c
pLight->Diffuse.b *= 1.2f;
* I" C2 Z: L7 Y; t2 l
2 ^3 {. D' K) Y3 r: v& E9 x
pLight->Ambient.r *= 0.8f;
" V" u! P3 R7 d9 p, o% R4 ]& p: a' Z
pLight->Ambient.g *= 0.8f;
V1 P5 ~' F8 h
pLight->Ambient.b *= 0.8f;
! E+ g$ _( T8 o4 q
5 c* |& ?+ I O7 a1 b, v8 x
memcpy( &m_light, pLight, sizeof( m_light ) );
, h0 G( H1 w; h @) M; p
* Z3 R: X# O4 E0 D
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
5 r. S4 _+ t+ I& a5 M
D3DXVec3Normalize(&(vecSun),&(vecSun));
* W. a2 ^3 o' q+ l/ l6 M% P
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
- q( J) N" D9 w. `
pLight->Appear( m_pd3dDevice, TRUE );
8 _; G( F6 p/ s: Q9 h6 L
2 u, B6 f+ D D* V) `3 ?, T
DWORD dwR, dwG, dwB;
) U8 t& m3 L) k; I( ^
dwR = (DWORD)( pLight->Ambient.r * 255 );
+ |' G2 F+ k- H( n/ ~
dwG = (DWORD)( pLight->Ambient.g * 255 );
3 j1 Y* j/ i% t: c8 D% r+ A
dwB = (DWORD)( pLight->Ambient.b * 255 );
0 O, f# q' I1 `7 l" h
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
, _0 q- S' j1 c3 _4 ~) ~; N. P; Z
}
/ F. p; w/ C- q! W9 |1 l/ l
}
0 c3 @: ~3 [# I5 E
}
$ ?& w0 }) H+ w& s: \
else
W9 P" A+ ^( H1 ^- G
#endif
: G( X4 D/ q: B. y2 g
! f- l; S! J. {3 V
if( m_bIsIndoor )
- B0 d7 j ^5 r6 Q3 N: w
{
8 T# d G: T0 S3 |" ^6 c
if( pLight )
$ _0 X% y7 y3 A( V7 d
{
$ T4 }* P6 I$ t9 E# U% w- j
// à??μ oˉè*
# Q4 j4 t' Z8 d2 V+ H
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;
' Q" J& X2 ?+ B
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;
) C/ ~; n2 \# }( F6 J
pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;
$ A4 j0 l2 ~7 T9 q% D! D6 a5 R$ P
$ i! p+ i& v) X- }/ P) w8 E
// oˉè* ??à?
. a. e$ p0 q4 z: l2 a5 l- o
pLight->Specular.r = 1.0f;
' w1 G8 P1 P9 u$ u8 T
pLight->Specular.g = 1.0f;
4 ~! p k0 K) _$ [/ g/ Z
pLight->Specular.b = 1.0f;
% n; e9 Q$ s8 r6 r$ x& [
// àü?? oˉè*
, p [# q7 q9 r
pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;
2 u7 A: M* c. o) Y
pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;
2 G$ P5 r$ V( K' [5 _, ?" V
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
8 I1 D+ f* a, T5 y% z0 H
! Q( `) l, T. s* b$ ~' M5 V
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
4 R! _/ X4 X. z8 m v. X7 s
{
" w4 B Y* M$ c h0 B
pLight->Diffuse.r *= 0.6f;
; p3 H$ R' t0 t! J; f) Y, Q: |! P
pLight->Diffuse.g *= 0.6f;
, Z1 J8 b& d O F) ~
pLight->Diffuse.b *= 0.6f;
, G: w' K! S9 _ Z2 L# |
pLight->Ambient.r *= 0.7f;
0 d( r4 f' d& K, R
pLight->Ambient.g *= 0.7f;
3 V! V6 P0 c2 q3 C; i
pLight->Ambient.b *= 0.7f;
3 h( [2 P$ ?3 `, ]; F" b2 e
}
6 Q6 y+ g9 Q" ?% I
* K1 c& H- x$ p
#if __VER >= 15 // __BS_CHANGING_ENVIR
7 x B* T: C+ o# i
if( g_pPlayer )
/ v9 K' z8 d& T1 x$ }4 L9 v/ f2 U
HookUpdateLight( pLight );
+ w' j; c0 ]$ N& a0 L2 G
#endif
* i9 l/ ^' M/ a
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
+ x# ?( ?9 A$ R& e
- R8 x" V! F6 E2 A7 m9 d; K" [
pLight->Diffuse.r += 0.1f;
0 Q& J) M ^- G
pLight->Diffuse.g += 0.1f;
2 N7 D' O* n7 a- M3 m$ Z) `- Q! I
pLight->Diffuse.b += 0.1f;
# {* ~; _' J' ~6 Z# N8 ~+ z9 @& I
// oˉè* ??à?
e; A% j; Z, l9 W8 i
pLight->Specular.r = 2.0f;
6 X, Q2 |3 _9 w9 M
pLight->Specular.g = 2.0f;
* V6 Z, D, a+ Y% d0 J% m7 v
pLight->Specular.b = 2.0f;
( r/ z/ ` S, s6 Q) @
// á?oˉ
( ]: e& o: O7 l* s4 I, x
pLight->Ambient.r *= 0.9f;
" b- I2 P' O2 V j; |. c
pLight->Ambient.g *= 0.9f;
' `9 D% r1 F- F& `, y
pLight->Ambient.b *= 0.9f;
% r7 K( L8 M1 [" N$ N R
$ ]' i( |% C9 a, E2 n5 }
memcpy( &m_light, pLight, sizeof( m_light ) );
% D( v* \; W" i2 G
) q# t v8 Y9 { v
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );
% N( ?# u$ z5 e- k. o) A* b: P
pLight->Appear( m_pd3dDevice, TRUE );
/ C/ S: y7 T4 C) {4 M0 f9 k' ~: p
3 o9 X2 G# X1 u8 _- g
DWORD dwR, dwG, dwB;
0 p& G7 Y8 d6 f" T: |2 C8 {( C
dwR = (DWORD)( pLight->Ambient.r * 255 );
3 `. d, D/ U* U9 }4 s+ S) |. H' I$ \
dwG = (DWORD)( pLight->Ambient.g * 255 );
+ ^6 x6 L& H& |$ I! N
dwB = (DWORD)( pLight->Ambient.b * 255 );
, V! m% j+ O' I* n+ K, U# e
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
; z# S. c3 Y: u0 p ?* f
}
3 L ?- x3 p& d2 _
}
) ?4 B+ K9 n/ N" {, g
else
! }7 ?4 y8 N5 G
{
7 Q0 d, D9 q- t
if( pLight )
1 Q3 U0 @6 v. ]# O
{
1 |% f* I% g6 Y( Z2 a
9 o6 m n, q5 X1 n) J
int nHour = 8, nMin = 0;
! I- g/ s9 |6 I% c; e7 w
#ifdef __CLIENT
0 B( ^3 j& e: _* c$ _* i7 O$ [
// ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù.
: H4 x; G8 ~: z9 G& e
nHour = g_GameTimer.m_nHour;
$ x6 E" j3 _2 m7 M9 u1 j
nMin = g_GameTimer.m_nMin ;
' ^ f4 p# Z* w, L R
#else
O9 r( I$ |0 T
// o??o??′? ??°£à? m_nLightHour???* °?á???′ù.
7 M0 M* @# r" j2 k! W+ [% r
if( m_nLightType == 1 )
) G6 D9 l S6 C6 `
nHour = m_nLightHour;
3 p+ @& i" n( g6 h+ d7 v
#endif
& y/ \; |- W/ X0 p) _
nHour--;
3 N. c: W4 J& \ x9 A# |( R
if( nHour < 0 ) nHour = 0;
# Q+ a! M6 `& E2 U: @
if( nHour > 23 ) nHour = 23;
6 \( O' }* K2 i
* d/ [9 P, y i3 ]9 I# @
//if( m_bFixedHour )
9 V- C, K) A U/ t6 p8 l) M
// nHour = m_nFixedHour, nMin = 0;
. l; M6 D6 M7 O
LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];
" X) L; Z7 v' B# v
LIGHTCOLOR lightColor = m_k24Light[ nHour ];
( O& e9 g6 w* u
6 l( W8 a+ n4 M5 l
//m_lightColor = lightColorPrv;
& `% l4 p& m [
lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
t' U& b: ^/ i4 z3 H; N5 Q1 M
lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;
6 Y/ z; {2 m% ^: Y
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;
/ }' O3 A5 r; q8 F+ {
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;
( U" f# L0 n% g' z" M8 C
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;
$ N+ Y+ K9 `! h2 X& P u
lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
9 |+ I$ L$ K4 Y& |& a8 s
// 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)
5 {/ b; c: z0 Q- o+ F% A5 X3 n
- c$ F6 P2 E- F7 r* b
// à??μ oˉè*
4 I) I( s' L0 N+ x( a* v2 ]
pLight->Diffuse.r = lightColorPrv.r1;
/ n' [( G# } n6 h% M) N3 D
pLight->Diffuse.g = lightColorPrv.g1;
# z- p& |1 Z! X1 A9 S
pLight->Diffuse.b = lightColorPrv.b1;
6 t) x' k) h0 B) K: L5 M; \$ ?8 ~
// oˉè* ??à?
9 T* i6 f7 G7 i& b
pLight->Specular.r = 1.0f;
. \8 a6 E$ _4 ~4 Q5 y# v% ]
pLight->Specular.g = 1.0f;
P- {# `$ n8 ^
pLight->Specular.b = 1.0f;
; H" |+ L8 _, W3 V1 |4 A# X
// àü?? oˉè*
% `8 f% v- T5 T: ^7 n
pLight->Ambient.r = lightColorPrv.r2;
* F B- R: I' s+ S* s) A" Y! @" p
pLight->Ambient.g = lightColorPrv.g2;
E5 \4 ^( F8 d! N* ]. c6 k. z
pLight->Ambient.b = lightColorPrv.b2;
# w4 D7 V7 c' P% k# I& u
8 Z& K) v) z2 r4 j4 v: l, `
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
2 d+ ]6 y" O$ U$ P: Z, b
{
?/ k" Y9 ]/ O+ M1 J, w
pLight->Diffuse.r *= 0.6f;
) m% L" w; V5 Q- Y
pLight->Diffuse.g *= 0.6f;
& j6 ]1 C2 U' `. R) g9 k9 ?
pLight->Diffuse.b *= 0.6f;
; M5 J' g1 J4 y0 Y6 h
pLight->Ambient.r *= 0.7f;
$ J+ u' K( n) e( g4 R( G
pLight->Ambient.g *= 0.7f;
& u: V) X) x( O+ ~
pLight->Ambient.b *= 0.7f;
5 x+ E9 n% A8 w; L
}
+ \: F+ @0 c/ s' w+ G
4 Q/ C. z! _4 u
#if __VER >= 15 // __BS_CHANGING_ENVIR
' _- ]* D% ?' B: R! I1 X/ U4 b: `
if( g_pPlayer )
$ @3 w# c- h5 t; Z
HookUpdateLight( pLight );
7 O# M! L- p! Y! K
#endif
$ V/ |9 E% J8 M. d& B1 ]. u
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
7 a" [: @; r3 P
, |3 ~6 w- k( }9 B4 H
#ifdef __YENV
- e( t" }) \5 R; C2 P% a: _& |( u
pLight->Diffuse.r *= 1.1f;
( d; @0 l$ y7 q* U* w
pLight->Diffuse.g *= 1.1f;
1 N) Z% Z+ s6 ]% m
pLight->Diffuse.b *= 1.1f;
7 r; R7 J$ N1 E4 {# o
// oˉè* ??à?
) F$ H3 ~: v4 P1 s
pLight->Specular.r = 2.0f;
+ u* G1 R( v, W2 S$ {
pLight->Specular.g = 2.0f;
4 F% z8 O7 _$ x$ K
pLight->Specular.b = 2.0f;
0 D; m K! f1 N+ n% R2 L) r
// á?oˉ
1 i" m3 z* i# o5 S- l5 t) ?/ L1 E
pLight->Ambient.r *= 1.0f;
$ L) Z/ o& K- B
pLight->Ambient.g *= 1.0f;
8 q L+ G- A) P, J
pLight->Ambient.b *= 1.0f;
! b! W; {! D5 \) X2 h
#else //__YENV
+ L ]* B8 J% _
pLight->Diffuse.r *= 1.1f;
; W' b$ d/ _: i
pLight->Diffuse.g *= 1.1f;
* [6 v* \. k- q; D4 p* s* o
pLight->Diffuse.b *= 1.1f;
0 }# l2 s. }/ }& K+ W. w% W
// oˉè* ??à?
! H0 x5 G- ]# |( v% L5 N$ |6 }# @
pLight->Specular.r = 2.0f;
. c+ c& Q, J7 M9 i$ O
pLight->Specular.g = 2.0f;
! O. V7 J( \. y8 b# J
pLight->Specular.b = 2.0f;
6 N! O0 y( q1 X9 u) F- H
// á?oˉ
: C h. \; ~4 x0 r6 q5 r
pLight->Ambient.r *= 0.9f;
" m. i5 e9 B# `3 i! X2 b3 c
pLight->Ambient.g *= 0.9f;
8 y! O* l4 b3 L6 V( O; f+ O
pLight->Ambient.b *= 0.9f;
' E; c( j; e1 Z* \" T; Y! l
#endif //__YENV
8 @ f7 e) ?1 T$ i. z
3 K: ?9 b5 z: m. d. V
memcpy( &m_light, pLight, sizeof( m_light ) );
% p/ E8 Y8 I. ?6 ~4 }/ t3 p% R& p
$ O+ W3 [) U% N# }, R7 v
D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);
& ^! O4 U7 y3 T4 }4 }) E) |
D3DXMATRIX matTemp;
# {0 i1 D- U; c0 l( i! @! g
static const float CONS_VAL = 3.1415926f / 180.f;
" s* Q* _ o* V& \# g
' ~9 l9 G! h4 ^/ U0 ]
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);
0 l8 F/ P6 h3 Z2 r& G' d
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);
: ^7 A3 D* b- ?( y) v
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
: z8 q$ C" e# g' z4 p7 J, k
pLight->Appear( m_pd3dDevice, TRUE );
6 ~" U: y) t, q& G
/ h) h6 G- R- J I3 M" m: B; T( t+ v
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
, v* g0 r1 m& I& \& m; \
// D3DXVec3Normalize(&(vecSun),&(vecSun));
+ J7 h$ Q+ F, m& }) ~
// pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
, E9 C$ u m4 d" B% V' z+ C' G
! m& \% o( w! L# T" ?
DWORD dwR, dwG, dwB;
$ c9 V" X @: ^( Q4 I1 i
dwR = (DWORD)( pLight->Ambient.r * 255 );
! e+ I" v- K8 K# r3 ^6 K& j9 Y5 q
dwG = (DWORD)( pLight->Ambient.g * 255 );
7 ]8 Y a* ?8 |1 S
dwB = (DWORD)( pLight->Ambient.b * 255 );
5 }, h5 b. V$ s' n3 a) e# U6 O
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
4 T0 |9 n3 @+ T7 { g# B# }
}
" q& C3 e! ]$ S! B3 U% } u0 A
}
" ]) m# P8 j' v2 [
4 ~5 s. |- P" z& }( Z. l% ]1 x
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );
. p0 }' n) q0 L: t% [% y
m_pd3dDevice->SetRenderState( D3DRS_AMBIENT, dwAmbient );//D3DCOLOR_ARGB( 0,0,0,0) ); //m_dwAmbient );//D3DCOLOR_ARGB( 255,128,128,128) );//D3DCOLOR_ARGB( 255,50,50,70) );
# a b0 _( O2 A0 [/ J/ Q6 z
::SetLight( bLight );
3 t7 @- o4 E$ \4 m5 E: @3 U1 a
. d2 B, p* y2 |, j, n
// ±ao? ?D?í???ó á¤à?
' O( Z- d4 m' a6 u0 H
m_pd3dDevice->SetMaterial( &m_baseMaterial );
8 r) S: L [( d. s* f
: P# e% S+ J( s. j: t, t& c
#endif // not WORLDSERVER
! m. G: d! v) d- l7 X) I& X1 o: M
}
" ^ o- L7 e& U5 w* D
并更换
8 q* {+ b( }0 z% k
Code:
P6 K2 c- X% F+ I I7 \
__FLYFF_INITPAGE_EXT
) K9 ^: o: X7 |% G7 ^2 ]
定义
4 f5 a' G& ]! n3 w( f
3 R8 i; k( w6 z6 J8 h: j9 U( i
3 _8 v( D# V& p2 A7 q1 r) a
; f s6 D6 S/ E' v% r2 i* N
1 g( O* ~: f: n8 H3 j g: A9 V
现在终于删除我的狗屁加速...
6 ` ^$ c2 u& c8 L
$ y, Z4 f g/ j
+ |1 I% }: o1 p
) l3 ~: N$ m$ A# ?( A
欢迎光临 飞飞世界论坛 (http://www.ffwold.com/)
Powered by Discuz! X3.2