Commit Graph

46 Commits

Author SHA1 Message Date
nhmall
585e9f1b35 fix a 'program in disorder' in tt_oname
Changes to be committed:
	modified:   win/win32/winhack.c

sys_early_init was never called for win32 GUI. That was causing "rnd(0) -
program in disorder" in tt_oname.
2015-12-07 06:48:05 -05:00
nhmall
385d4c4293 Pilemark support for windows
Changes to be committed:
	modified:   win/win32/mhmap.c
	modified:   win/win32/winMS.h
	modified:   win/win32/winhack.c
2015-06-20 08:33:49 -04:00
Alex Kompel
598ee94628 win32_gui: load pile mark bitmap on startup 2015-06-17 11:32:07 -07:00
Alex Kompel
afa0e95e66 win32_gui: implement background glyph rendering
try to use system TrasnparentBlt (or not)
2015-06-09 08:34:11 -07:00
Sean Hunt
1c081b1647 Remove stale version control lines. 2015-05-25 09:21:31 +09:00
Sean Hunt
97d6fade74 Reformat all C files.
I'll push a formatting guide at some point. There may still be
outstanding changes, but please feel free to resolve those as you arrive
a them.

To the best of my knowledge, there is no changes to the actual code
content, but the formatter does have the occasional bug. If you run into
an issue, please fix it!
2015-05-09 13:43:16 -04:00
nhmall
20069798d4 Merge branch 'master' into win32-x64-working 2015-05-07 04:52:30 -04:00
karnov
2a907f894e Version number increment 2015-05-06 22:04:27 -04:00
Dion Nicolaas
b6007ac59d BCC is more strict about not statements before parameter declarations 2015-05-02 13:48:44 +02:00
Dion Nicolaas
eb9f7b3177 typo in comment 2015-04-16 22:40:22 +02:00
Dion Nicolaas
0c4573d82a fix tile2bmp build under mingw. Provide alternatives for Microsoft-specific macros. Be consistent about slashes in gcc Makefile. Don't include shlwapi.h for any compiler. 2015-04-16 22:36:06 +02:00
Alex Kompel
62617092b5 win32_gui: gettting x64 build to work 2015-04-14 08:54:44 -07:00
Derek S. Ray
b1a7bbbbdb pull in the recent unconditionals merge from master 2015-02-27 21:25:00 -05:00
keni
03140969ee Bulk recovery of file CVS headers and addition of NHDT- headers. 2015-02-26 09:19:03 -05:00
keni
665dedc3de Add RCS version lines 2009-05-06 11:00:43 +00:00
nethack.rankin
2c0a072ef1 main() reorganization (trunk only)
Move some internals-related code out of port-specific main so that
it isn't duplicated a bunch of times.  One minor side-effect of this
change is that if you auto-pickup something at the very start of a game,
it will happen after any full moon/new moon/Friday 13th message rather
than before.  There's a second change for some:  the shared main() used
by several of the micro ports had a small difference in game play--if you
saved a game while on an engraving, it would automatically be read when
you resume--that will now occur for everybody [Elbereth weenies rejoice!].
pcmain() was also calling update_inventory() at start of play.  That's
unnecessary for new games, where inventory initialization triggers a call
to it for each item added to your pack; but I wasn't sure about restored
games, so everybody gets it there now.

     The Mac and BeOS ports evidently haven't been touched it some time;
they still referenced flags.move which got replaced by context.move quite
a while back.  The Windows GUI code has a declaration for mswin_moveloop()
which appears to be non-existant, but I left it alone.  I assume that the
Qt interface uses the existing main() routines; at least I couldn't find
any start of game code specific to it.  vmsmain's revised main() is the
only one which has been tested.
2006-04-02 07:35:30 +00:00
nethack.allison
6177f4b871 win32 and wince
Remove the email address which is no longer valid from
several NetHack source files.
2005-01-23 19:39:01 +00:00
nethack.allison
21eaf22be4 win32gui message history; also clipboard support (from <Someone>)
- added 2 menu options: Copy ASCII Screenshot To Clipboard, Save
  ASCII Screenshot To File
