飞飞世界论坛
标题:
自动饮血和登录视频
[打印本页]
作者:
admin
时间:
2016-1-10 03:46
标题:
自动饮血和登录视频
食品车:
1 C5 `& W7 d/ C3 g! O1 \1 ^ C+ R
尾翼:
. [3 R# v) H( Z7 v0 _
9 u/ R& q$ Q6 b% d
代码:
5 z/ U3 \5 E3 {0 T! D7 K: x# q
CWndAutoFood::CWndAutoFood()
' s9 K1 m% K! ~5 b1 n) G
{
+ Y( o- z4 T( j
m_pItemElem = NULL;
9 k2 {2 r" ?0 v# Q! e
m_pTexture = NULL;
/ g1 |* E7 r/ \/ Y8 V
bStart = FALSE;
# S, _9 R1 c6 f" U6 Y0 ^
}
4 A9 y4 N3 }! u9 u
- z# \ z, E x& E5 Z8 H% o! N
CWndAutoFood::~CWndAutoFood()
+ N2 T3 W# h% U- s6 S: b% D
{
) n! `. u# H `0 l! T! I
AfxMessageBox( "AutoFood ist gestorben
" );
! p6 g! j2 M% C$ L: R* ~
}
; F7 g5 L- y; ~) T2 f+ g6 J
BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
! p9 n' V' I K! {% \. E
{
, r" W) m( ~) D
return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
& R; ?# m1 x& J
}
7 s) l; l0 r9 H' e& ~
- v/ T8 `) g1 a3 d9 u& _
BOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
7 L$ u$ ~. A" ^
{
! o. Y- s5 u( d! c' `% D6 S/ d
LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
! K8 l5 Z: @. e8 Y
CRect rect = pWndCtrl->rect;
9 _, f& z6 V) b! @! J! d X) X
if( rect && rect.PtInRect( point ) )
& L8 {4 u1 w) g/ o
{
' `) c9 t9 m& U; R! c( e
CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
6 Q3 T# ]1 ?3 }3 j: w% E4 C. C
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )
! o- `3 S# L/ J4 L! @! C
{
" ]' `8 S5 @% k/ f- E9 ?1 ~7 l
if( m_pItemElem )
. T4 O2 p" a, N( G: M
{
' O7 |7 w9 W4 u; i5 ^$ r/ P
m_pItemElem = NULL;
0 ^% t" T9 }1 _* d
}
" d) f, r4 I1 ]' @- o) y+ Z
m_pItemElem = pItemElem;
% f- U/ r. L, }1 F |% q3 f" s
m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );
, j1 Z2 s, Q5 p( P" t! n
}else{
% i+ d+ x, o# C( h/ g3 o
SetForbid( TRUE );
7 K6 t& N4 V& Z6 e5 x: C' N+ ?4 }8 t
}
7 b( C0 V! ]+ J" x3 y
}else{
* Z! ^/ C4 l" n- p9 ~
SetForbid( TRUE );
$ z3 e( T: j# x; y
}
* z; F* ` R3 R+ ]# E
return TRUE;
/ B4 S- M8 F/ F$ O# W
}
5 p8 m, W! ?. i. Q, ^
1 c3 R: q1 V! }: ~2 a) a
BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
* I( U/ {% B: g% {
{
8 {1 ^, r* e8 h
switch( nID )
" L+ s" N8 u1 t* D( @& e2 C
{
+ O2 @1 {2 t$ n x
case WIDC_BUTTON3:
5 O9 C9 N4 @$ K
{
% ?8 Z6 a2 x" f* u
bStart = TRUE;
. V# P# A, H1 N# x3 V. T: r B1 x ~
break;
$ ~7 ~! m. J- |, X$ p
}
/ O. Y6 T. D9 D; w
case WIDC_BUTTON4:
# c. {/ Z4 h+ M" Q& s6 a4 l( c
{
; B* r. T, a' u; L
bStart = FALSE;
* y, U! R+ f: ~1 f* {
break;
/ s m; t8 y" S
}
' H( ~0 f9 @8 o
}
# _6 ?# y! N3 U/ |
return CWndNeuz::OnChildNotify( message, nID, pLResult );
5 g5 O* B( ]* a, r
}
8 Y- p. E6 a. n0 n- T( l
void CWndAutoFood::OnDraw( C2DRender* p2DRender )
3 q" `; H. [- g: B: K
{
9 }$ ?. U( u0 T2 M
CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );
. @6 w9 W2 Y H! w5 I8 W8 ]# e8 z3 I4 g
if( bStart || !m_pItemElem )
$ [% l2 v; S* n0 f
{
/ D7 v9 F& Y1 ^. P5 n. H5 i( o, L$ g
pBtn->EnableWindow( FALSE );
. I* k, ~$ ]9 C; _/ r& p, Z
}else
4 @4 y+ S0 p1 H
pBtn->EnableWindow( TRUE );
3 A6 W! s( g$ r
if( m_pTexture )
& S& j3 e- b) D
{
7 c9 I7 Z! Q" z: l0 B
LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
F' s5 `" t u. f9 l; D
if( wndCtrl && wndCtrl->rect )
1 @4 r) u i3 r, s* E5 y! t& d, M
{
' p b; I% \2 d* D
m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
6 {: ^( r7 x2 q; G4 W, w( y
}
4 D9 K& {% U* b6 _
}
1 r' @; E: b1 m4 Q+ `6 R' g
}
# B! K# ^4 J0 y* A* k& w, }5 K
# l) l6 g" }0 A0 Z
BOOL CWndAutoFood:
rocess()
1 [; ]( M, N- m: s) I; o
{
- Q( c8 x% ? h* d/ G
if( bStart )
; t6 K1 R' v4 Z( F- N3 s# ^% @; b' f
{
1 o. c" |; G) @
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )
9 {+ `" h0 y8 b6 k0 \7 A
{
$ A3 ]1 o/ Z2 t3 |# |; y# P
if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )
: a1 s0 r& M- p' e! U5 D. ]4 k
g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );
, q# ^( X$ G' g0 b; {
}else{
. h% K5 I1 ^: d8 S2 [4 Q
bStart = FALSE;
+ H. l$ K8 ^8 w K) a
m_pItemElem = NULL;
- Y0 q3 y9 H( O5 G$ @8 F" Q5 R
}
0 X6 e( `) k9 ]
}
* F8 [) s2 b: s: T! x4 v( H
return TRUE;
5 O# Q. ~( O" A, f$ h
}
: [9 |4 G; v' ~+ M$ r7 ^1 d
( N+ P3 \( O7 G( t0 P7 T) P
登录视频废话:
0 n) E" f) g u+ k5 Z2 [, J4 ^
尾翼:
# r' f$ D( w$ ?& d! e: A# |
3 p* [7 p. `8 w( Z2 S
代码:
% N- w" T1 ~5 t' e
% |% J& A* C8 b2 K; v4 p# Q- \
void CWorld::SetLight( BOOL bLight )
" O& s) H( `1 B
durch
$ x- A) z8 u V2 F% C. j
Code:
- _0 U& \1 A# ]4 P4 v$ C. O' I- X
void CWorld::SetLight( BOOL bLight )
; M. e' X3 b* u* W9 f; S1 f+ V4 h
{
+ X8 R( S1 x' |
//ACE("SetLight %d \n", bLight);
2 N: t+ h2 ] O. ^) u
$ O; k2 q2 E0 E5 e# J; e+ v
#ifndef __WORLDSERVER
1 V: j- n2 }# [/ `$ A, h0 v- @4 Q
DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
) a/ M" R8 q* |: M" E
CLight* pLight = NULL;
* B* F0 n+ N% ?% p7 s/ X, X7 L
& Z& H: ]( Z5 L5 G) ~0 | C( J/ F
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
! U! n) `) J! E" y; k& a
+ B9 U/ C; m: w6 }/ d1 y
pLight = GetLight( "direction" );
$ L( ?( `# ]5 @7 p8 [
$ Y, ?5 J4 P7 x6 o% y; [ R
#if __VER >= 15 // __BS_CHANGING_ENVIR
0 g6 m- T; P# T2 N& m: W) I) v. l2 u
if( g_pPlayer ){
$ H/ Z' C1 C& w9 T
ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );
% G3 ^& B! |; B3 z* ]2 E, ~
if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!
% I- L ^' H, R6 t6 c. [8 y M
{
& B+ @/ y5 u( J8 I" H- A
if( pLight )
, H3 X2 j2 H7 D; ~: W+ K1 h" K, `: F
{
& @3 L* l& h, |. F
pLight->Ambient.r = pInfo->_fAmbient[ 0 ];
: W3 c( O2 I# Z2 c1 V( R
pLight->Ambient.g = pInfo->_fAmbient[ 1 ];
- _8 ~) a- f6 e8 C$ K0 ^. J
pLight->Ambient.b = pInfo->_fAmbient[ 2 ];
5 N! M% e; d( s
+ Q' |3 R: _+ b& R: O9 K! O# l
pLight->Specular.r = 2.0f;
- f. `- V( \5 G/ j
pLight->Specular.g = 2.0f;
) a+ c2 G! j4 M1 N+ R
pLight->Specular.b = 2.0f;
9 J% x1 X7 j( v, r: w7 Z9 M
$ {3 V1 Q9 |$ v" C' ^! L- E
pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];
8 g* E2 Y" w0 j7 a8 x, Q5 e% a
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];
% h7 B0 ^7 }5 }) M/ [; Z2 Q+ u A2 |
pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
x5 n+ Y* k8 T& o% V. ]( z; z7 U' R
- B+ }4 ~" h$ B4 r: e* L
HookUpdateLight( pLight );
, p+ I P v" N" |! ], `
) x$ B* U3 U- ]: z# r0 P
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
3 ]6 w1 N0 g( t7 ]* L( n+ h
9 {; O" i( E7 x* z
pLight->Diffuse.r *= 1.2f;
4 P+ V& Q. n) K! ?4 ]' l( y' t7 [
pLight->Diffuse.g *= 1.2f;
- ]& P' a& e5 X1 h$ D$ v8 H
pLight->Diffuse.b *= 1.2f;
! d I. P5 I4 q1 F" ^! I" g
7 A) a5 i6 M9 n" N
pLight->Ambient.r *= 0.8f;
8 X' Y* s9 @+ N" M4 ^/ W4 n
pLight->Ambient.g *= 0.8f;
! F: S+ f' I: G. L L4 `
pLight->Ambient.b *= 0.8f;
4 q( x% g) m6 M4 ]4 d- w! |5 P' M6 _; n
2 ?7 R5 ?6 ~% k- M% c. G" o. `
memcpy( &m_light, pLight, sizeof( m_light ) );
* O( {- X7 G" T, F! J' }8 C
& a; d Z( ~( n) f/ T4 P
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
. H* b5 t3 E$ N3 m
D3DXVec3Normalize(&(vecSun),&(vecSun));
+ j" k9 u! S- G! J5 x% ]
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
|; m5 U9 e, |: M- ^
pLight->Appear( m_pd3dDevice, TRUE );
1 ]: S# y0 S- N+ ~: ^" p
( [. z4 [. M: F
DWORD dwR, dwG, dwB;
# U) V+ V$ m+ ]& p, O, |
dwR = (DWORD)( pLight->Ambient.r * 255 );
- E/ {- I* S( d- i! t
dwG = (DWORD)( pLight->Ambient.g * 255 );
8 _: l: a* l4 O2 r: y
dwB = (DWORD)( pLight->Ambient.b * 255 );
% w d! B$ N M' R, X3 r4 V
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
1 J6 f, T4 I- D% E
}
# D" m2 u' `& r4 Q
}
; P: U" {! n Y
}
% {; z- P7 [7 a% P) X$ e
else
! o! Y9 b7 S* u* k6 }! N4 a
#endif
3 R1 k. Z) F. `+ ?4 M$ J5 w
( H7 T) E) q, U" o0 _$ R* J
if( m_bIsIndoor )
3 c6 I" x# X! m
{
* K- t$ L1 G8 W, i9 C& P' F
if( pLight )
' U9 A6 L. M4 X) Q7 G: X, ^
{
$ ]: {# ]) p2 u% A/ w4 J4 ~& e
// à??μ oˉè*
+ m* J% }; G& @% _
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;
, E5 y1 X& i3 f3 y+ N
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;
: D: w+ M; \8 Y
pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;
( m. H2 i) b4 g& d. I+ O! u
9 m# h" o+ ]) X( s6 E
// oˉè* ??à?
/ P1 I1 N5 r" A5 I- C
pLight->Specular.r = 1.0f;
1 z; B0 f+ E: b2 ^
pLight->Specular.g = 1.0f;
1 b' r/ |* F8 M
pLight->Specular.b = 1.0f;
# f( ]3 m/ ]' b9 M' s/ Z' l3 s
// àü?? oˉè*
c- L0 O! l* z1 _$ T
pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;
1 l. R5 g b3 W7 b
pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;
- {+ I$ n# r9 ?3 [8 c# @
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
% d& K- b$ y$ w% y; Z2 C: k
6 p. m% \7 [9 P: V3 F, \
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
* l6 Y" R! e3 a( m# q
{
2 ~4 v7 Z( p- R- X: I
pLight->Diffuse.r *= 0.6f;
, k3 F5 g0 Y3 T- r y5 a; ~3 ]
pLight->Diffuse.g *= 0.6f;
$ n( u. q3 c4 b: q
pLight->Diffuse.b *= 0.6f;
1 Y0 Z. |4 N. p% j9 t2 T
pLight->Ambient.r *= 0.7f;
6 ]# z+ @+ c; J, Z3 o
pLight->Ambient.g *= 0.7f;
+ n2 k( }$ L. }
pLight->Ambient.b *= 0.7f;
5 u: J! ?9 {. {; a
}
& e5 F) ]: o8 s& u6 v2 `- j1 X e
; `0 Y. i3 ]% i n; B' O
#if __VER >= 15 // __BS_CHANGING_ENVIR
) W+ n+ b1 p5 R2 p. w/ l+ k E
if( g_pPlayer )
, l v2 R; F, ~' T
HookUpdateLight( pLight );
* x9 f9 ^( `; R- J2 c
#endif
/ _6 z& `- Z; W7 P: F, G, j
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
4 Z3 f' [$ h. A# d9 B2 G
: S2 R5 E! }% a4 [7 [' i O% @
pLight->Diffuse.r += 0.1f;
3 ?0 p4 ~) f! h. a! K
pLight->Diffuse.g += 0.1f;
/ O' p. ^* M$ z4 {4 r# v. M5 U1 ?- J
pLight->Diffuse.b += 0.1f;
% \9 b) Y& o5 ?
// oˉè* ??à?
, P1 U0 d" W: }% C# ^
pLight->Specular.r = 2.0f;
7 L: M( a2 O S; K4 M, P. G
pLight->Specular.g = 2.0f;
m o2 s4 L' [4 T! h9 @2 G" J. @
pLight->Specular.b = 2.0f;
1 G+ G( k: O& C* E' b( D* s: w
// á?oˉ
/ K& T. h7 k! ]; B0 `( R
pLight->Ambient.r *= 0.9f;
, e/ p) j- q+ U, j7 _7 E& e' R( T" U
pLight->Ambient.g *= 0.9f;
5 f0 m7 W& c3 d; C( g9 z X
pLight->Ambient.b *= 0.9f;
( q9 |7 E9 C) e) X$ B
1 L0 K5 H e" O! q
memcpy( &m_light, pLight, sizeof( m_light ) );
/ k4 |) u4 j% G! m5 u9 p0 w
- I- [$ l* {& s' {
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );
h$ r% T1 }% ~$ y% a
pLight->Appear( m_pd3dDevice, TRUE );
/ ^5 U0 b) k* a# I9 I" U' x
2 m$ y+ ?, b3 V1 f" N) o' P
DWORD dwR, dwG, dwB;
- i8 ]9 v% O& d5 Y! a
dwR = (DWORD)( pLight->Ambient.r * 255 );
! b u$ { b; z! C4 D8 E
dwG = (DWORD)( pLight->Ambient.g * 255 );
- C; w6 t( Y) S* A# j) [2 M4 ~
dwB = (DWORD)( pLight->Ambient.b * 255 );
1 u K% _& ?2 {: o7 D
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
, @+ Y( S3 q& W' j. H- N+ X, w
}
& i3 A# i( s9 p8 B5 `* g' @# b
}
+ @ O5 r7 a, H1 @% j1 f
else
$ S/ s5 {4 A6 D1 m) @
{
+ g+ [: x- P1 @
if( pLight )
- w+ p4 J& o3 G! ^# z7 D
{
3 v6 \* K! N6 a
3 f6 c+ K8 \: T- o
int nHour = 8, nMin = 0;
" B2 [# O6 q7 g1 j
#ifdef __CLIENT
% O- S0 ~# n' s4 o7 F
// ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù.
, Y6 ^3 H' s; n3 A) t: Y
nHour = g_GameTimer.m_nHour;
2 N$ G K$ J$ ~: ]' O3 @
nMin = g_GameTimer.m_nMin ;
% ^' K6 R) ~, A1 A. C
#else
) G& k$ u" k$ x4 ~/ T
// o??o??′? ??°£à? m_nLightHour???* °?á???′ù.
3 K! z; {& J; D! W$ S# V, y
if( m_nLightType == 1 )
. o: H% `$ g3 ?' w2 Q5 q
nHour = m_nLightHour;
$ _. F) Z% g6 E- q, V+ h& a5 |* {
#endif
* ~# }) Z! B% K
nHour--;
! h; F- Q* U1 h; h7 p
if( nHour < 0 ) nHour = 0;
/ W6 ~7 l" Q, ]6 W' [2 R
if( nHour > 23 ) nHour = 23;
' r& i+ `: V g- K) h
7 W s* b( g* |. B+ o9 f% l
//if( m_bFixedHour )
# ]+ ^) F, G% E5 s1 c; S: I
// nHour = m_nFixedHour, nMin = 0;
% j- E* D; X+ j2 O* d$ f
LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];
8 c& M K* Z7 P7 U; r
LIGHTCOLOR lightColor = m_k24Light[ nHour ];
1 c! m+ K6 N9 H7 g* M
. }7 _' N" o+ V- |0 N% {/ j
//m_lightColor = lightColorPrv;
) V& a: `7 c: R# o0 N1 j
lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
4 ^9 c/ F" T7 [3 ^" I) h; H& F) T
lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;
' T" ]5 T) W& d6 _
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;
! y* ?+ \0 }4 s8 A0 L1 M) I
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;
! y8 l: v! X9 y5 d0 I. v: I
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;
* b' k( w2 H8 N3 _$ k& k' b
lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
! v/ X7 f7 z2 c
// 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)
! o/ |: B" M. n* ?6 _
" l! v; P- \; c( P; ^8 L1 V, ~
// à??μ oˉè*
- L M0 [" ~% z0 M/ X% c
pLight->Diffuse.r = lightColorPrv.r1;
2 [8 h- J& [- C- w: Y
pLight->Diffuse.g = lightColorPrv.g1;
# ^2 j: u9 a i( \
pLight->Diffuse.b = lightColorPrv.b1;
8 F5 L/ V3 A7 Z% e9 m+ n( Q
// oˉè* ??à?
" Z7 e* A1 G4 N6 o1 H# H3 X v; _& v* Q
pLight->Specular.r = 1.0f;
4 R0 {0 F# C' C: w2 y' I3 d3 h
pLight->Specular.g = 1.0f;
5 d$ d' P$ F# i: s: Q/ {* C
pLight->Specular.b = 1.0f;
3 T7 l+ u" ^+ o+ z3 D: [+ Y) D
// àü?? oˉè*
8 i- a$ ?0 z8 k* h
pLight->Ambient.r = lightColorPrv.r2;
. E7 s- d& a' x* R% J
pLight->Ambient.g = lightColorPrv.g2;
/ [+ }* K4 E; s9 @3 k
pLight->Ambient.b = lightColorPrv.b2;
3 e3 _6 w$ J# b$ k1 k
9 Y$ p1 r% B z
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
! d7 _' h% F) J$ E
{
) n9 K3 b' }9 t
pLight->Diffuse.r *= 0.6f;
$ r6 d# B2 w2 ~* M# j+ }* Y! k3 V; j
pLight->Diffuse.g *= 0.6f;
. p6 u8 B( t' |; j) b; I3 H, E
pLight->Diffuse.b *= 0.6f;
3 ^, |! f( e9 t2 ?" [/ Y' O
pLight->Ambient.r *= 0.7f;
# o x9 v, l# g- b+ j; V- h
pLight->Ambient.g *= 0.7f;
/ T7 Z8 y( |" G. c+ n( U" l: o+ f- A
pLight->Ambient.b *= 0.7f;
D3 D0 i% ]4 f, ?/ m6 _
}
/ K7 `# L6 N5 {; x* Z3 O: D
, ]* O8 M/ l2 _: F S
#if __VER >= 15 // __BS_CHANGING_ENVIR
t% S. c" x, N" ]
if( g_pPlayer )
3 ]0 `+ G! O3 }# c% R
HookUpdateLight( pLight );
* V! H- [0 J+ o; R
#endif
1 F" n+ D; b4 T" m# A% ]
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
4 g7 X3 b4 x1 ^$ t
& A7 V( j+ @8 h5 I" Y+ r
#ifdef __YENV
( ~- A. K7 ?' d
pLight->Diffuse.r *= 1.1f;
/ `) Z6 T( z) e$ R/ R) j' V6 A! ~; W; K# C
pLight->Diffuse.g *= 1.1f;
! _0 j, @5 G+ T7 R0 r/ {% r6 Y
pLight->Diffuse.b *= 1.1f;
: R7 Q _9 {8 R- s! r0 t: g
// oˉè* ??à?
! k$ R6 }3 q* J& R9 F# E
pLight->Specular.r = 2.0f;
& P/ j$ ^! i+ L: i7 q. v0 f- ^
pLight->Specular.g = 2.0f;
: A! O* K, `7 G& C
pLight->Specular.b = 2.0f;
( L, r, l% k5 Q) J9 Z% ^" g2 y8 Y4 _
// á?oˉ
4 U1 m$ ?# `! T3 l7 U: j
pLight->Ambient.r *= 1.0f;
9 Y3 Y5 B, B, O7 N% O
pLight->Ambient.g *= 1.0f;
' l! J2 ^% @: `5 r2 x6 W% H
pLight->Ambient.b *= 1.0f;
# ?9 V9 |1 L4 h" N
#else //__YENV
' S$ N/ f6 x6 y |; n
pLight->Diffuse.r *= 1.1f;
& E' ^7 H) C% C# \! m& B
pLight->Diffuse.g *= 1.1f;
1 s% E3 g( i1 v3 _8 C$ L
pLight->Diffuse.b *= 1.1f;
$ a& U. n& y0 f ` g7 s8 m$ `
// oˉè* ??à?
* W9 a3 s7 J+ T/ [/ o
pLight->Specular.r = 2.0f;
9 N* Z( n* S: k# K
pLight->Specular.g = 2.0f;
; H0 h/ {( B* ~7 m( |' p
pLight->Specular.b = 2.0f;
( l# D+ f0 v% r; Z" {% q
// á?oˉ
) Y; E( V) y& w2 z. P* L0 b
pLight->Ambient.r *= 0.9f;
( O. c0 W n) s$ L% r; v
pLight->Ambient.g *= 0.9f;
. d( W8 j1 D% V- L, S0 K: ?6 W: f; D: }
pLight->Ambient.b *= 0.9f;
5 o/ P6 k$ N/ ]2 u$ A5 I
#endif //__YENV
" i' a* U- T l/ r5 V8 O$ O
v) A+ m" p: P& U' {* A
memcpy( &m_light, pLight, sizeof( m_light ) );
! m6 g' f: ]$ p, M6 J2 r
" l. ]6 a0 x' Z7 W# D
D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);
' f. p) k% A( n( K
D3DXMATRIX matTemp;
2 x9 A" s4 R- H! @. L) J9 O
static const float CONS_VAL = 3.1415926f / 180.f;
# G# c9 W: o4 T- n6 l. ]( c, L9 s4 r
% E, ^$ b; `% ]$ |
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);
5 R9 @, N$ _0 z3 J) ]9 U8 x
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);
! I. H* _9 u1 g3 W
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
' H8 _* \* j4 g/ \+ @
pLight->Appear( m_pd3dDevice, TRUE );
( T1 `; L& n3 l- H" l8 P7 P
! }5 D' S; x2 C8 j" M3 Z
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
) l+ Q7 _( ^' V6 V; O7 M3 K5 Y: ~
// D3DXVec3Normalize(&(vecSun),&(vecSun));
3 p+ V# J8 V6 M- _, q. L* m
// pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
l( z5 p# q6 W* o2 z7 o$ O1 y9 d
) e% K- y3 C0 r0 s9 g
DWORD dwR, dwG, dwB;
- o9 S: S2 z* J7 M
dwR = (DWORD)( pLight->Ambient.r * 255 );
) L H8 c' f3 P, n! W& C
dwG = (DWORD)( pLight->Ambient.g * 255 );
9 w: ~) {! M5 F- T3 r8 u
dwB = (DWORD)( pLight->Ambient.b * 255 );
" A' g9 k4 d2 q( e
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
% h# r3 @, U7 f" C W& g
}
1 K7 E6 x, p* m; K
}
- }$ D) f9 ]6 K/ J$ s% W/ t- ?9 q
5 N7 v) L0 t& i7 s/ s: ^" n
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );
4 N" W' O2 b c V1 p- e5 E( b
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) );
* D5 b) a0 N4 D1 P, G
::SetLight( bLight );
8 J% f6 ~; T- l' A) q/ W
* G& `! O; d) C/ h& O) e; p1 U! R7 T
// ±ao? ?D?í???ó á¤à?
3 V: @- ~' H5 R
m_pd3dDevice->SetMaterial( &m_baseMaterial );
@; ~2 c: |% _: k# B
, {8 ^& n2 y7 t' v; I$ j: z
#endif // not WORLDSERVER
1 i) I- o& y2 [( B
}
( C N5 N: {) M4 l u
并更换
! T, r" d: J% U( i) Q p
Code:
; [) C9 q5 j6 _5 g
__FLYFF_INITPAGE_EXT
4 {* R0 E+ ]* d, Q
定义
; e2 y$ D8 z/ E. p
% }, t& U; \. o- x
0 j3 q9 @5 |; h
; q1 {6 _6 U m+ N' d, H: y; S
( u% A0 G8 H/ J
现在终于删除我的狗屁加速...
5 l; g- i o0 C: C0 Y6 V
# V$ ^" t/ R- l' N
H( X" n" b5 K; U n6 d" S% m6 t
# W1 Z8 N8 Q* u' R1 T/ _3 ]
欢迎光临 飞飞世界论坛 (http://ffwold.com/)
Powered by Discuz! X3.2