飞飞世界论坛
标题:
自动饮血和登录视频
[打印本页]
作者:
admin
时间:
2016-1-10 03:46
标题:
自动饮血和登录视频
食品车:
, z: p. m, v1 K, h0 I$ a+ i
尾翼:
6 j2 n; v; T0 u& l
5 D8 @3 j9 X. z3 n* @
代码:
: U7 \( ]3 y5 h3 K
CWndAutoFood::CWndAutoFood()
+ S4 ^+ \! Z$ d) S) m% l
{
- U* M; D1 I F8 D8 [
m_pItemElem = NULL;
$ N2 {% u. ^. x* }$ a1 d9 n
m_pTexture = NULL;
0 O# Y2 v y, k- S1 u
bStart = FALSE;
6 r8 W3 Q( K" ~: n. I- T8 g; l7 r/ N
}
) m4 C$ i9 a: U- X
z1 j! G6 [8 S; H3 C3 k, d9 o
CWndAutoFood::~CWndAutoFood()
1 \7 V0 q' ]% g9 @/ n/ W
{
3 ~/ m) O3 f& J: @
AfxMessageBox( "AutoFood ist gestorben
" );
$ B9 N0 M# e1 g) Y5 ~! H
}
9 T) x1 b- S$ D) n4 O4 P
BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
1 x# |, D4 H+ ^$ _+ O
{
4 x$ O0 r$ O' U. \" s
return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
# {# \4 Z$ W7 s) Q
}
( u1 j, p2 Y8 q0 K
3 _( C5 [' v# c% o1 t" t
BOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
2 q8 z ?1 |( R1 b3 Q/ S
{
, B# H9 i4 W$ j5 D4 ?$ d/ R0 {
LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
/ W% b* U$ A E* k* P5 E
CRect rect = pWndCtrl->rect;
5 q+ B0 w! C- u
if( rect && rect.PtInRect( point ) )
. n w# `% n; t* W! P+ ?
{
: X' I, N# K9 k
CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
; O2 `- i3 {+ T) U+ E- a
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )
: z7 e* h) |1 B$ d# u
{
7 P' e7 c; F# p
if( m_pItemElem )
/ Q6 T" c. {9 A
{
7 y- l, R0 w6 O8 C0 q# A, ~8 I
m_pItemElem = NULL;
2 L6 V4 s8 _+ D. C3 v
}
$ G" a# |8 \$ F, N" l
m_pItemElem = pItemElem;
! E. [- @2 G- f( P1 T6 t, g
m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );
5 X8 z% _* Q" S$ E; s" h
}else{
: z! J& s' Z2 v5 C- D
SetForbid( TRUE );
+ L" [5 {1 a: ?; S
}
! Q1 P# s0 G8 ~& v7 w$ F* k! ]
}else{
' K7 k' s; g1 c( s2 I
SetForbid( TRUE );
7 T% i; x* q! O3 Q
}
9 h d6 G% s2 x
return TRUE;
6 A8 Z( C, o9 Y" E5 o
}
* }7 Y! I% O% k: k( Q/ F
0 a; j H+ ~) [" _3 V
BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
7 e# ]- Y" z$ p! t% e8 H2 k( Y
{
5 P) U6 i- b0 _; a* [2 ~! y$ S* v
switch( nID )
; E1 e6 V. ]% L& v6 `) W' h
{
- R; {( V: u$ g8 Z5 P B. z: j
case WIDC_BUTTON3:
3 W* a/ Z! `! B2 ?/ A! P# S. v
{
8 T/ j5 ~1 f3 y- ~4 A
bStart = TRUE;
) @5 E7 |6 D1 G+ n5 I
break;
2 U I* q# o$ d* B( _! `
}
0 S9 ?, |" I( r+ n/ `
case WIDC_BUTTON4:
% r* ~) ]0 {! i' D0 |4 s
{
, E- O; I3 z' J, G
bStart = FALSE;
9 v$ t R) _5 M; j, ~# o) @% F
break;
. Y; K: |: J! F% \) E( I, j
}
. @6 Q: x' R" e3 h
}
% A% w$ G6 \9 H7 k3 _1 @0 H
return CWndNeuz::OnChildNotify( message, nID, pLResult );
" N% F0 r6 J# A( P0 ^
}
$ g" {% |6 V9 z4 a
void CWndAutoFood::OnDraw( C2DRender* p2DRender )
8 T2 l# w3 k" j
{
- [, b3 ~7 L4 y/ ^% J0 s
CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );
; S# ^. A; j) |9 q
if( bStart || !m_pItemElem )
1 Y X2 L, d- J( ^# U
{
7 X0 T! C( l8 [7 @' f# }( A6 P2 t
pBtn->EnableWindow( FALSE );
- | D$ Q2 [$ D( a( y
}else
# Y0 x' H7 i8 S' L* Z1 s
pBtn->EnableWindow( TRUE );
1 U% U' M8 \, ^& t4 ?" S) m
if( m_pTexture )
. c; H0 G$ r4 k( r' m' P, Z
{
: f) G2 \8 U5 V) `% Y0 F
LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
+ ?" }, a( s, u# t
if( wndCtrl && wndCtrl->rect )
# L8 O/ J8 x0 m8 j$ e5 `' x% b. Y2 J
{
" a: ^ P( D; L( s+ e) F/ r( M
m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
6 `+ h, r1 w; X9 f5 [
}
- v" j" K* f# a$ F7 o% S
}
9 n8 H* Q) {9 |: N R
}
& O. @- E% m8 U5 C
7 J0 J9 M0 t( Z
BOOL CWndAutoFood:
rocess()
# |8 I9 F6 M$ q/ _
{
$ r, \/ N6 O N, s$ A
if( bStart )
/ b8 Q1 S& B. Z/ C1 {. F+ z9 v/ T" V
{
/ d) q2 e7 x6 @' j; d) |
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )
! y+ f9 y. X! W: t) E
{
7 t8 Y1 r% g/ e
if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )
# k7 v% Q8 Z7 ~. j7 j
g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );
% L- u4 }8 N: w- w1 U2 f# _
}else{
$ N% {' |1 i0 s% w/ V
bStart = FALSE;
- S" \! g# f6 E
m_pItemElem = NULL;
; v8 t& H$ i# ]2 D. e+ p# T+ N
}
1 w7 l) a! o1 I9 _" L& t
}
# k: [" x! P% p
return TRUE;
h5 i5 h; d& p+ g$ w: y+ d* F* e
}
6 V$ U8 f, U* q& c
2 f, k- l7 z& \ n# `$ b7 n& n* c$ l
登录视频废话:
+ n& D1 U, @* @6 Q% B# {3 t
尾翼:
* j7 p9 H3 k; d+ `" a$ Q* J
. {9 x" W# q# F3 r
代码:
. r8 U* t& G. u7 w7 x, R
+ B# K7 y+ v d! F. ]) D
void CWorld::SetLight( BOOL bLight )
4 t" P1 i! n- B; J
durch
, c+ b2 k4 b9 W
Code:
[ l$ c( |0 a* X$ Q
void CWorld::SetLight( BOOL bLight )
( `( o! K+ o8 t b w. m& [
{
' O8 w j/ `# v) P
//ACE("SetLight %d \n", bLight);
6 _, J& J1 z U F. G
, _; H1 C" O6 i- x0 s9 x5 o
#ifndef __WORLDSERVER
+ X! f. O9 H2 Z
DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
- v6 q% j& l3 K, l
CLight* pLight = NULL;
5 Q" G: L/ t( O! E: S( e% h
1 ]% C! |& I5 @$ d" {6 w. J
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
. \- ?: z3 ~2 O6 P
: }! t/ k7 [% w# }) P+ Y) B
pLight = GetLight( "direction" );
8 b/ N4 }6 [- }
. k! }) ^7 O2 O# I
#if __VER >= 15 // __BS_CHANGING_ENVIR
7 W% M2 ^# c2 x: L+ D$ j
if( g_pPlayer ){
, F7 V5 |- i& H6 J# {8 D8 h
ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );
5 E" u$ d P% J5 t$ G5 X5 L
if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!
+ M# y% k* O% O6 e
{
8 J& q; i5 d0 p$ f9 u( m6 H# s6 U- S
if( pLight )
# d7 r7 G! i7 t2 r; ?5 t
{
9 B. w ^) ~" n' u: _* X
pLight->Ambient.r = pInfo->_fAmbient[ 0 ];
& A% N% W2 Q# o Z, x; O
pLight->Ambient.g = pInfo->_fAmbient[ 1 ];
7 L( U$ ~) s. Z
pLight->Ambient.b = pInfo->_fAmbient[ 2 ];
: U3 N% Z! [- N' w: B$ W) O4 {3 _' B
8 S0 ^- [, F. v" O' Z
pLight->Specular.r = 2.0f;
' i: v8 S8 {9 Z3 H8 x% k
pLight->Specular.g = 2.0f;
7 P) \5 J. w* a" Q, w8 R6 W
pLight->Specular.b = 2.0f;
x) |) c6 M6 K% m4 q5 U- h+ v: _, n
0 }2 y' R+ q6 I8 J6 w5 n& I% B8 k
pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];
5 a) O8 c0 p6 v+ z/ a! D' `+ {" h
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];
/ a" G1 j2 D$ S% p3 |# A4 D9 N
pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
: T8 Y* `. r' ^% `. B* Z% C
$ f- Z- d0 t- N
HookUpdateLight( pLight );
7 y/ B2 U/ l$ g4 b' y. q! U' F
) N S( h/ V, k, f& o5 Z. N7 V1 L* S7 L, x
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
5 T) y3 I& i) H2 H) ^9 J
. |7 x4 e' q# q" q. A8 d* ^
pLight->Diffuse.r *= 1.2f;
4 @- E2 h, o3 d" H; {! m4 i
pLight->Diffuse.g *= 1.2f;
& S, W# M L: \" j
pLight->Diffuse.b *= 1.2f;
- c7 t2 o3 U Y+ u! P
* X/ y8 I2 H% E1 |# a" l( P
pLight->Ambient.r *= 0.8f;
2 s9 V* Q9 t1 C" E& P1 L/ l
pLight->Ambient.g *= 0.8f;
: x3 D( x3 ?0 g# J
pLight->Ambient.b *= 0.8f;
$ n: C' ]2 p- U3 l- V& Z1 p' F' ?
8 @/ K: n+ b; H6 B$ ~ e( q
memcpy( &m_light, pLight, sizeof( m_light ) );
: M- R1 A, R( ~1 |
5 ^! p0 G2 g j' z1 y7 |
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
, p1 N# H' L/ Z3 I0 z* s
D3DXVec3Normalize(&(vecSun),&(vecSun));
% v* x( }7 m' L6 m
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
5 }, ~ I w8 p" n6 p& X6 B
pLight->Appear( m_pd3dDevice, TRUE );
0 l; G& h# H- x
$ i8 ^9 K0 O: s' `7 w! f
DWORD dwR, dwG, dwB;
% [$ z! D6 m5 U. v+ c
dwR = (DWORD)( pLight->Ambient.r * 255 );
5 F" Z$ W/ g( ]: ^9 t
dwG = (DWORD)( pLight->Ambient.g * 255 );
: Y2 ~1 E' Q' ]0 @
dwB = (DWORD)( pLight->Ambient.b * 255 );
/ @4 \5 H; |9 V6 W; g3 ~- I
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
6 {4 n3 u- Z% T3 r+ a. E$ z3 Q5 }
}
$ e% @) R6 i G- m* D$ x- N" a
}
" Z0 h4 T6 C% P8 z, ^/ d/ N# l: F8 ~6 ~
}
f% t. ~$ v" |: I$ t4 m
else
: o' ^: R; [3 A. a( @0 ]$ D0 a$ y
#endif
7 P9 A3 C& B! p
7 g* d( _# g9 s3 {4 R
if( m_bIsIndoor )
& F6 b% X3 V. F5 |8 {$ d! Y
{
7 b! q$ n: E8 z9 B& d1 \
if( pLight )
. C2 m9 q' S. |+ P4 Z: r6 O
{
8 ?+ U. z! Q0 w8 C7 u& E
// à??μ oˉè*
. b- e( e3 ?: A0 W4 `9 o) S7 u. O
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;
; N# _) h# D9 O, J/ o
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;
3 G1 G4 b2 U! s' \
pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;
$ y/ E# n4 L* q: n' P$ c
/ p0 Y! F! L* c, I8 u! F
// oˉè* ??à?
5 U# m c% e% C) C0 G
pLight->Specular.r = 1.0f;
. p, d9 x w- E, z& b+ I
pLight->Specular.g = 1.0f;
, L q2 S5 h- H3 @ c
pLight->Specular.b = 1.0f;
) [5 d# o- C3 {( a
// àü?? oˉè*
: t1 d6 @" e; x1 D6 ~
pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;
* C4 v" R% P8 P) [6 K, a h
pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;
2 @9 L3 h6 J8 B6 U+ K1 Z9 j* c$ D
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
: e, Y5 X0 q% o* V% T
; B; p+ ^ o' l, Q
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
6 a& T4 S3 D+ V) T# }
{
: _ l$ E# W" n2 H9 j
pLight->Diffuse.r *= 0.6f;
; ~# Q- g1 W' t6 H8 F; I' F
pLight->Diffuse.g *= 0.6f;
' x9 {/ L% p' Q% o+ ]8 e; U/ l5 l, B
pLight->Diffuse.b *= 0.6f;
! b8 s0 _6 J" ]$ H# e: p* i( B
pLight->Ambient.r *= 0.7f;
8 W$ n/ b1 L7 N, P- r# G# t
pLight->Ambient.g *= 0.7f;
* ?7 ?1 y& b$ E/ N% O' i9 T
pLight->Ambient.b *= 0.7f;
) S: C4 E4 A8 z( [
}
2 U0 t2 @$ y- ]1 b1 J# K
4 t/ z& Y% P0 |: V ?
#if __VER >= 15 // __BS_CHANGING_ENVIR
" Q% A% ^: h# f. u S* p
if( g_pPlayer )
- `8 q# P; Z6 i
HookUpdateLight( pLight );
. [% u9 J- h2 ?0 F
#endif
! o9 r x) d3 q2 b/ _% x: e* ?. L
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
- G, X& F4 [: s- a
4 @; A" `) G, u! M q& [
pLight->Diffuse.r += 0.1f;
5 G& k* p# y$ g- Q
pLight->Diffuse.g += 0.1f;
- z4 i( u3 a9 a
pLight->Diffuse.b += 0.1f;
}) [4 e6 E" l, J% Y/ M
// oˉè* ??à?
4 h7 K U6 f c, U9 ~( j: b
pLight->Specular.r = 2.0f;
2 X, h, Y+ D! _& z! M! T# C- F7 Z
pLight->Specular.g = 2.0f;
3 H4 n _9 E$ e# N( i7 ?
pLight->Specular.b = 2.0f;
6 g; N$ b& T" X% M; y. V
// á?oˉ
5 C1 [8 ?2 t9 A- U9 `
pLight->Ambient.r *= 0.9f;
: U+ D4 h; Z9 K* X Z
pLight->Ambient.g *= 0.9f;
" o- K2 H/ Y& S2 Q
pLight->Ambient.b *= 0.9f;
- p3 d3 I M4 Y: a6 G
; i- `5 |7 j4 n) t4 j+ E3 X
memcpy( &m_light, pLight, sizeof( m_light ) );
& |# n6 e' j; K C" _5 M
% Y! s$ i& |5 K4 O4 g7 J- [% G
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );
( h* T t/ a/ E7 I- V
pLight->Appear( m_pd3dDevice, TRUE );
- d% {! ~1 m6 A% n% j6 L, X
* J4 T& [" G& W0 V7 ?
DWORD dwR, dwG, dwB;
( n- h0 e; P# X3 w- c: p
dwR = (DWORD)( pLight->Ambient.r * 255 );
( K: @( E6 L6 x% I a b# b! U# q
dwG = (DWORD)( pLight->Ambient.g * 255 );
+ n: _* P3 D- b
dwB = (DWORD)( pLight->Ambient.b * 255 );
* }- B6 |4 W) n0 b; e6 p
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
$ x: C$ c5 s0 \% W [7 l N
}
6 o* O7 `' l+ \& n/ u6 P0 o( n
}
! x# ^' z8 L4 P& p+ R- |, k7 Z
else
N" k( `6 [9 A% \$ d( N' [6 ?
{
+ o# \6 X( d% v: C, T; C# Q" }
if( pLight )
9 W8 f# Z( G; W
{
0 ?. R& W* d2 J& S
! }3 t' `: Z* O+ b
int nHour = 8, nMin = 0;
9 \1 |+ i+ {; g+ }
#ifdef __CLIENT
: g! [! Q& J: k4 Z9 _
// ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù.
1 w- v4 r/ @0 K/ u- Y
nHour = g_GameTimer.m_nHour;
5 V' A- C& h9 B) s! p/ m& t3 \8 M
nMin = g_GameTimer.m_nMin ;
) P; F/ B- H K2 V
#else
9 ~0 P5 o5 V$ @6 o5 @
// o??o??′? ??°£à? m_nLightHour???* °?á???′ù.
, _: s9 }/ T, `! x
if( m_nLightType == 1 )
/ R7 M' p- m. l+ U! u% ]
nHour = m_nLightHour;
9 _- r8 w6 R" W- J4 L
#endif
$ b# V) A( U0 v% J
nHour--;
/ F* I5 Y$ A9 P# m& y3 t o9 s
if( nHour < 0 ) nHour = 0;
/ B5 u0 M3 f& D
if( nHour > 23 ) nHour = 23;
. E- A) t3 B7 O5 u) ?+ _
/ ?- I1 z9 l7 K' e3 u
//if( m_bFixedHour )
. R1 } Q5 c/ `; V
// nHour = m_nFixedHour, nMin = 0;
8 W- x# G0 C7 j5 c8 J# F
LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];
' w7 h$ r) a% C* G
LIGHTCOLOR lightColor = m_k24Light[ nHour ];
6 U* j9 q0 ^- j$ r* G$ g$ T
& _: f- R1 {& o% A. W n
//m_lightColor = lightColorPrv;
' G# a7 s+ a/ }) _4 _
lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
4 v/ M! |% [$ |( h) t% u( G
lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;
7 {% C% e% I+ _7 p5 A
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;
3 ?6 a7 y$ a% u* S0 ]3 j2 T3 t3 e
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;
% n" I4 K& p3 }6 N) M( C7 x, Q
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;
5 N7 a2 U5 [# r' s" z1 y* a
lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
% @' } `( p% k/ y
// 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)
8 f# G& h5 G7 d+ M. o: r/ q* j
! z, P- f* }, e1 [' f. N
// à??μ oˉè*
8 O6 v1 v; Q7 t, ~1 t& }9 [
pLight->Diffuse.r = lightColorPrv.r1;
+ f( c$ ?4 E+ F/ V- ?
pLight->Diffuse.g = lightColorPrv.g1;
W' H2 T6 e$ r+ c5 @% I/ i2 b
pLight->Diffuse.b = lightColorPrv.b1;
" ~3 _# z ~4 f6 V$ Q4 j
// oˉè* ??à?
$ p, g w& d0 l' z- T
pLight->Specular.r = 1.0f;
, m. i* }$ Z/ w
pLight->Specular.g = 1.0f;
# ?' a) K% e% Y+ |5 i. u) z0 r& L
pLight->Specular.b = 1.0f;
7 W6 U) h/ @3 x; x
// àü?? oˉè*
, [0 W% r, n* ~" ]6 J4 o2 v
pLight->Ambient.r = lightColorPrv.r2;
7 u8 j x- y7 r# z
pLight->Ambient.g = lightColorPrv.g2;
4 ?" E- J6 F2 q) |5 F5 b1 K
pLight->Ambient.b = lightColorPrv.b2;
: v1 f( a2 J, C1 O% G
5 f" Z2 {5 b- j
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
3 h j- ?6 b u# o A# j- p
{
. e! N6 z: f5 n6 M) ]
pLight->Diffuse.r *= 0.6f;
! ]: s4 I2 d1 ~ \/ }
pLight->Diffuse.g *= 0.6f;
( E! T- [* f- i4 l$ J" |- D' o
pLight->Diffuse.b *= 0.6f;
* o8 D" z: f6 |5 o, b/ M9 @3 \
pLight->Ambient.r *= 0.7f;
' u# z4 j. W8 B# _' n
pLight->Ambient.g *= 0.7f;
( R8 {# E+ I' I" T- |+ S5 q
pLight->Ambient.b *= 0.7f;
1 A! F" e7 _$ n. L7 g* `
}
, E/ F* Y4 s0 ]! R
, g8 z1 a: A) W" H# n
#if __VER >= 15 // __BS_CHANGING_ENVIR
]: v1 I' J# p/ J7 {4 j
if( g_pPlayer )
z7 |. k) n( K7 X; R
HookUpdateLight( pLight );
; R' j' b# y& c. V; D g
#endif
- E0 ~1 d; V% b/ q, m9 D
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
- ^# [3 \/ w. C; Z8 p' ]! j
. @# K6 A, r3 I! I8 M
#ifdef __YENV
7 t& d( e2 Z( L6 t) `
pLight->Diffuse.r *= 1.1f;
0 a0 x# b @) u8 N( F3 P
pLight->Diffuse.g *= 1.1f;
2 B. P) g8 p8 t
pLight->Diffuse.b *= 1.1f;
: `. ^5 W& Y0 @+ g
// oˉè* ??à?
, S* y# i x3 \/ D9 ?
pLight->Specular.r = 2.0f;
! m0 F$ w& G1 }
pLight->Specular.g = 2.0f;
( S& B1 g% _+ ^1 ^1 |, \3 S
pLight->Specular.b = 2.0f;
6 {) X7 V( Q/ n
// á?oˉ
/ Y9 M8 L8 ~! b9 z! Z0 z
pLight->Ambient.r *= 1.0f;
$ E& ?: f: n8 E( |, j
pLight->Ambient.g *= 1.0f;
% t$ c R3 K3 \
pLight->Ambient.b *= 1.0f;
5 ?- M% M, ^0 [6 \! x
#else //__YENV
6 R$ I$ w9 V1 O: N3 |% M
pLight->Diffuse.r *= 1.1f;
, c6 ]( [- v" X2 k. e7 X& E
pLight->Diffuse.g *= 1.1f;
; c0 O/ K% E. t) ~+ b8 F1 P5 d2 X5 R9 n
pLight->Diffuse.b *= 1.1f;
. ]- |& g) b C' U) u% |/ h; z+ m3 M
// oˉè* ??à?
* q& E8 h7 o' |( L2 F2 _; D
pLight->Specular.r = 2.0f;
, [" v7 p+ V, y: ~: F R0 k4 Z4 C
pLight->Specular.g = 2.0f;
, a* f3 h7 h- G
pLight->Specular.b = 2.0f;
. c; }0 C" y u% G. M
// á?oˉ
- ? \; T% m2 F$ _/ o* l9 e' I
pLight->Ambient.r *= 0.9f;
/ v. w& i; O6 c3 N* F: |9 @/ @3 B
pLight->Ambient.g *= 0.9f;
' j% t% H9 D9 _$ o1 |( T$ |0 d
pLight->Ambient.b *= 0.9f;
u0 U( V1 E- y( g% F: \
#endif //__YENV
6 |+ B2 j2 h# o( z. O2 N, S" A5 q
* t# z0 q2 O! V* `
memcpy( &m_light, pLight, sizeof( m_light ) );
) a8 `, @: y( H1 ^$ W
; ~( w$ U5 W- T7 }
D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);
* l5 y( a3 N5 @5 M5 D
D3DXMATRIX matTemp;
, g- w; v: t0 l) M7 r. l
static const float CONS_VAL = 3.1415926f / 180.f;
% h4 D0 Y; A9 [+ O! V
' d# a: N+ \3 }' O7 V" U
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);
. R/ j# w/ l- ~3 u# f
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);
! F2 }3 \/ h) G9 I
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
3 v. j; ~: M% s$ c0 W: P3 @8 l4 g
pLight->Appear( m_pd3dDevice, TRUE );
5 z; P j8 F6 k# {2 H x2 d
( {: ~# U6 j( ~' u& f/ Z3 Y) u
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
$ W$ o4 J6 W$ O0 a
// D3DXVec3Normalize(&(vecSun),&(vecSun));
3 ^# f) `( x9 T i# w
// pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
/ w+ C: K2 v3 R" {+ B
* I+ u' v& |$ x
DWORD dwR, dwG, dwB;
9 |! w! c$ D! j4 }7 K% Y4 z
dwR = (DWORD)( pLight->Ambient.r * 255 );
6 q. e9 Y* W& X( b
dwG = (DWORD)( pLight->Ambient.g * 255 );
0 v, p0 @7 q' E) i1 p( u8 w
dwB = (DWORD)( pLight->Ambient.b * 255 );
6 u2 j5 Y, O1 S
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
: Z# z9 Z+ S# a9 j0 k
}
8 e8 N4 S: O' D0 J a8 i3 ?
}
. I& F" A3 V+ a" }3 O: k
; _' a1 _9 | e: V& ]
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );
4 B% L7 M4 o$ I, i
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) );
( K$ u9 o: z( \, |
::SetLight( bLight );
+ b0 f) Q$ o1 e* j/ E; O! S
! P5 v+ U: ?6 d+ t5 v
// ±ao? ?D?í???ó á¤à?
% y- ^+ I E N
m_pd3dDevice->SetMaterial( &m_baseMaterial );
+ |+ }. s$ w; R0 t4 O
5 Z9 |8 q$ f# p8 M3 Q9 z
#endif // not WORLDSERVER
( ^' A% u0 Z* Y* N% _9 R0 X
}
! K' F8 \7 F6 w/ I
并更换
9 L) s9 S9 Y/ c0 [, ?' Q: |8 T
Code:
1 Z/ k# b! t7 f9 Z- t3 p
__FLYFF_INITPAGE_EXT
1 B& P! e1 k i! h8 V, x
定义
. q0 j8 b& c1 R5 h" C
0 Y& b$ k$ |8 ?% g8 L. _
' g2 t9 w5 g8 V. O( `
: ^- i- R! @5 `, u5 U8 a6 B; h# E% I {
( D |. M7 D4 l
现在终于删除我的狗屁加速...
1 v# Z, ?6 A4 i; z/ J$ I
5 d, ]- F3 m% p7 M @" `4 f& W5 Y9 q
0 v: ~5 C3 C( M/ |4 p, W9 d
, Y) Z8 O1 l( ?6 u
欢迎光临 飞飞世界论坛 (http://ffwold.com/)
Powered by Discuz! X3.2