飞飞世界论坛

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

作者: admin    时间: 2016-1-10 03:46
标题: 自动饮血和登录视频
食品车:
4 [. i6 o8 ^" G. U尾翼:; h) i  ^; Y) a0 T" |) Z& F

9 g, }$ Z7 b8 {5 }+ P3 V9 H代码:
; _0 e& o  [* p7 B5 o+ T4 }( M: ?CWndAutoFood::CWndAutoFood()
/ ]: D, _$ |% F4 }{7 S& \  s1 F2 y, h
        m_pItemElem = NULL;
% T/ [0 |( m5 y+ P' M* w; t        m_pTexture = NULL;
) y8 k, w+ r2 u5 s0 ^' Q7 j/ j: V' n        bStart = FALSE;
! X8 A$ p" R8 p1 t' d9 ]}0 n3 Y/ N5 A6 q# k
+ g3 g* X! d% K* ?4 ], R
CWndAutoFood::~CWndAutoFood()7 i' g9 M6 V7 v# B
{& [) [# J1 C, _* z7 |* f
        AfxMessageBox( "AutoFood ist gestorben " );
: [: J. J0 h) C  B# s+ Y. x. b/ @: @}
+ f$ e# V' v; T% K2 O" ^5 N; wBOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )6 z) w6 d; d( W; C& D. p5 s5 Y6 o) O
{& Y# A& l& D/ J, i8 ]# V
        return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
0 F  t! S$ E: J) ~7 ~& }}$ }* v& _3 h( ~( [6 P9 R
5 \; z" Q% H+ ]7 H" I2 G; r
BOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )/ i% k2 e' i9 h& l7 y8 }: I
{
) {( h& v' j0 h- V( Q8 B        LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );0 K& r3 I/ u) @2 U* T- Q
        CRect rect = pWndCtrl->rect;
8 [  p' \" D- x3 X' `  E+ a+ {        if( rect && rect.PtInRect( point ) )+ `8 M7 ~3 h7 s7 ?! @( [9 ]. S
        {7 @* k" ?2 \8 N1 p8 P4 `( V
                CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
( e5 T) J' @" S- ^% X8 g/ ?                if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )$ H6 q, g3 H6 ~% S
                {8 L+ ~) Z+ [0 F. G# G, N4 n
                        if( m_pItemElem )4 |: O# W- G! o+ m' u; C
                        {% h2 J8 E8 R6 ?# \1 @+ a3 a3 \
                                m_pItemElem = NULL;
; Z" _5 D9 i: i' U9 P' \8 k" d                        }" e( u* q% p4 M% H+ P' R
                        m_pItemElem = pItemElem;
9 s4 c2 `8 m* _                        m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );
/ j& s, {$ P6 h$ k  x- t9 c3 Z                }else{
7 `3 {$ F$ H8 g' ^; {+ I& {- w                        SetForbid( TRUE );
/ D. C$ c" q, B6 I+ }& a7 k                }2 J) `) k. g/ j) ~
        }else{
; n4 ]  W3 a* o7 O! f& @6 o                SetForbid( TRUE );0 d& Q3 @5 N+ z' w. k) C. ]% ~# r
        }
7 q& p  a. s5 k5 x, N; p4 g        return TRUE;
1 J' @0 c+ P% P+ P2 `, k0 Y6 C& D: x2 G}
7 S% V0 h# h7 M# Z" u7 o  T/ [% M% ^; V  G
BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
, ?) U, F! X9 E# V) R% M4 H, _, `{5 |; D3 |( |+ k
        switch( nID )
9 s, |; c. H" a+ x        {
9 ]9 Z# o% [8 n3 i3 n        case WIDC_BUTTON3:+ T8 K% q' q' b1 T# L0 Z% M5 S
                {
8 i' p5 H! [0 s( D3 c7 L% r                        bStart = TRUE;' o9 E/ N3 U9 F- T1 u  a
                        break;9 D) ?4 u5 H: J& `, ]% [
                }
  o7 u# d. G' Z) M1 M& n        case WIDC_BUTTON4:
" j, n/ G+ H" @                {
5 _/ [+ [# u5 N" v2 S                        bStart = FALSE;
: {  G+ R3 ?" w% m9 z                        break;8 C. q2 |4 C% ~5 M% T* F! S% O. r
                }9 @  S) R8 e' C- i
        }
: ]& `. q" ]4 l/ o        return CWndNeuz::OnChildNotify( message, nID, pLResult );, r0 I& A: T, q/ e8 e" ~2 D: w
}       
. n2 b7 Y3 A+ r9 ^void CWndAutoFood::OnDraw( C2DRender* p2DRender )6 E: q& W1 X1 D/ U7 x
{
) U1 S  b2 ?5 M        CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );6 s# d. g# u; j: \* }( j( Q, H# p, N
        if( bStart || !m_pItemElem )
8 ~4 H% D' ^0 d5 m) `# F/ B9 n( [        {
$ p1 f. s  ?, I* T/ g                pBtn->EnableWindow( FALSE );
$ w3 b2 h- D' ~: T3 {/ y0 |        }else8 ]+ t# l! z$ C5 J& z' O  y7 |
                pBtn->EnableWindow( TRUE );; Y& f4 z" V5 T: N
        if( m_pTexture )2 l2 l$ s% Z: t' ]
        {
: R# W  w1 \, S2 u0 B                LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
2 e! E. H; z* _" s4 a: a                if( wndCtrl && wndCtrl->rect )1 ]$ M3 g7 e% U. ?' Z
                {/ ~( k7 c7 q, y1 K4 v+ [5 Q
                        m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );& C" @. Z2 c; n+ Q8 a% ]/ n: \7 A' ~
                }+ P; Y  b- W+ S8 A3 B  V+ u+ P
        }
8 X3 w) g& b0 h8 E}; D* f( ?, `" w, m; H8 o, N; Q
* R; j% l+ F' G5 `
BOOL CWndAutoFood:rocess()" ~# I' B1 j1 e6 y; \
{
, R+ i1 m8 s, M  S; Q! v        if( bStart )) ^: C+ O8 P* W. a: w9 l
        {
4 x, g9 D8 G, B! G7 J! D- I                if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )
; @) ?' k/ u2 I+ r0 y6 Z9 K2 @                {
, u: a8 s+ \! P6 R                        if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )" g$ z7 f+ v2 S2 @, z# }( G) H
                                g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );
