飞飞世界论坛

标题: 自动饮血和登录视频 [打印本页]

作者: admin    时间: 2016-1-10 03:46
标题: 自动饮血和登录视频
食品车:7 X9 v$ P# R# T2 n
尾翼:( X4 a% c4 k! K/ e1 C3 n
) T1 H3 I5 y* v$ F
代码:9 E) P  r  P, w7 \% y8 V* f
CWndAutoFood::CWndAutoFood()
+ W6 a$ N- T0 r5 ~" p0 U: k  b8 U% Z{
8 T+ j' x& h9 F6 h# t        m_pItemElem = NULL;
  ]# Z* N9 W6 X$ o) t1 b        m_pTexture = NULL;
$ \) N% L; R+ s' M+ d! F, B# a        bStart = FALSE;. p- F9 h2 U5 q( ~" @2 c" P! w
}$ Y4 w( _4 X+ j( b$ y
+ }' H4 z5 }* k3 z4 H; X
CWndAutoFood::~CWndAutoFood()
; Y8 X2 A) _3 Y1 N2 Q( T5 E{
1 N0 c, g) a6 k7 r, ^        AfxMessageBox( "AutoFood ist gestorben " );
1 R8 A* }+ k$ W- W9 P6 `) Y}" B! z" Y  ]! g% }" I
BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
3 ]3 D7 W1 T/ u( e; o% K{, _, [  _5 Q! [7 j7 v
        return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );# R0 y3 S/ x8 a0 V. @* M- \
}
6 V5 p. S& J0 M) r1 p9 N, b
0 i, k9 [& `' a$ V' \+ NBOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )' f6 J: _, d: o
{' r/ m& {) Y3 g5 m- W
        LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
8 t# T6 b) [. |" Q0 |/ a* M        CRect rect = pWndCtrl->rect;2 T% r3 ?* ^2 h5 |& R: G
        if( rect && rect.PtInRect( point ) )- y& C8 M/ T" w% {) ^( u
        {+ Q/ K3 |/ z# d# Z- n$ U
                CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
! e0 Z6 g& f) A' S9 C: d                if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )
, p9 O! S, o/ k0 [                {
0 u$ W, Z2 {' t$ }2 C$ j" X                        if( m_pItemElem )
' F  ]4 j! @, I  U' s1 I                        {  D* X1 m8 Z, H( a% N  |. u5 X
                                m_pItemElem = NULL;' G6 i7 c  B7 t! b6 K' ~2 i: \3 c
                        }8 _" L) M$ H1 `- Y! _
                        m_pItemElem = pItemElem;4 C) v5 u/ r) n$ P6 \
                        m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );5 l% r" i# |1 \2 x  d
                }else{
" r# C" a: \+ [& q                        SetForbid( TRUE );; q" t; @4 V% A0 |# R
                }" w3 F8 b* c$ v$ y1 B: ?
        }else{
' @: l# ?2 Z+ Q3 U" Y! O' v                SetForbid( TRUE );
. e2 e( q( v5 L9 @6 d5 l9 J0 ~6 I        }8 p" W9 u6 A5 D! N8 F" ~6 y9 ?
        return TRUE;6 K0 s2 ^1 a8 x- M5 n
}4 F! t) x( p+ y+ n! H9 A% p

. C) L5 R$ x1 Z2 K- d9 |, RBOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
+ t& b6 o0 s/ ~2 h# B+ o{
5 q5 M4 p% r1 ?        switch( nID )
, @0 o' w, j/ i+ a* T0 z+ G5 u        {
- v& L+ \* g( J        case WIDC_BUTTON3:
/ s4 \8 u! Q' ^! Y, B                {9 c/ _$ D1 H- [
                        bStart = TRUE;
9 }1 U# ?, _5 N' u) r                        break;
) R# t* P( e: {- {  Q/ F& Y                }0 k* F$ z! P0 q, f4 A, [3 X" \
        case WIDC_BUTTON4:; K# {! s* b! W0 E0 i
                {0 A2 b. _  \6 V; X5 I
                        bStart = FALSE;
3 m/ [6 A' b4 c, h: W; o- Q& W. W                        break;0 X" V8 [/ s5 ]0 e
                }% @6 O9 b  d: X+ x, w8 C3 q
        }: T' y6 N6 n/ ]- p/ i$ f$ s
        return CWndNeuz::OnChildNotify( message, nID, pLResult );) j# W0 `3 F1 F! `
}       
* H0 e+ d" N+ S0 m8 ?2 I; X+ ~1 kvoid CWndAutoFood::OnDraw( C2DRender* p2DRender )
4 ^, @- g, o0 s0 t5 o. |9 L' m{! j) n5 Z0 m/ I
        CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );& C& ]' q1 r/ \
        if( bStart || !m_pItemElem )' R7 f; A9 U# d( |1 r# E. t2 q
        {
. e& H0 X2 {  B  Y1 ?. c, D                pBtn->EnableWindow( FALSE );+ V& e) {7 n' W+ q& F6 a
        }else0 n9 a% ?1 x$ g4 y" c
                pBtn->EnableWindow( TRUE );' k( w$ C! _5 k6 |% T4 g  W4 w; a+ m
        if( m_pTexture )
+ ]8 Z3 i" j: X! P# {        {
' a3 N7 N, Z; W, T# p5 L                LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );* Z( }. |/ [6 l
                if( wndCtrl && wndCtrl->rect )
