Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old April 15, 2017, 00:47   #21
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 52
Posts: 6,654
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by Derakon View Post
It's sad that we have so much duplication of effort in Angband and its variants.
I used to think that, but I see it as more like an ecosystem now. As a maintainer it's great to have so many variants around to steal ideas from. So the process of a maintainer developing their ideas, and then others copying it doesn't just give a chance for all the variants to improve, but in the end it probably ends up with better implementations.

That's especially the case for "creative" ideas, but I think it also is for coding techniques (sorry, I English bad today). There's also the thing that Angband and variants have such a broad design space that you can do things like wilderness or randarts in many, many different ways.
__________________
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them.
Nick is offline   Reply With Quote
Old April 16, 2017, 10:17   #22
Siemelink
Rookie
 
Join Date: Feb 2014
Location: Hungary
Posts: 16
Siemelink is on a distinguished road
Quote:
Originally Posted by Pete Mack View Post
MSVC doesn't have stdbool.h
You can write your own, then add -I. to the compile line.
http://stackoverflow.com/questions/5...s2010-question
Angband has h-basic.h, which defines bool as well:

/* Use a char otherwise */
typedef char bool;

#undef TRUE
#undef FALSE

#define TRUE 1
#define FALSE 0

#endif

replacing the typedef with #define bool char seems to recover bool.

But the order of includes seems off. get.h gives errors in the getset definition, bool is not defined. I can add #include "h-basic.h" in get.h to get a bit further.

Then I am stuck on item_filter, which is not defined anywhere, in any file.

bool get_item(struct object **choice, const char *pmt, const char *fail, cmd_code cmd, item_filter filter, int mode);

Confusion reigns!
Siemelink is offline   Reply With Quote
Old April 16, 2017, 10:26   #23
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 4,317
Donated: $40
Pete Mack is on a distinguished road
get.c, line 54
Pete Mack is offline   Reply With Quote
Old April 16, 2017, 14:10   #24
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,827
Donated: $40
takkaria is on a distinguished road
Your problem is that you shouldn't be compiling get.c or get.h, they're not used. They should be removed, I think that's my fault that they're still there.
__________________
"Physician, heal thyself."
takkaria is offline   Reply With Quote
Old April 16, 2017, 23:12   #25
Siemelink
Rookie
 
Join Date: Feb 2014
Location: Hungary
Posts: 16
Siemelink is on a distinguished road
Quote:
Originally Posted by takkaria View Post
Your problem is that you shouldn't be compiling get.c or get.h, they're not used. They should be removed, I think that's my fault that they're still there.
Oh, that made a difference!
Now I only have one more nut to crack, a linker error:

unresolved external symbol _FreeDIB referenced in function _Term_xtra_win_react

Neither of those keywords means something to me.

Willem.
Siemelink is offline   Reply With Quote
Old April 16, 2017, 23:32   #26
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,827
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by Siemelink View Post
Oh, that made a difference!
Now I only have one more nut to crack, a linker error:

unresolved external symbol _FreeDIB referenced in function _Term_xtra_win_react

Neither of those keywords means something to me.

Willem.
You might need to include win/readdib.c if it's there as a file to compile.
__________________
"Physician, heal thyself."
takkaria is offline   Reply With Quote
Old April 18, 2017, 22:52   #27
Siemelink
Rookie
 
Join Date: Feb 2014
Location: Hungary
Posts: 16
Siemelink is on a distinguished road
Quote:
Originally Posted by takkaria View Post
You might need to include win/readdib.c if it's there as a file to compile.
Thanks again. I had the file included but for unknown reason WINDOWS was not defined. So the whole file was commented out with #ifdef. I fixed this by adding #include "h-basic.h"

So finally, I can compile without error. The game runs, I can start new or load a save file. I have the main window and the subwindows. But as soon as a dungeon is generated, the game crashes.

I still have a compiler warning on the code below: Expected an expression. This probably means that the array is expanded as {}

static const char *desc_stat_pos[] =
{
#define STAT(a, b, c, d, e, f, g, h) f,
#include "list-stats.h"
#undef STAT
};

The warning goes away if I expand this by hand.
static const char *desc_stat_pos[] =
{
"strong",
"smart",
"wise",
"dextrous",
"healthy"
};

I see that the method to define an array using an #include is repeated aplenty. Expanding everything by hand would be a mess, so now my next quest is to configure this code for the funky compiler.

Willem.
Siemelink is offline   Reply With Quote
Old April 19, 2017, 03:24   #28
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 4,317
Donated: $40
Pete Mack is on a distinguished road
Rather than including basic.h, add /DWINDOWS to the compile options.
Pete Mack is offline   Reply With Quote
Old April 19, 2017, 05:43   #29
t4nk
Adept
 
Join Date: May 2016
Posts: 249
t4nk is on a distinguished road
Quote:
Originally Posted by Siemelink View Post
static const char *desc_stat_pos[] =
{
#define STAT(a, b, c, d, e, f, g, h) f,
#include "list-stats.h"
#undef STAT
};

static const char *desc_stat_pos[] =
{
"strong",
"smart",
"wise",
"dextrous",
"healthy"
};
It's probably trailing comma? Note that macroexpanded code looks like this:
Code:
        ...
	"dextrous",
	"healthy", /* the comma */
};
t4nk is offline   Reply With Quote
Old April 19, 2017, 22:41   #30
Siemelink
Rookie
 
Join Date: Feb 2014
Location: Hungary
Posts: 16
Siemelink is on a distinguished road
Quote:
Originally Posted by t4nk View Post
It's probably trailing comma?
Yes.
When I compiled the snippet separately I could get the warning and also the correct contents from the array.

Willem.
Siemelink is offline   Reply With Quote
Reply


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
Compiling Z+Angband Ravenheart87 Variants 7 May 24, 2011 09:35
Compiling 3.2 Omnipact Development 6 December 27, 2010 10:39
compiling in VC6 NeoWizard Vanilla 1 January 16, 2009 03:10
Compiling in Linux trickypig Vanilla 6 November 16, 2008 16:26
Compiling 3.0.9b under SuSE 9.3 ... TJA Vanilla 14 May 12, 2008 22:17


All times are GMT +1. The time now is 20:30.


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