Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old April 2, 2020, 01:15   #81
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,698
Donated: $40
Pete Mack is on a distinguished road
That reference to player IS the reason. If you first include player.h instead of picking it up later, the warning will vanish. But a forward declaration is better:

strict player;

...
Reference to *player. You only need the full structure when you dereference the pointer (with * or ->), and that never happens in .h files.
Pete Mack is offline   Reply With Quote
Old April 2, 2020, 19:09   #82
DavidMedley
Knight
 
Join Date: Oct 2019
Posts: 608
DavidMedley is on a distinguished road
Who gets credit for this?
Code:
const s16b ddd[9] =
{ 2, 8, 6, 4, 3, 1, 9, 7, 5 };
Or:
Code:
7 1 6
3 5 2
5 0 4
DavidMedley is offline   Reply With Quote
Old April 2, 2020, 19:46   #83
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,698
Donated: $40
Pete Mack is on a distinguished road
Not sure about what the second bit is, but the first part--the list of directions to allow iterating loops--is old, old code.

Quote:
Originally Posted by DavidMedley View Post
Who gets credit for this?
Code:
const s16b ddd[9] =
{ 2, 8, 6, 4, 3, 1, 9, 7, 5 };
Or:
Code:
7 1 6
3 5 2
5 0 4
Pete Mack is offline   Reply With Quote
Old April 2, 2020, 19:54   #84
DavidMedley
Knight
 
Join Date: Oct 2019
Posts: 608
DavidMedley is on a distinguished road
The second part is arranging it like you would on a numpad. 4 -> down and to the right, for example.
DavidMedley is offline   Reply With Quote
Old April 7, 2020, 16:14   #85
DavidMedley
Knight
 
Join Date: Oct 2019
Posts: 608
DavidMedley is on a distinguished road
Found this interesting bit:
#define PY_KNOW_LEVEL 30 /* Level to know all runes */

But it doesn't appear to be in use. Does this mean someone intended all runes to be instantly known at character level 30? If this constant isn't used again, shouldn't it throw a compiler warning?
DavidMedley is offline   Reply With Quote
Old April 7, 2020, 19:55   #86
DavidMedley
Knight
 
Join Date: Oct 2019
Posts: 608
DavidMedley is on a distinguished road
Code:
/**
 * Return the player's chance to hit with a particular weapon.
 */
int chance_of_melee_hit(const struct player *p, const struct object *weapon)
{
	int chance, bonus = p->state.to_h;

	if (weapon)
		bonus += weapon->to_h;
	chance = p->state.skills[SKILL_TO_HIT_MELEE] + bonus * BTH_PLUS_ADJ;
	return chance;
}

/* elsewhere */
#define BTH_PLUS_ADJ    	3 		/* Adjust BTH per plus-to-hit */
So a +1 to hit is equivalent to 3 skill points, right? So a warrior that starts with 70 melee skill effectively has +11 to-hit over a rogue who starts with 35, for example. (They both advance at the same rate.)

Last edited by DavidMedley; April 7, 2020 at 19:58. Reason: Better example
DavidMedley is offline   Reply With Quote
Old April 7, 2020, 20:53   #87
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,698
Donated: $40
Pete Mack is on a distinguished road
No. The 3x applies to the to_h bonus on the character sheet, sum of effects from equipment, stats, and buffs.
Pete Mack is offline   Reply With Quote
Old April 7, 2020, 21:27   #88
wobbly
Veteran
 
Join Date: May 2012
Location: Adelaide, Australia
Posts: 2,299
wobbly is on a distinguished road
I'm failing to see the difference. 35 + 11 * 3 is well not exactly 70 but pretty close & if you look at how it displays on the character sheet:

human warrior: to-hit: 24,
human rogue: to-hit: 13,
wobbly is offline   Reply With Quote
Old April 7, 2020, 22:42   #89
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 8,255
Donated: $60
Nick will become famous soon enough
Quote:
Originally Posted by DavidMedley View Post
Found this interesting bit:
#define PY_KNOW_LEVEL 30 /* Level to know all runes */

But it doesn't appear to be in use. Does this mean someone intended all runes to be instantly known at character level 30? If this constant isn't used again, shouldn't it throw a compiler warning?
IIRC there was a plan for that to happen at some time during the development of rune ID, but it was decided not to be necessary. And I think the compiler doesn't throw an error because it's not in actual code, it's just the preprocessor.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is offline   Reply With Quote
Old April 9, 2020, 01:33   #90
DavidMedley
Knight
 
