Patches Used for Lineage 2
Greg Furstenwerth <[email protected]>
| Newsgroups | gmane.comp.emulators.winex.devel |
|---|---|
| Message-ID | <[email protected]> |
Patches were created by Gryphon "dont know his real name sorry" and Greg
Furstenwerth
Actually most of the work I have done has been overwritten by gryphon
due to making other things work along with it :) so most of my original
patches are of no use. Hope this helps you guys at transgaming :)
Other patches that were used were done by Nadav Frum
http://lists.transgaming.org/pipermail/winex-devel/2004-February/000117.html
http://lists.transgaming.org/pipermail/winex-devel/2004-February/000147.html
I have used both beacuse I used such a old CVS to do what I did :) but
apparently this works on new CVS as well
This patch allows for mouselooking around the edge of the screen in
lineage2 "gryphon"
--- winex-changed/dlls/dinput/mouse/main.c 2004-05-08
20:11:05.000000000 +0200
+++ winex/dlls/dinput/mouse/main.c 2004-05-12 02:23:45.322847624 +0200
@@ -105,6 +105,8 @@
BOOL WINAPI DINPUT_ForceSetCursorPos(INT,INT);
+BOOL LineAge2_warp_problem; /* Warping should only be done while
mouse_looking */
+
typedef enum {
WARP_NEEDED, /* Warping is needed */
WARP_STARTED, /* Warping has been done, waiting for the warp event */
@@ -438,6 +440,7 @@
RECT window_rect;
BOOL do_abs_calc = TRUE;
BOOL changed = FALSE;
+ int change_pos_mouse;
GetWindowRect(This->win, &window_rect);
min_x = window_rect.left;
@@ -446,10 +449,10 @@
max_y = window_rect.bottom - 1;
/* Now, warp handling */
- if ((This->need_warp == WARP_STARTED) &&
- (hook->pt.x == This->mapped_center.x) && (hook->pt.y ==
This->mapped_center.y)) {
+ /*if ((This->need_warp == WARP_STARTED) &&
+ (hook->pt.x == This->mapped_center.x) && (hook->pt.y ==
This->mapped_center.y)) {*/
/* Warp has been done... */
- This->abs_prev_point.x = hook->pt.x;
+ /*This->abs_prev_point.x = hook->pt.x;
This->abs_prev_point.y = hook->pt.y;
This->prevX = hook->pt.x;
This->prevY = hook->pt.y;
@@ -457,18 +460,42 @@
hook->pt.y = This->abs_pretend_point.y;
This->need_warp = WARP_DONE;
goto end;
- }
-
+ }*/
+
+ /* Warping away from screen edge when mouse_looking */
+ /* currently code is not compatible with absolute mouse (not verified) */
+ /* and not compatible with the MOUSE_HACK flag */
+ /* It seems that lineage seems to start with a warp and since the arrow */
+ /* is at the left position, it gets warped 100 to the right. Looks
silly, I know */
+ /* The -100 +100 trick isn't the state of the art, but it works
perfectly if your */
+ /* your horisontal screen resolution is higher then 400 pixels. */
+ /* if not, it's time to buy a new screen */
+ if ((This->need_warp == WARP_STARTED) && (LineAge2_warp_problem ==
TRUE)) {
+ LineAge2_warp_problem = FALSE;
+ change_pos_mouse = 0;
+ if (This->abs_pretend_point.x >= max_x-100)
+ change_pos_mouse = -100;
+ if (This->abs_pretend_point.x <= min_x+100)
+ change_pos_mouse = +100;
+ if (change_pos_mouse != 0) {
+ This->abs_pretend_point.x += change_pos_mouse;
+ hook->pt.x += change_pos_mouse;
+ This->abs_prev_point.x += change_pos_mouse;
+ This->prevX += change_pos_mouse;
+ DINPUT_ForceSetCursorPos(hook->pt.x, hook->pt.y );
+ }
+ This->need_warp = WARP_DONE;
+ }
This->m_state.lX += hook->pt.x - This->prevX;
This->m_state.lY += hook->pt.y - This->prevY;
- if ((This->need_warp == WARP_DONE) &&
+ /*if ((This->need_warp == WARP_DONE) &&
(hook->pt.x == This->mapped_center.x) && (hook->pt.y ==
This->mapped_center.y))
{
This->abs_prev_point.x = hook->pt.x;
This->abs_prev_point.y = hook->pt.y;
do_abs_calc = FALSE;
- }
+ }*/
/* Relative mouse input with absolute mouse event : the real fun starts
here... */
if (hook->pt.x != This->prevX) {
if (This->absolute)
@@ -589,7 +616,7 @@
This->m_state.lX, This->m_state.lY, This->m_state.lZ,
This->m_state.rgbButtons[0], This->m_state.rgbButtons[2],
This->m_state.rgbButtons[1]);
-end:
+/*end:*/ /*label not used anymore, would get warning */
LeaveCriticalSection(&(This->crit));
if (dwCoop & DISCL_NONEXCLUSIVE && !((This->need_warp == WARP_DONE) &&
@@ -642,7 +669,8 @@
EnterCriticalSection(&This->crit);
This->warp_time = current;
TRACE("Warping mouse to %ld - %ld\n", This->mapped_center.x,
This->mapped_center.y);
- DINPUT_ForceSetCursorPos( This->mapped_center.x, This->mapped_center.y );
+ //DINPUT_ForceSetCursorPos( This->mapped_center.x,
This->mapped_center.y );
+ LineAge2_warp_problem = TRUE;
#ifdef MOUSE_HACK
This->abs_prev_point.x = This->mapped_center.x;
This patch allows for the mouse to not double click on icons ingame.
Thanks to Villager for pointing this part out :)
___________________ x11ddraw.c changes _________________
@@ 502 @@
- X11DRV_MotionNotify(0, (XMotionEvent*)event);
+ /*X11DRV_MotionNotify(0, (XMotionEvent*)event);*/
break;
case ButtonPress:
- X11DRV_ButtonPress(0, (XButtonEvent*)event);
+ /*X11DRV_ButtonPress(0, (XButtonEvent*)event);*/
break;
case ButtonRelease:
- X11DRV_ButtonRelease(0, (XButtonEvent*)event);
+/*X11DRV_ButtonRelease(0, (XButtonEvent*)event);*/
break;
}
- if (!propagate) break;
+ /* if (!propagate) break;*/
/* dinput didn't take it, propagate event to a window */
if (event->type == MotionNotify) {
/* cut down on motion events, they slow us down */
This allows for armors to render in game that would otherwise render
solid black
_____________________ texstate.c changes ____________________
line 713
That line should read: static inline DWORD D3D_GL_color_op(GL_D3D_priv*
priv, DWORD Stage, DWORD State)
2 lines below you have: DWORD cstate = _TSS(Stage,COLOROP);
below this line add folowing 7 lines:
/*this line is needed for the Lineage2
* armor problem. Without it some
* armors are rendered black*/
if (cstate == 18) {
cstate = 2;
_TSS(Stage,COLOROP) = 2;
}
This allows for the gamma of buildings to be corrected so they are not
blinding light "gryphon"
_____________________ texstate.c changes ____________________
go to the winex/dlls/d3dgl/ folder and open texstate.c
for 3.3.2 branch line 713
for 3.3 branch line 702
(other branches; look around, it's near)
That line should read: static inline DWORD D3D_GL_color_op(GL_D3D_priv*
priv, DWORD Stage, DWORD State)
below you have:
DWORD cstate = _TSS(Stage,COLOROP);
/* this line is needed for the Lineage2
* armor problem. Without it some
* armors are rendered black */
if (cstate == 18) {
cstate = 2;
_TSS(Stage,COLOROP) = 2;
}
DWORD astate = _TSS(Stage,ALPHAOP);
add folowing lines below last line from the above code:
/* this patch is for the Lineage2
* building gamma problem. Without
* it buildings and rocks are rendered
* practicly white */
if ((cstate == 5)) {
DWORD aar1 = _TSS(Stage,ALPHAARG1);
if (((astate == 4) && (aar1 == 2)) || ((astate == 2) && (aar1 == 2)) ||
((astate == 4) && (aar1 == 1))) {
cstate = 2;
_TSS(Stage,COLOROP) = cstate;
}
}