|
|
食品车:! c Y6 l* @) i! v
尾翼:
- j6 P% v* W. u; ^& q& X: Q1 D q1 X
代码:
# ]1 t. \4 {$ J4 L0 F3 g6 a! ACWndAutoFood::CWndAutoFood()
1 |$ ^3 j) ?# e{
1 l4 r# q0 L% M" g0 E- T# O* {6 D3 a m_pItemElem = NULL;
2 H0 f4 L# i6 n" o2 F# Y7 @ m_pTexture = NULL;
3 h8 ~# a' U/ f, ~: | bStart = FALSE;4 a* z% g5 k, A. H
}
: R/ |: X+ N. `4 I
- ^% y' h/ N }' R5 oCWndAutoFood::~CWndAutoFood()- L7 e I z8 Q1 I# H8 X0 U
{
8 v- A& V; |6 K9 K" e9 o, X6 N ] AfxMessageBox( "AutoFood ist gestorben " );( K" `1 H( p9 i, I( ?
}
3 C R# c6 R& B* e$ [& lBOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
w9 S# C0 R) _{
7 I% S9 J/ b2 z+ x1 A# o3 ~& R% ^7 a return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
6 ]- @: t1 T( T- M! R2 i; L0 J8 y}# n% Z; y7 n! y& {! R
4 B( F) d/ o7 y& \3 g% ?1 Z7 w( QBOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )% K% d0 j3 [1 A& j% h+ i
{0 k" c$ b* i8 d+ d
LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );. |5 {# U% i t5 O
CRect rect = pWndCtrl->rect;0 c1 _8 @* h* w! n! F
if( rect && rect.PtInRect( point ) )$ |# W" U6 c* T
{
6 q& ^8 a( ~" \- V. ^9 R CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );6 u3 W) w9 ?1 y* e
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )! d: k# Z0 r5 ^# g2 o& R. i
{
2 _8 g/ N( d0 L3 t c if( m_pItemElem ), g u8 |& D/ G
{7 d F& o6 D( s4 O" s
m_pItemElem = NULL;
% F) e9 Z# t1 B3 a" ^ }
( W# m; v1 `+ E- U% q) n8 a: ]6 r m_pItemElem = pItemElem;+ p1 v% T+ U- t' V' ?2 X5 t, H
m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );
9 ^: ?6 J4 G: V$ M' _$ V- G5 h, b }else{
+ ~3 ]6 f$ C$ V& } SetForbid( TRUE );/ N9 Y/ z, c' l$ g" J4 u) ^
}0 }8 {6 j) o2 L- J
}else{2 K5 O6 ]" N' w: a5 w! A( h/ [
SetForbid( TRUE );
* G# ?) t0 d( ~ }. U( g6 m# L. C( x6 U6 b- g8 S
return TRUE;
! F D3 g e3 g1 R- J}/ A" c) k) |1 \+ d) n& O8 R
5 F4 U: h$ P! K; ]- m2 H aBOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
- e; D& h, I! R: u/ y B- x{* s- v# Y5 L$ }7 d$ l0 z
switch( nID )
. l$ O0 C/ N2 n- F) s: s {; H* ^ y+ m, G2 Q$ y3 O+ G4 L
case WIDC_BUTTON3:
! q3 _2 V- [8 {9 ~- Z& x8 G) p. U {7 \; R2 B0 H/ @( N8 `
bStart = TRUE;, N, c0 w2 t) U# X" y8 K' F, G s
break;2 h( d' s) Y' ~/ e8 t. o, ]: l$ A' _
}7 ?- Q: J6 R7 c2 L+ p* _7 Z( L$ ]
case WIDC_BUTTON4:; I/ g# v4 o! I' s" n$ { q
{$ t) z N6 a- ` c5 x! z+ \9 n
bStart = FALSE;+ H+ n- j8 m9 [! Y& ^" {
break;
, @1 F5 z- Y" C) K }
3 z) r c/ G6 p4 [ }- R9 t$ }7 q) l) x$ n- Z
return CWndNeuz::OnChildNotify( message, nID, pLResult );5 ~9 ~1 q$ t; I
} ( ~4 m' ]- a& h3 v3 V; _
void CWndAutoFood::OnDraw( C2DRender* p2DRender )) ?; h+ i* G/ `: D+ e* F9 e { u
{8 m9 ] J P. q( E+ ]7 w' I+ N! [
CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );" t7 F2 i# _1 D3 \4 K& ?. n9 p& {
if( bStart || !m_pItemElem )0 ^' C$ v6 L% J j( E5 q; h' }( g
{$ c4 l9 e; x# j+ {
pBtn->EnableWindow( FALSE );
& m0 G( `# j/ k/ B$ v }else
( j- r4 I9 [/ S" Y" ?" N pBtn->EnableWindow( TRUE );
; L: i+ T/ n; n9 N* g if( m_pTexture )
3 i F" @. o4 n3 D {
( v3 K& p4 c0 ^; J% { LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
- r7 e3 Q0 X+ @7 U$ f( y; k6 v: s if( wndCtrl && wndCtrl->rect )5 s- R) K# O1 Q* p6 u
{* w; t8 `! r2 L& j& @+ H
m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );7 A- Y2 n p& x" y, e1 ^3 Z" K0 F; ^9 O
}6 Y( p8 F3 p8 U# c7 B" N8 [* V7 B
}
/ K& [2 f: B4 K}
L% B2 v5 O; V. m$ P3 ~& w; {& e: L- M) C. e, a
BOOL CWndAutoFood: rocess()
2 Z. ^" Z& V) G9 M. N! i% }' @2 }{
; S: y* ?$ C6 K9 h$ [. {$ Q7 _7 b6 c if( bStart )% t3 X( O) R% ]1 E3 K0 Z
{. d i7 ]# b% r; `" O
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )
& A+ x3 R" p# s' }$ B {3 Q1 q* v6 z' ]
if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )
! k6 [. ?3 k f/ J% X' h0 K2 E9 T g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );3 k/ u3 b7 X5 ^
}else{
, ?# g6 [& x. y: _" x; d bStart = FALSE;
) d$ R- D2 C; K. Z0 U- f2 R2 A3 H m_pItemElem = NULL;6 o0 G5 G* I3 \+ ]5 v
}
w% \% b* A7 d0 N0 M2 M }
; ~# O8 f+ x- g; T return TRUE;
. T( ^+ `& b) f1 l' H* F' L+ M* ~}
~4 H% \+ _# V3 R" _& o; ?4 m0 z! p6 i4 G; B1 [% d6 }
登录视频废话:+ u4 s' x7 m7 x) K, q5 G
尾翼:
% r+ H: Z; b' G, N, o
8 E f* D+ ^* U) o代码:
% w: O0 q3 F% B' x2 {& O0 k* j: l |3 O2 w8 h! Q, q
void CWorld::SetLight( BOOL bLight )
% z; b( e" W* @" z) t3 l$ O* Vdurch8 j7 Q5 V `7 f# D" q7 @
Code:, ]9 M% p7 [* G8 m9 F
void CWorld::SetLight( BOOL bLight )
. z* I. l5 _8 s( u- y{/ F$ |( D+ h8 A' m
//ACE("SetLight %d \n", bLight);
8 m* M( ` N$ U
! m2 p" w. P8 }7 a3 y#ifndef __WORLDSERVER . c5 v! E8 g! A: g! \ O
DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
& H- @4 t6 P0 q CLight* pLight = NULL;
: F; W/ F/ g! w( j F5 P% J; a) Y, _9 Z
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );# h/ p; p) i1 L* [! ^' c4 ]
- S* J* A9 c% U5 T1 T& `2 G7 @0 d pLight = GetLight( "direction" );
* e# p/ N4 e- z; q: z
+ E, N( d) ]. r1 e#if __VER >= 15 // __BS_CHANGING_ENVIR
0 h$ C3 r" ]' ^1 i) g- L2 Q if( g_pPlayer ){
8 z- P! ]" g9 E, l) J5 c ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );
/ E g4 F" {5 i' Q- L3 U; X6 Z if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!
& S. u; C* k9 x) o( d0 f {; w+ h% P# I" H$ v
if( pLight )% J, y/ M" L( M. q1 s1 l1 C
{
4 \, V1 A( i: C8 M4 u" ?3 i( G# x pLight->Ambient.r = pInfo->_fAmbient[ 0 ];
- ^! a5 C3 K# J# z$ A pLight->Ambient.g = pInfo->_fAmbient[ 1 ];
: n1 m' O$ G" Q# e( I1 q pLight->Ambient.b = pInfo->_fAmbient[ 2 ];% _8 V: t" T- n2 w$ R3 v& O
* P% j5 V$ u, R9 R1 ?
pLight->Specular.r = 2.0f;1 @1 l1 D+ \; e. C3 q
pLight->Specular.g = 2.0f;
' a! Y4 g6 i8 {( ~ pLight->Specular.b = 2.0f;
6 D+ g& b1 U$ c' L & i, I6 X, w1 \6 ]) B4 O& Z: R
pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];0 I+ |3 w/ _ E ~
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];3 n/ ]- ~6 b7 v" y9 F
pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
~' t) u: G7 s6 n
* v8 L$ f. F; w( p( x HookUpdateLight( pLight ); , t) O4 c, X% P: k( {
9 R& k0 ]5 W# j) H; ^$ [+ c* x5 }
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
# f4 a; y* R: C' q0 K1 k
5 l, L8 ?7 o& E4 ? pLight->Diffuse.r *= 1.2f;
( O. L h' m' Q9 m" i pLight->Diffuse.g *= 1.2f;5 z# Z4 Q' `* S# d) U- h7 H& N
pLight->Diffuse.b *= 1.2f;6 u& b- c1 U( x7 p( M
. d" [6 a1 l$ b& K6 I pLight->Ambient.r *= 0.8f;% K& w& x3 C/ U a: B# L& k$ ]
pLight->Ambient.g *= 0.8f;
) x7 E" n1 h! E5 [+ G: s pLight->Ambient.b *= 0.8f;3 q6 E) A) [& h2 J9 Q% ?
2 f( J b8 ^9 J3 T4 r# i
memcpy( &m_light, pLight, sizeof( m_light ) );
7 W2 e9 y) ^/ q: f0 d8 Y/ K S* M1 ]2 ~% O, Y
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);" v. G" N3 t9 n& L5 @1 S
D3DXVec3Normalize(&(vecSun),&(vecSun));8 H9 ?- n; u w% d* R. g' B
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
: f% |, b& {* z8 t. C pLight->Appear( m_pd3dDevice, TRUE ); n% b. J' h- l) Z" | ?* K2 D" o
! J1 U+ R+ q) j: A7 U: G. j) \/ ~5 U DWORD dwR, dwG, dwB;
6 f8 y! H- D5 t, C dwR = (DWORD)( pLight->Ambient.r * 255 );8 W6 g) @$ Q2 G" I$ |: Q
dwG = (DWORD)( pLight->Ambient.g * 255 );0 D* w3 Y. o) `3 c* S( G% ^
dwB = (DWORD)( pLight->Ambient.b * 255 );
6 c; X2 C4 x2 ?4 k0 R. Z' A6 _ dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
! s0 S# }7 ~6 Q+ @6 {5 ]: w9 ? }9 H9 D6 O0 W0 F! Z4 g4 i
}2 ~" o) y8 T4 o. R7 A- D
}* \: W6 s4 I* ]8 J4 U2 N4 ~
else
1 ?% Q) N+ { i7 A; I$ P#endif & e+ U0 o1 A0 y9 w
# s4 N6 }9 ~# } v
if( m_bIsIndoor )
8 g4 ]2 g% x0 J, Q/ W ^ {- p. B) \8 j/ \7 @& W5 W; a
if( pLight )+ C$ F& E. U' M7 v! K- r
{
& Z; Z" Z. w2 u' v1 X) p( \ // à??μ oˉè* & M& p, k [, r. e
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;% V; ]- c, l0 Q( n# o$ J
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;
4 A" R$ H2 z5 n+ Q pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;
$ I& J8 u% G- V+ `6 E
1 P0 s( p. G" K/ w0 J, o // oˉè* ??à? * w7 h: c0 ]5 f9 y8 N5 T+ A# [. ?6 r
pLight->Specular.r = 1.0f;
7 x: D! `$ R. d- Y& K9 y pLight->Specular.g = 1.0f;3 D: _0 P1 T0 {/ ^; F
pLight->Specular.b = 1.0f; J1 f1 O: X, f/ c9 t; l0 k
// àü?? oˉè*
, u. c) Z/ ]& \5 o7 y pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;% k' Z. z) F/ _& x/ T8 E
pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;, b, Z2 c+ ?( _& ^- W6 ?, w
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
1 u0 W1 j& b. Y- n) T' X F( P% M2 l
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
- ?% a9 N7 H' z {
5 j4 r) S6 p' i/ L u x3 p# t/ g pLight->Diffuse.r *= 0.6f;
% {3 m9 `+ Q# e pLight->Diffuse.g *= 0.6f;
; v) o4 E7 {" ?' f4 p7 L pLight->Diffuse.b *= 0.6f;1 k; e3 L5 d* |$ F# j/ e
pLight->Ambient.r *= 0.7f;
. G# j: p+ w( C5 U, F pLight->Ambient.g *= 0.7f;
. l/ {, Z4 [- `, D8 s) q pLight->Ambient.b *= 0.7f;
% x- f3 t f& ?2 z8 Z }
# T( B: O4 N+ c3 D! F/ h9 d
6 U" {- d* G) s& v#if __VER >= 15 // __BS_CHANGING_ENVIR
; h9 n# F+ Y$ @3 [0 n+ O6 e, z, r7 N7 E if( g_pPlayer )9 d( ^2 |5 e" C% u: q
HookUpdateLight( pLight );# [- j0 `- A4 L! Q
#endif
; ?- d0 C) v1 K/ q/ Y" Y! ` memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
, ]* l; T6 ]2 x c4 V# h$ {1 G- D4 m4 E
pLight->Diffuse.r += 0.1f;
# ?: o. P+ K6 C4 g& g% Z$ }0 C pLight->Diffuse.g += 0.1f;7 H V9 m; h; J
pLight->Diffuse.b += 0.1f;
' \& e5 ^/ `- S% q // oˉè* ??à?
6 T7 F1 T c$ P. N pLight->Specular.r = 2.0f;* [' c8 z7 N% [; R$ Y8 H+ T
pLight->Specular.g = 2.0f;4 o' |0 K2 b7 J, R0 i4 s
pLight->Specular.b = 2.0f; F$ K, j8 [5 t( a0 ]+ d, _* S& T
// á?oˉ " H& S% l0 n" s* {
pLight->Ambient.r *= 0.9f;
% j2 o' g) n/ X& Y* q+ c7 h# U; w pLight->Ambient.g *= 0.9f;" L" q2 k$ X9 b# f/ G/ N
pLight->Ambient.b *= 0.9f;
. I: X; U+ N# C% }+ z: o% s! Y) I1 h
memcpy( &m_light, pLight, sizeof( m_light ) );
% m$ m4 n T9 n 8 R% c) `* C5 ~
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );- V. B/ g7 B1 u) G: D% J4 j) y" y7 Q; v) i
pLight->Appear( m_pd3dDevice, TRUE );
! I5 Y" K7 m: i" v ]# s. e0 h
. N) c( N/ O! y; P+ O DWORD dwR, dwG, dwB;
" M" e# R0 Y+ D5 p6 x dwR = (DWORD)( pLight->Ambient.r * 255 );7 |9 P7 {% @5 ~7 p& M7 A
dwG = (DWORD)( pLight->Ambient.g * 255 );$ z# H; A) z, `" h, [
dwB = (DWORD)( pLight->Ambient.b * 255 );
y2 L( U" p V/ D5 a1 T dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );8 q$ Z' U3 S. }: c5 Y
}6 l( l( W8 V' O+ J, f( L! r
}
/ {$ d& J* O5 ?6 T* h4 S# J else
1 Y- ^7 G* i7 _, S& I, S {
( |7 y5 P, c" i0 ? Z4 b5 H3 { if( pLight )
. _3 i$ m1 {: G- N! q, W8 \( @ {* H$ J! {/ o9 [( L/ s: Z5 \
/ K- a% u }/ Y) Y
int nHour = 8, nMin = 0;
5 O4 i( ^ G5 q6 D1 b2 b5 T8 S+ D. a. @ #ifdef __CLIENT
$ w4 { A8 S- ~9 F! d& m // ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù. + f9 t$ Q' f" M( v+ x
nHour = g_GameTimer.m_nHour;$ Y" G+ O v/ w
nMin = g_GameTimer.m_nMin ;
, N, Q) P' }1 d" E, `0 ? #else" b: C5 G6 V" i! O3 d
// o??o??′? ??°£à? m_nLightHour???* °?á???′ù.: i i5 Q) H- p' j1 x+ _
if( m_nLightType == 1 )6 J* l# A) u* D/ @% N+ _% V
nHour = m_nLightHour;
' D$ h- G. B' ]( x0 a #endif
6 K+ b8 ?) K U. y% C nHour--;
; i7 g: v- j7 f: m9 l if( nHour < 0 ) nHour = 0;
: d( y1 u# G" `# b s$ M7 z if( nHour > 23 ) nHour = 23;
1 n6 g% q8 G" G6 I) l% Z) @9 C/ l
, G' h! Z; F% P3 }" f' h0 C2 ] c //if( m_bFixedHour )
$ u' H; l- `/ W7 n; R. r // nHour = m_nFixedHour, nMin = 0;
! }; B2 `( f% C) }/ w LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];3 J0 c! F, C6 w5 Z
LIGHTCOLOR lightColor = m_k24Light[ nHour ];
; }0 ]1 e5 l, Y4 Q3 e5 e: X. x; w, @% _
//m_lightColor = lightColorPrv;/ }& g9 D }# c K% K: b j Q
lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;( W& J- h/ S0 X+ d! U
lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;
- @" J8 _) h8 X8 }6 ^0 U lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;, [+ M* E/ M% I4 D
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;, f9 k( M3 J4 X, }
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;/ Q# L9 i4 `' J$ D! C' E% t
lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;8 R6 f, C; `5 m1 V% \" d9 M' K
// 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)1 ^7 t2 t2 x4 w8 b( F6 p" W+ J
+ g5 O# {" z: t0 _! |/ S
// à??μ oˉè*
. s0 Q1 Y. B1 r4 Y' `& T) W pLight->Diffuse.r = lightColorPrv.r1;
' \" ^+ G/ Y4 [/ o& [ pLight->Diffuse.g = lightColorPrv.g1;6 m; c! H/ j' U" L( n$ N8 S/ c
pLight->Diffuse.b = lightColorPrv.b1;
" D6 f/ }, s M3 X u // oˉè* ??à? ) S& u/ R5 M3 s6 Y) _, y
pLight->Specular.r = 1.0f;
: Z8 l9 T8 ] x pLight->Specular.g = 1.0f;
) j8 G" q9 @. W pLight->Specular.b = 1.0f;0 n0 O% h |7 W/ r( g
// àü?? oˉè*
+ R g4 X) i; z* U: a pLight->Ambient.r = lightColorPrv.r2;
2 ~9 L0 s% m+ |% ]0 O# u pLight->Ambient.g = lightColorPrv.g2;, V U J, a8 R' X: w& a
pLight->Ambient.b = lightColorPrv.b2;
2 u6 ?) H( Q, N/ u
. {9 w1 E# v7 _! E- d) y& k1 B7 ^ if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.- L9 A: }9 N& }1 e# P
{
. k! ~) z: q: n4 f& ^7 J( @ pLight->Diffuse.r *= 0.6f;
, R& D. K" E* s$ n4 h. \7 D* N& R pLight->Diffuse.g *= 0.6f;
8 I6 D6 g- F4 B- P( c, c6 z* w* P pLight->Diffuse.b *= 0.6f;
$ [- w' C( J) h+ U }* _ pLight->Ambient.r *= 0.7f; i& G) I' Z% M9 {. T4 b- J
pLight->Ambient.g *= 0.7f;
% g$ G! I% H; X9 n pLight->Ambient.b *= 0.7f;1 @" O. Y. O& k3 j8 u5 ^
}
6 {4 E! G7 G/ g1 n$ r* t
& c) m' M! `! l7 C- \2 [#if __VER >= 15 // __BS_CHANGING_ENVIR
# z) w( B. T) v( E. r if( g_pPlayer )
4 { t- |# n' @0 ^ HookUpdateLight( pLight ); ~$ g- y3 d* l* C
#endif
$ i$ @( j, R7 ?; T; d* c memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
5 D8 y& @: q+ n U7 P t
3 {+ _, w" M7 h( z7 K9 a) C; u#ifdef __YENV
4 O, z% z% G! M; m6 J( J9 g+ v pLight->Diffuse.r *= 1.1f;6 q5 j. |* g% \& Q) W& Y) h
pLight->Diffuse.g *= 1.1f;
. F* }) T8 \' r6 P pLight->Diffuse.b *= 1.1f;
6 Q% g$ O8 n; t o# r. J) i+ g; ] // oˉè* ??à?
: L% R8 z2 |) j/ _ R& { `- v' _ pLight->Specular.r = 2.0f;6 T' A* ?" L, d2 y
pLight->Specular.g = 2.0f;7 e% m$ w" `% F/ B* m7 t( L1 l
pLight->Specular.b = 2.0f;$ k! C( R3 z) N- F1 j
// á?oˉ 1 F$ z9 ] N' O
pLight->Ambient.r *= 1.0f;
- ~4 ~% j/ O! [% R pLight->Ambient.g *= 1.0f;8 Y! V! R8 Y4 ]
pLight->Ambient.b *= 1.0f;! l6 e/ v- t' a7 L1 q/ L
#else //__YENV3 @3 @3 e- V$ i& z
pLight->Diffuse.r *= 1.1f;
/ R6 M3 q( I0 i5 `4 f pLight->Diffuse.g *= 1.1f;8 g1 J/ N ]" G+ l6 G! N
pLight->Diffuse.b *= 1.1f;' u) P9 n O9 E9 r- n5 d) B
// oˉè* ??à?
" r3 Q7 L6 `/ m% L pLight->Specular.r = 2.0f;: C: }( |2 r( L! G
pLight->Specular.g = 2.0f;& ?; Z$ D" T, b5 g" P. r: \8 n3 x
pLight->Specular.b = 2.0f;* S/ m0 }% q0 |+ I
// á?oˉ 5 p/ ^ R5 y8 g. l7 D/ z
pLight->Ambient.r *= 0.9f;
1 |9 w/ ^6 H9 B' w& d" _/ e8 D5 M pLight->Ambient.g *= 0.9f;
6 }' Z, ?* c4 s1 k. S! D+ |& ~ pLight->Ambient.b *= 0.9f;
. O o- w% E& O* T" N/ [# O- i6 d#endif //__YENV
/ X2 V2 r; p' E" L ( f: s" W5 q, n0 ]2 ?* J
memcpy( &m_light, pLight, sizeof( m_light ) );
$ t' l9 \" |# C! j7 J0 d
8 F6 Y( @4 S5 ]% v5 G0 l D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);
/ n1 a9 N% F' u0 L7 \. u& x0 x. I D3DXMATRIX matTemp;
( j( L- w7 E, F: k, z: V static const float CONS_VAL = 3.1415926f / 180.f;
1 I0 B6 m( m+ Q$ L4 f4 Y8 g( @2 y5 K M3 ]6 x( e$ N
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);) c1 f. U, ^9 ]3 @) P
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);
' f9 p, f" U) A8 }( R+ V+ l pLight->SetDir( vecSun.x, vecSun.y, vecSun.z ); 7 H. x" E/ D, z& z
pLight->Appear( m_pd3dDevice, TRUE );
, R6 W' Q& |/ P! @( \; c
6 n* F' [% G& |; N/ ]. i& ^# I // D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);& K- }; M: s4 c: s& |
// D3DXVec3Normalize(&(vecSun),&(vecSun));
1 r7 Y8 a& |% R$ K2 w* ? // pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z ); + X4 U6 H* h5 {: a. D" V) f
7 H9 S6 \' {; k$ h# u8 ]0 n
DWORD dwR, dwG, dwB;
1 N0 w3 d, ~4 i: b) a: R dwR = (DWORD)( pLight->Ambient.r * 255 );
" d% L x; g8 O% {. x9 p dwG = (DWORD)( pLight->Ambient.g * 255 );
3 |& H3 u- V2 A0 Z& H$ A+ { dwB = (DWORD)( pLight->Ambient.b * 255 );( D% l! A" C7 K$ T
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB ); 2 s: D! s) ^, M7 S" p/ ?1 S
}) C0 P/ b! _) Q/ T. ?" h1 {% W
}2 M( T; a2 o! o% Z
9 f! A6 F- B, v3 g/ M* f3 T! j( I/ E m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );' M: j: \; u% }7 G
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) );
2 t* `. |+ i, u ::SetLight( bLight );; S% l2 {4 v# {: R; p
* `. d; r, r! u2 m" a1 C // ±ao? ?D?í???ó á¤à?
; E5 N# M$ N5 E4 f5 y8 l m_pd3dDevice->SetMaterial( &m_baseMaterial );2 F% V) e5 r6 O$ E0 w
- ?( x: l% E7 l/ b# P
#endif // not WORLDSERVER) e' Z* X) q5 h: M/ A) {
}, Y! P- A, P/ D0 |- H
并更换
x3 ~ q$ @$ x2 M3 `' }& uCode:/ F3 Z4 J, J8 X$ a
__FLYFF_INITPAGE_EXT6 |( W/ |. _/ p7 W3 I
定义
4 K# ~9 I& H" X$ K: f- L% o, P( G1 E& u! `
, x! M4 Y1 U: c3 _7 \, B
3 n B5 c2 Z, Y2 g
5 W8 ~1 A% N* v2 k7 t现在终于删除我的狗屁加速...
3 H( M% \& W4 R; C+ _
1 c2 X4 \! k# f2 r$ j
$ l7 {# z% Z! \1 ~4 {& P2 d- S& @/ O7 @; w; M
|
|