0 h2 {, l3 ~% `. t  m5 O& z: w                }else{* m7 L/ m# \8 `
                        bStart = FALSE;( a- \+ F8 M& n4 g$ Z
                        m_pItemElem = NULL;
% @) h) {8 n3 y! k( L* ~                }9 W* x8 h+ ]" _8 l- H
        }
9 ]  T1 b" A3 c$ t0 u0 N        return TRUE;
. b0 p) @  P  j+ C}' Q" i# @, p9 p) \0 r5 f# b
* ?/ e# f$ ~7 N' |* ~
登录视频废话:
5 ]% L4 @) e1 f0 y- W& V尾翼:
2 @3 u" N1 E7 m* @. v5 `$ i4 Z* D5 S9 E0 r5 n6 }; z$ O1 t; S
代码:5 e/ g/ v$ {: \! ^8 E# m
/ |5 G3 H) k& O  V
void CWorld::SetLight( BOOL bLight )
/ F5 ?* }* d( \1 V' M$ jdurch. t1 ?  m* ]4 d) t4 m
Code:
3 B' Q1 @) E% m3 W% P% J2 V$ A/ xvoid CWorld::SetLight( BOOL bLight )
" v, `% h- B$ o( e# {9 U  _  c{
  _8 s2 j7 I1 K        //ACE("SetLight %d \n", bLight);
$ B$ P* S' q+ z5 _6 c       
3 C8 w% q5 H; q' h: l6 Q& T- u#ifndef  __WORLDSERVER
5 j! C5 G" T3 t! p        DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);0 p- K& O# V. k$ j2 U7 I) s# ]2 H
        CLight* pLight = NULL;( }, X: J' t7 a0 o* u7 _

. g& Y# C/ i1 u. |, I$ e        D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );" X) S- R. H* e/ V
* P( ~: l7 I* u- k7 h: G6 D2 o2 g% S
        pLight = GetLight( "direction" );
# E# J+ X; D& l" Q  d/ V' K! H- b7 {" v
; \2 [! {  U% D8 T" {#if __VER >= 15 // __BS_CHANGING_ENVIR8 x% T8 ^3 r4 r5 t
        if( g_pPlayer ){
) X! w+ m$ P/ ?- r                ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );" x2 @* ~4 F/ J6 a8 t( t
                if( pInfo && m_kCurContinent._bUseEnvir )                // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!
6 {5 j6 }; O7 O  y                {* B5 l- B2 J7 o2 [8 n
                        if( pLight )
0 q. m4 m/ h+ T, G; m                        {/ R) n  _9 y/ w# s2 w9 f
                                pLight->Ambient.r =  pInfo->_fAmbient[ 0 ];5 w7 H: G, N2 P9 q1 }) b" y- }, Y
                                pLight->Ambient.g =  pInfo->_fAmbient[ 1 ];! D, d$ ^4 [9 f2 x+ h
                                pLight->Ambient.b =  pInfo->_fAmbient[ 2 ];
1 J3 Y+ S% C( u1 B; [+ @2 T  Q- T
/ k5 |! v1 `6 l/ v                                pLight->Specular.r = 2.0f;
& e/ U! q. y- N$ U  n. ^% L! l                                pLight->Specular.g = 2.0f;: e2 K4 K! L: w& |) s% T
                                pLight->Specular.b = 2.0f;' G+ l4 X+ a5 ?2 J" i& Z
       
4 X" F: Y0 E6 K- v% z. D0 B  m8 k                                pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];- @. W9 C+ Y, T4 F7 H; T. ?
                                pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];
0 g& a# C! K- a0 y                                pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
4 l/ t% }5 G2 }& ~       
" y0 s% a$ e7 _, N                                HookUpdateLight( pLight );
2 C* f, w9 f2 o# G6 v3 R/ V4 {
3 m5 Y! p3 Q$ z5 Z4 }* `8 V! W                                memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
5 ]6 P: [3 I/ m2 t                4 i# r5 @" x+ ^4 Y/ G$ V5 Z
                                pLight->Diffuse.r *= 1.2f;+ |8 @" L  z% t. K
                                pLight->Diffuse.g *= 1.2f;/ O' r/ L: F) f, ~8 J' K
                                pLight->Diffuse.b *= 1.2f;+ w' j! M' c8 A$ }2 _3 x

: p+ Z2 m4 B5 @                                pLight->Ambient.r *= 0.8f;
# q1 U3 N: y4 S! i+ B4 N                                pLight->Ambient.g *= 0.8f;
* Y- K" e. d; \, E. ^+ K                                pLight->Ambient.b *= 0.8f;
, U2 z6 M5 V! G, T5 @" X+ d* ~6 A0 n       
5 f6 U+ n/ m6 o  o6 E                                memcpy( &m_light, pLight, sizeof( m_light ) );
+ b5 j( N9 n. Y& V5 E
7 w8 Z4 R4 ~9 S1 w7 @  ^                                D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
" R" a  @  I: g" H  q& N6 }5 U9 i                                 D3DXVec3Normalize(&(vecSun),&(vecSun));# `4 p" }' ?% J9 U! B
                                pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
1 Q! |) x6 E3 Y1 Q9 T5 y                                 pLight->Appear( m_pd3dDevice, TRUE );
' a) R( ^; c4 ~5 W& C& ]                : e" ]5 H& Y% E* m4 b, j) V# w
                                DWORD dwR, dwG, dwB;* e% H; H8 M% M/ Y  t% V8 a
                                dwR = (DWORD)( pLight->Ambient.r * 255 );4 t, h5 ~- w% G5 A
                                dwG = (DWORD)( pLight->Ambient.g * 255 );. U5 u9 y- j: S+ D$ b+ v8 _
                                dwB = (DWORD)( pLight->Ambient.b * 255 );9 I6 _# ^3 u8 r, X8 i; y2 {
                                dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );1 C  x  \) J1 f, b6 k+ F
                        }& `0 K3 K3 I; G# y
                }; i% h9 w+ b( a( e! \  ~
        }
: A' x. r4 s) u: m# X& ~        else
' s# W( h0 a, D- E2 d0 a8 @! d7 k#endif . R2 z1 z$ M$ i% J: e3 n) K, _
5 ?! y$ ]! B& o* B5 i
        if( m_bIsIndoor )
" C9 }& Y2 Z* t        {, x) q4 L! n% r3 Z: f( O
                if( pLight )$ D2 |. q( N7 R' M) {6 r# l/ W) W1 w
                {               
9 }+ U' m$ I+ z' L) I  x                        // à??μ oˉè* 1 H9 {' w& s; j0 _, W7 n  i
                        pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;" W1 h4 E+ a; U, |1 ]  n
                        pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff)  / 255.f;
! \3 Q7 F: A; A" j8 i                        pLight->Diffuse.b = ((m_dwDiffuse) & 0xff)     / 255.f;
( ?5 d/ V8 v: H: |- i5 i
8 g, T% h1 u) g) x7 [                        // oˉè* ??à? 3 R+ r0 b- u: k
                        pLight->Specular.r = 1.0f;
5 r) V1 T+ y1 m6 o" [) C0 |+ e                        pLight->Specular.g = 1.0f;
7 ]0 k" _9 c6 s" }  Y  E( f                        pLight->Specular.b = 1.0f;
' ]% h$ _4 g8 V$ d2 _- U                        // àü?? oˉè*
/ d) Z0 V/ x' F/ `9 f                        pLight->Ambient.r  = ((m_dwAmbient>>16) & 0xff) / 255.f;
8 X9 ~  N8 ^8 r7 n                        pLight->Ambient.g  = ((m_dwAmbient>>8) & 0xff)  / 255.f;
3 \* f( S) Z; M% R+ ~5 x                        pLight->Ambient.b  = ((m_dwAmbient) & 0xff)     / 255.f;6 X3 P- |3 b5 W# F

. F6 q( \0 j: s* j                        if( g_Option.m_nBloom )                // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
5 ?4 y0 {, e% g0 k2 y! c5 q. O                        {
/ L* s, J, D; k4 L! |                                pLight->Diffuse.r *= 0.6f;+ c8 t* ]- ^' d% X* y- k4 r
                                pLight->Diffuse.g *= 0.6f;8 [4 C2 k9 b2 j% G) O/ @) E
                                pLight->Diffuse.b *= 0.6f;
3 k& k' ]- E; n1 c                                pLight->Ambient.r *= 0.7f;* ?7 a/ b2 d; ~% W) }1 V' E
                                pLight->Ambient.g *= 0.7f;5 I- V/ j: z8 L- Y. I9 b6 ]
                                pLight->Ambient.b *= 0.7f;
# x, R, R. x4 N# M2 t                        }1 p3 {+ z* G- ~+ u2 D
3 i4 e4 o  ^; d
#if __VER >= 15 // __BS_CHANGING_ENVIR+ t' i0 ]# y* W
                        if( g_pPlayer )  ]% ~. `! k) Z0 z! e: T* f
                                HookUpdateLight( pLight );7 k% ?9 Q1 Y: }# l! w/ f
#endif
, c# D7 z! I# `  F                        memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );9 q) \3 X# t* C  ]; r8 }

