Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old August 17, 2011, 19:28   #1
APWhite
Adept
 
APWhite's Avatar
 
Join Date: Jul 2007
Location: St George Utah, USA
Posts: 244
APWhite is on a distinguished road
330 Borg started but snagged.

I am working two clinics now and I'm gone about 70 hrs a week. I do not have time to learn the new code to get the borg's keypress stuff working.

I will need someone to help me rewrite the inkey_ex() from util.c to allow the borg to function.

The old 320 code looked like this:
Code:
ui_event_data inkey_ex(void)
{
	bool cursor_state;
	ui_event_data kk;
	ui_event_data ke;

	bool done = FALSE;

	term *old = Term;

	/* Initialise keypress */
	ke.key = 0;
	ke.type = EVT_NONE;

	/* Hack -- Use the "inkey_next" pointer */
	if (inkey_next && *inkey_next && !inkey_xtra)
	{
		/* Get next character, and advance */
		ke.key = *inkey_next++;
		ke.type = EVT_KBRD;

		/* Cancel the various "global parameters" */
		inkey_base = inkey_xtra = inkey_flag = FALSE;
		inkey_scan = 0;

		/* Accept result */
		return (ke);
	}

	/* Forget pointer */
	inkey_next = NULL;

#ifdef ALLOW_BORG

	/* Mega-Hack -- Use the special hook */
	if (inkey_hack && ((ke.key = (*inkey_hack)(inkey_xtra)) != 0))
	{
		/* Cancel the various "global parameters" */
		inkey_base = inkey_xtra = inkey_flag = FALSE;
		inkey_scan = 0;
		ke.type = EVT_KBRD;

		/* Accept result */
		return (ke);
	}

#endif /* ALLOW_BORG */
The new 330 stuff looks like this:
Code:
ui_event inkey_ex(void)
{
	bool cursor_state;
	ui_event kk;
	ui_event ke = EVENT_EMPTY;

	bool done = FALSE;

	term *old = Term;

	/* Delayed flush */
	if (inkey_xtra) {
		Term_flush();
		inkey_next = NULL;
		inkey_xtra = FALSE;
	}

	/* Hack -- Use the "inkey_next" pointer */
	if (inkey_next && inkey_next->code)
	{
		/* Get next character, and advance */
		ke.key = *inkey_next++;

		/* Cancel the various "global parameters" */
		inkey_flag = FALSE;
		inkey_scan = 0;

		/* Accept result */
		return (ke);
	}

	/* Forget pointer */
	inkey_next = NULL;

#ifdef ALLOW_BORG

	/* Mega-Hack -- Use the special hook */
	if (inkey_hack && ((ke.key = (*inkey_hack)(inkey_xtra)) != 0))
	{
		/* Cancel the various "global parameters" */
		inkey_flag = FALSE;
		inkey_scan = 0;
		ke.type = EVT_KBRD;

		/* Accept result */
		return (ke);
	}

#endif /* ALLOW_BORG */
For the rest of the 330 code changes, I was able to quickly identify the variable name changes and the few struct changes-- most have been updated. But I have no idea how the event handler works.

I see there is a change to the feature array as well. I will cross that bridge when I come to it.

The borg source code is at innovapain.com/borg
Andrew
APWhite is offline   Reply With Quote
Old August 18, 2011, 00:48   #2
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,828
Donated: $40
takkaria is on a distinguished road
OK, could you email me about this? I know at least vaguely what you'd need to do but I haven't got time to explain right now. (takkaria at gmail dot com)

Quote:
Originally Posted by APWhite View Post
I am working two clinics now and I'm gone about 70 hrs a week. I do not have time to learn the new code to get the borg's keypress stuff working.

I will need someone to help me rewrite the inkey_ex() from util.c to allow the borg to function.

The old 320 code looked like this:
Code:
ui_event_data inkey_ex(void)
{
	bool cursor_state;
	ui_event_data kk;
	ui_event_data ke;

	bool done = FALSE;

	term *old = Term;

	/* Initialise keypress */
	ke.key = 0;
	ke.type = EVT_NONE;

	/* Hack -- Use the "inkey_next" pointer */
	if (inkey_next && *inkey_next && !inkey_xtra)
	{
		/* Get next character, and advance */
		ke.key = *inkey_next++;
		ke.type = EVT_KBRD;

		/* Cancel the various "global parameters" */
		inkey_base = inkey_xtra = inkey_flag = FALSE;
		inkey_scan = 0;

		/* Accept result */
		return (ke);
	}

	/* Forget pointer */
	inkey_next = NULL;

#ifdef ALLOW_BORG

	/* Mega-Hack -- Use the special hook */
	if (inkey_hack && ((ke.key = (*inkey_hack)(inkey_xtra)) != 0))
	{
		/* Cancel the various "global parameters" */
		inkey_base = inkey_xtra = inkey_flag = FALSE;
		inkey_scan = 0;
		ke.type = EVT_KBRD;

		/* Accept result */
		return (ke);
	}

#endif /* ALLOW_BORG */
The new 330 stuff looks like this:
Code:
ui_event inkey_ex(void)
{
	bool cursor_state;
	ui_event kk;
	ui_event ke = EVENT_EMPTY;

	bool done = FALSE;

	term *old = Term;

	/* Delayed flush */
	if (inkey_xtra) {
		Term_flush();
		inkey_next = NULL;
		inkey_xtra = FALSE;
	}

	/* Hack -- Use the "inkey_next" pointer */
	if (inkey_next && inkey_next->code)
	{
		/* Get next character, and advance */
		ke.key = *inkey_next++;

		/* Cancel the various "global parameters" */
		inkey_flag = FALSE;
		inkey_scan = 0;

		/* Accept result */
		return (ke);
	}

	/* Forget pointer */
	inkey_next = NULL;

#ifdef ALLOW_BORG

	/* Mega-Hack -- Use the special hook */
	if (inkey_hack && ((ke.key = (*inkey_hack)(inkey_xtra)) != 0))
	{
		/* Cancel the various "global parameters" */
		inkey_flag = FALSE;
		inkey_scan = 0;
		ke.type = EVT_KBRD;

		/* Accept result */
		return (ke);
	}

#endif /* ALLOW_BORG */
For the rest of the 330 code changes, I was able to quickly identify the variable name changes and the few struct changes-- most have been updated. But I have no idea how the event handler works.

I see there is a change to the feature array as well. I will cross that bridge when I come to it.

The borg source code is at innovapain.com/borg
Andrew
__________________
"Physician, heal thyself."
takkaria is offline   Reply With Quote
Old August 31, 2011, 04:34   #3
APWhite
Adept
 
APWhite's Avatar
 
Join Date: Jul 2007
Location: St George Utah, USA
Posts: 244
APWhite is on a distinguished road
I got that email sent off. Any chance you looked at a solution?
APWhite is offline   Reply With Quote
Old August 31, 2011, 12:15   #4
Magnate
Angband Devteam member
 
Join Date: May 2007
Location: London, UK
Posts: 5,054
Magnate is on a distinguished road
Send a message via MSN to Magnate Send a message via Yahoo to Magnate Send a message via Skype™ to Magnate
Quote:
Originally Posted by APWhite View Post
I got that email sent off. Any chance you looked at a solution?
I think takk is on vacation at the moment, so it might be a little while.
__________________
"3.4 is much better than 3.1, 3.2 or 3.3. It still is easier than 3.0.9, but it is more convenient to play without being ridiculously easy, so it is my new favorite of the versions." - Timo Pietila
Magnate is offline   Reply With Quote
Old September 5, 2011, 15:39   #5
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,828
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by APWhite View Post
I got that email sent off. Any chance you looked at a solution?
Not yet, sorry.
__________________
"Physician, heal thyself."
takkaria is offline   Reply With Quote
Reply

Tags
apwhite, borg, screensaver


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Angband 3.2.0 Borg kurie Vanilla 56 October 14, 2011 13:26
330 ways to kill a warrior Estie AAR 11 August 9, 2011 18:56
getting started on OSX cinereaste Development 8 August 6, 2010 05:13
APW borg on OS X pesachyonah Vanilla 7 February 12, 2008 11:56
[Un] Confused how to get started in 0.6.2-wip6a, + misc. Bostock Variants 7 September 6, 2007 21:26


All times are GMT +1. The time now is 00:37.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.