- implemented saving message history
2003-10-13 14:48:13 +00:00
nethack.allison
416412f92b Remove vestiges of old overlay source split
[trunk only]
2003-09-05 02:45:18 +00:00
nethack.allison
27977b7c15 win32 stuff held until after bugfix release (from <Someone>)
-better handling of "more" prompt for messages that would have      scrolled off the window
-support perm_invent
-menu option to add/remove windows captions
2003-03-03 23:31:36 +00:00
nethack.allison
31e40def94 (from <Someone>)
Allow someone to resume their game by clicking on a saved game, if they
have an association set up.
2002-04-21 13:22:57 +00:00
nethack.allison
63e0b1ec2d (from <Someone>)
Two things:
1. This patch causes the window placement of the main window to be
written to the registry, and to be restored upon the next start
of the program. I had to move the creation of the main window to init_nhwindows,
as the registry is not read until then.

2.  Implement support for wc_popup_dialog (or rather, support for not having
popup windows.) It asks getlin questions and get_ext_cmd on the
message window, much like the TTY port does it.

The get_ext_cmd procedure is almost but not quite the same as the
one for TTY, and I think it is better: It autocompletes the extended
command you type, but if you keep on typing it doesn't add those letters
after the completed command, but just keeps track of how many (correct)
characters you typed. If you type a different character than the
autocompleted command has, it shows you what you typed again. If you
press backspace, it deletes the characters you typed, and if autocompletion
is no longer possible, it removes the autocompleted part. The effect
of this is that you can type as many letters as you want when typing
an extended command, as long as it is enough to identify one command;
and you only have to delete the characters you actually typed if you made
a mistake. I think autocompletion is a lot less obtrusive this way.

Some notes about the patch:
- Both mswin_getlin and mswin_get_ext_cmd now have two versions, with
  and without a popup.
- yn_question was changed so that it displays a caret, which is a lot
  nicer IMHO.
- I had to implement a new NetHack Windows Message parameter,
  "MSNH_MSG_CARET", to make it possible to show and hide the caret in
  the message window. Normally the caret is created and destroyed by the
  window that owns it, but in NetHack the input focus is always on the
  main window, while the caret is in the message window, which happens
  to be the only one that knows how large the caret should be.
- mswin_putstr_ex's last parameter changed from boolean to int; the
  semantics are enhanced so that a negative last parameter means "delete
  that many characters from the input line". The string to be deleted is
  passed in as well, although it is currently not used.
- A rather large chunk of code finds out where the last string that was
  displayed on the message window ended. This is necessary to place the
  caret at the right spot. The caret is always positioned there, even if
  it is hidden or non-existing.
- mswin_get_nh_event was changed to actually process and empty the
  message queue, and called from mswin_putstr_ex to make sure the
  message window is updated before the next step is done. Without this,
  the caret is positioned before the last message is painted, which
  makes its x-position after the last character of the previous line.
2002-03-27 12:17:26 +00:00
nethack.allison
8669a4e053 Remove high-bit characters in recent comment 2002-03-11 02:40:43 +00:00
nethack.allison
db2bdaadcb (from Yitzhak) part2
part 2 touches only port files

Makes Borland happy with current sources.
Fixes bug in WM_PAINT handling in rip/splash code.
Fixes getline() bug (H0009)
Tidies up source.
Fixes up copyright notices.
Adds TODO docs for Borland. (Removes "TODO" note)
Small changes to defaults formatting.
Fixes ALT key on Graphical Port non NetHack mode.
Hilites pet in Graphical Port text mode.

Also Implements windowcolors for status and message window in graphical port.
On graphical port,
tested to see it actually works.

Tested on platforms Makefile MSC/BCC Graphical/Console, MSC IDE for
compile and run and performing hilite pet in graphical text, not
displaying rawio, alt key.
2002-03-10 17:41:11 +00:00
nethack.allison
c181ce223c (from <Someone>) 2002-03-09 11:30:26 +00:00
nethack.allison
f4a23fa572 bit 2002-03-09 00:56:39 +00:00
nethack.allison
422e8b22ae winhack.c mods
- change sprintf -> Sprintf macro
- fix sprintf syntax
- point to a www.nethack.org URL, rather than a Microsoft one
2002-03-09 00:43:14 +00:00
nethack.allison
9940848030 follow-up to <Someone>'s patch.
I left a couple of prepanic() calls in there accidentally
when modifying the patch.

Michael
2002-03-07 23:24:11 +00:00
nethack.allison
8a984ed35e (from <Someone>)
Here's a patch that checks whether the common control
library is available and up-to-date

