飞飞世界论坛
标题:
自动饮血和登录视频
[打印本页]
作者:
admin
时间:
2016-1-10 03:46
标题:
自动饮血和登录视频
食品车:
$ a4 W# R* i0 G2 `' n
尾翼:
' X* [7 A+ k6 t5 Q$ b
# C" v7 L( F h/ v+ j- f
代码:
8 J; z$ Z- B7 h* s+ ^: F
CWndAutoFood::CWndAutoFood()
+ ~9 c* x3 m0 e$ S& z, d8 s( E
{
1 |; P5 z( T& H6 D. o* L/ p
m_pItemElem = NULL;
8 {8 ]2 n F5 F" \1 l4 Y9 O. E
m_pTexture = NULL;
9 g& f1 m- X+ {; ]
bStart = FALSE;
; K* m; Z5 d3 e a8 L7 u
}
0 A7 l# A3 j" R7 E8 ?
: Y! j( s; D8 S% _% Q. G( b
CWndAutoFood::~CWndAutoFood()
, f# p- _6 e$ C+ |- o. e4 d
{
2 G" H& }5 Q/ D' J6 v# I0 h% T
AfxMessageBox( "AutoFood ist gestorben
" );
; z6 e0 W- I: L( W7 r& r7 P( J
}
V. H% E4 V2 C
BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
4 S/ G ~, C- ` o# k
{
3 y' |1 Q& j7 |& S j) P0 w5 ]2 H
return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
4 s1 u. g& q4 t# N, b. q5 g
}
& i" q+ L% [8 u5 d5 }2 a% H* r
9 F4 ?( d: x) A
BOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
* T. E) h' B! p
{
! V" E. U! p( R- t' s4 p% G
LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
# q" \) d8 U/ y
CRect rect = pWndCtrl->rect;
9 J- C$ l5 Y- X# A$ W
if( rect && rect.PtInRect( point ) )
- Q: P; d) C$ u" ?& c( V
{
- `; j! h+ ~ ]$ T6 e1 t
CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
: F) ]/ y0 k% D7 u* j$ {
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )
0 |$ I* }: M9 K: y0 P
{
' G+ u& a9 N% t+ H4 k5 h1 ]
if( m_pItemElem )
8 m& L6 g) L6 a: w2 K
{
# o( U( `5 t" n1 ^6 ^. k# A$ X+ B
m_pItemElem = NULL;
! t1 r) q0 I# N$ d6 I
}
6 C/ z: I( ~$ h9 a+ L) `' z Q/ K
m_pItemElem = pItemElem;
8 Z! w" z. Q) r
m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );
. l" c7 M4 B E' z" y9 s" b, D
}else{
0 `! b7 c: i. L' Y4 p/ k" n
SetForbid( TRUE );
& e4 S" q; n7 |$ A6 N
}
- P' x& b- [# ?; T
}else{
$ C* f4 I' f5 a& w% B0 g
SetForbid( TRUE );
. D* j0 C9 d; H9 ]
}
' k8 h& h0 i) F8 E7 }
return TRUE;
# ?/ _# M- A2 w# S" c* u
}
: x5 N+ ^+ ?2 u2 q! I" W& g( k
# C2 m3 E9 p; \' ~" b$ C6 U( p
BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
6 V1 z2 c% q7 b
{
' n3 p- F$ O% y1 O+ v9 D$ Y8 c
switch( nID )
! G( w, b- h9 A: ]
{
! Q8 T/ v! ~+ B+ J8 N
case WIDC_BUTTON3:
' R% L5 j" n8 t, H) K1 C
{
Y2 @4 a) T) U3 Y! D
bStart = TRUE;
# N5 k" y* ^0 C5 x6 m
break;
# \0 S! R) N+ O0 L2 q+ P& [. _# x, {) |
}
; b) N2 e* ]8 d4 a( U: ? D
case WIDC_BUTTON4:
4 E5 P0 N" B8 l8 u% O! ~- J1 I
{
( G) E. s" S; }9 T% G
bStart = FALSE;
1 U& N2 D) H5 s, l
break;
+ T( N: t( x4 o& [1 T$ H
}
- S! H# |6 P: y# c0 V1 U
}
- q+ u9 U. A- f; d( w( `% A
return CWndNeuz::OnChildNotify( message, nID, pLResult );
) S4 \! R+ v ?) ^' t
}
. z# x5 e: j+ Q
void CWndAutoFood::OnDraw( C2DRender* p2DRender )
# Y! M; }( m/ y2 R
{
0 b8 i- T- h6 o8 v' m; |
CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );
0 l+ h$ T' B/ }4 i* B% J
if( bStart || !m_pItemElem )
/ L& A; v; V( h
{
3 r* g# c+ ^' T' ]. T$ h
pBtn->EnableWindow( FALSE );
}& m5 t) Z% C) t8 M- d
}else
) l8 q4 n1 I4 p. t; x
pBtn->EnableWindow( TRUE );
) X2 T/ `: b9 M* `
if( m_pTexture )
( L3 Y$ ?- Y/ F: }- f- I. x! W
{
. L& w& ?8 h, _2 o- P0 {: w, p
LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
4 A6 o$ R$ C4 G" ^" N* E7 E6 C
if( wndCtrl && wndCtrl->rect )
n0 D% C% b& X, L# b
{
+ q0 w; u, `; n3 \0 y
m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
* y+ }3 [1 k7 Q* T9 ~2 x1 Y5 K' a9 I
}
$ V) ^* j, O) E4 r" J4 S% H
}
, z- E- s6 p3 \
}
% f5 Y% T i4 a$ L, V
) R _5 g0 \' e7 e
BOOL CWndAutoFood:
rocess()
9 h( R* K' V7 s a; Y" s
{
( p+ m+ u4 E, d7 P( V* S
if( bStart )
; x# B0 }2 {4 M
{
. n9 u' W, _# X4 T
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )
: I6 A) L4 Y9 l; Y: i" O; z: U
{
1 a$ q- r4 e) W2 x9 e) |; U' U
if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )
6 Y8 Y% M# P# c3 `* f2 R+ _
g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );
( u4 P' ]: Q0 n' o; J! c: Y4 v
}else{
* E9 P; M6 ^+ u3 Z2 O
bStart = FALSE;
2 |# u/ Y( \: G6 ^
m_pItemElem = NULL;
1 F1 ^1 ~8 t5 m0 \
}
* W( C7 B3 x3 r. C# V
}
) c+ y/ A, Q, W7 I# ~8 w+ I% q+ q/ ~1 Y
return TRUE;
2 H5 u! ? f3 R/ X
}
" |9 u |& b& X/ h8 ^( R$ K; C% L
T' ^2 z ?! q! T2 h
登录视频废话:
6 Z( J+ ^* d8 q5 x% n9 s( ?4 D
尾翼:
" j" D* u" d+ a: k Q' w: g
1 k$ A# L3 R, b8 q ]
代码:
$ @ ?7 F# S) s! Z( A* S. ~' `
5 r2 I" f4 N6 o, J
void CWorld::SetLight( BOOL bLight )
0 h" q, L1 @' t* f
durch
& H* G6 O4 y, M5 a! o" d
Code:
* X8 P. ]" L3 [' y% f
void CWorld::SetLight( BOOL bLight )
$ v7 J! n1 n. |
{
: I8 i/ b7 G9 u. V+ X0 ]; l- d- ]
//ACE("SetLight %d \n", bLight);
" k" m* ], l" J5 O
; ]3 @- S6 t$ {7 m8 z7 v
#ifndef __WORLDSERVER
, c3 q& x: C1 ?/ j6 ]- \
DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
& D) G- f- |: r5 i
CLight* pLight = NULL;
. J& |0 V, u# d7 k' X0 E
9 ? ?# g4 x; C2 i& b$ J
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
, K& a5 Z0 Q! ?! k
. r( H8 F1 f; N' W: ~( G. F- R1 w
pLight = GetLight( "direction" );
- z* T* o" [( t# |# S4 }8 D0 }
0 ^0 q4 ]& X3 }2 U: M. N) N g
#if __VER >= 15 // __BS_CHANGING_ENVIR
0 Y6 K. |2 x5 L0 _: u7 N
if( g_pPlayer ){
. V2 W' L, ? P+ O0 }
ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );
1 P$ v5 ]. u; u8 q" c" z8 q0 N- E
if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!
7 M9 f' h) x2 W5 X
{
% O8 m5 \ v, l) i
if( pLight )
+ q7 u& p0 K- B0 \% i5 _3 v( @
{
' S3 U& X+ D O( S/ I! z% G. ?3 U
pLight->Ambient.r = pInfo->_fAmbient[ 0 ];
2 J3 g2 J' _5 ?7 M+ B
pLight->Ambient.g = pInfo->_fAmbient[ 1 ];
- g% d" a* e6 D+ A! ^+ X4 k
pLight->Ambient.b = pInfo->_fAmbient[ 2 ];
" |. \+ G# |% M$ ]+ N
2 j0 r1 K$ r7 p7 N4 [* F6 {
pLight->Specular.r = 2.0f;
% e4 q: n) B- k( p4 x' K/ k
pLight->Specular.g = 2.0f;
/ l8 j; b' D+ Y7 n% @
pLight->Specular.b = 2.0f;
5 y5 O& Q% S; ~
5 m5 Z3 B$ Y$ l
pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];
( T% k; e; j' e t
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];
! R" j4 t& _+ W
pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
6 i$ X/ B+ h- P3 ^, V7 S$ H" H
! |3 Q1 E* w6 ]) I& _ @
HookUpdateLight( pLight );
* L h4 _" |* H
$ g. J9 X7 |5 C7 w) ~( v. w( {
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
3 M1 x: {6 X* {" ?, _
: c7 w! m1 h. D! H. n
pLight->Diffuse.r *= 1.2f;
. o& u/ G4 V' j/ O/ Q _/ d
pLight->Diffuse.g *= 1.2f;
3 t; o1 A& `; H( h9 i& v4 O
pLight->Diffuse.b *= 1.2f;
2 M- R) b7 i7 G z5 H4 b Y0 k5 {
" J0 x6 F* o0 R" {- o
pLight->Ambient.r *= 0.8f;
3 ~" F: u# E7 e& O7 d N& k, q
pLight->Ambient.g *= 0.8f;
! ~7 x6 E% `5 Z: n( R0 l
pLight->Ambient.b *= 0.8f;
, g! h; J2 M/ j1 L+ p
0 Z- O2 K1 [2 r2 r% {
memcpy( &m_light, pLight, sizeof( m_light ) );
/ _6 ~5 J$ d; M& I8 L& E! p# X
; v. C0 ?5 J% ~9 {1 X
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
& i+ O) B0 h% v
D3DXVec3Normalize(&(vecSun),&(vecSun));
# q( f, f* J( J' R
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
3 F# n% M% ^; ]4 Y; ?) X, ~
pLight->Appear( m_pd3dDevice, TRUE );
) ?. x6 b/ q) A
$ r+ E, x; B. v3 ^
DWORD dwR, dwG, dwB;
- H! _, _$ v! g+ M# g6 `1 ?3 p
dwR = (DWORD)( pLight->Ambient.r * 255 );
E8 r- d K& z
dwG = (DWORD)( pLight->Ambient.g * 255 );
/ c' K. ]) |4 _1 Q
dwB = (DWORD)( pLight->Ambient.b * 255 );
2 K& S- }, t6 [6 J( R4 v, Z
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
" T' v6 c) d, K
}
, g; Y3 G- v. _! j* y- b0 F# A
}
$ J3 z3 s r2 ^( e/ O
}
$ C/ c0 d+ S' x# g' u
else
% X; j2 k( f7 z6 V4 T( D7 o
#endif
6 K# n5 B6 E* f6 g- @+ [' s" ]
! l% {8 r6 p& h) p" s/ A6 u6 T
if( m_bIsIndoor )
# a+ U$ Y$ G& r, Y' p; O8 `
{
. u7 s) D; _( ~7 k
if( pLight )
1 G8 m1 t& c. n4 d, p
{
$ N# u% v. m% ?8 {' s
// à??μ oˉè*
6 ?6 W. [$ R4 ]/ |
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;
; l, p/ l7 U4 L) v. {5 ]; C5 W1 f
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;
+ T- W8 i+ O( q0 g$ F
pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;
/ R- N- [! o6 W
) b A! c) e. b* `
// oˉè* ??à?
5 s) r4 L( q" J# D; R& A+ R5 e6 z& g# j
pLight->Specular.r = 1.0f;
$ w$ F; V5 M9 ?
pLight->Specular.g = 1.0f;
' w: L- A P2 v. f
pLight->Specular.b = 1.0f;
; F& v: F9 T7 n/ A; \8 R, c
// àü?? oˉè*
* m8 C/ T* t1 I) B! P
pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;
$ P& W+ x7 q" P" a3 l5 ]; x3 @
pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;
$ r! |7 O2 T* ?3 O' b/ R
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
) D9 K2 z6 \3 z1 [2 Q/ t
, l! s, j; j! F
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
, I2 M2 i; B. o Z
{
# z1 U) G( X- D
pLight->Diffuse.r *= 0.6f;
9 N6 H2 L- L, p7 q, p6 G5 P
pLight->Diffuse.g *= 0.6f;
9 K+ T6 U% J) Y; ~
pLight->Diffuse.b *= 0.6f;
% T6 P( y( m/ V7 i/ |! Q& y
pLight->Ambient.r *= 0.7f;
$ W& p8 n, f% q4 `, B
pLight->Ambient.g *= 0.7f;
8 t$ T6 Q5 ]# G5 l, m( e0 n/ g7 ^9 \
pLight->Ambient.b *= 0.7f;
3 j0 v) w( B$ ~2 ^0 y
}
9 P5 k2 [; a* ?
* _- t4 h, s* C& P! y% T
#if __VER >= 15 // __BS_CHANGING_ENVIR
6 _" e3 `8 y5 G) q4 Z" [( e9 k Q( g
if( g_pPlayer )
0 m N8 S0 l* N' H4 P# K/ |
HookUpdateLight( pLight );
% s4 V% x) b: ?, {8 t. C0 P
#endif
3 L& ]0 J3 L3 h) Q! U) c \
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
0 D: i: y8 U( a) t( L
t# T$ Z$ r0 b2 F: x
pLight->Diffuse.r += 0.1f;
8 l5 q& D3 ?9 p; n }. H- U
pLight->Diffuse.g += 0.1f;
% d9 K& `! |: s; p+ i! ]- C
pLight->Diffuse.b += 0.1f;
! |; a6 Z( N% o( S) b/ m
// oˉè* ??à?
6 b: u5 W, L$ U/ x" F
pLight->Specular.r = 2.0f;
t& q' P+ J: [) a9 P
pLight->Specular.g = 2.0f;
& `* _8 X" }% D+ \1 V$ ~9 S
pLight->Specular.b = 2.0f;
0 J' N( Q& l: \( G. A: S3 L
// á?oˉ
. S' B! A) Z0 O0 s
pLight->Ambient.r *= 0.9f;
0 y2 }, o) K E% z; v- |6 ?
pLight->Ambient.g *= 0.9f;
% E% m* @/ U9 l" A2 T
pLight->Ambient.b *= 0.9f;
9 j- t' w9 ^& q9 D. f; `) }" e
7 q3 Z K8 e; i4 o) p
memcpy( &m_light, pLight, sizeof( m_light ) );
4 \/ \6 Y# {5 V) p0 C9 R7 }# v
! Q5 C- }! s& N* j% B# x# _
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );
3 }* N K, L" C. u
pLight->Appear( m_pd3dDevice, TRUE );
% |( }$ s6 b" w! R H# k; {
& x2 ^2 T# P8 H. v
DWORD dwR, dwG, dwB;
$ @2 V2 X6 d& M
dwR = (DWORD)( pLight->Ambient.r * 255 );
: k( ^: a+ A& }6 B9 |' L
dwG = (DWORD)( pLight->Ambient.g * 255 );
/ L6 Q# p$ o+ f: ]
dwB = (DWORD)( pLight->Ambient.b * 255 );
- m, X' W, J5 y6 x
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
! s% n$ K H) n Y
}
. d j* m" F% @$ K" C
}
/ {4 a* k7 s8 @& e
else
$ O, f+ d# l3 B5 }7 g
{
+ d3 O, W; _5 R/ ~% t
if( pLight )
' O$ J8 z' s7 m4 a0 N
{
9 {! k9 ~3 |& Z% j) R
4 f* H# j: q6 s( l# o3 C
int nHour = 8, nMin = 0;
$ x- m- e" r* i( w5 O2 u1 Z" r9 V9 O
#ifdef __CLIENT
0 t% I+ i$ j& }6 W7 D0 j
// ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù.
- R% ?; n r8 w7 _. R8 o
nHour = g_GameTimer.m_nHour;
- C: U9 {) }1 T1 |$ [- M
nMin = g_GameTimer.m_nMin ;
5 T, Z# k" e5 s; L
#else
* ?6 v, x& G4 l% ]' n
// o??o??′? ??°£à? m_nLightHour???* °?á???′ù.
& c u0 E: r3 j( s6 k- l
if( m_nLightType == 1 )
3 R5 Z& v5 [8 `. [
nHour = m_nLightHour;
# \6 N3 d' n) a: x. I+ E
#endif
7 k/ x3 J* L3 H$ m0 {' p
nHour--;
) z1 p3 F7 b, p( F
if( nHour < 0 ) nHour = 0;
- o* R* p: E/ f/ l
if( nHour > 23 ) nHour = 23;
5 W# {$ @8 ]% |1 ~6 u
6 | v# m' A1 O- ^8 b) E
//if( m_bFixedHour )
L5 j8 V4 B6 _) I5 j
// nHour = m_nFixedHour, nMin = 0;
; n2 @3 V( E. f: s! c8 F+ Z4 T
LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];
$ G+ J2 S4 v. D/ v+ X
LIGHTCOLOR lightColor = m_k24Light[ nHour ];
' j3 ? v3 ?# S+ T; W2 P
. w- K2 [: c! f; p9 M7 m
//m_lightColor = lightColorPrv;
5 R+ [5 U( \2 z* N! I
lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
$ e0 n5 z' t% I: P7 k
lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;
3 f X$ s1 x0 D3 r+ M k( M
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;
. N4 S2 P, P& Q4 g, L* E) e1 T
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;
3 U! y5 O) r" D; k& j! l: N1 N+ X
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;
; A7 i$ }3 g! ]3 s
lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
: o6 l% Z. w2 H+ ]. h+ u) |
// 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)
3 v$ y7 z1 S* U2 L7 k5 x
9 \' D4 W% u+ D* v& q6 x. F$ A3 l
// à??μ oˉè*
& g0 K$ X0 Z* n8 m/ p
pLight->Diffuse.r = lightColorPrv.r1;
. ~8 o! C, @2 s, K) X0 E6 M
pLight->Diffuse.g = lightColorPrv.g1;
# z/ v* @2 H9 P" l4 K2 Q5 D, ]
pLight->Diffuse.b = lightColorPrv.b1;
% y4 O H* b$ l
// oˉè* ??à?
- Q2 r0 K3 V1 H7 r
pLight->Specular.r = 1.0f;
2 h+ R& `( Z% y4 }
pLight->Specular.g = 1.0f;
2 W3 {* Y6 e9 \& a
pLight->Specular.b = 1.0f;
. P! O0 \2 |/ j+ U/ \
// àü?? oˉè*
% Y0 K6 s3 k; Z7 N; @
pLight->Ambient.r = lightColorPrv.r2;
4 U. q, ?$ j' q' }
pLight->Ambient.g = lightColorPrv.g2;
: u+ Q* s( d0 j1 \
pLight->Ambient.b = lightColorPrv.b2;
1 \7 @ k: B5 r$ J) B7 [" C
# J* d* I- u9 e# J2 j
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
2 B+ M& y( e& n/ }
{
/ j V) F9 D5 i/ R6 l- h
pLight->Diffuse.r *= 0.6f;
4 r6 I8 R1 l, ?4 N0 U9 N
pLight->Diffuse.g *= 0.6f;
3 n( b1 l/ T' s5 @1 P3 }
pLight->Diffuse.b *= 0.6f;
( }5 \3 V- ^3 Q; i# o! B
pLight->Ambient.r *= 0.7f;
+ Y& Y& T& ~+ j/ w
pLight->Ambient.g *= 0.7f;
' `2 f. A1 g$ I. C6 N6 x8 c
pLight->Ambient.b *= 0.7f;
& \7 x0 u& R/ i F/ o4 Z: ^
}
- s+ o4 @5 E# N. M1 s1 e) L3 g
4 u, p5 N1 N, t- F3 O9 [
#if __VER >= 15 // __BS_CHANGING_ENVIR
4 m* Z3 ^# Q7 f4 N) y# X: b7 v
if( g_pPlayer )
6 Q# c ~( ^. z# s3 J
HookUpdateLight( pLight );
B* y" m4 H; D% ]4 c! \# W0 a$ Q
#endif
1 e* m8 [2 w8 ^# U& t; F
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
. X" k+ z: y- Y! J* S2 d* v
* Q) S a; \! B- } P6 ?
#ifdef __YENV
* f4 X1 y: ^8 \- X6 B+ w) q
pLight->Diffuse.r *= 1.1f;
& V6 i6 f7 F. g. f$ l
pLight->Diffuse.g *= 1.1f;
2 D$ A; B( Y; b `) @
pLight->Diffuse.b *= 1.1f;
, [7 B6 p! x: C1 y1 n0 Y u9 H
// oˉè* ??à?
6 |* W2 L% ^) |* J& G
pLight->Specular.r = 2.0f;
! ?& L3 f" C2 [2 y$ P/ G" _
pLight->Specular.g = 2.0f;
* E, W8 ~( _$ D! ?7 T3 c
pLight->Specular.b = 2.0f;
$ A7 h J1 @* w; m4 h- a3 H" z
// á?oˉ
: w, H' q+ P1 y* _
pLight->Ambient.r *= 1.0f;
% J4 {2 o: S, g( Q* Z
pLight->Ambient.g *= 1.0f;
1 f6 H8 i. r; x
pLight->Ambient.b *= 1.0f;
( { ~$ X% k2 H7 k1 ]
#else //__YENV
% J) R9 F6 ~4 q( Q# A
pLight->Diffuse.r *= 1.1f;
3 a8 n4 T9 ]7 W8 w
pLight->Diffuse.g *= 1.1f;
1 H; b$ z, v8 ^! z# `
pLight->Diffuse.b *= 1.1f;
; E% Y4 |2 V! M
// oˉè* ??à?
7 k: L. B! Z* q: r4 R4 C/ |
pLight->Specular.r = 2.0f;
6 a z5 u$ A e9 t1 |, D
pLight->Specular.g = 2.0f;
0 a0 n# Z( ^7 w/ O: s& n
pLight->Specular.b = 2.0f;
$ I9 s n# o' P( z/ J+ x: g
// á?oˉ
4 Z& Q0 E' ?0 ^8 w
pLight->Ambient.r *= 0.9f;
1 H# b* J6 h. r: U0 A5 N' Y9 J* m
pLight->Ambient.g *= 0.9f;
$ T% d$ R% U' G' T7 R
pLight->Ambient.b *= 0.9f;
, T. s. `+ M3 t/ b3 d v' t
#endif //__YENV
f& Z7 [5 h$ v% y3 j
3 a+ j. r. |5 p7 }! g
memcpy( &m_light, pLight, sizeof( m_light ) );
& K& N4 b$ o$ J8 L* z
( a8 W0 K$ h) m, S# ]+ T8 q9 U6 p
D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);
+ y( S1 {8 [1 w% S6 }5 L1 f* J# j
D3DXMATRIX matTemp;
7 y- b% ^0 ^7 N- F0 v
static const float CONS_VAL = 3.1415926f / 180.f;
K! i4 |% @# w, C* H- O
7 ~* Q% r+ `! t7 D% \6 x( T) I
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);
: z5 ] U3 r! t2 h
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);
# u Y$ x7 i) n# x
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
4 n& W- z0 L& K5 I1 \
pLight->Appear( m_pd3dDevice, TRUE );
. s7 `- x' C5 ?8 ~. S
% L" K( ~$ d" E5 Q' p4 m
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
; X& _, F- Z6 a' }
// D3DXVec3Normalize(&(vecSun),&(vecSun));
1 C4 t* E2 P) X& `
// pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
* x% g* E$ P; r. J( X
2 g/ T% L* H; P; d7 M, [& k
DWORD dwR, dwG, dwB;
; R0 y$ t) m% M4 r( v7 U
dwR = (DWORD)( pLight->Ambient.r * 255 );
9 d3 ~2 H7 S: q0 q! ^6 x: I
dwG = (DWORD)( pLight->Ambient.g * 255 );
/ ~' B$ d- S W! e I# B& X" s
dwB = (DWORD)( pLight->Ambient.b * 255 );
9 i& R3 U& g$ a% p6 L
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
7 x( e; D D9 l' y1 L8 w2 {& A
}
" ~4 V1 A1 G# b2 Q3 g
}
& C4 d) @, f: @* ~0 K
* F/ M4 n1 k; i' ~; d" d
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );
$ s9 ?1 V8 \" n* H( w6 s
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) );
v3 ?8 V# M# `2 O8 S+ k
::SetLight( bLight );
1 r: D, P# {$ [
- v7 Y! {& t' X
// ±ao? ?D?í???ó á¤à?
' F2 t5 X! I- h N; X
m_pd3dDevice->SetMaterial( &m_baseMaterial );
- t9 J2 l! Y$ w6 ~% d
, w3 O) d' }+ P) f
#endif // not WORLDSERVER
1 {( m: q3 `, E* Q
}
5 S: G* C8 x7 s* P4 A- N
并更换
. _7 c$ Z. @4 Q$ S3 I. u1 t
Code:
! j9 R k7 e8 R1 x8 ~1 o
__FLYFF_INITPAGE_EXT
* |- k$ O" U/ h
定义
1 k! P/ D& ^3 X& v, H6 f, ?
* I9 j; j9 b4 P( s1 K8 ]4 i9 u
' m* a8 K( ~- u- _4 Y! R9 z+ `
+ d5 V8 L. X7 k( U# a1 B$ p& s0 q
% |/ Z4 T# |5 w
现在终于删除我的狗屁加速...
( F+ Q! E8 v" a+ i! ~3 u: E* Y
& m }& p2 f+ D
& H* D9 a) D5 I( x* |% ]
3 [: \3 t2 U" w. F; A! Q9 b
欢迎光临 飞飞世界论坛 (http://www.ffwold.com/)
Powered by Discuz! X3.2