飞飞世界论坛
标题:
自动饮血和登录视频
[打印本页]
作者:
admin
时间:
2016-1-10 03:46
标题:
自动饮血和登录视频
食品车:
* C6 h8 @/ i a# b* ^+ K
尾翼:
: n- D# q2 s8 d0 _" s. Z6 V% R
' F4 } s! r/ l) }. b
代码:
9 i8 r$ Z/ z- m
CWndAutoFood::CWndAutoFood()
, m, n) @& [9 Q- d
{
2 B9 m: v8 d9 S0 O- r
m_pItemElem = NULL;
- g, F- C. V8 \7 B4 N# @
m_pTexture = NULL;
; o- E9 @8 d# G6 ?" e* }
bStart = FALSE;
. D- ?$ S8 e8 ^: n* x1 i
}
1 H( n: W8 H) D& N5 W# a9 S% k6 ]
0 T { w) q8 a0 s8 N7 C
CWndAutoFood::~CWndAutoFood()
7 L# C! q. n' M+ a7 w) [. F
{
3 _' B% ^" n6 H7 A
AfxMessageBox( "AutoFood ist gestorben
" );
" D1 ~, W- Y Z; c0 f
}
4 g& t5 m+ v3 R5 |: H& o# f1 X- L
BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
5 K G5 X/ a+ W* Q
{
& k1 q) X Y8 f- R1 H y
return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
/ D" y3 Z. N- r1 j" z4 c
}
% R# i- e" w. A, Z" v; c
" w/ q, U# E, _) a3 @
BOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
" I; E+ S: B4 n2 E2 }6 Y1 b
{
0 L3 l/ {& q9 I9 o& V# w
LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
0 ^# l8 s% j, C: E( O$ }
CRect rect = pWndCtrl->rect;
( N! o( D4 Z5 f+ t) y+ T0 W
if( rect && rect.PtInRect( point ) )
$ U4 l. H) j8 g( X3 e& ?
{
) s. [+ U6 y( E z3 m
CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
, L/ B( c2 q2 [7 }1 d1 _ J6 f
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )
1 F7 W: g- ~' v; g m" s; V
{
" b4 g1 Z M5 \4 u. |1 J) \+ O4 \& Z
if( m_pItemElem )
" H, u1 N- A7 a* e
{
. B% c% R* h! j$ Q5 H8 q2 b/ w
m_pItemElem = NULL;
) q! ~9 `% Q0 s; I- ~
}
9 Q" _/ K: {1 w
m_pItemElem = pItemElem;
$ \: g+ |- L3 g7 O c1 i
m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );
5 q C$ J! t/ _/ a/ B/ e9 v/ j
}else{
1 w0 D5 O: @5 C6 V* G4 \( J
SetForbid( TRUE );
2 U" X5 @: H# V; ^$ R" }. i
}
9 ?2 z6 ], x( B
}else{
' y/ i- ]' J, G0 S
SetForbid( TRUE );
8 K7 O7 j1 h* N. U8 l: c7 F0 A
}
: v( W5 r0 u! o. p* x
return TRUE;
% c' M* P- B- f( j8 r
}
, a# V' h: {2 s' K
& S2 f( {4 T) a1 O
BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
; i4 r8 c( s" g% s
{
; p% N! H2 Z6 r; O: T: H$ b
switch( nID )
, i% w V* U; P% q3 p/ L
{
% L/ n5 G+ B% K: ^) |! G
case WIDC_BUTTON3:
; j4 X# z/ l, | n5 \+ [% _
{
U$ b5 r/ g! `' j
bStart = TRUE;
9 G0 d4 l8 d- H/ x2 m) J7 w
break;
) p4 L/ S# _$ S: l4 U" L1 ]
}
" J0 j0 j w D# b! N7 X3 \
case WIDC_BUTTON4:
L" `& x* N1 b1 ]$ T0 M' U7 n
{
3 g1 D5 R# k& s! I# I4 q9 W
bStart = FALSE;
. _ X! q& b; x, I* v% ~
break;
; n6 y4 @1 y: a% c
}
9 r& P' d8 p5 ^2 C, T! e
}
5 r0 T& L7 a& D$ t2 x$ }/ n
return CWndNeuz::OnChildNotify( message, nID, pLResult );
. x6 T3 V# \9 C6 d
}
& w/ j* P. t6 A4 }% W
void CWndAutoFood::OnDraw( C2DRender* p2DRender )
, J' q7 Y4 G4 s7 C& L7 X" s
{
0 u, ^6 X3 B& P d; [
CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );
7 v5 q8 {/ v. x% D" g
if( bStart || !m_pItemElem )
7 x! V0 q% p' X4 K9 V
{
# @0 v2 a% S! d. J L
pBtn->EnableWindow( FALSE );
, [/ I: y ]1 J: T/ Q# q
}else
, r% X1 q; {" Q! @ w
pBtn->EnableWindow( TRUE );
8 c. L A$ g1 a+ L; L, @" E
if( m_pTexture )
/ _* a' z4 j9 y' }8 h, N; ? H
{
& E7 v' [& O: D1 f. V6 l
LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
' ?; W. B3 e$ R) S: X" E! a7 J
if( wndCtrl && wndCtrl->rect )
; X, O3 B4 U" h/ v
{
3 n( H" o& g8 N% h8 \: p
m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
7 U H% F# E. r
}
9 t1 S' G* i/ W: Y
}
, J) `+ L. l% O# y6 {* i
}
" N+ G3 A- ^$ ?# G
3 `; y/ p/ ?- \5 n
BOOL CWndAutoFood:
rocess()
4 c. Y( V9 Q! }- A3 J
{
( \9 I @* t! }( I _5 z* R: O/ L
if( bStart )
! Q$ J) }$ ^* X# o3 ^
{
$ @6 k% C) x7 \8 w
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )
8 `- I7 q8 h: T, E0 d7 C4 z
{
r! \: C& ?: \" w+ `; [
if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )
2 ^0 a; `: W; S' ~0 P$ E7 w6 j
g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );
# X' O# s0 a5 j( c
}else{
9 {. M! N9 ]9 t' i9 o3 `# ?
bStart = FALSE;
+ g3 C# m# z# M& M
m_pItemElem = NULL;
0 k$ |% N1 F) U+ G
}
9 a: Z2 j% Q/ ?" H
}
$ S8 }3 i: T) M6 R, Y5 F$ \
return TRUE;
0 p( c3 `* d5 O& S' r2 a
}
6 x: V& `0 E5 @4 D$ l( i. O
, R$ w& H) B, w4 P" n3 A8 Y5 W( f
登录视频废话:
% S3 ~) j+ w' A
尾翼:
( c8 P7 ]9 f" z# a( H
$ o! c6 r9 u+ c! @ R
代码:
7 p- n. Y+ L2 J; I! _
4 H: r) m( X4 O. I' ?
void CWorld::SetLight( BOOL bLight )
q. e$ v& C- Q( N
durch
$ N2 f0 w! i( l D! z# |; v
Code:
& z$ C: ?7 B/ P {/ F0 m, R8 E7 x
void CWorld::SetLight( BOOL bLight )
: v. u( g0 ]5 }+ A% t
{
# G* ^* W9 w$ e% x- Q# Q) I: H
//ACE("SetLight %d \n", bLight);
) Y" p! k/ \+ D. s
% ^8 F) N. t3 N
#ifndef __WORLDSERVER
" D: ^/ V1 x& Y9 p/ c' ^( S& E0 X
DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
8 g, s# e) G9 l* t" I+ w2 c! }
CLight* pLight = NULL;
6 J v0 `, m5 s5 B& b. @
' N) |$ E/ Q/ K3 F8 S- M
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
h; x- a3 w2 q6 u5 x; B3 f D
4 H. C' Z4 G9 O# g0 h; N
pLight = GetLight( "direction" );
) X- R6 s& x5 n4 Z4 [
0 @; j( C+ `! D3 D# t$ `% e
#if __VER >= 15 // __BS_CHANGING_ENVIR
/ `; Y6 A7 a' A
if( g_pPlayer ){
) J) ^( Z6 D% h% Y5 K
ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );
. n; l; W5 K" v
if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!
( t3 O$ y$ l" Z7 d. A" Z
{
" g% \/ ~* @7 i2 K( A
if( pLight )
- L P# D* t4 O& O: A5 J- @
{
, @6 o! C7 v0 [& Y: v& w- G
pLight->Ambient.r = pInfo->_fAmbient[ 0 ];
: q U8 F0 t) J! |6 b# C
pLight->Ambient.g = pInfo->_fAmbient[ 1 ];
2 i$ A5 Z& x+ ^; o; M) w# @
pLight->Ambient.b = pInfo->_fAmbient[ 2 ];
% x8 [- E$ d# Q; j" \4 f' m( r+ K
3 T( [! T( v, s0 z& W0 M+ @8 R( ^
pLight->Specular.r = 2.0f;
& n6 r' N$ M8 G5 Y- O4 |# H
pLight->Specular.g = 2.0f;
: r: i2 A7 {2 W$ B6 C
pLight->Specular.b = 2.0f;
( V" s: `9 T# T1 B$ N* o' [% q
8 \ V- }; \8 d6 X( `. w" r
pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];
' P7 G$ ]) w5 l7 J: T6 t
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];
2 [ |& D/ l5 h1 p
pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
7 f. |& E9 @# T+ ^' s2 I$ W) C
7 u1 v# C0 V% Z& n/ d' d4 s
HookUpdateLight( pLight );
: S, G( y! q% Q! x
- Y6 [) Q/ J$ |1 [0 q& T5 x
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
& Z; i/ {' E/ R
5 K9 L- j" O; |/ `) P8 \( d
pLight->Diffuse.r *= 1.2f;
" S( r) p* [' L. l8 i
pLight->Diffuse.g *= 1.2f;
- J6 G3 \4 x) X
pLight->Diffuse.b *= 1.2f;
}: O5 M7 Z& E; l6 g
5 `' z. _* A, Y9 {5 U
pLight->Ambient.r *= 0.8f;
) [4 l b& A: b5 ]1 W) ?
pLight->Ambient.g *= 0.8f;
9 t% Z+ O9 N9 V) i! A
pLight->Ambient.b *= 0.8f;
* \/ `: m( Z; U0 ^- i% E1 M9 C
+ X# g9 ?. r G8 T% i. Y
memcpy( &m_light, pLight, sizeof( m_light ) );
+ v: `5 [. V+ a' p5 i
1 Z! ^- O# q5 k. y+ \
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
. S" u5 t/ l, l! h9 I( l
D3DXVec3Normalize(&(vecSun),&(vecSun));
* v& ~$ C% n! l; Z9 E, K4 i1 b! L
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
- q% R8 Y7 t4 E4 B: j5 K, H5 }
pLight->Appear( m_pd3dDevice, TRUE );
/ T* d4 o0 g: t6 F3 ] N
4 E8 J+ ~/ m* d: U1 z ?' p
DWORD dwR, dwG, dwB;
/ ]' C6 z! Q" M3 m/ C& x7 ]
dwR = (DWORD)( pLight->Ambient.r * 255 );
, S6 N' |% p4 J7 Y% z% ]
dwG = (DWORD)( pLight->Ambient.g * 255 );
' m. c/ Q- B4 N# o+ k8 F
dwB = (DWORD)( pLight->Ambient.b * 255 );
) f" I- b8 `- t- n8 N/ V, `
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
+ O' u5 M4 r1 w# @" q1 f
}
7 n7 u6 a H2 j) \+ s7 ^$ p( n
}
3 s6 l5 |$ N' X& n1 p4 U, i
}
" z1 F, S5 i" R( c% e! V; r
else
: @5 d0 g5 O, A: \) X6 |) c
#endif
8 `) m$ k% N4 P
) F: S4 ~$ [0 |9 ?' L% [ P+ C6 h
if( m_bIsIndoor )
# ?. }! e+ ]7 x( Z
{
) E% ]) e2 T y
if( pLight )
# t" f: ^. }4 ?9 Y& o! o1 u6 m
{
9 y- ]$ U4 S6 [ P4 s
// à??μ oˉè*
5 [. ~9 @1 p, G- J* _5 ^' b* x; m
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;
7 N) e$ O1 ` s, P6 K
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;
: R Q. b u' s
pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;
5 U; b3 A4 q* P7 L( b
% n- l) y2 H- Y) P
// oˉè* ??à?
* ]0 R" l( r% ^! a& g1 w
pLight->Specular.r = 1.0f;
" @# C/ \$ v5 y
pLight->Specular.g = 1.0f;
/ b* A; d) r' ^! v8 A/ W
pLight->Specular.b = 1.0f;
- x1 ]' k5 y# N6 Z
// àü?? oˉè*
" a( G' D+ P, ?# s
pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;
" [. _' h" m* U( i% Q+ e' X
pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;
, d& `0 ]/ l7 \/ S b2 [9 y
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
; H1 I. x' T( o1 e* y5 V
z3 ]; l- h- H4 }; t8 X2 _
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
7 k6 Q* i u. R
{
+ F7 p1 H: P3 j( N& h. @6 `
pLight->Diffuse.r *= 0.6f;
! u% o n! u2 E, o$ F) Z
pLight->Diffuse.g *= 0.6f;
, Z O5 z! [0 N$ ^' e; X( s
pLight->Diffuse.b *= 0.6f;
0 i& D# {! f) b) m- v
pLight->Ambient.r *= 0.7f;
$ `# O$ p+ f6 ?/ j7 F
pLight->Ambient.g *= 0.7f;
/ R, S+ G4 a' O+ v1 \) U2 B7 n/ u
pLight->Ambient.b *= 0.7f;
" u6 A2 h9 O" m: {- p4 t7 n! t
}
( `/ V1 c* ^& U+ U8 s( Z6 w
* p; m: H" C3 D. ^# A
#if __VER >= 15 // __BS_CHANGING_ENVIR
/ b1 Z4 q! B- G) a- s
if( g_pPlayer )
5 c% k6 {* M1 I# G6 `
HookUpdateLight( pLight );
: `5 A0 t" g$ l( Q& Y
#endif
1 k5 Q9 s$ Z. a$ S5 U0 W: R
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
4 f0 D6 F/ t$ O# c* Q( [
. `5 X/ m+ d2 c! F/ \; m
pLight->Diffuse.r += 0.1f;
0 U# R' B1 M/ d7 r8 I1 }) F* j
pLight->Diffuse.g += 0.1f;
' m% C% ]2 S4 o* d J# V
pLight->Diffuse.b += 0.1f;
8 G5 t. [( _' `' M" f( _
// oˉè* ??à?
3 `5 v7 {3 N+ e- J. j3 \
pLight->Specular.r = 2.0f;
4 f( S- d: H1 G4 f, q) S/ l% u
pLight->Specular.g = 2.0f;
3 n4 E1 U' Z) G# U
pLight->Specular.b = 2.0f;
# g9 D' h. ~# `4 w( j4 \
// á?oˉ
, L" u$ d$ D+ R6 ?- \9 H
pLight->Ambient.r *= 0.9f;
( b( v. Q" { P, H
pLight->Ambient.g *= 0.9f;
5 J; T: Y/ x) L c" a4 H; d' c' M% a
pLight->Ambient.b *= 0.9f;
; m: K1 x! z" \9 d
6 u3 ?. z) W5 F7 B
memcpy( &m_light, pLight, sizeof( m_light ) );
* \) F6 i- Y( g& E( D" s
3 [/ q% X v: b5 b& h5 ~
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );
1 w, J* W1 b) n
pLight->Appear( m_pd3dDevice, TRUE );
+ r- X6 D, u9 K
: j Y! ?' t$ T7 m! @
DWORD dwR, dwG, dwB;
" J5 o) f3 Q& E1 I! V( ?' Y! R
dwR = (DWORD)( pLight->Ambient.r * 255 );
% m+ M& U5 O# C* U( T
dwG = (DWORD)( pLight->Ambient.g * 255 );
) k0 l! }6 J7 l
dwB = (DWORD)( pLight->Ambient.b * 255 );
- ?1 J' n2 v) F. r4 r
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
2 H3 n) L. ?! m- q" c6 E
}
2 w6 L. A. w) e- p& b+ f
}
: O' p6 [: p5 W0 s/ w$ g
else
5 R- x9 d$ M* ]7 p
{
: ~2 B& f' c) X) t
if( pLight )
3 s0 t9 R! C2 [( n* @# q+ K. ?
{
5 A6 a V$ i o6 o! u f) P
: R: \6 |5 \+ z' h
int nHour = 8, nMin = 0;
% Y4 Z( |# f' i6 \
#ifdef __CLIENT
9 L! c: e" y" v; ~+ G) u/ _: E
// ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù.
" O' B' `/ v& v8 ]) P
nHour = g_GameTimer.m_nHour;
# {; A& \# {, r# Z6 m
nMin = g_GameTimer.m_nMin ;
: X. s1 L4 t! O- y
#else
) p: F5 J5 _! M& g
// o??o??′? ??°£à? m_nLightHour???* °?á???′ù.
7 y4 t8 C+ U% T* D7 V g
if( m_nLightType == 1 )
! B- O$ q' s# L( H2 O* X
nHour = m_nLightHour;
7 F4 W; X0 D; ~ _( ^1 U
#endif
- k5 H4 F8 A! w/ `5 ^4 i8 q/ @9 x
nHour--;
1 E6 t; _9 r8 i# ] p% ~6 Z
if( nHour < 0 ) nHour = 0;
4 i4 R; X9 H3 L0 F1 X
if( nHour > 23 ) nHour = 23;
, Y2 ^8 G8 t" }0 s- \# K% p
$ {, I+ _& C. n% V
//if( m_bFixedHour )
- [( R, ?& N3 k. y& J3 s' h7 D
// nHour = m_nFixedHour, nMin = 0;
' R6 `/ {1 P p& I, R. O) {% b+ m
LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];
' r4 G/ D2 c# D' \9 u( d7 @6 ?8 G
LIGHTCOLOR lightColor = m_k24Light[ nHour ];
% A( n2 {0 W; b) k9 m) Y# }( v
, Y3 ]+ T* A6 }% R, P4 _# `" I
//m_lightColor = lightColorPrv;
7 s3 S; ~; C5 ~
lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
5 O- r9 q6 T' |2 A
lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;
" J5 `- \- h" n! @
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;
7 w$ b4 `8 s1 v
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;
% Q; o( t# d$ K5 n3 i
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;
9 j5 y7 G4 P) h: L+ W/ {( m
lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
# \; y, I$ U: k. d3 d) N0 a$ I9 ^
// 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)
5 y8 a& r1 w2 L( L
/ s+ y: M7 D: V
// à??μ oˉè*
; {* L7 b# k5 q3 h' Z4 P3 F" P: i
pLight->Diffuse.r = lightColorPrv.r1;
) ~6 _7 w0 A4 W
pLight->Diffuse.g = lightColorPrv.g1;
& P a5 D+ K' K l! C6 k/ E
pLight->Diffuse.b = lightColorPrv.b1;
! l8 q# d" y2 N. ^
// oˉè* ??à?
! |8 O3 o2 y3 S* g
pLight->Specular.r = 1.0f;
. s( Q' y4 j+ N' @. m! U M5 T
pLight->Specular.g = 1.0f;
R: [3 b& |' Z4 a
pLight->Specular.b = 1.0f;
2 G% A+ |. z1 \3 T ?, r: J
// àü?? oˉè*
% H) h. j! G! |( `' n6 R
pLight->Ambient.r = lightColorPrv.r2;
& s3 W' E, c0 F# O. U
pLight->Ambient.g = lightColorPrv.g2;
5 e1 [# s8 e0 c& x
pLight->Ambient.b = lightColorPrv.b2;
- Y, J' x; P1 G$ m( L4 M* O) t( L& b
, j9 M% N. I7 Q3 ]- ?, y
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
% W9 C% X% T% _: X2 a: B2 t2 N
{
$ O* }# t. ]7 a) [
pLight->Diffuse.r *= 0.6f;
# G) o3 S5 d7 D$ M3 w' t
pLight->Diffuse.g *= 0.6f;
" t2 C- n8 ]' w3 a, c
pLight->Diffuse.b *= 0.6f;
* G( T% T! r9 G; d
pLight->Ambient.r *= 0.7f;
7 M) K5 V& I. Q
pLight->Ambient.g *= 0.7f;
/ D0 |) P) f" _) z0 v+ d
pLight->Ambient.b *= 0.7f;
/ x" R2 Q+ B* ^. \! v! D$ m
}
- r& O0 h2 G( E! L6 k' G3 \
8 E# d3 Y, T4 k; }; E$ d& |
#if __VER >= 15 // __BS_CHANGING_ENVIR
/ s# a: O: v2 q
if( g_pPlayer )
6 `( d0 V; R5 J5 `% s& o K6 ~
HookUpdateLight( pLight );
1 B( I `0 |% z' ~$ T( T3 v
#endif
/ y) _; E! T7 A! U6 B& X
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
- }+ D4 Y: A% e4 y! f# S8 S
9 P# d7 ?, N/ z0 \9 a3 A
#ifdef __YENV
8 M9 V* Y, g! v4 v! X/ I% i
pLight->Diffuse.r *= 1.1f;
7 f8 j0 ~: O4 P' U- ~9 V! a1 t
pLight->Diffuse.g *= 1.1f;
& c+ d+ L+ L3 ~
pLight->Diffuse.b *= 1.1f;
" Q% }% i- z5 l! i9 r, o
// oˉè* ??à?
; Y8 q+ T; d; n" N. r; y0 G
pLight->Specular.r = 2.0f;
. u! z& H" F( k2 G; H! A
pLight->Specular.g = 2.0f;
: {5 ?: G7 G& }* b/ k) N! h5 w
pLight->Specular.b = 2.0f;
; g$ A7 t# G: [( {4 L3 Y
// á?oˉ
* c$ {8 m$ j) k5 w |+ J3 R
pLight->Ambient.r *= 1.0f;
1 m& q5 R: F) f# G
pLight->Ambient.g *= 1.0f;
2 x# ~& |/ A5 h2 k6 p0 m
pLight->Ambient.b *= 1.0f;
" l/ O( H) y- }9 r
#else //__YENV
) w8 `* s8 T' X
pLight->Diffuse.r *= 1.1f;
! s5 E1 d L y6 M! K. C
pLight->Diffuse.g *= 1.1f;
3 i* @7 F$ ^9 r/ M: s
pLight->Diffuse.b *= 1.1f;
1 M8 D2 X3 _) \( g1 I
// oˉè* ??à?
/ u! b( F" U, C; b5 P1 I' Y
pLight->Specular.r = 2.0f;
% {# e9 [+ {: k$ u
pLight->Specular.g = 2.0f;
1 @6 o+ D" y1 I& _
pLight->Specular.b = 2.0f;
# S: w# h( C! P9 t2 B; z( F: @7 Q# R
// á?oˉ
( J( @7 u0 Y' i2 J/ y6 c
pLight->Ambient.r *= 0.9f;
& @* g0 {! y2 y2 h# k r" I- _
pLight->Ambient.g *= 0.9f;
! C, r3 |3 P# u* y' ?" T
pLight->Ambient.b *= 0.9f;
$ ?" R0 l& m3 f
#endif //__YENV
' J }' }& G5 h4 w1 y
2 r5 w/ Y4 `- O' I4 j
memcpy( &m_light, pLight, sizeof( m_light ) );
, H/ H" o+ C6 V! |* b9 M2 U
, O3 V8 r8 S. L" Z
D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);
, [: r% K" n! V* O, g
D3DXMATRIX matTemp;
4 l" c* D6 e! k# a! f; i
static const float CONS_VAL = 3.1415926f / 180.f;
% M* E G8 p# g( h; L
3 E. s1 U2 m% [
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);
1 H) n+ W8 B9 [1 ?$ N8 a1 t) {
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);
& ^! f$ v) a6 A* d
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
0 F+ y2 h8 d4 ^9 x) p+ B, m
pLight->Appear( m_pd3dDevice, TRUE );
$ B# x6 r; o: N% S
2 m, ^) l" z% z6 i$ K" }/ b
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
4 {+ W9 A* \1 B6 V
// D3DXVec3Normalize(&(vecSun),&(vecSun));
4 N# y* d* H/ u: ~
// pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
! w. Z* k: g) E& m( }: |
$ _8 u" e5 x: d" u, {+ t
DWORD dwR, dwG, dwB;
% V: Z$ w8 K1 Q: F
dwR = (DWORD)( pLight->Ambient.r * 255 );
: G4 B" r+ \/ f9 J! k) ^8 L3 o( k: s
dwG = (DWORD)( pLight->Ambient.g * 255 );
2 r; A$ s9 |) D+ A1 [; y& B. x! F
dwB = (DWORD)( pLight->Ambient.b * 255 );
! ?( S1 k9 d$ H6 w: y8 j* Y# {
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
# z0 t/ b9 ]6 x9 U3 r
}
?% {9 v( {; S% Q0 I
}
: p/ M( n( t3 m- Y: w
1 P9 z& f/ S6 c6 |
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );
5 F- a! I) Y @5 t5 F
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) );
9 g) a3 X0 l0 G. Y) u# u
::SetLight( bLight );
3 Z- I# B2 Z" [0 u
3 }! T( F: t: X7 R
// ±ao? ?D?í???ó á¤à?
4 i) q) F8 f" x w; {4 L
m_pd3dDevice->SetMaterial( &m_baseMaterial );
7 ?, Q+ f( P$ o- @9 B, t, d
4 `5 y. }2 U, \* y; u7 j
#endif // not WORLDSERVER
. w" j* h1 r. ^& F8 a5 \
}
9 s. E* ~$ U! o4 ~
并更换
) B7 z8 \* o1 c' q4 |
Code:
$ R# y8 b+ g" ]( m8 v
__FLYFF_INITPAGE_EXT
1 c8 q3 G/ \4 X6 {/ ]: t0 q, ]
定义
+ Z' y$ e( J% Q% T
4 u: }$ L! ]9 z
& k5 ^) W1 i+ L5 v( x2 ~6 p
0 z+ v' [. t) Z
0 e; e- g" j$ t/ N
现在终于删除我的狗屁加速...
I4 k4 Y9 K& F! i. l* K
9 i9 Q+ Y, C' }5 s: Q7 X$ e
7 N" P1 Y5 @; z& I+ Z9 c
% k, l* I/ v& m8 j* D
欢迎光临 飞飞世界论坛 (http://www.ffwold.com/)
Powered by Discuz! X3.2