[slightly modified from <Someone>'s version to reduce
 indentation one level, and to fix wrap-around
 in the patch]
2002-03-07 23:09:59 +00:00
nethack.allison
53d5dcf83a Something <Someone> reported. Ensure that an early panic() doesn't
cause an access violation in win32 graphical port.
2002-03-07 21:50:20 +00:00
nethack.allison
7214e1f05c Ensure that each win/win32 source file has a copyright statement
and mentions the NetHack license.
2002-03-06 16:18:27 +00:00
nethack.allison
4494593c30 (from Yitzhak)
win32gui: more splash screen integration

The Makefile have rip.uu/splash.uu added to them.  However, this won't
work if you don't have splash.uu.  Instead, just copy rip.uu or another
.uu and name it splash.uu.  Make expects to have splash.uu present (at
least Borland's make).   It doesn't add splash.uu decoding to the IDE
framework.  It does a bit in winhack.rc and Makefile.bcc to bring
winhack.rc up to sync with Borland's compiler.  If you don't like the
splash screen, then I'll have to redo that part of the patch apart from
the others.
2002-03-04 22:55:45 +00:00
nethack.allison
c0f875710b (from Yitzhak)
Support for a graphical RIP.

-verified for successful source compile and display
of tombstone upon death only.
2002-03-03 16:46:40 +00:00
nethack.allison
3d185eeb87 from <Someone>
Combine the 32x32 icon and the 16x16 icon into a single file.
Clean up the command line argument processing a little.
2002-02-12 23:00:27 +00:00
nethack.allison
5a8cf1c4c1 Some win32 updates from <Someone>;
also corrects a cut-and-paste error that I made in options.c

The following options can be set in the game now:

  WC_HILITE_PET
  WC_ALIGN_MESSAGE
  WC_ALIGN_STATUS
  WC_SCROLL_MARGIN
  WC_MAP_MODE
  WC_FONT_MESSAGE
  WC_FONT_STATUS
  WC_FONT_MENU
  WC_FONT_TEXT
  WC_FONTSIZ_MESSAGE
  WC_FONTSIZ_STATUS
  WC_FONTSIZ_MENU
  WC_FONTSIZ_TEXT
2002-02-08 11:32:56 +00:00
nethack.allison
80a0fbd62b win32 argc fix
fix a problem when NetHack directory contains spaces.
2002-02-08 02:37:08 +00:00
nethack.allison
02e2c671ed Fixes from <Someone>
- added support for new options
- fixed couple of typos in options.c
- added sunken edge around message window
- added capability to replace font in the font table (if we will want to
  change font sizes dynamically later)
2002-02-06 00:15:47 +00:00
nethack.allison
baa752d5f9 <email deleted>
The following fixes several bugs:
1) Mismatch between docs and game in definition of what '+' resolved in
favor of docs...
2) When game needs to be recovered a message box is shown.  This is a very
deprecated fix.  It pretty much answers just the conditions that require
this (a yn question to an erroneous winid), and is not useful for other
purposes.
3) The score file is written.
2002-02-03 17:51:54 +00:00
nethack.allison
6e173ddf5f win32gui patches (from Yitzhak)
[...]
One of them deals with the patch you just sent, that changes the name but
does so more extensively, particularly, also in the Save dialog in
mhmain.c.  Another is one of the changes to winhack.rc to make it compile
under Borland.

This also (beyond patches I sent): fixes no Options prompt bug, and fixes
up the menu bar (which I broke in one of my patches).

Tested on msc/bcc tty/win makefiles and vc ide.
2002-01-27 21:37:31 +00:00
nethack.allison
359957ddbc One of the beta testers asked if the win32 scrolling
offset could be configured.  This allows it to be
set from the config file using:
	win32_map_cliparound_margin.
2002-01-27 04:36:39 +00:00
nethack.allison
7f7c1ff26b FIXES:
- added counting to the menu window. I changed the way it works in the TTY
port though  ("you hear the rumble of distant thunder..." :)  The count
applies to the currently selected item instead of being aplied to the item
to be selected  (in other words a12 instead of 12a). It works better this
way in the graphical port since there is a notion of current menu item.
 I also notes that the count is ignored for PICK_ONE menu - is this by
design?

- somebode mention that text is not scrollable by default - this is fixed.

- fixed player selection dialog to use initXXXX options

