|
|
食品车:
1 m, ^' F# o( D+ J尾翼:4 k; C8 x* Q# q+ ]% D( z! W
3 s* H! w2 U* G I; F& \; V4 I
代码:: f( w& q% f6 F6 R7 @0 N& I# j
CWndAutoFood::CWndAutoFood()
+ H% |7 K+ ?/ P& j: i% X{
% s+ b8 X: v4 r+ z. M3 k m_pItemElem = NULL;; F+ Q% C) X |+ `, L( A% Y! M/ v
m_pTexture = NULL; A! P' p' R. x6 `- A6 N
bStart = FALSE;# [ h. ?# T& o) t( Q/ o
}
* O2 Y- L/ y A: }: s" B" N0 g, S* ~ O- C6 p# A
CWndAutoFood::~CWndAutoFood(), G8 f( G; m6 a* {9 [
{
; ^% ^1 s% k$ [# @( a AfxMessageBox( "AutoFood ist gestorben " );
( `3 S- e7 s5 x; N( H+ x! R}
- w- E% y: G8 I+ P9 t' ?BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
) C" g; z; b) t/ F{8 M! X' Z7 ? k5 [; s
return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );; N4 o9 G4 x- z
}, g6 V) n; K) b. z, I% e
6 {: l& j- a" n4 Z, [4 P4 w
BOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
: u1 P: t# X4 n{
" X8 ^2 I* p8 u) `' g LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
. p/ r T& x+ q+ w CRect rect = pWndCtrl->rect;7 |, H. s# m% o+ T: }" B; w
if( rect && rect.PtInRect( point ) )
$ C i7 F& Q8 P4 _7 x7 o+ \ {
! Z. l* S$ A6 F5 O CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );. g+ r8 E' _; k! f- s4 y0 P
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )
! E" j" s2 j9 P. k/ h* i {/ W& o% t1 _: W
if( m_pItemElem )
: f% X9 g% |2 h1 T, A {) L, N$ t- z0 [: h
m_pItemElem = NULL;; a' ]& C% i0 A0 j) v, J8 j, n) t& \
}
, |, v; U0 g2 |1 Z7 O m_pItemElem = pItemElem;
* \: o$ y+ x, {( x7 V8 p$ Q m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );3 Q! O/ B1 X6 x5 y: ~
}else{' p U* e8 P2 c. f6 `% D$ j) r
SetForbid( TRUE );3 `# f: i; _) e( H
}) I( f) `2 m/ a4 d% g d# `
}else{; f) `8 `1 t) [+ }/ [9 C
SetForbid( TRUE );% f5 |3 O) m% }- E) e
}* o& U9 m# r) z* E- b7 l' U
return TRUE;
$ K* q: T& p" G! L* L}& Y( K! f: O+ H$ w5 g! }; j: }) I
5 } a. b6 \* @3 F3 j# _BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )3 ?" X2 }: z4 Y7 i
{
1 O4 U q& M5 u( m switch( nID )
6 ^! x9 M7 R/ U( r {
/ G8 `& V2 W& Y& g case WIDC_BUTTON3:
" ?& c, `( q: ` s8 e {
. t, u z6 g( m2 [ bStart = TRUE;
0 F' S$ C; c9 b( l break;
% F2 r7 v: Q( U+ b5 I# ] }
. j6 q9 M7 d ^! V case WIDC_BUTTON4:: M# s$ |4 [; }7 E# \
{
% q* ~) D+ V* M8 A bStart = FALSE;
" V5 ?2 |- {) m$ {. N4 G( T+ D break;; M; P8 f) ^. L9 J% ?
} j# a Y( Z, W3 c! F# Y1 n
}+ k9 X5 O. |' S! M- j) r+ x2 u. z
return CWndNeuz::OnChildNotify( message, nID, pLResult );
9 f$ p) {8 s2 \} 9 l( g& L- p! N: c
void CWndAutoFood::OnDraw( C2DRender* p2DRender )
5 i. f/ Q9 p/ S) K{# {" S6 u* U" `* \
CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );$ _8 {! J" u6 f# U l
if( bStart || !m_pItemElem ); Y4 ]4 u1 Z2 @; {
{
; X) b' n. B( ] pBtn->EnableWindow( FALSE );
: m& s6 O6 B- j4 H, \ c2 l5 t }else
: F1 [2 B* O4 o: ~4 X pBtn->EnableWindow( TRUE );+ {& Q+ U6 k' r% Q) v; r
if( m_pTexture )
V) E2 z) U# Z/ d+ R. |9 w {
6 V$ K6 v) |1 @! m, o, y LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
' j3 X0 A0 L6 u! m7 r# d7 x# l% V if( wndCtrl && wndCtrl->rect )
1 ~! _7 h/ x5 A+ I {8 ~% L6 V0 [1 | T" W5 a. D5 D
m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );5 }. C4 [0 }& W0 d8 b/ P
}
9 H* [( r6 H& ? }
, T( e% d) W) [5 T7 m9 e6 n' I5 _}1 G: j9 T6 Q% |5 Y) J7 M
% ?. \! s3 J1 E7 g. m
BOOL CWndAutoFood: rocess()4 v& O8 Y4 o8 z) i$ o3 Q0 {, j
{
7 Y' j7 ^6 n/ t( ? if( bStart )
1 ~' c* f& W+ ] {) [" a9 i- ]3 Z7 F
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )
3 ^ s' T( e2 I" j {$ X. w# u* ]. m
if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )
$ H6 v' v- a5 P' b$ E' P g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );/ m9 a9 b; N9 F3 g0 \4 v
}else{9 T: N' r$ R, ~6 d; f
bStart = FALSE;( {- c, K/ D- C( I# P) E$ Z
m_pItemElem = NULL;
2 n9 z% z7 w" b q# R }
0 `# e8 K6 c/ {0 E4 ` }
# z- A9 ?/ @! h$ H5 u. l return TRUE;
4 k8 I$ ~" B% Q# V3 T" }" \' q# {9 ~}1 [$ b3 u- X; Z3 p. a$ e
' A3 L$ N( m4 V) D! V* ]/ K登录视频废话:" q- K9 Y7 ]1 Z2 O
尾翼:
3 C$ `4 O1 W) b$ I1 ]& e9 k) {7 e! }9 ?/ @/ X0 G
代码:0 b+ n3 H4 E% S
! `0 _5 G+ x) d* P5 q5 ~! n
void CWorld::SetLight( BOOL bLight )
" u) p: @2 V/ n" u$ S; kdurch
9 ?3 u' c6 T" \8 p$ nCode:, @5 W5 v. O' I" d
void CWorld::SetLight( BOOL bLight )( k, T+ ^3 ]" k* m, [3 Y. A0 y
{
% `1 u5 v- B7 K4 C7 s, G6 n% l //ACE("SetLight %d \n", bLight);& |- j/ ~% s/ u
' h5 Z: B. ~( l4 R" q0 R! h#ifndef __WORLDSERVER
( \& t6 M( n! G7 Z* t DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);8 l2 S% k, f$ ]
CLight* pLight = NULL;2 p. z- [* D8 `$ _" }* L9 k3 G
" Y) r! p4 `1 Q/ ]; k" T
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
( s5 F+ R# w1 M6 c- x' l4 }6 Y e
5 `( C" v" p9 \* m pLight = GetLight( "direction" );
2 ^, t( B% ` A
0 u0 L7 ]4 Q/ {# q#if __VER >= 15 // __BS_CHANGING_ENVIR, a. D6 b2 }: V+ r
if( g_pPlayer ){
, O8 y" g; u1 x i* |; H ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );
% {/ p; `5 y6 p/ h$ Y6 Y" ~ if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!9 L; [6 I: m7 B/ f5 S" ~) o
{
. {- Q9 G# A/ K- r$ ~ if( pLight ). H8 I( Y6 T4 | J, ]: z
{
' j* Z4 Z9 w0 d7 N0 ` pLight->Ambient.r = pInfo->_fAmbient[ 0 ];
1 a/ t1 t# Y$ t; I6 y pLight->Ambient.g = pInfo->_fAmbient[ 1 ];
0 u6 I8 e0 H0 M2 r' @* a2 |/ c, W pLight->Ambient.b = pInfo->_fAmbient[ 2 ];) P5 y- B3 {9 W) n, q9 r: |$ \! t5 H
+ b9 p) B& U6 ]/ n6 M2 c pLight->Specular.r = 2.0f;
5 Z* Z. S+ ]' a7 t" M pLight->Specular.g = 2.0f;
% k x3 d' Q* g5 b. G" O* v pLight->Specular.b = 2.0f;7 z! h4 }- K1 G/ x; K0 L
, ?* n6 `6 ]+ @3 I1 @8 N; h* [) ~ pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];7 N8 y* p6 l+ Q1 t1 S. P% z% W
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];' h+ j# E9 P% n: Q, a3 e
pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
' v y: p Y/ F2 i& { - s, l0 I6 c7 D8 i( [1 \# L
HookUpdateLight( pLight ); " z0 ?2 v+ Z, X3 H( C* H& Y. D
' z0 U! E, M( Z% U, i( ?7 j
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );# T4 b- f/ s" j7 ^
/ W. ^+ {( I; E pLight->Diffuse.r *= 1.2f;
0 \# p+ [) U4 X4 j8 z pLight->Diffuse.g *= 1.2f;. s5 s3 `8 P' B7 R: e/ H/ k) E6 i
pLight->Diffuse.b *= 1.2f;
" k& b( e3 z+ j' C" S/ n6 o. p; {2 D: r# v
pLight->Ambient.r *= 0.8f;; C( \ m ^; O$ R) s
pLight->Ambient.g *= 0.8f;
. h+ l8 o) L4 E' v2 K. d U5 _: ? pLight->Ambient.b *= 0.8f;% M! b7 M" R* q
, }; C- D; L1 W2 e( _ memcpy( &m_light, pLight, sizeof( m_light ) );- O' w) `! j; W" {% P$ l1 l+ |
" m6 X: S/ ?( {1 q, D D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f); t2 W7 D# P/ H; p1 _; T
D3DXVec3Normalize(&(vecSun),&(vecSun));
5 U( K( d' ]- a" f pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z ); * v/ Y P$ F! H8 I1 M; q
pLight->Appear( m_pd3dDevice, TRUE );+ X K1 ]) C4 q5 w' A4 C& x- ^
& n8 }+ d! u* E% F$ y
DWORD dwR, dwG, dwB;
9 V2 @6 n1 f- n+ ?+ }$ K/ W7 \ dwR = (DWORD)( pLight->Ambient.r * 255 );
% T: {% ]* w9 v# k dwG = (DWORD)( pLight->Ambient.g * 255 );* L' }9 Q, S" w: D$ W
dwB = (DWORD)( pLight->Ambient.b * 255 );$ A( b( _# J( \% a
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
; b) r+ U7 P' U5 p2 Y3 H, y! M0 | }
: K8 q7 F& n0 @4 c% X }* K" a! I0 T7 C5 B7 `" P4 q* e
}) w% P+ _) m* ]7 j0 e/ O* B
else
; Q2 K, J0 c$ X0 O+ P' f#endif
& m! ]! W/ B. h6 }" T, s; s0 M
2 k: K$ U6 F. k+ r if( m_bIsIndoor )
- ?( O5 I- s+ D2 j6 S' l {$ E! ?# J% L# d
if( pLight )2 F. w( |& E$ }+ l1 W9 B0 b. }: L1 E
{ # y$ D" P& R: k! Y& O% ?
// à??μ oˉè* 1 ^5 Y- @* C3 a/ _
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;
; ?" G# E1 S" u pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;+ Z. }4 U) F7 a5 _3 g9 R6 y0 B& w
pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;) ~6 Q: @; S/ h0 y1 i2 g6 [( z! [: `8 h
4 S! i* V! t0 y
// oˉè* ??à? . ^: D8 M% x0 `
pLight->Specular.r = 1.0f;
/ P7 b1 _3 O' A9 S7 E8 B pLight->Specular.g = 1.0f;: s8 V" m( V" x8 E* x5 ?. o; M' U
pLight->Specular.b = 1.0f;$ z4 b" t. u) u! |% u
// àü?? oˉè*
+ g' d: G9 Q' s7 |0 [1 A2 Z pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;
8 `9 S7 X1 O5 f1 h pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;
, n3 R1 h9 O2 I. L pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
. j3 @ e# p, A5 D1 J+ t6 X' _" d& R4 Q- G( n
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.# V: b. d6 Q9 W! G( @$ g
{2 B; a' _: f% V" }! j
pLight->Diffuse.r *= 0.6f;
7 B" r# y; a8 L: I3 z; P pLight->Diffuse.g *= 0.6f;% r. v( P) H1 v t z% G9 j* M
pLight->Diffuse.b *= 0.6f;+ T; s% \4 s9 E3 U9 c: f1 L- Q
pLight->Ambient.r *= 0.7f;0 P; r2 x3 L! K
pLight->Ambient.g *= 0.7f;: c$ W* }2 X( u9 F' r, X% U
pLight->Ambient.b *= 0.7f;1 k! F7 W# }$ L
}
u8 R6 b' n* h. X+ k( e
2 I9 S6 N4 [! C7 T; L# E#if __VER >= 15 // __BS_CHANGING_ENVIR
; L# K) Q1 c9 D! L" o. l if( g_pPlayer )
' c5 j% r/ C# `) Y) q0 w! k/ B HookUpdateLight( pLight );" j, I+ H: E8 c% w; g" p$ }7 I
#endif0 t, w$ @4 ]' x6 r4 B
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
/ ~* u, m9 c# `" O0 h2 T+ Q
1 e9 w) u- N( G+ N6 L7 t pLight->Diffuse.r += 0.1f;; B! v5 x. a5 Q8 C
pLight->Diffuse.g += 0.1f;: ]$ z+ c- p( ~* x/ h4 J' V
pLight->Diffuse.b += 0.1f;
2 @: ]% D7 x1 a: D. h // oˉè* ??à? $ O9 i* c3 E r+ J/ x
pLight->Specular.r = 2.0f;3 p# R9 E) y. s% Y# ?
pLight->Specular.g = 2.0f;
2 _: l$ r3 ^: S+ u8 o" c8 c pLight->Specular.b = 2.0f;
& o% s% V' ?( ]4 t1 V* |9 P2 z4 \' W // á?oˉ
4 I$ ^8 _% A+ Y2 q d3 k7 _ pLight->Ambient.r *= 0.9f;# T/ i. Y$ v- t
pLight->Ambient.g *= 0.9f;9 J6 k+ q: X# ^- f) t+ Q
pLight->Ambient.b *= 0.9f;* S5 U. H- C* `; N
# |4 M5 ~$ k% e! r) g memcpy( &m_light, pLight, sizeof( m_light ) );* u: i: n; a( }- }, r
6 b* o3 H' x% R6 `
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );- y* s. X4 e. I5 z9 M
pLight->Appear( m_pd3dDevice, TRUE );
7 j9 ?: c7 \! B $ M, c4 W* f) X( G" J0 {( i4 |
DWORD dwR, dwG, dwB;; a! u$ g' Y$ `7 \! O
dwR = (DWORD)( pLight->Ambient.r * 255 );* r' g. {; @5 P$ D; r
dwG = (DWORD)( pLight->Ambient.g * 255 );' t8 v. {/ o& |0 |/ i# _$ U
dwB = (DWORD)( pLight->Ambient.b * 255 );
. `5 J5 L5 b g* ?3 {; T ]$ G dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );8 F1 o% h0 [4 i6 k& ~7 l
}
6 C( ]# U+ c7 D$ f }% T, K$ w) E {
else
# L# H% B& `: g B$ L {: ]* k! K3 |$ O# m
if( pLight )/ g8 z; U) _& N
{
) b! H1 w3 ]- k+ j 4 s0 p7 p3 O7 j& m8 I
int nHour = 8, nMin = 0;% T5 e& _0 h9 l' N4 z% F
#ifdef __CLIENT
$ G9 U! e4 p: N% e: Z // ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù.
6 t n" k$ {' g5 q nHour = g_GameTimer.m_nHour;& W& r6 Z) ^# x( y8 e/ v6 [& {6 @
nMin = g_GameTimer.m_nMin ;
; q) ^! |/ x9 z, r6 r. `/ o) ]5 d #else/ a, f7 ~/ A' I4 a& Y9 a
// o??o??′? ??°£à? m_nLightHour???* °?á???′ù.- H* r) c& m, R" s
if( m_nLightType == 1 )
% l$ S' R' r2 N; ?3 X1 r nHour = m_nLightHour;
4 ^, \8 V) }+ B6 v #endif/ F# d5 L" v; Y/ |- Q
nHour--;
% g8 O& U& d# @) P8 a A# b if( nHour < 0 ) nHour = 0;
9 ?& d; u1 T; I1 B8 q if( nHour > 23 ) nHour = 23;# s+ V& t/ \, ~% K8 X
9 A5 O# \/ [$ e& e% M4 |2 Y' i
//if( m_bFixedHour )7 t+ w5 d( l7 R" L6 L
// nHour = m_nFixedHour, nMin = 0;
! P& t( T) ? d% I5 c" W% _ LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];
* |' E r- R! i9 o) H. s* P; r* g LIGHTCOLOR lightColor = m_k24Light[ nHour ];' e4 x* S% q% b9 D% A+ y/ M
! `2 G4 n8 v& s( B& k$ b
//m_lightColor = lightColorPrv;
4 t9 \ X, w$ Y( h8 O lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
+ q" @6 i E/ S; @8 N* h: d lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;
; N% v: |8 \$ }& t: k lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;
Z9 ]/ A9 \% h( k6 N: w lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;: c+ t$ H0 `! z, s6 g& ^
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;
6 f/ s3 w0 ^0 V7 U8 ^ @ lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
% U- X8 a) K2 p+ s // 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)
- J8 Y3 e }+ V5 N& s- ]- r
% W' c' p0 ^/ q6 H* g4 h // à??μ oˉè* 4 M2 `9 s9 D2 I o. |3 N3 q6 z6 ^
pLight->Diffuse.r = lightColorPrv.r1;
4 j* r5 T1 V: h pLight->Diffuse.g = lightColorPrv.g1;; u! D3 X9 q# ] q( u% i7 t4 N
pLight->Diffuse.b = lightColorPrv.b1;
; B& U' _, J- a+ o. ^3 p ?) H2 \/ @ // oˉè* ??à?
* x) o7 K! o4 i- r0 L4 t pLight->Specular.r = 1.0f;3 q/ V( o' k' n& \
pLight->Specular.g = 1.0f;# J4 Y% `6 C% G1 R* ?% J9 _
pLight->Specular.b = 1.0f;! ~0 M8 v1 o% h' e
// àü?? oˉè* # }+ A* }; x) J6 N
pLight->Ambient.r = lightColorPrv.r2;; y3 g2 }* e6 [1 R2 V
pLight->Ambient.g = lightColorPrv.g2;
. a, ?( C2 W5 ~0 A0 ]9 t- L pLight->Ambient.b = lightColorPrv.b2;
% m4 X$ B" n3 O( B
9 m6 G! B3 z1 d: J8 ^$ t if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
7 [ p$ J) R# {: |- Z- l* T0 k1 d& [* W {( H6 t" ]' C! o& U( J
pLight->Diffuse.r *= 0.6f;7 q3 L( N4 C+ n% S$ n, U
pLight->Diffuse.g *= 0.6f;$ K- _/ M# s/ G3 Y' }( e/ G4 b
pLight->Diffuse.b *= 0.6f;+ Z+ M- e2 P7 V: n1 [ T
pLight->Ambient.r *= 0.7f;
$ a+ ^* Q4 V, q- |5 _; R" u pLight->Ambient.g *= 0.7f;& z- e6 D T- y/ u# g" M
pLight->Ambient.b *= 0.7f;
' z" c4 E/ _/ a* z9 [1 P }
9 t8 W. A I* X C8 _* |, l- h, f$ _
, k& [+ X$ m$ R5 u. y' C* [& `: E. w#if __VER >= 15 // __BS_CHANGING_ENVIR$ Z: S" s* |$ T) d- U# g
if( g_pPlayer )
' s& f7 ^0 @0 m' C1 p HookUpdateLight( pLight ); 4 t G7 S; h5 U! h
#endif
: ]% m5 S/ F* U$ t# U: G$ [9 Y! s3 o( \ memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );8 W, F/ q$ m) a! a
3 u* a; g I3 a6 \* U" o5 r) a; ^8 t#ifdef __YENV& |3 p# ^: p/ ^6 x' F$ D' f2 M
pLight->Diffuse.r *= 1.1f;
7 p7 ^+ ]1 D* l S pLight->Diffuse.g *= 1.1f;
; S+ X) k* o5 R& t, n pLight->Diffuse.b *= 1.1f;
; [& t/ z4 B' e. C$ G |2 w( W // oˉè* ??à? : u/ e/ V0 Z( ~' O, W6 l8 h
pLight->Specular.r = 2.0f;0 K5 z* q" q2 u( C; {
pLight->Specular.g = 2.0f;
" i" Q O; T! i! j7 l1 X: v6 K; r; q pLight->Specular.b = 2.0f;8 ~; K- M) S% Z$ Y2 v
// á?oˉ
6 q) A# ` @( B' l3 a2 x( J pLight->Ambient.r *= 1.0f;
2 n8 ]. H! c- C7 s9 K* M! K- X, W( N pLight->Ambient.g *= 1.0f;; d- D- ~' i/ ~
pLight->Ambient.b *= 1.0f;
8 @# O8 v3 ^6 P& c8 Y#else //__YENV1 j3 u& @2 |' w# W
pLight->Diffuse.r *= 1.1f;$ ]9 x# V/ R7 G7 o
pLight->Diffuse.g *= 1.1f;* x+ c+ m1 N" O/ B5 ^
pLight->Diffuse.b *= 1.1f;
4 [0 u# I2 M7 j( y. Z // oˉè* ??à?
! x8 [8 U$ Y% I @) G5 a. k pLight->Specular.r = 2.0f;1 H0 Q* m, p! E' l) e7 Q
pLight->Specular.g = 2.0f;. q$ l9 w ^ Q% J8 i o" X
pLight->Specular.b = 2.0f;
" {5 ]1 a5 ?! a/ ^ @ // á?oˉ
$ u- e% `* `, u- n4 q' ~8 D pLight->Ambient.r *= 0.9f;! F% z5 D; q2 E4 b# D# ~
pLight->Ambient.g *= 0.9f;
2 G" J5 u5 @5 _: o, g pLight->Ambient.b *= 0.9f;
' ^8 e+ f/ }* t k7 A. ^#endif //__YENV
2 a! S/ k/ W$ Y& q+ v 1 Z# T4 A9 M1 ?4 e' f% @8 j( e
memcpy( &m_light, pLight, sizeof( m_light ) );
5 _2 `6 y# K" S5 i
8 _0 R3 A; J# Q. m) p D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);
' r( z/ t) j% v+ d S" u D3DXMATRIX matTemp;4 h3 U6 ~: W4 e) }1 z& {
static const float CONS_VAL = 3.1415926f / 180.f;
8 h' _8 k' K+ E/ e2 k0 L. O
[& L2 M Q) m) E @ D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);; B- I2 N" ?+ X$ h! j) S% Y" B
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);! x" U; q; Y; \& X9 x$ G
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
( b! d" c `. U& b9 M, a* p pLight->Appear( m_pd3dDevice, TRUE );
& P9 w) d% V$ H) A5 G; `
/ s& z0 [- Q- L( z R' s, m // D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);# g) i$ T3 o4 i# a8 G
// D3DXVec3Normalize(&(vecSun),&(vecSun));. G. {2 N& u- _( r3 R' Z
// pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z ); 6 q7 y b. {; U' r2 u
d7 q0 h" K( O6 @
DWORD dwR, dwG, dwB;
2 K6 r! R" b! A5 ?, ]$ K- G6 g3 ^' t dwR = (DWORD)( pLight->Ambient.r * 255 );7 t* O/ N4 J4 K: x. ?- P3 m
dwG = (DWORD)( pLight->Ambient.g * 255 );0 E' U: c6 N, Q- P' ^1 k
dwB = (DWORD)( pLight->Ambient.b * 255 );
+ F7 H$ m5 Z9 ?. N dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
$ w8 i4 Q! I9 q9 ~: W% H }5 M" U2 m* L3 A6 f, r. f" I
}
9 H- K0 u @7 f4 @8 h" }8 R# o4 h3 C7 j; q' M$ n
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );$ a0 \( B- a7 J. A
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) );
, O7 z) E: f& c% }' ~8 ? ::SetLight( bLight );* x3 X2 D6 e# l3 _3 l$ L
) Y' I* R% e( ?1 j0 z E/ x // ±ao? ?D?í???ó á¤à? 9 n4 @) P, t4 G+ l* E
m_pd3dDevice->SetMaterial( &m_baseMaterial );; ] B7 }/ b& e0 M$ S! y# I) ^9 ^. ]
L$ p! q0 c' `" f$ \( ]#endif // not WORLDSERVER
( l& u. ^3 X9 s}; A5 L& j/ Z, l9 ~ d5 _
并更换1 e9 i7 N n, U& }
Code:
' e8 Q K) E* r1 i1 O* C7 J, M T__FLYFF_INITPAGE_EXT& E1 w7 b2 D1 C3 E( O9 w% h$ d4 R
定义
! a6 f" T/ a% n; h& j7 {. L
) b. ~5 t# q5 }# g& @. d3 W( ]
M; d5 }1 s9 r/ W: x' a' L8 h6 n8 Q( \% B% g0 G
5 p3 p. L* k# ~2 {' M1 n4 h$ q' c& W
现在终于删除我的狗屁加速...4 v/ E: m6 J& a, j; Z& S' J# f. }
* e/ o/ a/ e) z: ^) O) D+ g& N
; S% c4 W( ?! w: i0 o: a! x, N& L
( S& g l( t: f" Z4 ~ |
|