8 y" I/ g3 P" B& p                        pLight->Diffuse.r  += 0.1f;  i, g8 C# J! }8 w+ Z. K7 T
                        pLight->Diffuse.g  += 0.1f;8 M# n+ Z: \2 [3 o2 F: b4 k
                        pLight->Diffuse.b  += 0.1f;
1 \# [+ P9 h4 i7 n1 T, v3 j                        // oˉè* ??à? ( O; h' x2 s: ~  h
                        pLight->Specular.r = 2.0f;/ }2 w0 V" L% i1 _; y8 D0 k2 H
                        pLight->Specular.g = 2.0f;
1 u/ X; l; w* i/ t                        pLight->Specular.b = 2.0f;
1 U1 k& Z* I; H, X/ N0 I# t* M                        // á?oˉ
3 }! r# Z: g  a$ ]8 x2 n1 Q                        pLight->Ambient.r  *= 0.9f;7 I6 }# P# {0 c7 Q: t: a
                        pLight->Ambient.g  *= 0.9f;3 X% M( a" V1 Y* D6 p) l! B# y: l
                        pLight->Ambient.b  *= 0.9f;
( u( |3 k) d& r* j
" H6 n$ k6 [- H/ v2 m                        memcpy( &m_light, pLight, sizeof( m_light ) );
% v% ]$ R7 _( ~1 ^                       
- [* k) A, J: F* D2 T                        pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );0 b# c# @4 \5 g/ ^
                        pLight->Appear( m_pd3dDevice, TRUE );
% `/ f+ F: S8 ^$ x9 @# A* q1 u' i       
/ F% ?9 n/ E" s2 i% A" Z                        DWORD dwR, dwG, dwB;
' ^. p( Z" n  e) A) U                        dwR = (DWORD)( pLight->Ambient.r * 255 );
7 m8 l2 R1 b( j# y" _  a5 O                        dwG = (DWORD)( pLight->Ambient.g * 255 );5 m( p/ i& H7 f+ |
                        dwB = (DWORD)( pLight->Ambient.b * 255 );2 ?+ |5 P' ]" i) _0 ]
                        dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
- H: T) c! l* t2 R+ I* A( z                }% G9 B) k, D6 W2 D
        }% M2 L5 ?1 v, p. g! `( |& q/ J
        else: ]/ W1 n+ ~6 w* d0 [, L
        {4 v* x5 I) a+ `
                if( pLight )
: j! ]! y4 F& ~" D( k                {) q# ?, y) V7 x3 G4 w
                % `2 V4 e/ E; s1 ]' c" t
                        int nHour = 8, nMin = 0;
4 I* M* g4 m/ D9 f        #ifdef __CLIENT
: N4 V& w  J5 D# G0 W2 w' y; c                        // ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù. # M" Y+ c8 U5 ~- I  c) q3 P
                        nHour = g_GameTimer.m_nHour;7 z! O4 k* H2 _/ {/ L
                        nMin  = g_GameTimer.m_nMin ;
' o  A7 A  P0 E2 ]1 O' {        #else
, J' U; ~3 U# ?                        // o??o??′? ??°£à? m_nLightHour???* °?á???′ù.
' A4 h3 y: `% b* `' K2 A) f' s) B1 K" b                        if( m_nLightType == 1 )
# v! o* [4 r" w/ w' f6 n! i7 ]                                nHour = m_nLightHour;) k& _3 B1 c' L8 |' x$ v  O
        #endif
5 j( Y! E/ y+ r: s; t                        nHour--;
& ~% z; i/ X8 C; [" J4 C                        if( nHour < 0 ) nHour = 0;) p3 T4 m0 g+ ~9 p$ U, |# a
                        if( nHour > 23 ) nHour = 23;
9 }0 ?! J9 d3 u9 Z$ A, K8 X6 @
4 }# s$ I1 A2 a% O) X                        //if( m_bFixedHour )" h1 y! P4 v  W2 K0 L# `3 F6 t" o
                        //        nHour = m_nFixedHour, nMin = 0;
& `% V3 }# c2 v5 c. ]; q5 @" v                        LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];# p0 r( _1 o8 ^1 G  s, T
                        LIGHTCOLOR lightColor = m_k24Light[ nHour ];
. L$ x# z. [* ~) `. |. i& l7 B. Y9 I( G/ j) ~5 x' w
                        //m_lightColor = lightColorPrv;
( J8 c. U/ a$ H- t" V5 N! M                        lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
+ ?9 N8 \3 c7 _7 u' I                        lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;( E8 d# o: S# B' {6 [; |. w+ _
                        lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;
2 ~+ p9 O& q) ^* H+ ?' n0 i                        lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;
4 b3 p& z5 l2 K& e                        lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;; P) g! r' w  v1 o4 }
                        lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;: q1 W) F2 b. L! L0 D$ c+ {  W
                        // 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)2 u% }" L) }. U% x, N

6 e  y% w) c! p  e. [                        // à??μ oˉè* 4 G5 n  Z3 T# M) d
                        pLight->Diffuse.r  = lightColorPrv.r1;$ }1 {6 I3 C' X9 E3 H5 r: E9 E
                        pLight->Diffuse.g  = lightColorPrv.g1;
, ~& H" i# @0 W1 y# @                        pLight->Diffuse.b  = lightColorPrv.b1;% K% y0 J% I! C
                        // oˉè* ??à? / ]1 L+ K6 @9 o: @' l" g) N
                        pLight->Specular.r = 1.0f;
" G" Q/ H" s) f" v# Y! b9 O- p" x9 d) ~                        pLight->Specular.g = 1.0f;
9 p+ |( F2 a: z4 E                        pLight->Specular.b = 1.0f;
2 J* Z% B( j$ }4 j% S& w& J                        // àü?? oˉè* ) a# t- h; L: w, `0 H" S3 O
                        pLight->Ambient.r  = lightColorPrv.r2;
3 s4 U2 |4 J! E" C                        pLight->Ambient.g  = lightColorPrv.g2;/ w. T. i: d5 `6 A( P0 O) H6 L* b
                        pLight->Ambient.b  = lightColorPrv.b2;. j! ?2 Z/ ]2 E

9 Q% p) ]+ Y4 d/ k  D% O, [1 f- n! W                        if( g_Option.m_nBloom )                // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.2 f7 Q4 {1 t+ B) m) R% V
                        {! L3 q8 I/ G6 v9 H  _5 r
                                pLight->Diffuse.r *= 0.6f;0 u6 o1 L) {  t, J
                                pLight->Diffuse.g *= 0.6f;8 r6 h6 `4 D8 r# X# M
                                pLight->Diffuse.b *= 0.6f;' I5 x# w$ _- a3 c% `# l$ c2 K( s- J) V
                                pLight->Ambient.r *= 0.7f;. l8 L4 J8 T7 g4 g
                                pLight->Ambient.g *= 0.7f;) @% W3 B9 v0 [
                                pLight->Ambient.b *= 0.7f;
( C# I' B1 @# Q" C( G1 z' q7 g: m                        }
( H' s) f- |6 }: g; D                       
. J- V  d, k; s9 ?9 D, h; C7 W#if __VER >= 15 // __BS_CHANGING_ENVIR
9 l4 V1 y9 K2 C3 F# ^4 H# v7 q                        if( g_pPlayer )
- `' C+ h2 M$ R/ N5 f                                HookUpdateLight( pLight ); + T3 G) {$ L6 }- O* H3 @
#endif
, n' z1 D3 _) N( N                        memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );! \5 X& d9 e6 j- ^5 b$ F" u
4 c5 I0 o- |5 P- T( C; b" V: C, i
#ifdef __YENV5 q5 u- T" {: G+ M
                        pLight->Diffuse.r  *= 1.1f;6 |. j& z' U4 p
                        pLight->Diffuse.g  *= 1.1f;
. Q" X5 f$ `5 i4 k                        pLight->Diffuse.b  *= 1.1f;% d3 R: t' M  j5 m
                        // oˉè* ??à?
1 A9 V8 a; e) c  q% u9 u                        pLight->Specular.r = 2.0f;
0 k  Z) U; _8 s/ _3 L' V                        pLight->Specular.g = 2.0f;6 o  l' @0 |( V$ @3 u
                        pLight->Specular.b = 2.0f;
$ f% r3 v0 x+ O# c                        // á?oˉ
) H. G% ]8 O6 s                        pLight->Ambient.r  *= 1.0f;
( n5 R& t! \: I( ^, r. p2 S. G1 m                        pLight->Ambient.g  *= 1.0f;
% i% T- V6 Y6 q                        pLight->Ambient.b  *= 1.0f;% u" B, S  Z! r; K2 r8 a
#else //__YENV; D- i8 N. Y# _
                        pLight->Diffuse.r  *= 1.1f;5 ~( P1 ]* H+ w( k' |' w' j# k
                        pLight->Diffuse.g  *= 1.1f;
! l7 R9 h/ t* X1 X7 d- e0 E                        pLight->Diffuse.b  *= 1.1f;
+ I' U: \/ U$ n  H                        // oˉè* ??à? ' A+ z. M2 h* K/ Z# T' u
                        pLight->Specular.r = 2.0f;* O8 j& H6 Q! M) P2 J5 J8 k
                        pLight->Specular.g = 2.0f;9 m: Y% T( |1 O" g
                        pLight->Specular.b = 2.0f;
; R+ }" n+ `4 M) _                        // á?oˉ 2 T; a) T' n8 a7 ^- p/ K% c
                        pLight->Ambient.r  *= 0.9f;+ {7 i4 Q& j0 `& ~
                        pLight->Ambient.g  *= 0.9f;6 W4 \9 G- M8 l. S8 R( z* ?$ ~1 Z
                        pLight->Ambient.b  *= 0.9f;) m0 Q+ j2 O  I9 z2 _! n, U) Q7 I
#endif //__YENV
+ K0 u  ?; D" T2 P& l& ?  W7 U                          l- @& ?5 m1 M6 S
                        memcpy( &m_light, pLight, sizeof( m_light ) );
7 M  m( J/ ]+ W0 i! m                       
; w, c/ A$ P- N                        D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);
) ?5 Q2 L1 f' |  I                        D3DXMATRIX  matTemp;
+ M; b( b. U2 S, X6 d                        static const float CONS_VAL = 3.1415926f / 180.f;
6 T4 T9 r, f) ^7 G1 ]
" K( K6 r4 n2 r9 C. W( |1 a: [8 a                        D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);
, F2 ]) k0 f3 o                        D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);* r7 t$ y. }0 ~- Z
                        pLight->SetDir( vecSun.x, vecSun.y, vecSun.z ); # e3 t/ o& ]# w
                        pLight->Appear( m_pd3dDevice, TRUE );( F6 N4 J2 m; K9 h, u" o2 ^* O
$ b3 X% f: U: @4 V/ x* ]. Q& }& p& [
                        //        D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
+ @5 }7 ?" m6 ~2 _4 i1 |: P6 l                        //        D3DXVec3Normalize(&(vecSun),&(vecSun));4 B" @1 x6 E: h9 B6 }) U
                        //        pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
! L4 g5 a& J* [7 Z& I8 s+ o1 d0 C) o4 z& z
                        DWORD dwR, dwG, dwB;
3 _; ]# s. F2 A* |2 a5 v                        dwR = (DWORD)( pLight->Ambient.r * 255 );9 [& Q+ S* _: i0 n' F
                        dwG = (DWORD)( pLight->Ambient.g * 255 );
! _6 h9 A2 I3 {2 C2 M# ?                        dwB = (DWORD)( pLight->Ambient.b * 255 );
7 o, I3 e9 ]- [& b( o/ c                        dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );                        + P3 h0 x2 I' H- N1 _. @" h1 x
                }( t9 Y4 r; H* o8 }
        }
. a+ n2 b8 o& w. z8 z4 w$ h7 W! R2 h1 n5 h- d
        m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );, n! ?. }" g5 j9 O/ {; m
        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) );/ \! i  I# n; \, t/ k. ]
        ::SetLight( bLight );9 N) D% M3 t7 R, X
' y, E/ [  V$ z& P* i8 E3 Y
        // ±ao? ?D?í???ó á¤à?
2 p* N; m4 J- n        m_pd3dDevice->SetMaterial( &m_baseMaterial );
6 h$ o, ^* Q0 f        . u4 J" N+ R5 r
#endif // not WORLDSERVER
6 K; M! U2 z/ ~" q6 t+ `4 D}/ l- L, ]( J. x6 m% k# J+ e7 L: G
并更换4 I6 X8 k* A: R1 R
Code:
6 `& ?& F' M7 i: x2 c" y& W__FLYFF_INITPAGE_EXT
/ M$ g& Y/ z$ U定义# |) J$ Y+ [: V. j6 j

9 q5 N6 I# S$ f6 B% P, o" V& ^0 G2 w$ p/ s# a
3 }+ C# N$ C0 T" _! [# b, e

1 v/ b/ H. u; S4 ^3 ]* {$ Z. W现在终于删除我的狗屁加速...
7 g' W- j% f5 ^( d! ?! `
+ ]5 Z2 y) g; o/ Q/ K
/ n0 H9 e# f; E1 A3 `
+ k) z0 e  H) J




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