7 Q5 z2 ?# i9 H$ j. F$ p. v3 M& O                {* [& V* `9 X% ^2 `, J1 K) ^6 d
                        m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
4 O; Z: a7 J- p& {                }
$ Q' H  S& _; T3 N! D  }3 l! [        }
7 q4 P! p  ~% v}' X- w- o* N" F

, W& L! y% e6 W+ G) uBOOL CWndAutoFood:rocess()1 G8 ?4 Z* S# w+ s- D% ~
{
0 n7 D9 w( m3 m; U8 @2 g        if( bStart )
( e8 S! n% N6 t) [        {0 h5 X  Y# J9 x% N- M2 m0 G! o
                if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )
- [, D: @8 g/ G- x% n) H- p                {
5 ^/ }4 ^7 j* b                        if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )9 C" f( n+ V) Z1 M3 C2 S/ K2 g
                                g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );
3 V9 f, s8 Y* l# w" a9 b                }else{
' L7 K. C- ^* e1 \. ?3 [: k* x                        bStart = FALSE;  K& z% ?7 a2 d" R1 O4 \. b! ?& _
                        m_pItemElem = NULL;
% o4 o% L5 Z* k6 ~7 [                }
: M! E; `1 O2 v- B& a. Q        }$ l+ w3 {* K9 h
        return TRUE;. B& y" s+ G/ V8 Y, r
}7 L6 g) O' A# Z6 s/ ?
0 u5 l3 O5 m8 t+ k" a
登录视频废话:
& ^+ c9 M& s9 @' a4 `尾翼:
! `8 H' d% h  ]6 g  p' q; n6 j4 m  Z* r. k  ]! x# N: o
代码:+ Z8 A7 c( J8 X- O/ o

0 w2 g. c; g" I- m0 ?# |void CWorld::SetLight( BOOL bLight )  k8 M! o* F, F4 G5 d2 Q
durch
1 o/ o7 N2 u, wCode:
, V7 W" i+ @& J: L& v- }void CWorld::SetLight( BOOL bLight )
$ P4 k( p$ F7 a1 V0 Q- o  H' y{8 D  L! `. k6 k6 a, S
        //ACE("SetLight %d \n", bLight);
/ `7 g8 m% N3 m$ a1 v7 ~/ |+ A        0 h$ o7 ?) A2 q" [! {
#ifndef  __WORLDSERVER 7 {$ K1 P3 x  P  D1 z+ u. b
        DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
; T1 r) C+ ~; u+ I$ l        CLight* pLight = NULL;
7 U3 S8 D# n$ V# Z; S' j1 a% K5 H/ r( X' H- L/ C0 \
        D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
5 k, H3 [( |7 U' i) P2 B, U4 I* _) r( {; t% b, z1 R
        pLight = GetLight( "direction" );: M# `  x+ p6 d. U" k( V3 G- {% K
$ s& l  g  B9 T2 {/ a! y" K9 c
#if __VER >= 15 // __BS_CHANGING_ENVIR# z; K# J: B! G! _) O% s! R: T4 w6 \( x
        if( g_pPlayer ){
7 B* @; H+ T# J# p                ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );( F4 p9 I$ y' A& K
                if( pInfo && m_kCurContinent._bUseEnvir )                // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!. p7 S: I6 |2 |5 L) V/ W
                {8 [* b4 O' l' w
                        if( pLight )
5 M0 a0 b( ]' N2 L1 Q6 n- _                        {
2 X' T6 g7 b' U( M9 q: a; r5 Z                                pLight->Ambient.r =  pInfo->_fAmbient[ 0 ];
3 {% A) W& a& ^5 G, `                                pLight->Ambient.g =  pInfo->_fAmbient[ 1 ];' s' w! b* M: T" A6 i! G+ r# ~
                                pLight->Ambient.b =  pInfo->_fAmbient[ 2 ];& V# P3 Y, ^" y' ~# v
% F* O+ ?& |- P  u4 [- _9 g9 R7 c4 w
                                pLight->Specular.r = 2.0f;
* v% K; Q! W* h# Y, E) s                                pLight->Specular.g = 2.0f;3 E0 p& ]: Z! V6 X
                                pLight->Specular.b = 2.0f;, g4 f% E/ ~  G# K# U; e! A5 r
       
( X6 l) y) h8 q                                pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];/ C" A* m& n- A6 h& m4 i2 V9 p
                                pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];4 ^$ y+ D/ M# J: n( @5 n1 D: Q3 I
                                pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];' c. f6 `" {0 s( a- t. I
        9 x% O7 |5 P8 `% _' C  y; I
                                HookUpdateLight( pLight );
- o( t% G, z2 `) d, v+ O
: {0 c8 ?. w" W/ e                                memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );& R0 v. w# E9 W/ b, \! q; |
               
* v% n& l8 e. j! e                                pLight->Diffuse.r *= 1.2f;% s+ U! i1 d/ @. x! B# P) Y
                                pLight->Diffuse.g *= 1.2f;1 j$ P1 B0 P4 s8 Y9 ~7 k- e* |/ H/ b$ u
                                pLight->Diffuse.b *= 1.2f;
) ?, T& ]  T! h% e. Z* c& A( M" s3 g, @2 o$ L
                                pLight->Ambient.r *= 0.8f;, q( O6 q& h/ |, K% ]- [( Q. y3 r  @; b
                                pLight->Ambient.g *= 0.8f;% c0 v9 h! T8 m" s  h2 O3 Z9 u8 K
                                pLight->Ambient.b *= 0.8f;+ f0 M3 J1 y+ R7 b. c
       
4 y/ d4 |9 y3 r  t, {) ^                                memcpy( &m_light, pLight, sizeof( m_light ) );% [# c  }) _& ]+ d& d: ~

& R: j6 T  S  B  }                                D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);* @% \& f$ Z0 c. t% {% V# z. `
                                D3DXVec3Normalize(&(vecSun),&(vecSun));
: M* c1 j  I5 H; F) Q4 t" F                                 pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
0 d7 \" H& w8 C+ y5 w                                 pLight->Appear( m_pd3dDevice, TRUE );
, Y( Y" f: G4 V4 R: _0 [# s                ; W8 O6 v7 j2 {% |+ S4 A! G
                                DWORD dwR, dwG, dwB;
: S" |7 t( |$ E9 E6 m                                dwR = (DWORD)( pLight->Ambient.r * 255 );5 B* x8 _5 G* x6 W- v& \
                                dwG = (DWORD)( pLight->Ambient.g * 255 );
" U  X" V; ]" Y5 _: g$ q; f7 z                                dwB = (DWORD)( pLight->Ambient.b * 255 );
. M* w7 L, _( j. f: c& E                                dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );9 n: a$ H- l  \3 q! a9 R: M  J
                        }( t, k5 e. `7 T3 ~6 w7 g
                }
- y5 j( a  R, a        }
4 ?7 i" E& B7 s8 d9 G, q        else
7 E3 }$ I7 w! t' X% Q#endif - j) S. Q* o% z+ V# R7 X" A
4 D8 \. R1 _0 R- E
        if( m_bIsIndoor )
& k9 m/ r. t: K, s- P2 k; u8 i8 }        {
% X6 U$ y% ~- }) \2 T                if( pLight )
$ ]) R2 ]& p  ^1 a                {                6 U. ]$ c+ u2 J  C! _8 h' @1 _
                        // à??μ oˉè*
, E0 x* c- }' n                        pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;
) S: p2 I5 w6 f0 o2 S. S3 i, t2 v! z                        pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff)  / 255.f;  R$ s, ~+ i2 {. x. g
                        pLight->Diffuse.b = ((m_dwDiffuse) & 0xff)     / 255.f;
0 r0 `* t, X3 ?, F8 z' ?# F4 _7 C8 L5 \
                        // oˉè* ??à? # s; ~3 `; d0 _8 x0 \( e, o) `7 t
                        pLight->Specular.r = 1.0f;
$ D9 {1 H) q# E& \" K% O                        pLight->Specular.g = 1.0f;9 h6 n" ]) ^0 [0 Z9 F" w
                        pLight->Specular.b = 1.0f;0 b* |4 p" d1 T: O
                        // àü?? oˉè* 5 i. i- V5 {6 L
                        pLight->Ambient.r  = ((m_dwAmbient>>16) & 0xff) / 255.f;
5 k( Y+ H1 U8 V7 T( t                        pLight->Ambient.g  = ((m_dwAmbient>>8) & 0xff)  / 255.f;
* O) Z& o* D/ B% c( l                        pLight->Ambient.b  = ((m_dwAmbient) & 0xff)     / 255.f;( y- Z3 q; V9 i2 L9 T

2 ]- H$ G- X7 }" n8 Y' {) r3 N                        if( g_Option.m_nBloom )                // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
! N3 L& O$ H. C9 j                        {- A) j0 d% W7 A5 |
                                pLight->Diffuse.r *= 0.6f;
9 E$ q# u. y9 {' Z' L                                pLight->Diffuse.g *= 0.6f;
: t  t; a' `& E; N5 D/ I                                pLight->Diffuse.b *= 0.6f;
) r, s) t1 j7 l! @. y6 A                                pLight->Ambient.r *= 0.7f;
( F, M) I- b3 _8 n  A                                pLight->Ambient.g *= 0.7f;
# ^, v- C# `& v: }# c( |                                pLight->Ambient.b *= 0.7f;
& W3 y& d2 l4 [4 {* K$ G                        }6 g. y0 b: T7 a7 H

2 A- N  U7 V  g" [- ?#if __VER >= 15 // __BS_CHANGING_ENVIR
+ r! Q. }  V4 P$ z! l5 m9 d' V                        if( g_pPlayer )
8 a* F, w4 _6 Z, \; {" }                                HookUpdateLight( pLight );
8 K- Q. X7 ^, x9 E$ t#endif" |! U4 Y6 n. ?5 z, X
                        memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );" I# v) D* k3 C7 w1 l

/ a; C( n2 y! B9 X: |) O: f, T% L& b5 ^                        pLight->Diffuse.r  += 0.1f;
5 Y) W4 K" W" e: x" @) ?4 x7 o$ x                        pLight->Diffuse.g  += 0.1f;9 W7 q& Y' J! H/ y. |0 L
                        pLight->Diffuse.b  += 0.1f;
3 M4 X9 J4 i. r                        // oˉè* ??à? + Y, t& X/ m% o9 `% f" q
                        pLight->Specular.r = 2.0f;
4 S7 {9 H; F5 ?$ M# ^& q/ ^# H0 ~' k                        pLight->Specular.g = 2.0f;0 V# d1 E2 d- q; \
                        pLight->Specular.b = 2.0f;8 c0 i, J( C; {
                        // á?oˉ
5 H. c0 g6 ~5 z* M2 E- X( V                        pLight->Ambient.r  *= 0.9f;
7 ^1 z3 P3 b  _                        pLight->Ambient.g  *= 0.9f;; M" C1 U8 _/ C# T. y4 }- \
                        pLight->Ambient.b  *= 0.9f;; x, G0 ^6 R9 M
# ~# G3 s  l6 v* H9 s( K
                        memcpy( &m_light, pLight, sizeof( m_light ) );
. t, j+ ^& R2 Z# ~! S; m                       
. A4 t& f  w9 r( f9 ~  u6 b4 f                        pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );4 \! b/ b8 R" V' u
                        pLight->Appear( m_pd3dDevice, TRUE );0 O- t& s; u% h) _1 ~9 @, L
        ; A* u- I- g1 N+ O8 x
                        DWORD dwR, dwG, dwB;
+ n* C$ j: X( `! ?  I" W                        dwR = (DWORD)( pLight->Ambient.r * 255 );
) s2 ]/ }. c- Q( L                        dwG = (DWORD)( pLight->Ambient.g * 255 );
# n/ |, O+ U1 s# i5 t* P! S                        dwB = (DWORD)( pLight->Ambient.b * 255 );
4 V& }: D5 }' j; ~/ `$ P7 O                        dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );" i$ v  z! m: _8 }% `1 h/ h
                }) O' ~0 o! f8 U% F
        }# b, K# M0 n/ \
        else
+ M2 u: `0 b; e        {# W3 E/ V6 t7 S
                if( pLight )( J& N5 J. b- u4 ^4 G
                {
* `  L: j! I9 z" R( A% |2 p                3 \& f. U# w3 O. w- y3 U
                        int nHour = 8, nMin = 0;
, h2 [4 E$ q# e- \. @9 \        #ifdef __CLIENT1 E! U3 y" B$ [1 n) D
                        // ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù. 7 @& w/ j' L( e) ]
                        nHour = g_GameTimer.m_nHour;% q1 q* ]% b. {# V
                        nMin  = g_GameTimer.m_nMin ;! E! v' X" ]. R) E
        #else, T# x' I2 v; o, c
                        // o??o??′? ??°£à? m_nLightHour???* °?á???′ù.& t5 A: J  Y0 G: m5 a9 m7 P
                        if( m_nLightType == 1 )
% M0 _* H( s$ x2 h" J% ]                                nHour = m_nLightHour;
9 Y: [  O1 w& _. y2 b: T8 B% U& }        #endif
2 \/ p& J0 }1 t4 B6 D+ L2 l- A" g                        nHour--;
% j' }# e" e% S3 H' j                        if( nHour < 0 ) nHour = 0;
7 }7 \4 L: N- d( m: m                        if( nHour > 23 ) nHour = 23;
: K/ p: m8 P( V* E
- f$ o5 x0 R3 e3 I) n7 m                        //if( m_bFixedHour ): b1 H; X4 W2 u
                        //        nHour = m_nFixedHour, nMin = 0;' Y5 ], z! b% E- ]/ v8 M7 J
                        LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];
7 i" }$ Q' w3 E# g( N                        LIGHTCOLOR lightColor = m_k24Light[ nHour ];& O2 E9 R; Z  U" {8 d9 a
+ Z) x( v; ~9 {% F' R; F
                        //m_lightColor = lightColorPrv;
9 v1 f+ U9 ?; S) ]                        lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;8 ?8 p4 L% o! E
                        lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;
- D  J3 C9 H4 C6 J' A( ~$ _' A/ l0 ^                        lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;6 x% \: Z* t& z- Q3 M* B
                        lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;0 p" M4 j- s" l7 X+ E3 w- p9 Y
                        lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;& A$ B1 r8 U/ ]5 D- A
                        lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
! ?- K! s$ u  W" u9 G* J, U                        // 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)$ S4 p) M. O; Y/ Q, ?) I5 N: Y

' y, I' q, J9 }+ ~; Z2 Y                        // à??μ oˉè*
8 e% f$ T" w, q( D7 y5 r& I                        pLight->Diffuse.r  = lightColorPrv.r1;
! O3 {% I, k. y  }/ m/ o: e; L, \                        pLight->Diffuse.g  = lightColorPrv.g1;* C4 j2 b1 s0 Z5 R
                        pLight->Diffuse.b  = lightColorPrv.b1;# o" Z5 T; i% V) R& n& d
                        // oˉè* ??à? & i# u: M) k7 R6 K# c
                        pLight->Specular.r = 1.0f;# h1 V5 i. u1 R2 {' m: u- \9 I  K6 u
                        pLight->Specular.g = 1.0f;" U6 |9 m9 l# P# t
                        pLight->Specular.b = 1.0f;
: `4 f/ v. w1 n/ n                        // àü?? oˉè*
) Z4 `4 ~& ~' j- M$ e/ `8 X                        pLight->Ambient.r  = lightColorPrv.r2;
, f1 @; n% |9 A  ^5 n5 w5 X                        pLight->Ambient.g  = lightColorPrv.g2;( p9 w; m$ \9 k
                        pLight->Ambient.b  = lightColorPrv.b2;
! n$ A- V$ h' T3 @. H, K9 ^* d- Q. D- w1 {& Y
                        if( g_Option.m_nBloom )                // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
9 P$ c! }6 |: F. ?1 Z  |- B                        {1 s- `- I$ ?- Q8 L' z
                                pLight->Diffuse.r *= 0.6f;
3 ?6 n' F1 L" f                                pLight->Diffuse.g *= 0.6f;) e5 }7 j. ?( w6 W( W2 K4 Y/ `
                                pLight->Diffuse.b *= 0.6f;
' g/ _. X* E; _3 O  v                                pLight->Ambient.r *= 0.7f;
& c7 ~  q& U/ K. _9 t8 Y1 i, v; t                                pLight->Ambient.g *= 0.7f;
, ]7 e7 F7 a3 T- [                                pLight->Ambient.b *= 0.7f;
! a+ o& Q" \- n0 r                        }
3 t, V, a# z( @- \4 V7 l                        ' N& d+ m* N, f
#if __VER >= 15 // __BS_CHANGING_ENVIR* B* L% Z; D) Z3 Y
                        if( g_pPlayer ), \* D7 Z; a$ w; k* \6 _
                                HookUpdateLight( pLight ); / b& z8 ?; g! Q1 h; }  `4 @
#endif% H0 e3 c; D4 }  L: P  w
                        memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
% P: a' d- ~  L. O4 N4 A1 f4 t/ W* K& X% j( Y+ w
#ifdef __YENV  x! A: l0 e; a% I. o1 V
                        pLight->Diffuse.r  *= 1.1f;. Q% v5 [+ r9 i- \( s- ~. G& o
                        pLight->Diffuse.g  *= 1.1f;+ I9 Z$ _8 I5 Y2 X3 D
                        pLight->Diffuse.b  *= 1.1f;
  U4 N( _$ F' T! u                        // oˉè* ??à?
  r" z% [7 N5 C2 E& z# ?: q                        pLight->Specular.r = 2.0f;2 p$ n* v; i% D7 |; J- ?5 `" w
                        pLight->Specular.g = 2.0f;% L/ d* Z! n) Y# Y. X* G
                        pLight->Specular.b = 2.0f;
: P; x) P8 [0 `: e! a& y1 f                        // á?oˉ
, i  k8 U* h' f5 t9 G                        pLight->Ambient.r  *= 1.0f;
' L7 w/ W% E3 W, f! }$ ?                        pLight->Ambient.g  *= 1.0f;
, K, i, J1 T/ F! C5 Q: J+ V. O( H                        pLight->Ambient.b  *= 1.0f;
- N; ~  ~/ h, \6 Z#else //__YENV
. a, ]! X# k; t                        pLight->Diffuse.r  *= 1.1f;+ U  F" V; d; |% P
                        pLight->Diffuse.g  *= 1.1f;7 B/ a% |8 D) t' ~' o; a, g
                        pLight->Diffuse.b  *= 1.1f;3 i# P! T9 ^1 b; q+ _8 e
                        // oˉè* ??à?
! E9 ]6 M2 G! f" y, I0 n) |' B" G# o                        pLight->Specular.r = 2.0f;0 W4 O0 j( w' |# p
                        pLight->Specular.g = 2.0f;* @7 ^* }, `0 t
                        pLight->Specular.b = 2.0f;0 ^6 ^/ Z$ W7 U$ y( z, p) E& X
                        // á?oˉ 8 D' V5 }1 ]" Y! @( u9 v' a
                        pLight->Ambient.r  *= 0.9f;! t- K* |% t8 v
                        pLight->Ambient.g  *= 0.9f;
. A% V  U  T6 |% e. U7 ]                        pLight->Ambient.b  *= 0.9f;
  {, M8 R7 g, a: ~6 c6 ~- s: ]#endif //__YENV 1 D- H3 _5 L* _% F  T
                       
