飞飞世界论坛
标题:
自动饮血和登录视频
[打印本页]
作者:
admin
时间:
2016-1-10 03:46
标题:
自动饮血和登录视频
食品车:
+ a0 f7 b% A) d# v8 I# X
尾翼:
' T' Q4 Q; P5 ?, n3 f! ]8 y
9 G+ Y+ j# l e) J$ Z
代码:
! r# S+ i9 t6 J
CWndAutoFood::CWndAutoFood()
5 [6 h5 G! P5 w5 d, a( J" @6 j
{
2 R& I) o n' _7 R* v
m_pItemElem = NULL;
% [& `' N+ ^2 O& x1 `. X
m_pTexture = NULL;
6 e# r# t! _, o7 ~9 @0 w, l
bStart = FALSE;
" R2 x ^0 G& N) n
}
! i; S: M$ m; a# m! `9 w
/ @0 e: h! u5 E& `, T# F$ k' _
CWndAutoFood::~CWndAutoFood()
7 C0 V; F) N; M8 G) Q3 @3 a
{
' T1 T1 U9 \: C
AfxMessageBox( "AutoFood ist gestorben
" );
$ }6 f0 t& v- D5 u
}
! |8 R! G$ v3 y0 B- F
BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
# L, ^' O- ?: J6 ^7 {
{
& Q$ _' ~. J+ m' G% l8 [
return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
' `. o/ w9 |& P% f
}
. |( S8 e2 f9 m; K, ^
0 _8 j' \7 w; C" x
BOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
6 G3 T6 H) ]2 Z
{
+ P- s& } u3 B) s4 K) g% r
LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
5 n- y$ ^3 m. N" P3 V: }
CRect rect = pWndCtrl->rect;
5 P. W, a) B* s
if( rect && rect.PtInRect( point ) )
8 V/ Y' Z0 O! Y; Q5 y+ ?
{
7 M8 T- K2 Z$ g+ i
CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
6 i! e- p0 u$ T1 u) n
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )
$ |* s( y; e1 |9 V/ o! K; o
{
* r% Y3 l) T! c1 f
if( m_pItemElem )
) O+ }& h- l* B9 N
{
" m" F& t' i' K3 R$ Z# V5 x' c
m_pItemElem = NULL;
6 H% F# D" r0 ]* }3 Z+ o
}
+ g% f: {$ I) q
m_pItemElem = pItemElem;
$ \$ J' N. p# b4 ~; V' [2 ]0 b4 w
m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );
& d, m, R! i4 G5 J% O
}else{
9 S, _7 _5 _ t4 b, p
SetForbid( TRUE );
/ H& c! Z' O6 p9 F, N
}
4 Q, n& z+ }6 o: ^
}else{
0 E1 m v a3 W: H
SetForbid( TRUE );
$ x; J/ A' X; {$ ~& w1 K u
}
3 |' g9 D$ p" L
return TRUE;
' H( @( Z, W9 I7 Q9 I
}
6 E) t3 S: v# R9 m
9 n; ~+ R# E/ I8 h8 @
BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
: _. z4 w/ \6 q7 H) |: d& J7 w
{
0 |1 j) C, W7 p5 @5 r
switch( nID )
/ f% x5 J% n$ p. J( `
{
% ^/ A6 c# X1 ~
case WIDC_BUTTON3:
4 p6 [+ F+ w" t: Y- G- S
{
1 e/ o# s2 _ h3 y4 x V# p1 J
bStart = TRUE;
( ^5 H( b# J8 s2 }
break;
4 t! o3 y0 _7 `/ [; _" Q; y/ R/ s
}
! G, E$ J7 T9 w% {
case WIDC_BUTTON4:
: |9 b E7 u9 R+ F K0 D6 g5 Z, s% N
{
P, w1 ], E1 O7 f( S& D3 @- Y3 y1 R
bStart = FALSE;
( k* |$ a; c# Y
break;
$ R4 u1 e" |; W7 B- K
}
: e& B3 x( m4 o% i8 [6 f
}
! L2 L9 o9 m. T
return CWndNeuz::OnChildNotify( message, nID, pLResult );
( K, w% F! O1 C% D
}
6 T4 w& `: j% l" @7 w0 c' i0 Q
void CWndAutoFood::OnDraw( C2DRender* p2DRender )
# u. ^8 q6 ?# i: H
{
7 ~6 g9 s3 }4 s$ C
CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );
* t% w$ [6 n4 M9 F, r
if( bStart || !m_pItemElem )
+ O+ G, c' |8 v5 W
{
6 a/ T0 x. {5 l; Y, ` H. P
pBtn->EnableWindow( FALSE );
/ g9 M8 Z$ [8 k% V# H' V# F
}else
7 J6 @5 e8 `# h/ |1 S7 I7 l
pBtn->EnableWindow( TRUE );
* t* T& {( b+ d/ T) a3 {+ [! ~
if( m_pTexture )
- g( A4 b5 ?) ]0 j9 D! Y
{
# O; j" H. S5 G8 w8 Y4 s
LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
. x8 o5 S* T$ U) F6 W! X
if( wndCtrl && wndCtrl->rect )
$ j6 H# d0 F, |( i5 c. l4 }! ^) Y
{
, v, O5 h# w" A) ~/ x; h
m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
- H6 P$ I) z4 P+ W8 C0 ?
}
$ N; d' |" N( r0 N6 r& H: w
}
* T7 h t# O" N) V$ s% A+ S% e
}
& r% _8 @$ a8 M- w( P
' a; {3 q* C) g5 _1 z" f3 W
BOOL CWndAutoFood:
rocess()
. I/ M' f) _: |. H D* U
{
( ]7 i! c+ Q. A+ t3 R
if( bStart )
% k* T- b7 l. t% k4 P; c# g
{
2 `* G8 C( W! l8 `9 ?- f
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )
5 c) b- M8 P3 n" q. @
{
0 d2 q. Y4 b* m" G. j% H5 }. D# S
if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )
3 O+ \& w0 `9 r1 ~, A
g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );
4 }; e- d& s) ]& z( ]( T
}else{
& G/ R& D& Z$ \; w$ _& }/ v# H
bStart = FALSE;
& Q0 o: H' g& s" a0 L+ y
m_pItemElem = NULL;
8 _. q/ K# t) V: g; ]2 r4 H
}
* W2 F+ ]. t, t, I0 h! Z6 \
}
7 j) Z4 {# r( \. y+ I
return TRUE;
: N" d7 W/ c0 U
}
9 m1 G2 {3 [9 p/ U, _& j, ^
/ [3 K$ T4 l- W; b
登录视频废话:
! S" J" E) r$ N- `& g" H
尾翼:
9 {/ R9 t* C( c4 ?% j7 v8 r/ X( W; a
7 m9 z) @8 W% n$ ? \3 L
代码:
* B) ]& A% B# u- A; {' i
$ X& A( O1 G/ Q( e
void CWorld::SetLight( BOOL bLight )
* p; ?5 }3 @7 K% o6 b1 a
durch
$ C1 t* q% G2 {/ J3 B( _7 g
Code:
2 f4 D3 {1 L. Y0 n
void CWorld::SetLight( BOOL bLight )
( F3 d+ {" N2 ~1 v, J
{
' i# I! U5 Z" T% @# ^; F$ ]1 n7 n n
//ACE("SetLight %d \n", bLight);
; S2 o- W8 [( o
N" b2 d j6 W8 ]3 V
#ifndef __WORLDSERVER
( B4 s' K3 L* e0 [/ |! h
DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
+ I: y/ D! ?& p/ P. F
CLight* pLight = NULL;
' X3 C4 S' B" X# ^* Y
8 k m+ L9 D5 N" b+ R- P' b
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
" W0 R. |" q6 Q% h9 v' Q% {
/ Q6 s, f* d- ?- t/ \9 \/ p7 N3 J
pLight = GetLight( "direction" );
4 C. p& ]" Y }& b3 Z% N, P5 G
% \3 j& u, n4 X6 Y0 l* ^
#if __VER >= 15 // __BS_CHANGING_ENVIR
4 S; z' M# V+ w
if( g_pPlayer ){
+ p2 R7 K6 a7 O+ H6 O$ R0 d
ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );
+ F8 M$ K9 y3 X' u7 k" |1 x/ |
if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!
- E+ [1 s/ |* f$ c' ]. s. i
{
# ^4 k8 G# O( C4 N2 Z/ c, P* \' ]
if( pLight )
6 I% c" N: ], ]8 }$ }* o
{
1 U! B* s$ z2 `9 w$ R
pLight->Ambient.r = pInfo->_fAmbient[ 0 ];
) V* g) H$ I5 H
pLight->Ambient.g = pInfo->_fAmbient[ 1 ];
! n3 Z+ a* d9 Z
pLight->Ambient.b = pInfo->_fAmbient[ 2 ];
8 D( h8 y. e- B+ V3 |: n
+ n8 y( c2 ?3 O5 d( V Q
pLight->Specular.r = 2.0f;
& }$ c d5 O" [, @# X! M5 J
pLight->Specular.g = 2.0f;
9 \ `/ [5 k4 r6 o ~ ]/ t. f7 ^$ S% k
pLight->Specular.b = 2.0f;
3 u, d( S1 ?& G
. q3 [3 I5 p! a' E0 j% r' p
pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];
, t5 G7 P$ Y5 k0 H" Z& {1 \0 A
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];
' Y! i5 A+ I# j9 S( O' A
pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
9 b( y7 n1 w* F9 m( f
. d6 h5 E- i+ s3 e1 E4 W& f3 W3 W9 l
HookUpdateLight( pLight );
/ U0 N6 y- j* x
8 S1 ^0 Z, l9 h. Y1 Q8 C) }
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
" b1 n/ S1 j% | F2 A0 p3 S( w, X
+ V! ^; _+ _2 C2 l
pLight->Diffuse.r *= 1.2f;
) |) `; Z3 i9 x) R
pLight->Diffuse.g *= 1.2f;
. k6 T" Z {+ q5 K5 d
pLight->Diffuse.b *= 1.2f;
7 w4 Y3 ~) V8 [- P* r
# L. Y( L, x9 B) Z
pLight->Ambient.r *= 0.8f;
+ W& u* y5 j0 H! F4 x
pLight->Ambient.g *= 0.8f;
9 u# k! F- v! ]- k
pLight->Ambient.b *= 0.8f;
1 K f& h: u7 r% W) X
: j2 w4 a/ B, t( c
memcpy( &m_light, pLight, sizeof( m_light ) );
3 {- `, a/ Z5 X- ], _0 S
( F+ p6 ^, E( x" `$ ^3 f7 C) S( u- \
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
' T, \& z# m* U, |* P" v
D3DXVec3Normalize(&(vecSun),&(vecSun));
% y1 R0 |7 G7 D, @
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
+ W/ w: ], F, p: N( [
pLight->Appear( m_pd3dDevice, TRUE );
0 l6 z# e6 z& ~' s+ W$ Q; b0 ]2 h
2 l' ~' Z% k) _6 ?
DWORD dwR, dwG, dwB;
. ]. E" \5 g; ~. d
dwR = (DWORD)( pLight->Ambient.r * 255 );
+ u+ A4 C- G7 x& F& z6 d
dwG = (DWORD)( pLight->Ambient.g * 255 );
5 X7 [% k2 P$ t+ G" M. v+ X
dwB = (DWORD)( pLight->Ambient.b * 255 );
8 H6 y* F7 v K4 ]
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
# ]5 C6 ]; Q8 m3 c
}
q' Z& K9 d+ Z8 f
}
{' ~0 @5 {6 \/ [: u4 d- y; S2 v8 O
}
9 m# B/ F( ?! S- B
else
2 d; P2 K( `( g$ g5 j
#endif
3 `* ?) l# D' d# A! P
1 q8 [) e: K7 t; M
if( m_bIsIndoor )
E: `. }% Y# ?7 z! H4 M6 \9 N5 a
{
& p# D# c& N% S- l, I5 A/ o
if( pLight )
. ?2 W$ l/ U- G x' b0 Q- D
{
8 b1 H( d* F. w( e6 K! c' e3 J
// à??μ oˉè*
1 o# @! p8 m5 u6 w
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;
5 j2 Y7 m% I1 k. O' [! M1 Y
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;
; ?, y) f# `! }$ F+ _' j! Y& s
pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;
; w+ D# U; ~) {3 o- v" v+ P; h( N- _. B/ ~
* P* n6 q5 ]! K2 p, g
// oˉè* ??à?
: L0 ]( ^9 t) a9 h
pLight->Specular.r = 1.0f;
( @0 _) }# \1 S& `' d' O
pLight->Specular.g = 1.0f;
7 F! n, H: J% U0 h; X; n/ w3 y7 P
pLight->Specular.b = 1.0f;
5 j6 V; U) I; M r6 V- j
// àü?? oˉè*
' z7 n# k& c, d
pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;
9 J2 ]2 @' d, y5 {) C* W
pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;
; @. g: W5 F3 x
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
6 o6 _! g; k/ K5 ~- n4 I
4 ~4 Z, |! T- Q, a+ T L* T
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
. i9 {) p9 S+ K1 C% ]* Y8 Q
{
; q8 w- U: q7 P8 N. w v2 o7 C+ ~
pLight->Diffuse.r *= 0.6f;
* _. v8 j1 s2 V. n. A% @
pLight->Diffuse.g *= 0.6f;
) c8 s2 w+ d/ G1 N' r
pLight->Diffuse.b *= 0.6f;
: m4 f/ A# x. D |
pLight->Ambient.r *= 0.7f;
- i- @( _. W$ s2 _: {5 Y
pLight->Ambient.g *= 0.7f;
; p' Z1 U# z) n' Z3 |
pLight->Ambient.b *= 0.7f;
1 z) }5 b! y m
}
2 q Y, v' S' \' a6 Y
9 \( }, o# P. B$ w% w- j- O2 K& v% t
#if __VER >= 15 // __BS_CHANGING_ENVIR
$ E/ x3 R( W# l: }5 X; T
if( g_pPlayer )
+ a0 N! a! `; a- f" A) I1 a; n6 U
HookUpdateLight( pLight );
* G+ N& S e+ z( c
#endif
, L+ Q( P# A' s" M
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
- S, p. [( o% H: q
% V. s% F' [4 l8 D, h* m
pLight->Diffuse.r += 0.1f;
. h X$ w' h g7 r7 d6 v
pLight->Diffuse.g += 0.1f;
5 @& P7 V- U/ I% e+ T# w
pLight->Diffuse.b += 0.1f;
- N2 w9 t) W/ d
// oˉè* ??à?
' U* p8 @) C* N- M$ q$ s; T
pLight->Specular.r = 2.0f;
/ Q9 n( g4 C. x& o1 J ]0 K3 l. m
pLight->Specular.g = 2.0f;
# Q3 t# C+ W. J1 ?% }
pLight->Specular.b = 2.0f;
) W: h$ I, e/ Y8 a( r+ v
// á?oˉ
- [! N' q& R, A! T8 g4 J. x
pLight->Ambient.r *= 0.9f;
3 [* U. F: t+ s# u
pLight->Ambient.g *= 0.9f;
4 L* ?" Z& W/ ^% H4 h Z( B( N3 d
pLight->Ambient.b *= 0.9f;
2 l. @% A8 |! A2 t6 X" c
' r! p |( v3 Z
memcpy( &m_light, pLight, sizeof( m_light ) );
3 L- w6 w" j! a1 M" t, \9 g6 e; Y
3 H! c. c3 q, _: }8 _* c* l
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );
" ^& l: J7 e* Q) j
pLight->Appear( m_pd3dDevice, TRUE );
. e7 v( w; _) X0 K# f" _6 N
w5 C5 @! c& d
DWORD dwR, dwG, dwB;
; o. ` i. c: a, G4 s) z
dwR = (DWORD)( pLight->Ambient.r * 255 );
" _7 z7 A2 h7 ~$ L! r4 L ^( b$ D
dwG = (DWORD)( pLight->Ambient.g * 255 );
5 B5 \8 \6 t6 |0 E& \& ]1 g
dwB = (DWORD)( pLight->Ambient.b * 255 );
1 r) L; C/ F/ N
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
, c: [) n a7 d0 f- `5 F4 W
}
w! U# T5 { f
}
) @( Y- J9 e4 h d8 J7 ]0 Z
else
# s- m8 b+ L; @& L! F$ q+ J
{
/ {5 j, e& r8 p$ h( y
if( pLight )
8 k3 x0 P) j: t2 f9 ]$ i: R
{
( j e3 R. M4 k- v2 H3 R& R
' x0 i- U# ]6 r ^) P" o7 U
int nHour = 8, nMin = 0;
2 e1 D/ T4 E. s2 a
#ifdef __CLIENT
8 l' N i2 }5 }. C& j7 ^
// ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù.
, R+ m( Q/ m! n
nHour = g_GameTimer.m_nHour;
+ P" k5 t9 ^2 s0 p5 D9 a; N
nMin = g_GameTimer.m_nMin ;
+ x5 X; |! f- {, C' ^+ ^6 N
#else
5 \' W! }7 H. ~1 p) U
// o??o??′? ??°£à? m_nLightHour???* °?á???′ù.
$ |4 u( `& G7 J( \" \# d
if( m_nLightType == 1 )
( e! r8 O! R, Z1 `+ M* y% s
nHour = m_nLightHour;
% T1 |4 q+ D/ |# G3 T
#endif
! V* {; B3 c& M( i, G! X) v2 n `
nHour--;
|! {0 @( r' P+ t" C8 t7 w$ E
if( nHour < 0 ) nHour = 0;
, d. U: ]( f4 T) z9 B6 f
if( nHour > 23 ) nHour = 23;
6 G- e# h- W5 \, K& `
& E! f/ k% G* B* f
//if( m_bFixedHour )
9 D' Z7 F+ { d' O% |8 O! m" y
// nHour = m_nFixedHour, nMin = 0;
& |- w j) `$ | }: T9 l. L$ u& ?
LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];
3 k6 P* d- y/ i6 t `# g. A
LIGHTCOLOR lightColor = m_k24Light[ nHour ];
: O2 p% k# N+ E" n! f; o2 l# R
* t2 s% l: @0 L8 Q! W
//m_lightColor = lightColorPrv;
6 c' P( f, a2 X' `
lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
) r: [: C& x, v3 A- J0 J
lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;
: @5 B8 q/ G, p6 P2 `- D; ^
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;
* P: |1 P d# ^) A( `4 h) X. W% }
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;
: X( l% t7 X( t( w
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;
) N O, |; B9 ^: F E
lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
& ^& y) W) f R3 _7 D& K. g
// 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)
9 c, Y& \; U3 W B4 g
+ e+ _! N# F' z1 H
// à??μ oˉè*
) E% }4 |8 Q9 B" ]
pLight->Diffuse.r = lightColorPrv.r1;
7 E( i/ C& ]0 o4 S: T; {
pLight->Diffuse.g = lightColorPrv.g1;
7 }$ P. C# S4 j0 Q
pLight->Diffuse.b = lightColorPrv.b1;
% ~; `+ n& f# |: S
// oˉè* ??à?
" v+ a2 k* o* D5 X
pLight->Specular.r = 1.0f;
/ ^/ d' B2 h! j1 h& W
pLight->Specular.g = 1.0f;
' `5 @) P1 H6 G( \) S' D# e
pLight->Specular.b = 1.0f;
# ]( w# ]% N, ]7 y5 q+ ]1 J
// àü?? oˉè*
1 E$ p3 S; A+ z$ ]% z
pLight->Ambient.r = lightColorPrv.r2;
: ^. u1 P6 `/ G2 |5 T# x
pLight->Ambient.g = lightColorPrv.g2;
) r; Y2 `0 J0 }$ B- x9 I
pLight->Ambient.b = lightColorPrv.b2;
8 j9 h4 [" \' m# Q" M6 t; U
/ g: f$ J9 n/ {4 A$ |
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
8 D! r k7 c& V7 y2 J `+ A
{
0 p" G8 d6 B1 e* l- G, R
pLight->Diffuse.r *= 0.6f;
! J" L, `9 s! u: Q
pLight->Diffuse.g *= 0.6f;
+ ]' N- J% l0 N0 v8 `
pLight->Diffuse.b *= 0.6f;
/ a( l9 T2 D% ~) E" `
pLight->Ambient.r *= 0.7f;
) ^4 U$ P4 Z, O2 v; d( f* f; H& v
pLight->Ambient.g *= 0.7f;
& n4 I4 y' r" M! A( T! E
pLight->Ambient.b *= 0.7f;
* g1 N* Y! [; o
}
4 M0 i4 ~. c- e2 S4 c3 w5 \
+ O C7 n6 X6 U$ j1 G6 S' m8 ~
#if __VER >= 15 // __BS_CHANGING_ENVIR
8 w# R* e, {# F m) u
if( g_pPlayer )
5 X* d2 `. y3 i9 W% E1 O
HookUpdateLight( pLight );
( m5 Z1 |* k9 Q! q7 i s- C
#endif
' O6 g: y; m- F+ D& ~6 U* {- @( J8 x
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
4 Z) f9 O5 _7 N, ~1 p) L( H$ y
& a- P5 `8 `! F! o
#ifdef __YENV
8 R7 T- B! r( s! u! S; D; h
pLight->Diffuse.r *= 1.1f;
; q b' |/ I0 O+ `
pLight->Diffuse.g *= 1.1f;
- F9 D) C' S5 j
pLight->Diffuse.b *= 1.1f;
4 C) e0 s6 g# X, |0 ~ `
// oˉè* ??à?
& X8 ~! n0 [6 D: [; H+ o
pLight->Specular.r = 2.0f;
7 M0 X$ J& ]2 v% q8 m6 Q, t3 m
pLight->Specular.g = 2.0f;
+ {4 E" \# a' j& m5 B
pLight->Specular.b = 2.0f;
) u, |" D& M9 `' u
// á?oˉ
; t0 W% M. k" j; s/ M$ ~5 `0 L
pLight->Ambient.r *= 1.0f;
l: @+ ?$ `" [3 ]$ |& Z
pLight->Ambient.g *= 1.0f;
2 w z7 f' a* e* A8 g4 }
pLight->Ambient.b *= 1.0f;
# {) e+ B$ Z9 S6 F' g
#else //__YENV
' {9 B- l' E1 L4 U2 v1 g! r
pLight->Diffuse.r *= 1.1f;
3 ~' r" P( f& T; _+ V' z
pLight->Diffuse.g *= 1.1f;
8 k8 s+ s! ^$ H! D/ c
pLight->Diffuse.b *= 1.1f;
' A2 I+ `# O$ T$ l
// oˉè* ??à?
' X z8 X6 D$ y
pLight->Specular.r = 2.0f;
5 F. G2 n* N: F# ~
pLight->Specular.g = 2.0f;
: m: z3 J. S9 U$ o
pLight->Specular.b = 2.0f;
# h9 l' |3 b7 B$ _& L
// á?oˉ
. o& d D0 o. Q# e8 B
pLight->Ambient.r *= 0.9f;
1 |0 m" B: b' ?1 A
pLight->Ambient.g *= 0.9f;
2 J* v/ D( f# N& [/ F4 _
pLight->Ambient.b *= 0.9f;
D; v4 B- _9 j. i
#endif //__YENV
: t6 r9 Z& j" Q$ D1 V
9 Y/ n$ n) v4 M, S
memcpy( &m_light, pLight, sizeof( m_light ) );
% w. {1 k2 S+ m
+ u& c, ?' S+ c2 E# l) z9 i9 r; a( i5 y) C
D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);
4 `( L5 @% }$ V# ?1 b
D3DXMATRIX matTemp;
' ^; c& k# N0 ^: ~# @
static const float CONS_VAL = 3.1415926f / 180.f;
: n7 ]0 F9 a; k" @8 H
! V8 x2 B5 D5 v% {( t! |
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);
" g, G+ O* E/ D) q* n1 a, v
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);
& h+ |8 b6 W' ?' ?: B: K. Z+ |
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
. T3 m( t; {6 C, {. Y
pLight->Appear( m_pd3dDevice, TRUE );
1 D: e+ x: ^: |7 Y. [8 G0 } H
1 \# c5 \$ N2 U! s7 F
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
2 g2 _2 o7 s1 k! R4 X, i) g5 P3 C9 F
// D3DXVec3Normalize(&(vecSun),&(vecSun));
' `+ @1 H: Z) S y6 _
// pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
% b8 m; i) G5 e& h7 t
3 u6 v8 {$ J* h3 B5 s' p. P
DWORD dwR, dwG, dwB;
% s; C) j, X# m' x
dwR = (DWORD)( pLight->Ambient.r * 255 );
4 ?+ W0 y/ }1 o% z
dwG = (DWORD)( pLight->Ambient.g * 255 );
9 Q& m( t0 k/ L8 @
dwB = (DWORD)( pLight->Ambient.b * 255 );
3 F j1 J- ?4 Z/ O
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
4 f* f k( N) P
}
1 v6 G6 g- s5 s+ W) |. @
}
0 X" r, S4 z8 A* m2 r( ^
' k1 ^- Q1 h/ ^) N; R( t$ L
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );
- |. r9 o2 p9 A/ k) [" l" ^
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) );
# b v6 H0 m0 W7 G
::SetLight( bLight );
. J/ c! D( _4 l$ c, K) ~" d6 z4 ^
! O: A o* l8 _* S7 V' _( J
// ±ao? ?D?í???ó á¤à?
, b5 t1 T, ?! y! w' q6 r7 P" m' r
m_pd3dDevice->SetMaterial( &m_baseMaterial );
6 u/ n7 Y7 b8 \2 h$ B1 X
/ g- I, {0 x1 |% H/ C6 c- F/ b) r# G
#endif // not WORLDSERVER
, i, t- b% C; V9 h5 M
}
/ M* I# t9 f9 Z* k4 a1 X
并更换
, M" L! ]" B+ R. k3 q, `9 [
Code:
1 A% i: ^, N/ h8 K* U5 ^
__FLYFF_INITPAGE_EXT
8 z2 d* c! r* [ ]8 q' j( h
定义
X: Y1 U. W& X9 ?3 d6 a& _* ]. Q
% h8 ^) u9 B/ w! r& D
4 k! w2 p$ r7 d; v$ y R
. M! o# u* ]0 I, z6 {; i
* E4 V4 U/ {8 e& V
现在终于删除我的狗屁加速...
; n# N2 _) G2 C' M& v* c
, H8 ?! _. t4 @& h
) v& l3 v) W g" E3 u
4 \6 U% r* u- A& ]7 U
欢迎光临 飞飞世界论坛 (http://ffwold.com/)
Powered by Discuz! X3.2