飞飞世界论坛
标题:
自动饮血和登录视频
[打印本页]
作者:
admin
时间:
2016-1-10 03:46
标题:
自动饮血和登录视频
食品车:
: u0 j( v8 b9 ^% O+ u6 x
尾翼:
6 [/ W- s& F9 L5 R$ }
; M6 c2 s8 J, u' w# `. |2 h
代码:
' h% S* x0 Z8 a# ]) p( G( h1 B d; O
CWndAutoFood::CWndAutoFood()
% d' T: _$ @' m0 j
{
! P5 g' f4 s a# Y* l
m_pItemElem = NULL;
; q* Y9 ^' y8 W. \ t
m_pTexture = NULL;
, H! x8 F5 ~% T& E& s. o
bStart = FALSE;
, u3 b1 r0 t/ K5 o
}
. i5 F1 x! |9 G, [ u- W, Q/ v
9 G2 I) `% y' K
CWndAutoFood::~CWndAutoFood()
Z0 q/ x* ~7 @8 ~' \- t* ]/ q
{
' V1 c& Q n" c9 U+ j3 X5 |# @7 C* ~
AfxMessageBox( "AutoFood ist gestorben
" );
9 D& U6 y9 I/ | M3 ?) p
}
; e4 y/ X, Q, a1 k, D
BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
4 f- W# ^ |7 u& Y" r3 d
{
0 }9 b: z4 b" w& P
return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
W3 a% _4 [& |7 n2 R7 @# t( @
}
& A+ e; z6 i# L$ B
3 Q9 f! s6 L5 M" I/ n* J. B
BOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
0 \1 _7 W! h6 A) Q- N
{
* `$ H; }5 U1 `! u+ P7 F9 S5 `
LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
( y$ O5 {" p' X1 h) N* m
CRect rect = pWndCtrl->rect;
/ z+ ]! L9 R5 O D$ K
if( rect && rect.PtInRect( point ) )
, }6 \/ c5 r) k9 u
{
. H- X N4 G# w" @, v% o
CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
% q0 P0 s, j, m" X* C, x4 ^3 m
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )
8 U0 Y& x* y0 H9 n$ X
{
, W( e* l1 Y6 C2 R% k( E) c
if( m_pItemElem )
; p( f7 `$ s) @; F5 v
{
6 o$ k. d2 g7 u! k
m_pItemElem = NULL;
9 j% V" K' z0 i! g
}
% R* m$ z! K* T; a& v% q% t* E* P
m_pItemElem = pItemElem;
3 \& L( @8 ?, [0 Y1 U
m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );
; ]0 |8 [! U0 X6 b
}else{
, ^3 [' T* S5 h' p' R1 S
SetForbid( TRUE );
) d& Q0 j" `7 \0 l
}
! c5 s1 H3 F; _" q7 Q% S) L5 C7 a9 U' i/ I
}else{
( }) r& X n$ \! m
SetForbid( TRUE );
8 ]* c6 j# w: z1 j$ m' }& l
}
5 |1 b4 c9 ]3 L) ?
return TRUE;
. p- K5 H% t# y0 y# P4 \6 X+ Y
}
% B) {6 j r: t! U: p5 H
7 ]+ n! e+ a6 J8 Z
BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
# ]9 V4 n+ N) f- |+ n
{
1 n5 e" n$ Z+ ~0 {9 m6 o. T9 \" H
switch( nID )
1 y- D3 a; P2 ~* ?5 Y; ^+ }
{
5 l" S2 a' o* W4 E: i% I7 F
case WIDC_BUTTON3:
" n0 U v5 Y" t5 L- u% Y
{
( {4 g- {. ?5 e8 F5 \. W6 g6 v
bStart = TRUE;
/ |5 a5 O, p5 V. M
break;
& P2 K3 n- ^+ j8 [0 j3 X
}
8 j! S7 M# N& L
case WIDC_BUTTON4:
! s6 c C. \ k% K% M
{
; s" P4 f% x; \6 c' j" h0 H6 {6 h; G
bStart = FALSE;
9 C" O2 _9 x# C! D: x$ d
break;
: P: Q1 b9 u' \2 f4 ]
}
# G Y: M5 q$ P" Y; e7 C; I0 r' ]
}
0 d7 n% y& F" W* z/ I* S
return CWndNeuz::OnChildNotify( message, nID, pLResult );
2 B: b$ e R- u @5 x' w4 E
}
- s6 d# @" s1 A4 V9 e
void CWndAutoFood::OnDraw( C2DRender* p2DRender )
$ ~- _, ~! M( |9 `& s6 ]
{
. y9 {$ ^- N! U, j
CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );
! z- G! U- h" k6 k8 `) P6 P
if( bStart || !m_pItemElem )
; M* d3 v- ?; k: I2 x
{
8 Q* @( W3 |# t, g6 X& n
pBtn->EnableWindow( FALSE );
; g. Q- Z) O2 L$ f4 {1 N3 j. e6 s" R: ~
}else
4 [2 u( s0 z0 @
pBtn->EnableWindow( TRUE );
2 p; B$ `$ s3 o ?. W% g
if( m_pTexture )
' M4 s5 M7 d7 F+ |+ B, {2 |0 z
{
+ I: }$ S2 {; l2 L
LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
H, G9 L) M- N* p `; A9 p
if( wndCtrl && wndCtrl->rect )
9 ~, ^: q4 U' C3 b
{
$ p# A5 t( V, v4 @1 I0 z6 F* K/ K
m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
6 ^5 u: H/ v; g$ r4 H* a
}
( B: o0 O5 J( L0 h" o- c% M
}
6 Y# B y% X; H+ P, N
}
, H7 y( l! n' q( s
- w) Q6 L9 S6 ?
BOOL CWndAutoFood:
rocess()
8 i+ @4 s! S7 o
{
1 j8 U% W9 p" e0 ]+ i8 P8 M J
if( bStart )
& [: }* `& f2 O3 y
{
, O$ ]! f7 P5 I8 P
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )
3 x, y2 H: ]% z/ k# Q
{
- m4 i( P* E1 j& H8 }
if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )
$ w) Q( d* k ~/ i+ r% G) O, f. e6 Q
g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );
6 U4 a! `% h8 S/ m
}else{
* m" F! ^5 Y3 f: ]9 L. o! {, R2 K
bStart = FALSE;
* C4 W9 y$ J- O. X+ V
m_pItemElem = NULL;
7 c& Y4 n( P7 F0 g
}
3 l Q7 s: m' J% h. o. r
}
: o& H" J/ G& g* G/ s0 c
return TRUE;
3 \1 R- A& e6 d8 B9 W/ j% @( X
}
$ Y( b5 D; q' n0 M+ r
5 a& b" |& [8 Z, n. O
登录视频废话:
3 {. Y; I' e- O+ u
尾翼:
- v% r) u$ g, b* j/ D8 ~; ~
s, T6 c" q; ]% s N& l
代码:
8 s$ d# x& E. a0 w3 n8 @" M6 J
6 ]2 B/ h6 ~ f) r7 Y
void CWorld::SetLight( BOOL bLight )
" s( e" M% s7 y2 e& j) y
durch
! E. v, t5 A& h
Code:
+ j: e; {* C+ P& E# @0 d! o7 G
void CWorld::SetLight( BOOL bLight )
, m, G: s2 A* s; T9 e
{
* x4 M* K: U+ Q
//ACE("SetLight %d \n", bLight);
! x! P/ W$ l; {9 t/ B) I
1 h2 h- _( ^# M- z g+ R
#ifndef __WORLDSERVER
# q& i- X9 j+ h$ w) T4 }2 m) u/ v
DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
; F0 ?* |- W0 A( x- R6 i0 h `, Z
CLight* pLight = NULL;
5 i' E2 P% V0 j: |, v
. g+ t f0 z) `' l8 X' x
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
9 o, v0 g: o; }9 Q2 U
8 w# C- s* O* k9 _7 K* K
pLight = GetLight( "direction" );
" W* |6 Z8 \5 \9 j3 ~
' ~4 f" ^3 @7 U, L3 l
#if __VER >= 15 // __BS_CHANGING_ENVIR
2 [/ B; M9 p; Y3 A( C4 k! N
if( g_pPlayer ){
2 u9 ^! @1 y- M O n8 c0 g U$ o
ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );
0 B+ n3 H' V% ]" |0 Z
if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!
+ p0 J6 d& [) u; O- J0 }
{
6 A0 {! `9 P7 p0 P0 U" w
if( pLight )
8 ]4 r0 x9 [8 u# Y4 Z3 L4 {
{
- G Y& o$ p7 X* }3 v3 Y( C: Q; s) \
pLight->Ambient.r = pInfo->_fAmbient[ 0 ];
, y3 G! o8 d! K- z% m
pLight->Ambient.g = pInfo->_fAmbient[ 1 ];
" c8 j/ L& }5 Y9 w4 Q
pLight->Ambient.b = pInfo->_fAmbient[ 2 ];
7 d; ^ O% Y; o, @* {. B# ~
, D; |5 a e& A' D0 b2 X
pLight->Specular.r = 2.0f;
+ F/ V1 E1 r& j+ _, I4 L7 {
pLight->Specular.g = 2.0f;
5 [$ S/ ^( V. m" }9 [' Q
pLight->Specular.b = 2.0f;
. f( [1 X$ C$ w. s, ]* Y
! U/ m" B, R) T0 U
pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];
- T2 @# Z2 x% P* D3 ]
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];
( i9 D% N4 q; q" Y5 d, a
pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
' ? y9 Q9 D8 A1 A" r9 K
$ M" u, T# k0 l8 N# F( O' Q& V: R
HookUpdateLight( pLight );
7 G6 Z8 W% v# ]- \3 W6 ~
/ D5 U1 ]7 }) C4 J& Y
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
: H' C0 S8 z* e2 u( T. Q( l
; \- h5 q& f# q& a
pLight->Diffuse.r *= 1.2f;
- M: q9 `+ d( l$ |" B2 B
pLight->Diffuse.g *= 1.2f;
6 `- G! V0 Y, T
pLight->Diffuse.b *= 1.2f;
' _8 A7 i1 _/ }! Y; L) I+ ^1 D
1 P0 K. V7 k& n: Z
pLight->Ambient.r *= 0.8f;
' L j9 S; I8 q( E: ]+ r
pLight->Ambient.g *= 0.8f;
9 n1 p7 e/ v+ X/ D/ u. \
pLight->Ambient.b *= 0.8f;
: u2 a# I6 C; w) a/ k# A8 y
3 W/ p j/ D' g& g, V+ i7 c
memcpy( &m_light, pLight, sizeof( m_light ) );
8 M' X5 M* e" }+ E/ T" t" u, S
, a8 x' P: J4 [' }2 N5 q7 _
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
0 }8 a+ q* D+ A, P
D3DXVec3Normalize(&(vecSun),&(vecSun));
# Y2 O. x1 t7 ~4 H
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
* ]0 d# S. x) V C( c( @: R7 M
pLight->Appear( m_pd3dDevice, TRUE );
& K+ v4 j2 x" R& j, F
5 |/ o6 J! f' M, H% \1 i
DWORD dwR, dwG, dwB;
7 o N0 {' o- _2 E
dwR = (DWORD)( pLight->Ambient.r * 255 );
- i0 a$ `3 X+ ~" T+ p, D0 w+ S* F
dwG = (DWORD)( pLight->Ambient.g * 255 );
9 b& y- s3 m, E. Q6 Z& s% b- N
dwB = (DWORD)( pLight->Ambient.b * 255 );
$ ^8 i; v+ L5 k n l# [
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
6 G! a; z% V8 m, h5 J
}
1 g) d# X) f+ m' ^+ Q4 x
}
0 Z5 j' q+ C% ~) N
}
7 L; x \: |" F6 A+ S
else
7 N7 U; g# T6 D
#endif
. |+ C2 W, `6 v8 \1 L
J& l, Y% {' l$ O
if( m_bIsIndoor )
. `( w3 _/ W4 F, i
{
3 I4 Q4 b! T D. _6 A) J
if( pLight )
6 N5 w: ^3 ?9 ], R3 Z: g
{
\ o. m, w0 i- x
// à??μ oˉè*
9 `# d6 B6 Q2 p# h1 x
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;
- D. i* K8 n, K$ M
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;
) d; Z0 ?1 c* q$ F5 _0 e8 N
pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;
8 ?/ J5 S& k# t& j) X
9 n5 _4 Q% [/ P8 Q
// oˉè* ??à?
. s+ ?$ _! W. Z* @- y
pLight->Specular.r = 1.0f;
) T4 ^: s) H% x- `
pLight->Specular.g = 1.0f;
* ~! o7 l5 E" i
pLight->Specular.b = 1.0f;
* A- [" b$ [- F5 o! U
// àü?? oˉè*
/ y' `% J9 X8 p/ [/ U
pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;
' b2 Y& E8 O2 N5 i% U- L: y0 x
pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;
; v+ \7 J3 q/ h1 F/ B% n9 r' L
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
3 [& \) c. P' U: j6 u% z; o) R; r
# `( I* U+ i; P* u! Q
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
: D- ~( u" K. O8 O
{
1 |% D G; j0 X' q3 i% s
pLight->Diffuse.r *= 0.6f;
' M/ F/ I- L: R7 M5 D4 V1 U) @
pLight->Diffuse.g *= 0.6f;
+ r! ]5 I4 }9 d; M( _
pLight->Diffuse.b *= 0.6f;
; { h1 S: A" C/ E6 {9 C- a3 |' g
pLight->Ambient.r *= 0.7f;
0 m6 M% m' @# ~9 c1 D' b/ \
pLight->Ambient.g *= 0.7f;
$ W4 R# J. p. [6 E3 V
pLight->Ambient.b *= 0.7f;
& t$ m& i9 [/ _" r9 H
}
& p: ^' x5 h( ^/ v" U
6 R2 E8 r6 U1 z) r) k ]9 _# d
#if __VER >= 15 // __BS_CHANGING_ENVIR
7 R2 O8 Q f7 p2 t( W' c
if( g_pPlayer )
7 q9 Y: P! ^- d$ q1 {& v2 t% u
HookUpdateLight( pLight );
5 G% e! O/ ]# s+ Q7 W B
#endif
' K9 h, a! ~! {! p) i) i$ ~
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
% [* |( o3 s% y& R! o& v
: s* ^3 X+ Z5 V& l5 l" e! H
pLight->Diffuse.r += 0.1f;
$ Z# a3 F! B; M; }/ L1 Q
pLight->Diffuse.g += 0.1f;
) w$ B( C. i3 ?
pLight->Diffuse.b += 0.1f;
; y# H! h) u0 e& X& r4 X$ }: d- m
// oˉè* ??à?
) Q+ g4 f! n- {3 O4 z( N9 M
pLight->Specular.r = 2.0f;
" }, n" [5 i0 W; f1 I/ N
pLight->Specular.g = 2.0f;
1 @% C8 O9 S# D
pLight->Specular.b = 2.0f;
- r2 x* b4 ~/ }" C. n
// á?oˉ
6 ?- b# \! U3 m
pLight->Ambient.r *= 0.9f;
! H% G4 J! w. a/ |/ a
pLight->Ambient.g *= 0.9f;
- z1 G1 a( e f5 \3 v
pLight->Ambient.b *= 0.9f;
& ?" S Y6 p- H7 p5 V) j
# g1 t: Z7 A, e. _0 h* K$ U% d) |
memcpy( &m_light, pLight, sizeof( m_light ) );
# j i. j1 `! C+ X1 b: G
9 _" b3 O- R! t9 k7 O. }
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );
3 G+ N& K7 \$ ^& Y& o
pLight->Appear( m_pd3dDevice, TRUE );
. @7 S: \) s3 t. w+ B E: _. a
/ g5 U' y8 i: A. ?; u/ t/ {
DWORD dwR, dwG, dwB;
, f0 C, t0 Z4 f1 `' Z: r1 W8 p0 e
dwR = (DWORD)( pLight->Ambient.r * 255 );
; m& ^, f4 b5 R# ?9 P9 ?+ T' r8 B/ X
dwG = (DWORD)( pLight->Ambient.g * 255 );
: T! j6 @7 y. o8 I
dwB = (DWORD)( pLight->Ambient.b * 255 );
8 G6 x$ S7 }& M) n0 }2 v& O q8 l/ s
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
9 O3 G( P/ c; V' R
}
/ T/ I- V K- b' r/ C( d
}
7 Z7 W) r$ }8 m) z1 S
else
% b0 V+ J; Q6 v7 X1 I) i0 v! l) r
{
" r5 ~5 o5 |( Y; J
if( pLight )
- g, d& U! G0 v u9 @& Z& ?( R
{
: A+ B( s o0 Z3 e3 o8 z6 M/ N
: E3 X7 u) I: {" O
int nHour = 8, nMin = 0;
. K L( T' i; W
#ifdef __CLIENT
, t5 F6 F1 d; l1 T. ~
// ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù.
" l2 k( _5 }& }# v, z0 N1 j
nHour = g_GameTimer.m_nHour;
* i5 W: e; F- G
nMin = g_GameTimer.m_nMin ;
' M. T& J) d& N: m$ X8 D. X
#else
4 N N$ s3 O) _$ H5 {% y
// o??o??′? ??°£à? m_nLightHour???* °?á???′ù.
: l, I- ~2 o0 b+ \8 E0 u
if( m_nLightType == 1 )
0 V6 C6 n% U% j8 g5 H
nHour = m_nLightHour;
; P+ p! E- M* a$ ?' |5 ^: Y' k4 C
#endif
; O* a. U% a: b' [
nHour--;
8 }7 J B, J, b2 F: d. D( q) M% |0 U
if( nHour < 0 ) nHour = 0;
" y) ^4 x6 S# t6 G7 P
if( nHour > 23 ) nHour = 23;
* {) ^8 m( i3 E: N6 n; o
6 d) S7 L. b$ ~( Y2 s
//if( m_bFixedHour )
$ V0 y4 n2 L7 k8 l8 `( h2 O
// nHour = m_nFixedHour, nMin = 0;
" \% n; W- [; v3 ]: G
LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];
0 ~& d3 ?/ Z8 ?. u
LIGHTCOLOR lightColor = m_k24Light[ nHour ];
6 s9 r9 O6 D u
k, ]& x) a9 w2 s( W; Q
//m_lightColor = lightColorPrv;
9 m K* B L; N+ ?% d4 X1 N# v
lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
2 l7 A3 C2 G! \' }2 ?+ y
lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;
7 \) _' q* J2 {2 }
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;
0 n8 r# K+ a, \. N/ O, ?# a- k3 ?
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;
, A0 r: I$ R# d. u4 U+ C+ E
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;
3 V# u2 t! n5 }1 z, S B
lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
! Q# {2 Z+ I5 Y/ u
// 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)
4 E4 W( e' b) ^1 ~; o9 {
) y# W% O- V; j2 k: u* n8 ~5 |8 i ^
// à??μ oˉè*
. T1 \2 H+ z8 Z. z6 \9 I
pLight->Diffuse.r = lightColorPrv.r1;
b$ q, u v/ c
pLight->Diffuse.g = lightColorPrv.g1;
6 ^2 r7 A3 o2 t) {- @ w6 s
pLight->Diffuse.b = lightColorPrv.b1;
" W9 m. j2 r& u5 b" W/ j
// oˉè* ??à?
& w) w: ^$ b$ U' V
pLight->Specular.r = 1.0f;
& Z5 l& F3 }1 z2 \- v6 w
pLight->Specular.g = 1.0f;
% T" F1 c* k! @2 k* A7 W" U
pLight->Specular.b = 1.0f;
* B. T) Q* ^+ ~7 {0 f
// àü?? oˉè*
7 F- Y! l' {8 g
pLight->Ambient.r = lightColorPrv.r2;
) l& c! ~! f: g1 r/ Y8 `) ~6 `
pLight->Ambient.g = lightColorPrv.g2;
1 K1 H# J" Q4 \8 J! R& H4 A: ?
pLight->Ambient.b = lightColorPrv.b2;
1 ^0 k/ j6 ` q: e" s3 U9 J9 u
: c& d, A# n' {: F8 {6 `4 p
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
% x6 V0 V- |& L9 I( S6 w3 ]
{
- M' S. D2 ]& q5 x9 O3 D! k
pLight->Diffuse.r *= 0.6f;
. @, J5 Y6 ]2 v) [8 \% R/ X
pLight->Diffuse.g *= 0.6f;
* |, q' V8 P( H* d# [# S3 I
pLight->Diffuse.b *= 0.6f;
8 P3 l7 _1 x% x3 _* }& [; X
pLight->Ambient.r *= 0.7f;
7 c8 {, B& x1 G) y" ]9 Q7 b
pLight->Ambient.g *= 0.7f;
$ n" g# y. d ?1 d
pLight->Ambient.b *= 0.7f;
3 l# Z& l4 ~$ T# ~# {3 C1 O" Y
}
, O- u! X0 o6 a) T2 S: u
* B. v" o. b& F* O3 \0 T# P
#if __VER >= 15 // __BS_CHANGING_ENVIR
( [/ p! x; y7 o
if( g_pPlayer )
: H+ z" \! h, H$ G9 M" q% ?" N3 u
HookUpdateLight( pLight );
" a, w. m# \) |5 v; P8 V
#endif
/ W5 L; \. x8 ~6 Z& [7 Y \
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
% a, w" W, ~' e' w" V5 R
% T+ N) ~) i/ F0 E( Z: ~3 G
#ifdef __YENV
' I- ?( _: K- f7 S8 Y
pLight->Diffuse.r *= 1.1f;
: I: b3 j: i4 V
pLight->Diffuse.g *= 1.1f;
8 [) Q, p( s; g) H! t
pLight->Diffuse.b *= 1.1f;
% N5 d1 W0 o% [9 f# g* Z
// oˉè* ??à?
9 \, W0 t! T" Z% O) }
pLight->Specular.r = 2.0f;
* V D0 @4 N1 A4 S {8 P: v" a
pLight->Specular.g = 2.0f;
2 G+ D) V1 w) |' b& a( i! T1 H" P7 D
pLight->Specular.b = 2.0f;
) L' Y, p2 l" o: O
// á?oˉ
2 a/ V$ O" ]; v) k5 D
pLight->Ambient.r *= 1.0f;
2 Y# c2 o2 {6 O0 {5 I y2 r) u
pLight->Ambient.g *= 1.0f;
4 E; N: g1 W, |
pLight->Ambient.b *= 1.0f;
0 T) G4 e: v0 R7 d! _
#else //__YENV
, ?, Q! ~6 l: b2 ?
pLight->Diffuse.r *= 1.1f;
7 p- M/ o0 i' D* n8 O
pLight->Diffuse.g *= 1.1f;
; V3 y% M$ E. E- A8 ?
pLight->Diffuse.b *= 1.1f;
* e* t O* [+ }' q2 u
// oˉè* ??à?
5 C( h: z" U* C% F: d
pLight->Specular.r = 2.0f;
+ c: s3 S+ Z. F8 d
pLight->Specular.g = 2.0f;
7 F7 p9 c' n, I8 q+ G5 H# I4 u
pLight->Specular.b = 2.0f;
/ H/ o5 j3 p7 k& a2 R9 F" C2 w
// á?oˉ
. g+ C( P W9 @% i9 k+ t7 r
pLight->Ambient.r *= 0.9f;
+ L, x, t6 M, w" ?' f
pLight->Ambient.g *= 0.9f;
& `% q7 a; L4 P: ^
pLight->Ambient.b *= 0.9f;
9 ]6 u, D4 a5 e
#endif //__YENV
4 Y2 K5 J% {1 Y
3 Q0 n1 U* U- M, i
memcpy( &m_light, pLight, sizeof( m_light ) );
2 K' |! `8 b. D+ F5 I6 J, w1 g
6 u7 |, K7 Q3 L- k% D4 H
D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);
" y7 Q6 |2 }0 r* h
D3DXMATRIX matTemp;
7 s: O" J' T0 l9 }* u/ u
static const float CONS_VAL = 3.1415926f / 180.f;
* n8 K+ K7 B+ p& j
/ i7 C$ ~6 {" d0 p
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);
- p, Z, J2 ?9 _- j& [8 ^
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);
% i) f$ U, B" p+ ]
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
8 U: t2 s- B/ e5 `
pLight->Appear( m_pd3dDevice, TRUE );
7 ]$ k d9 L" Z& K8 e
3 j2 e4 q6 i/ `9 j
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
$ h. a: u9 i h/ V& H N. i& r$ Z/ i9 R
// D3DXVec3Normalize(&(vecSun),&(vecSun));
, [ b' K2 H& y$ k" n5 I
// pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
6 u9 y# A% e. G2 T) V( L/ c6 w
! m4 L' a% u% y& K' }9 O
DWORD dwR, dwG, dwB;
3 X+ h5 n* e% \0 V5 v$ a4 n$ g
dwR = (DWORD)( pLight->Ambient.r * 255 );
2 D( ?+ c. N. G4 |) A
dwG = (DWORD)( pLight->Ambient.g * 255 );
% \+ h1 b) l5 r7 R( ]
dwB = (DWORD)( pLight->Ambient.b * 255 );
4 c2 [" H2 B6 ^2 [
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
4 V, V& Q, L0 R; T2 z2 C2 e# @) q9 C
}
& a0 }* I$ }; x. `) O9 B0 u. q0 R
}
* d5 i1 U7 Q. a) O5 e; y& x
7 e& s+ X1 n+ b* ^- i1 Y: T
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );
7 `" P( w; W# W
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) );
* p, T( j5 y L, L! l" w/ E0 s
::SetLight( bLight );
& i9 g$ u l; s7 }0 J* \+ _
8 T! a5 w& I% x! y" k+ u
// ±ao? ?D?í???ó á¤à?
" y9 q9 ?& f ]3 ]6 B& y
m_pd3dDevice->SetMaterial( &m_baseMaterial );
) {# e9 E5 S! m4 F- m" \# {
I& y+ q7 A' z u ]2 [( }
#endif // not WORLDSERVER
$ {3 ~" U7 J7 I
}
. e1 j/ A" `% W4 B2 o
并更换
; Q% y" [3 a! ? o
Code:
# u) w+ L2 N/ F1 B0 O E! E3 o
__FLYFF_INITPAGE_EXT
j9 l6 ~1 h- r; F8 S
定义
* \; s' {3 Z( L1 J; E4 F
) v; A5 S4 z, K8 W' v
1 s( v6 |! {8 G" z+ S" M2 u6 B- ?
: N: h) ]7 H) V+ k% s' a
! J1 V' l, D2 m4 R6 d0 s
现在终于删除我的狗屁加速...
. Y; |. @. b% Q* y6 m
, u2 B/ R% \8 B5 n+ O
! x# I# J. ~% T
/ ?5 f" A( @) {6 X, h3 Y3 A
欢迎光临 飞飞世界论坛 (http://ffwold.com/)
Powered by Discuz! X3.2