飞飞世界论坛
标题:
自动饮血和登录视频
[打印本页]
作者:
admin
时间:
2016-1-10 03:46
标题:
自动饮血和登录视频
食品车:
& h/ q: U, {1 A% u+ M( L S, J
尾翼:
2 O; c# f" t# G! u0 g
) D f, x% ]! K
代码:
8 W8 y+ i a6 d9 m, r- G
CWndAutoFood::CWndAutoFood()
8 s& y$ X. f1 \/ Q2 t, d3 `
{
" w8 X5 K' D7 `7 X5 r Y) @$ `
m_pItemElem = NULL;
0 a8 @5 s8 \* L* {! x3 O
m_pTexture = NULL;
/ z# B; Y0 W1 f' D3 j
bStart = FALSE;
* ^, W& P* Z! w) l) s4 I
}
4 O e( Q5 U2 l
$ V1 t, R( N6 w7 q
CWndAutoFood::~CWndAutoFood()
9 l$ }% m3 `/ l% k/ {$ w
{
5 F- u, a5 h+ T) L
AfxMessageBox( "AutoFood ist gestorben
" );
" O9 g' u3 @ V( n0 I( e/ g
}
6 n- M0 S: k3 k
BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
$ p$ q! N# l$ L- X* q: m9 k
{
/ P( J( e |2 Y7 z- @
return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
% Y' @2 G0 p0 }6 F( R& _' \1 j
}
2 ?6 n- P* o, ?5 S# g
! L8 u/ b/ {* Q5 |, D0 R
BOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
' g% b8 ^/ V. Q; `6 H \3 ^% S' P
{
1 n% H2 k" ?6 ~4 @
LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
P: u$ m( w( \# v" q
CRect rect = pWndCtrl->rect;
6 I% h' P% w% X/ l
if( rect && rect.PtInRect( point ) )
- h" K4 f7 ?1 z
{
$ x* n9 P7 U+ v+ L; p8 g2 W
CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
( u' r0 x2 j. F
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )
+ N1 ~" e/ [# h; j
{
+ T# l. @5 F% t1 Q3 F
if( m_pItemElem )
+ ?+ o1 [" o* x. m. j& n) k2 E
{
+ d1 V/ `- Y+ o
m_pItemElem = NULL;
. @# k+ F8 O1 Y4 y+ |6 a
}
0 n( J# E" C2 r
m_pItemElem = pItemElem;
. H" u( ~- w [" P5 C4 s& d
m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );
( K- D: s7 s5 k- v
}else{
6 H1 Q# s2 k' p3 C
SetForbid( TRUE );
( h; j0 f$ o4 D9 \# W1 m9 v. \
}
3 T: {9 Z3 b E* c# N
}else{
/ K% X1 f, x6 g: x9 X
SetForbid( TRUE );
4 Y# U4 h8 O; M9 t0 ~
}
/ J ]2 J, s4 W6 u' F. p
return TRUE;
* A" v- s/ h+ b; J+ j1 W. C; H% j4 q
}
! g3 i: M. u+ }8 x
. j$ v: B+ _8 S1 I
BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
5 m" I. N, F9 z P& Q' Q. _* j! q
{
& s+ u" T: X. W1 |) R/ t
switch( nID )
( h: X% I* J8 F2 Y! y6 i# k4 |
{
4 a7 D. Z5 T% g! u
case WIDC_BUTTON3:
6 D) a- q/ A$ r
{
1 A% |: m* q- {8 \ I! w
bStart = TRUE;
6 I! D& X9 a2 U0 v0 _
break;
. I( ^. S; g2 l
}
1 S, }0 X* T9 f9 j+ h
case WIDC_BUTTON4:
9 a0 J6 c9 F; f1 A/ t0 Q
{
" |" _& c1 @! J9 z A& o) T
bStart = FALSE;
9 E. c: U+ p: I7 j. e* ~' w
break;
; f1 \; F! V. A, i
}
+ {* |5 V2 q) M& d) e
}
8 K9 i6 x3 q' T( j) Q' P9 T* r
return CWndNeuz::OnChildNotify( message, nID, pLResult );
6 O0 R! o7 K! p1 E6 q# P2 x
}
5 X' m. L0 D% u! ?: C6 d
void CWndAutoFood::OnDraw( C2DRender* p2DRender )
* X `% ?: ]( N5 |' v+ b
{
: ^. P3 J) k: {" }/ a( l( E
CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );
" [4 ~! D' ~ a; D8 i4 [# Z/ K
if( bStart || !m_pItemElem )
y* D& Z* Z' r5 s, ?7 z% H# {6 {
{
5 O! V* e/ H! [' Y9 i
pBtn->EnableWindow( FALSE );
9 @1 w- |5 N# @9 E: O2 Z- H( ]
}else
4 D6 B& |! h0 G
pBtn->EnableWindow( TRUE );
1 H; Y; U' O+ m& v4 x% Q
if( m_pTexture )
; Y+ Z4 a* ~# h
{
+ ~1 c7 k$ t4 J) }$ j& K, ^ x! z, h
LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
+ P! x' t$ I; P) S
if( wndCtrl && wndCtrl->rect )
I* ?: v$ N# h: V$ N8 T0 `
{
* y: f' C; Z- }9 I
m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
+ w x; ^0 _" k! M, \
}
% ]: S9 v" U' K8 r9 I @; m# F0 Q
}
) W/ G. r6 |8 @! u8 i; I8 R( g3 s& w8 B
}
0 y6 m$ `, E: a7 x7 K
' U0 [( N+ w5 ~- C
BOOL CWndAutoFood:
rocess()
& y; R( p( Z: \7 ^3 W& ~1 d
{
' D% ^0 C9 F; }- j' K- M
if( bStart )
4 r" w' ]" i- X h" A
{
* e' `- `. [1 ^& m& S; ?3 L) W! {
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )
9 v3 q C$ D ?* m5 T& @, p
{
, G3 h& h" u* z5 Z0 H8 x
if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )
- s! t0 _0 H7 r# @4 O- f# ?" ]% n1 g
g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );
4 l. _( Y1 |/ q/ P4 h( C
}else{
* v6 Y' O+ T" C4 v
bStart = FALSE;
- z( h0 K! q, `2 ?8 B9 B
m_pItemElem = NULL;
: @+ r% V7 G+ y( }; @6 f4 y; r
}
' I& h' V# l0 Y( R3 M# S
}
7 v C8 r& K1 o; Q( {2 Z
return TRUE;
% i1 j6 |+ @ z, q
}
4 Z5 e$ G- |3 h/ p, x
: r6 x, f7 b7 O2 D* V; l' e" m, P7 e
登录视频废话:
6 e- S6 h5 p& v: _; `
尾翼:
$ I3 W. g% F9 p" Y4 q. A4 E
, w7 g7 N7 K; }
代码:
# q. J& Y! D3 D! r
( Z' _5 Q' R$ `/ ]3 o, { V
void CWorld::SetLight( BOOL bLight )
/ O) A l" G/ _+ P: `0 w
durch
: l3 V$ J& I4 D% N
Code:
: n4 R2 i, `) F1 G4 K1 i
void CWorld::SetLight( BOOL bLight )
* C7 T* Z* h6 d, U8 k/ \5 o
{
5 c1 r* d2 S! a& t( a' d2 W8 C! M
//ACE("SetLight %d \n", bLight);
- |) Q% H6 j8 D E% O0 ^6 V
+ K \) H) O# {" M& S' p" U
#ifndef __WORLDSERVER
) F; R( X% z0 v
DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
( s1 F: g4 f' R3 a# U. g8 {
CLight* pLight = NULL;
1 w9 W4 W7 `# }8 `5 f
% j g# p Q+ Q* k6 ^7 B3 X
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
6 Z$ H. q( e8 l- B- c
( M4 q9 X! u W1 Y
pLight = GetLight( "direction" );
# J3 o* s. c1 c& R- w8 e' V
9 O4 g, s( G* [7 k; n N4 S5 {
#if __VER >= 15 // __BS_CHANGING_ENVIR
% @/ D. d E% R) K9 ~" m ]
if( g_pPlayer ){
5 p& B8 S8 z3 E% L6 V
ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );
: b; |! x C! U/ G2 x/ j
if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!
! y( ]+ U5 j s4 O4 m+ P: F8 P
{
+ Y% M, H N( m# [
if( pLight )
; C: a6 o0 p* G' F* M; Z
{
$ J$ X7 x H$ M1 Z( b
pLight->Ambient.r = pInfo->_fAmbient[ 0 ];
' r) S* [) y; ?! z) S# a
pLight->Ambient.g = pInfo->_fAmbient[ 1 ];
3 | O0 I: I% ` ?
pLight->Ambient.b = pInfo->_fAmbient[ 2 ];
& }/ y: j+ L& G5 k. B
, ?. I- G* ^* Q. w4 j( i
pLight->Specular.r = 2.0f;
0 o/ ?0 {& {, F
pLight->Specular.g = 2.0f;
$ M; I/ H' {. ]& l& Q) }: G# v
pLight->Specular.b = 2.0f;
) N3 E3 h c1 I% e
" f4 N0 | k: y- G; v
pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];
/ [& t( {% P6 }3 d, V V9 u5 R
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];
1 ~, @' U6 R6 m9 U" u: N- J. p, Q
pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
% ^& E* l7 _! j% X& s1 i b
6 j$ {. a" M! D" m. u9 Y2 ]
HookUpdateLight( pLight );
( o4 C; I' F/ r3 Y
6 D, T+ C& G8 {" b. r
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
, s7 O4 h; T) o' A
( D% O. B0 k: j, J6 J, M
pLight->Diffuse.r *= 1.2f;
$ N% ^* r: \- i' E; l' A1 U8 W0 f
pLight->Diffuse.g *= 1.2f;
( p8 U. a+ }: \! F( f5 F, s. X
pLight->Diffuse.b *= 1.2f;
: |$ S) |' N8 ?( s9 f5 Q) q4 j
/ M7 j# u+ p o T8 y# }
pLight->Ambient.r *= 0.8f;
# g/ b+ V6 T/ n, L
pLight->Ambient.g *= 0.8f;
" P! J* ^5 t6 D
pLight->Ambient.b *= 0.8f;
* G" F' T+ i, @0 K
( A; S1 v; H' T9 X* L& B
memcpy( &m_light, pLight, sizeof( m_light ) );
& X9 o/ X( `0 a
$ q0 n8 D! @5 Z |( t; G0 S9 G6 e
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
2 z+ H: D+ h( f, L2 z4 v8 u
D3DXVec3Normalize(&(vecSun),&(vecSun));
. `/ b: H; a) v+ K: i
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
, y8 S% ?* N! G3 C" |# Q; N9 N: D0 Y: n
pLight->Appear( m_pd3dDevice, TRUE );
4 J } \/ ?- Q1 P- p `; n, X$ e
# A, Q: X! H) _( L5 V: ]
DWORD dwR, dwG, dwB;
1 N5 [9 j3 c( d* J+ f9 _+ }+ I! N% B
dwR = (DWORD)( pLight->Ambient.r * 255 );
: N3 @# y+ y; `4 P/ P# q% P
dwG = (DWORD)( pLight->Ambient.g * 255 );
4 d+ ]9 |, [ }3 v7 u7 y
dwB = (DWORD)( pLight->Ambient.b * 255 );
" G( q; l4 c# p) b$ O
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
+ R* Q# M2 Q% V2 P1 J* v4 j$ }0 \ I
}
, O# y6 u- I5 ], _% J
}
+ i9 W. M! l2 c. {
}
( W) O: o9 W3 r
else
; o8 y- C% m d. e; F. J; H
#endif
5 D( m$ |$ p5 b2 v7 {! Z C$ {
t: @% D/ g- _# S5 M1 n4 t
if( m_bIsIndoor )
0 K' i) p% X/ j, B2 \ H
{
9 i0 t/ K2 h. g0 u
if( pLight )
3 {* z( G6 b0 h- s( {1 W
{
" w- E6 Q Y( s/ n
// à??μ oˉè*
- e, D w7 a' N' D& z* ?
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;
, a9 X, [# s3 u/ E6 M: T/ s
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;
6 s, F" x! H+ j/ ?# n3 e
pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;
1 i# U& f% {$ a. _
9 Z. j$ }+ o" g7 l ~) k4 F
// oˉè* ??à?
/ e& p0 y' x/ e% z( s( Q" [
pLight->Specular.r = 1.0f;
' R& W6 A U5 p" V2 d9 V( P9 K
pLight->Specular.g = 1.0f;
6 c- O+ s l2 Y
pLight->Specular.b = 1.0f;
0 r6 {' l% z, }' y
// àü?? oˉè*
6 `1 C- C: A- {( r5 w
pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;
, T/ j _' m: S* q; f6 U
pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;
+ K- I& x2 r! J6 d9 |* A
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
+ Q- V; G$ x% r3 t- o% A
1 E2 z7 q9 a5 r3 A5 Y, P
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
% T9 I; n% }! H: l: _
{
' \) V9 z5 k% d1 y
pLight->Diffuse.r *= 0.6f;
f8 D- b5 L' V
pLight->Diffuse.g *= 0.6f;
; u( W, A6 \& I" i* @
pLight->Diffuse.b *= 0.6f;
. i; o N3 ~/ r2 @4 X" ?% O, I) a/ h* e
pLight->Ambient.r *= 0.7f;
: z/ Q8 _2 R) {
pLight->Ambient.g *= 0.7f;
4 ]! H+ e: T% G$ n7 F; W
pLight->Ambient.b *= 0.7f;
- K- z* `2 L# C3 C( q
}
3 D, R( m7 B% d" z" f
8 a& H, l8 f* F1 P
#if __VER >= 15 // __BS_CHANGING_ENVIR
/ p! e7 R8 ^8 w
if( g_pPlayer )
; {/ V' f. Z9 L3 h" v
HookUpdateLight( pLight );
+ h1 }# \! V* M4 A$ J
#endif
6 c+ n/ k* b) U' U
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
6 \7 p4 ?: y0 M9 m0 A
( R3 ?6 v) K) E- `) @ ~
pLight->Diffuse.r += 0.1f;
8 m5 m8 {/ s4 w+ q: }
pLight->Diffuse.g += 0.1f;
; _; L. [9 R5 e6 Q, q Q
pLight->Diffuse.b += 0.1f;
& s# P( ~8 ?2 Z x
// oˉè* ??à?
) Y4 M: f5 R9 |4 A6 G
pLight->Specular.r = 2.0f;
, Q0 M$ x0 X. M9 w
pLight->Specular.g = 2.0f;
/ a0 A, m0 \* Y8 g) b: e
pLight->Specular.b = 2.0f;
; [+ M- n9 ~2 r, ]# M
// á?oˉ
! X. k- Y9 p3 z! ~. B& u
pLight->Ambient.r *= 0.9f;
& u) A' c' K p$ K i) O
pLight->Ambient.g *= 0.9f;
4 j# Y# { h0 J! o& w3 W" C
pLight->Ambient.b *= 0.9f;
' P7 z' V' ]# M) k
6 X3 p& P8 h, w( f+ J' M* p% S
memcpy( &m_light, pLight, sizeof( m_light ) );
, J5 p0 V6 d1 r3 _" k2 b' t7 s% h- D
7 g7 d* {. z) }, j4 K' m( K5 x
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );
) G) \" s0 `* d6 J9 H& D o- c H
pLight->Appear( m_pd3dDevice, TRUE );
$ B$ h# M* ?1 L3 G7 D2 b
8 Z, K( N" W E+ M1 X( K, a
DWORD dwR, dwG, dwB;
# e6 Q* c* V @+ Y/ e2 H; x, w2 F
dwR = (DWORD)( pLight->Ambient.r * 255 );
5 Q" H% y n/ b- \* z, Z7 n* N
dwG = (DWORD)( pLight->Ambient.g * 255 );
0 v" |3 W' P* P; ^" i* P
dwB = (DWORD)( pLight->Ambient.b * 255 );
: ^! d' r, p9 u. k) R
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
( [2 n% K+ \) v* i; O8 k
}
# t: Z% v" l ^7 o
}
3 a; k y; l2 M& _8 Y; }4 U
else
9 O- Z3 ~; [/ L& B* F$ z1 W1 T
{
& ^4 l) w0 m% l; j; m: ]0 ]$ ^
if( pLight )
, g8 [' x4 l0 U( h
{
9 Z1 ~% F) ~6 n% H6 e
6 e# a4 S# W# e5 y) E! `
int nHour = 8, nMin = 0;
- p4 ^! g E* e0 v' x2 [. n
#ifdef __CLIENT
" \7 a* |. `+ W
// ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù.
4 c b/ y* ~- I% q5 |
nHour = g_GameTimer.m_nHour;
( `% \0 _; P$ G. y5 F1 y
nMin = g_GameTimer.m_nMin ;
4 Z" ?: e- j% t5 @
#else
4 [ G" m) V5 o4 Z# S6 F/ s
// o??o??′? ??°£à? m_nLightHour???* °?á???′ù.
, l8 u7 v, n- k M" X% G- N
if( m_nLightType == 1 )
# j) a; n7 d0 x
nHour = m_nLightHour;
4 h9 L. m" Z/ w0 w/ }; H# U2 C1 h$ ^
#endif
9 V% @( f2 U# Q1 C' ?; Z1 S2 [
nHour--;
7 W+ y7 V# b" V. z9 I) L& J
if( nHour < 0 ) nHour = 0;
3 t }" k- M& X
if( nHour > 23 ) nHour = 23;
3 ~' v1 R/ D$ _, a
# k7 M! E- y: e& r: z. e+ m, d
//if( m_bFixedHour )
% p I2 D i, B) q/ T7 f9 a$ A
// nHour = m_nFixedHour, nMin = 0;
6 _) k2 _/ U5 H' X
LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];
5 s& i! U- f+ ` j b) v9 W, d7 Y
LIGHTCOLOR lightColor = m_k24Light[ nHour ];
8 Y" o' A+ C6 W) H2 d( A( ?
9 E- ~6 U) Q" o- x: n. g
//m_lightColor = lightColorPrv;
. H) D) x* |8 H F2 P2 Q7 v) h9 T3 C
lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
6 k' D+ U _5 t( [$ e3 N) ?1 R
lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;
/ w) f3 H9 S' } a) R1 f
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;
6 j! F; j4 Z; ^1 n5 k. ~
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;
/ F" Z |9 t2 I1 v& T# a# d
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;
# f! F) _: F |3 |8 J6 C" j
lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
2 E+ O3 |2 }" V3 w5 l! z
// 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)
8 ^/ l* Q; M2 _# E4 A
; D1 f/ U3 a( z( }) O' J. V( R, _
// à??μ oˉè*
* i; V3 J: e7 r" T: [
pLight->Diffuse.r = lightColorPrv.r1;
: n7 x7 ~! t8 o% J& ~
pLight->Diffuse.g = lightColorPrv.g1;
) @6 y* P5 M% J1 r& f
pLight->Diffuse.b = lightColorPrv.b1;
# Y# t/ j7 P) Z: O: C. R
// oˉè* ??à?
. W5 }# H" o: [+ o! T" b) p
pLight->Specular.r = 1.0f;
) H: U$ ~- m) ]
pLight->Specular.g = 1.0f;
5 N$ j, _3 q8 z$ n, ?
pLight->Specular.b = 1.0f;
, A2 |' T; H( n) s j, Y
// àü?? oˉè*
. e4 ~9 z( p5 Q! M9 ?5 i. E5 \
pLight->Ambient.r = lightColorPrv.r2;
. @: h6 \/ [: r, ^) E4 u4 h) r
pLight->Ambient.g = lightColorPrv.g2;
, w3 `1 t& c; D# a
pLight->Ambient.b = lightColorPrv.b2;
8 q* f# h. y/ H# I
; U# t. ?6 [ X3 b
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
/ _# Z# A8 O' l
{
/ T7 p; v E, k( G( H3 K% V
pLight->Diffuse.r *= 0.6f;
5 {$ F9 J9 M' K6 r0 L+ g5 ?: H
pLight->Diffuse.g *= 0.6f;
) }# E) z- O. z% N
pLight->Diffuse.b *= 0.6f;
3 v/ T3 Q2 ]- R/ c) s+ ~
pLight->Ambient.r *= 0.7f;
4 S9 b- V" v% @( P) a' h% K+ O
pLight->Ambient.g *= 0.7f;
" F0 h* d2 x' n; I0 N( x
pLight->Ambient.b *= 0.7f;
% M0 H/ d3 ?% z2 ]' U/ h; n9 _ f
}
/ j2 t" W# H* t( t( R2 A8 D0 [
0 e, \0 r! c5 t+ y* T$ a( D/ G
#if __VER >= 15 // __BS_CHANGING_ENVIR
3 W$ [: w+ k z; T, q& o1 X1 g
if( g_pPlayer )
2 `7 i6 f+ F0 C9 T
HookUpdateLight( pLight );
/ s5 E+ `0 T7 f2 P: b
#endif
1 x& K( V/ @3 |# x6 h
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
! A4 c4 }4 E$ U: \* m. S; [- i( F
' t8 Y/ k t& q
#ifdef __YENV
/ S, B8 Q- Y! L p5 P
pLight->Diffuse.r *= 1.1f;
* ]6 N) ~8 \: Q* \$ G1 J3 H
pLight->Diffuse.g *= 1.1f;
- W9 Z1 t) `: v1 H' b
pLight->Diffuse.b *= 1.1f;
9 Q; N6 F$ ]1 j- l* |
// oˉè* ??à?
7 s/ _( e" l, ~7 Y
pLight->Specular.r = 2.0f;
T$ h1 [, J7 b7 e5 w) o( q
pLight->Specular.g = 2.0f;
" T/ H( A& d, Y6 m* ~
pLight->Specular.b = 2.0f;
: J, g* g( Q& |' c k: S, \: d0 B: `
// á?oˉ
7 S" R. i0 c: k5 a) e
pLight->Ambient.r *= 1.0f;
% g% C) F" v' {6 l' n; v
pLight->Ambient.g *= 1.0f;
. j9 G+ v2 N! E2 ~
pLight->Ambient.b *= 1.0f;
+ {" g9 F: ^9 R; y$ B
#else //__YENV
" g8 m% }% M3 f& z' p0 ~0 c
pLight->Diffuse.r *= 1.1f;
2 q* N5 K8 e( H% `0 v4 \
pLight->Diffuse.g *= 1.1f;
% P6 \- C8 A7 f6 F: M, V8 p+ @
pLight->Diffuse.b *= 1.1f;
. r Q9 f4 @/ E0 L
// oˉè* ??à?
5 F$ }7 Q" w+ }+ V3 ~$ ]
pLight->Specular.r = 2.0f;
3 f: {; F" s0 m. x- u+ G5 ]" a
pLight->Specular.g = 2.0f;
, _0 n L+ Q# z+ P
pLight->Specular.b = 2.0f;
& z5 Q: D& ^: e
// á?oˉ
1 J3 c4 Y8 X( F
pLight->Ambient.r *= 0.9f;
1 {- f6 B% o0 `, d2 p9 Z
pLight->Ambient.g *= 0.9f;
; @' _- m9 F/ j9 H* Y, z, H& @7 B
pLight->Ambient.b *= 0.9f;
& X6 w' r$ I, L* E
#endif //__YENV
4 E3 O& f, s+ b3 G2 E# V, n
. m i: Q" x5 k' P# O2 v0 h# w
memcpy( &m_light, pLight, sizeof( m_light ) );
, i0 H5 @" ?2 W1 E+ g( T% M1 ~& L
C' u4 U1 s+ u
D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);
. w9 M' c. r& [9 \/ R
D3DXMATRIX matTemp;
' o/ o0 j0 u8 h8 q
static const float CONS_VAL = 3.1415926f / 180.f;
g v& J/ p4 \# D# W4 i
8 ?, L5 L8 z4 P" |; ?# K
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);
* `9 t$ d/ D( D" T( l, x
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);
" f' Q( d% i% \1 T6 U2 \
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
1 o ~' V4 L/ M
pLight->Appear( m_pd3dDevice, TRUE );
# ?& m1 s+ c1 m. f* P0 O
- ?) w# n# M# i: U4 K, j
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
- D5 G' @$ `: \0 p: C
// D3DXVec3Normalize(&(vecSun),&(vecSun));
7 ~1 H$ Q# } o, F4 W; v! |
// pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
! w) _ H# @6 C: u2 L& u& }8 E
) `4 c2 I _) C7 c: r! P* H
DWORD dwR, dwG, dwB;
6 q- p3 {; L: e
dwR = (DWORD)( pLight->Ambient.r * 255 );
( ]; B, ? M/ K) a# ^
dwG = (DWORD)( pLight->Ambient.g * 255 );
/ G5 y1 N- P6 N4 g. O
dwB = (DWORD)( pLight->Ambient.b * 255 );
3 c. A5 h' u' l3 J
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
% a' {( J5 O7 M2 K
}
9 V' e' y) B4 S5 q2 N
}
/ i% P6 q1 f$ h! v
" W- s! x$ B( ^ d+ `
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );
+ H4 A" @/ | `) \' [5 H, 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 s/ f% m% o" c( j* d' }
::SetLight( bLight );
7 o( B3 F; Y3 c. k8 J8 w1 F# R
9 ]/ `! K6 u! u
// ±ao? ?D?í???ó á¤à?
5 K0 U( L$ w! Q" c+ e5 t
m_pd3dDevice->SetMaterial( &m_baseMaterial );
9 [$ n! W4 \2 Z5 V1 f0 @
# g* L8 s1 H! _2 O. C
#endif // not WORLDSERVER
1 F9 }$ S7 r+ f4 @$ ^
}
7 Q; p+ f' ^6 P+ R$ Y" K* n
并更换
5 J8 E& W) K. o& s: I1 E
Code:
# ^& V* b# U. s3 z) l& J7 R
__FLYFF_INITPAGE_EXT
. ^; U ]; `2 d: B1 g& v2 [
定义
: V+ l* o" C- w: z
1 C& K% ~7 f) A6 k. Z5 Z8 j
7 `# m$ B7 ~; w4 h2 ]: `
( i9 b. @; X5 Q, e t
7 q& O2 X, b5 N; }" ^! h
现在终于删除我的狗屁加速...
' d! D6 r9 i) ]" |8 P9 x+ o
9 _ k5 P9 b9 S* I; C3 D0 {
) q L) N+ I: J/ n! {& \
+ w! W! g$ Z/ u: A
欢迎光临 飞飞世界论坛 (http://ffwold.com/)
Powered by Discuz! X3.2