# z5 J1 N- c: B                        memcpy( &m_light, pLight, sizeof( m_light ) );
7 m# D& d1 p5 u) l                        : x) Q1 \$ s( p8 p7 D$ b0 T+ U
                        D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);& g9 ?* [' k3 o; Z) X
                        D3DXMATRIX  matTemp;0 Z, o! ?- N' ~4 B( C# n
                        static const float CONS_VAL = 3.1415926f / 180.f;2 h- W) k4 `+ |" q
: i3 A$ R0 p( ~5 u' Z9 l
                        D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);: A  e( E" y* D' F' ]
                        D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);# d( s: t0 \* P% A* m. P
                        pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
0 m3 L/ U9 P! H9 {- s                        pLight->Appear( m_pd3dDevice, TRUE );3 n" M; T& s* z# q* r/ I  W

5 X1 u7 Y' u. k; |$ W5 h                        //        D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);4 a8 F6 Z  Y- B, ?
                        //        D3DXVec3Normalize(&(vecSun),&(vecSun));
1 V6 W' ?9 M# K+ D. T, S& `                        //        pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
, Z$ S- V; c  o% t/ H- K; h7 ^
5 \  e$ l' L; q" d' T2 w) |                        DWORD dwR, dwG, dwB;
" o9 s" m1 n: ]/ {                        dwR = (DWORD)( pLight->Ambient.r * 255 );
; P; l: D; z2 u4 S' F                        dwG = (DWORD)( pLight->Ambient.g * 255 );
0 }6 y. X0 a7 R! ]- Q: v2 ~$ p! l                        dwB = (DWORD)( pLight->Ambient.b * 255 );4 R, ?1 F4 h0 h- r8 r: u
                        dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );                       
