MCPcopy Create free account
hub / github.com/NetHack/NetHack / NetHackQtSettings

Method NetHackQtSettings

outdated/win/Qt3/qt3_win.cpp:621–723  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

619" . XX "};
620
621NetHackQtSettings::NetHackQtSettings(int w, int h) :
622 tilewidth(TILEWMIN,64,1,this),
623 tileheight(TILEHMIN,64,1,this),
624 widthlbl(&tilewidth,"&Width:",this),
625 heightlbl(&tileheight,"&Height:",this),
626 whichsize("&Zoomed",this),
627 fontsize(this),
628 normal("times"),
629#ifdef WS_WIN
630 normalfixed("courier new"),
631#else
632 normalfixed("fixed"),
633#endif
634 large("times"),
635 theglyphs(0)
636
637{
638 int default_fontsize;
639
640 if (w<=300) {
641 // ~240x320
642 default_fontsize=4;
643 tilewidth.setValue(8);
644 tileheight.setValue(12);
645 } else if (w<=700) {
646 // ~640x480
647 default_fontsize=3;
648 tilewidth.setValue(8);
649 tileheight.setValue(14);
650 } else if (w<=900) {
651 // ~800x600
652 default_fontsize=3;
653 tilewidth.setValue(10);
654 tileheight.setValue(17);
655 } else if (w<=1100) {
656 // ~1024x768
657 default_fontsize=2;
658 tilewidth.setValue(12);
659 tileheight.setValue(22);
660 } else if (w<=1200) {
661 // ~1152x900
662 default_fontsize=1;
663 tilewidth.setValue(14);
664 tileheight.setValue(26);
665 } else {
666 // ~1280x1024 and larger
667 default_fontsize=0;
668 tilewidth.setValue(16);
669 tileheight.setValue(30);
670 }
671
672 // Tile/font sizes read from .nethackrc
673 if (qt_tilewidth != NULL) {
674 tilewidth.setValue(atoi(qt_tilewidth));
675 free(qt_tilewidth);
676 }
677 if (qt_tileheight != NULL) {
678 tileheight.setValue(atoi(qt_tileheight));

Callers

nothing calls this directly

Calls 1

insertItemMethod · 0.80

Tested by

no test coverage detected