Join Date: Oct 2019
Posts: 608
DavidMedley is on a distinguished road
Coming back to compiling for Windows... Any help is greatly appreciated because I have no idea what I'm doing.

Instructions:
Quote:
Cross-building for Windows with Mingw
Many developers (as well as the auto-builder) build Angband for Windows using Mingw on Linux. This requires that the necessary Mingw packages are all installed.

This type of build now also uses autotools, so you must configure it to cross-compile, e.g.:

./autogen.sh
./configure --enable-win --disable-curses --build=i686-pc-linux-gnu --host=i586-mingw32msvc
./autogen.sh
Code:
*info* running aclocal (-I m4)
*info* running autoheader
*info* running autoconf
./configure --enable-win --disable-curses --build=i686-pc-linux-gnu --host=i586-mingw32msvc
Code:
checking build system type... i686-pc-linux-gnu
checking host system type... i586-pc-mingw32msvc
checking target system type... i586-pc-mingw32msvc
checking for tput... /usr/bin/tput
configure: touching .deps files
Note: You have chosen to compile for installation, with data files
    in standard locations. For development, you may wish to consider using
    --with-no-install which will leave the game to run from the directory
    into which it was extracted and compiled.

checking for i586-mingw32msvc-gcc... no
checking for gcc... gcc
configure: WARNING: using cross tools not prefixed with host triplet
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether make sets $(MAKE)... yes
checking whether ln -s works... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for i586-mingw32msvc-windres... no
checking for windres... no
checking for rst2html.py... no
checking for rst2html... no
checking for rst2latex.py... no
checking for rst2latex... no
checking for pdflatex... no
checking for rm... /bin/rm
checking for mv... /bin/mv
checking for cp... /bin/cp
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for stdint.h... (cached) yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for an ANSI C-conforming const... yes
checking return type of signal handlers... void
checking for mkdir... yes
checking for setresgid... yes
checking for setegid... yes
checking for stat... yes
checking if gcc supports -Wno-missing-field-initializers... yes
checking if make supports SysV-style inclusion... yes
checking for make silent include syntax... gnu
checking for mvwaddnwstr... no
checking for use_default_colors... no
checking for can_change_color... no
checking for X... no
configure: creating ./config.status
config.status: creating mk/buildsys.mk
config.status: creating mk/extra.mk
config.status: creating mk/sinclude.mk
config.status: creating src/autoconf.h

Configuration:

  Install path:                           /usr/local
  binary path:                            /usr/local/games
  config path:                            /usr/local/etc/angband/
  lib path:                               /usr/local/share/angband/
  doc path:                               /usr/local/share/doc/angband/
  var path:                               (not used)
  (with private save and score files in ~/.angband/Angband/)

-- Frontends --
- Curses                                  Disabled
- X11                                     No; missing libraries
- SDL2                                    Disabled
- SDL                                     Disabled
- Windows                                 Yes
- Test                                    No
- Stats                                   No

- SDL2 sound                              Disabled
- SDL sound                               Disabled
make
Code:
Entering directory src.
win/readpng.c:21:10: fatal error: windows.h: No such file or directory
 #include <windows.h>
          ^~~~~~~~~~~
compilation terminated.
win/scrnshot.c:19:10: fatal error: windows.h: No such file or directory
 #include <windows.h>
          ^~~~~~~~~~~
compilation terminated.
win/win-layout.c:19:10: fatal error: windows.h: No such file or directory
 #include <windows.h>
          ^~~~~~~~~~~
compilation terminated.
Successfully generated dependencies.
/bin/bash: no: command not found
Makefile:31: recipe for target 'win/angband.res' failed
make[3]: *** [win/angband.res] Error 127
../mk/buildsys.mk:110: recipe for target 'all' failed
make[2]: *** [all] Error 2
mk/buildsys.mk:115: recipe for target 'subdirs' failed
make[1]: *** [subdirs] Error 2
mk/buildsys.mk:110: recipe for target 'all' failed
make: *** [all] Error 2
DavidMedley 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
is there a code? jozmon Development 19 August 4, 2014 00:38
Questions regarding vanilla inscriptions Avenger Vanilla 8 December 13, 2013 21:15
Questions regarding vanilla dungeon design Cazliostro Vanilla 23 October 11, 2010 12:05
code help please will_asher Variants 22 March 15, 2010 19:00
Looking through the code K.I.L.E.R Vanilla 5 July 11, 2007 08:01


All times are GMT +1. The time now is 05:12.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.