8 G+ `( }0 y9 D0 J  S9 U. F5 z                }
! B7 m4 z' r; Y  m0 `- w  ?        }. ^0 d- @2 z3 V7 _' b# q- r

9 d% k) E  {, n6 T- \" g' m$ A        m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );$ {( X; [4 O! c( ~6 p
        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) );
" @6 w& R( h0 _5 d        ::SetLight( bLight );
0 l: M. w3 Q3 t# B3 s# W: ^" _$ n; @% t  V+ u7 n8 R# x$ u
        // ±ao? ?D?í???ó á¤à?
/ l! G9 J: V5 P6 `! D- M        m_pd3dDevice->SetMaterial( &m_baseMaterial );+ x& ?& _& V2 j8 N
        1 Y+ E4 u" ^; U. m: E4 v5 M
#endif // not WORLDSERVER8 b1 t5 k6 K& Q9 O% K  g) c; V5 q- H
}* Z. h( ~# q1 l; T
并更换. P) u3 I2 {8 O; j. Y1 v
Code:0 U. l8 y6 L. j! g+ @8 X
__FLYFF_INITPAGE_EXT
; t0 Y4 D  A# d7 u定义( `/ d4 ~- ~. V) k% R
) L* L, s% T, y7 |

9 G: ]8 e5 V0 s& ]
& g$ I5 ]- n1 s; H3 E& B0 l- h1 b& E0 D9 h' U& v  b" r) Y+ x
现在终于删除我的狗屁加速...& ]- R: a4 g# s- n6 u+ G1 z

" a3 Q$ q0 u: B. M. k7 ~0 G  A
! z% u  s! i( |) Q, v# ]" \! Q" T
6 R5 N6 P$ U. B$ C. r




欢迎光临 飞飞世界论坛 (http://ffwold.com/) Powered by Discuz! X3.2