-----------------------
B1028 [reported] win32: popup window is too short
The text in the popup window's top line "What do you want to
call the ..." is cut off. Could the window be bigger, so you
can read the entire line?

Fixed.

---------------------
B1027 [reported] win32: select via traditional class char
In a shop (and perhaps elsewhere), I can autoselect a class of
items to drop: a for all types, b for coins, c for weapons, ...,
A for every item, B for blessed items, ... I like the new
possibilities, but I would like to be able to use the old way of
using ! for potions, ) for weapons, etc., as well.

Fixed.

---------------------
B1026 [reported] win32: setting multiple options

I want to set packorder and pickup_types. The first comes up
first, and I type in the order. Then comes the second, without
any hint what is asked of me. A little explanation here would
be appropriate, like "pick up what things automatically?" or
somesuch. When more than one option is set where extra input
is required, some explanation is useful.

Looking into. Apparently something  end_menu() call is ignored by nethackw.

---------------------
B1025 [reported] win32: menu navigation
I press O. Now, when I press "a" to turn on "autodig", not only
is the mark set at "a", but there also appears a dotted
rectangle around option "A" (capitalized). Shouldn't this
rectangle also appear at "a"? Pressing "a" repeatedly toggles
the checkmark, but the rectangle switches between "A" and "a".
My CAPS LOCK is not set. The same goes for B, C, D, ... N,
by the way. Pressing "A" works the other way around: the first
press checks "A" and "rectangles" "a", the next unchecks "A"
and rectangles "A" as well.

Fixed.

---------------------
B1024 [reported] win32: no text in final window
After I clicked away the last screen with information
(challenges, I believe it was), I got an empty text screen, as
big as my screen, without any content. It looked like the text
screens that appear on the right, only it was larger and had
only a large OK button over the full width of the window, and
no cancel button. Why this window?

Fixed. The program did not set window text for RIP window.

---------------------
B1010 [known issue] win32: cosmetic
When I get my list of spells, the columns aren't properly
aligned: if the spell name is longer, the rest of the line
shifts right.

Fixed. Fixed-pitch font is used for menu window.

---------------------
B1004 [reported] win32: numeric keyboard Del/.-key
The Del/.-key on my numeric keyboard doesn't make me rest a turn

Fixed. Added rest on Del.

---------------------
B1003 [reported] win32: focus
When the window has the focus, the window bar isn't highlighted.

This is by design. Menu and text widnows are popup and the main
window is disabled when they are up.
2002-01-25 07:19:21 +00:00
nethack.allison
7406ad3855 Windows Me and Windows XP. 2002-01-25 01:54:44 +00:00
nethack.allison
f48b00f5f5 It was ignoring the command line parameters
because there was an extraneous argv[1] that was
a repeat of the module name, but in quotation
marks.  The processing in pcmain stops on the first
argument that doesn't start with '-' so my other
arguments got ignored.

 argv[0] 0x00b40800 "C:\test\binary\nethackw.exe"
 argv[1] 0x00b40878 ""C:\test\binary\nethackw.exe""
 argv[2] 0x00b408f0 "-uwizard"
 argv[3] 0x00b40938 "-D"
2002-01-23 00:00:02 +00:00
nethack.allison
2d5361e389 From <Someone>,
Fixes:
- menu shortcuts implemented
- most windows close on space (except for menus with
  PICK_ANY style)
- "hilite_pet" option is implemented
- map scrolling is improved somewhat (it now scrolls if
  the char is within 5 spaces from the edge of the map -
  configurable by #define CLIPAROUND_MARGIN)
- added 3  winhack-specific options:

 win32_map_mode:[tiles|ascii4x6|ascii6x8|ascii8x8
                 |ascii16x8|ascii7x12|ascii8x12|ascii15x12
                 |ascii12x16|ascii10x18|fit_to_screen]=20
 win32_align_status:[left|top|right|bottom]
 win32_align_message:[left|top|right|bottom]

Note: aligning status window to left or right edge of the screen does
not look good.
2002-01-22 00:30:58 +00:00
nethack.allison
35b46238fc From <Someone>: a couple of improvements to the user interface:
- fixed charset value for fonts
- wrap long lines in the message window (there is a #define to switch it on and off)
- multiple display modes for map
2002-01-18 00:42:04 +00:00
nethack.allison
b79441dc5d Add WinHack source files to distribution 2002-01-13 05:27:55 +00:00