From ed607a625913cd175f0d12f5c2c5f911769fcdad Mon Sep 17 00:00:00 2001 From: Michael Mc Donnell Date: Wed, 22 Aug 2012 15:00:07 -0400 Subject: [PATCH 01/29] Use char literals in UTF 8 conversion to fix 798 warnings The data type is specified as char but the literals are unsigned char. This results in 798 truncation warnings in vs2010. The literals were converted with a simple python script to signed char while taking two's complement and the overflow into account. --- components/to_utf8/tables_gen.hpp | 1536 ++++++++++++++--------------- 1 file changed, 768 insertions(+), 768 deletions(-) diff --git a/components/to_utf8/tables_gen.hpp b/components/to_utf8/tables_gen.hpp index 1084ca28f..9c32f0427 100644 --- a/components/to_utf8/tables_gen.hpp +++ b/components/to_utf8/tables_gen.hpp @@ -10,785 +10,785 @@ namespace ToUTF8 /// Serbian (Latin script), Romanian and Albanian. static char windows_1250[] = { - (char)0x1, (char)0x0, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x1, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x2, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x3, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x4, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x5, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x6, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x7, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x8, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x9, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0xa, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0xb, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0xc, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0xd, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0xe, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0xf, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x10, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x11, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x12, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x13, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x14, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x15, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x16, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x17, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x18, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x19, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x1a, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x1b, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x1c, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x1d, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x1e, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x1f, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x20, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x21, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x22, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x23, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x24, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x25, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x26, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x27, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x28, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x29, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x2a, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x2b, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x2c, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x2d, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x2e, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x2f, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x30, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x31, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x32, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x33, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x34, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x35, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x36, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x37, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x38, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x39, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x3a, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x3b, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x3c, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x3d, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x3e, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x3f, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x40, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x41, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x42, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x43, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x44, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x45, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x46, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x47, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x48, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x49, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x4a, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x4b, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x4c, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x4d, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x4e, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x4f, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x50, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x51, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x52, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x53, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x54, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x55, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x56, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x57, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x58, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x59, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x5a, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x5b, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x5c, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x5d, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x5e, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x5f, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x60, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x61, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x62, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x63, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x64, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x65, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x66, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x67, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x68, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x69, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x6a, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x6b, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x6c, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x6d, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x6e, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x6f, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x70, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x71, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x72, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x73, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x74, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x75, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x76, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x77, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x78, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x79, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x7a, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x7b, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x7c, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x7d, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x7e, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x7f, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x82, (char)0xac, (char)0x0, (char)0x0, - (char)0x1, (char)0x20, (char)0x0, (char)0x0, (char)0x0, (char)0x0, // not part of this charset - (char)0x3, (char)0xe2, (char)0x80, (char)0x9a, (char)0x0, (char)0x0, - (char)0x1, (char)0x20, (char)0x0, (char)0x0, (char)0x0, (char)0x0, // not part of this charset - (char)0x3, (char)0xe2, (char)0x80, (char)0x9e, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0xa6, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0xa0, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0xa1, (char)0x0, (char)0x0, - (char)0x1, (char)0x20, (char)0x0, (char)0x0, (char)0x0, (char)0x0, // not part of this charset - (char)0x3, (char)0xe2, (char)0x80, (char)0xb0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0xa0, (char)0x0, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0xb9, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0x9a, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0xa4, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0xbd, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0xb9, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x20, (char)0x0, (char)0x0, (char)0x0, (char)0x0, // not part of this charset - (char)0x3, (char)0xe2, (char)0x80, (char)0x98, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0x99, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0x9c, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0x9d, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0xa2, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0x93, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0x94, (char)0x0, (char)0x0, - (char)0x1, (char)0x20, (char)0x0, (char)0x0, (char)0x0, (char)0x0, // not part of this charset - (char)0x3, (char)0xe2, (char)0x84, (char)0xa2, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0xa1, (char)0x0, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0xba, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0x9b, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0xa5, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0xbe, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0xba, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xa0, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xcb, (char)0x87, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xcb, (char)0x98, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0x81, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xa4, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc4, (char)0x84, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xa6, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xa7, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xa8, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xa9, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0x9e, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xab, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xac, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xad, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xae, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0xbb, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xb0, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xb1, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xcb, (char)0x9b, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0x82, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xb4, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xb5, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xb6, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xb7, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xb8, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc4, (char)0x85, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0x9f, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xbb, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc4, (char)0xbd, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xcb, (char)0x9d, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc4, (char)0xbe, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0xbc, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0x94, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x81, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x82, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc4, (char)0x82, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x84, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc4, (char)0xb9, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc4, (char)0x86, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x87, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc4, (char)0x8c, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x89, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc4, (char)0x98, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x8b, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc4, (char)0x9a, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x8d, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x8e, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc4, (char)0x8e, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc4, (char)0x90, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0x83, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0x87, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x93, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x94, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0x90, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x96, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x97, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0x98, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0xae, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x9a, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0xb0, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x9c, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x9d, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0xa2, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x9f, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0x95, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xa1, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xa2, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc4, (char)0x83, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xa4, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc4, (char)0xba, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc4, (char)0x87, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xa7, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc4, (char)0x8d, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xa9, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc4, (char)0x99, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xab, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc4, (char)0x9b, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xad, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xae, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc4, (char)0x8f, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc4, (char)0x91, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0x84, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0x88, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xb3, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xb4, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0x91, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xb6, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xb7, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0x99, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0xaf, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xba, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0xb1, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xbc, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xbd, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0xa3, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xcb, (char)0x99, (char)0x0, (char)0x0, (char)0x0 + 1, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, + 1, 2, 0, 0, 0, 0, + 1, 3, 0, 0, 0, 0, + 1, 4, 0, 0, 0, 0, + 1, 5, 0, 0, 0, 0, + 1, 6, 0, 0, 0, 0, + 1, 7, 0, 0, 0, 0, + 1, 8, 0, 0, 0, 0, + 1, 9, 0, 0, 0, 0, + 1, 10, 0, 0, 0, 0, + 1, 11, 0, 0, 0, 0, + 1, 12, 0, 0, 0, 0, + 1, 13, 0, 0, 0, 0, + 1, 14, 0, 0, 0, 0, + 1, 15, 0, 0, 0, 0, + 1, 16, 0, 0, 0, 0, + 1, 17, 0, 0, 0, 0, + 1, 18, 0, 0, 0, 0, + 1, 19, 0, 0, 0, 0, + 1, 20, 0, 0, 0, 0, + 1, 21, 0, 0, 0, 0, + 1, 22, 0, 0, 0, 0, + 1, 23, 0, 0, 0, 0, + 1, 24, 0, 0, 0, 0, + 1, 25, 0, 0, 0, 0, + 1, 26, 0, 0, 0, 0, + 1, 27, 0, 0, 0, 0, + 1, 28, 0, 0, 0, 0, + 1, 29, 0, 0, 0, 0, + 1, 30, 0, 0, 0, 0, + 1, 31, 0, 0, 0, 0, + 1, 32, 0, 0, 0, 0, + 1, 33, 0, 0, 0, 0, + 1, 34, 0, 0, 0, 0, + 1, 35, 0, 0, 0, 0, + 1, 36, 0, 0, 0, 0, + 1, 37, 0, 0, 0, 0, + 1, 38, 0, 0, 0, 0, + 1, 39, 0, 0, 0, 0, + 1, 40, 0, 0, 0, 0, + 1, 41, 0, 0, 0, 0, + 1, 42, 0, 0, 0, 0, + 1, 43, 0, 0, 0, 0, + 1, 44, 0, 0, 0, 0, + 1, 45, 0, 0, 0, 0, + 1, 46, 0, 0, 0, 0, + 1, 47, 0, 0, 0, 0, + 1, 48, 0, 0, 0, 0, + 1, 49, 0, 0, 0, 0, + 1, 50, 0, 0, 0, 0, + 1, 51, 0, 0, 0, 0, + 1, 52, 0, 0, 0, 0, + 1, 53, 0, 0, 0, 0, + 1, 54, 0, 0, 0, 0, + 1, 55, 0, 0, 0, 0, + 1, 56, 0, 0, 0, 0, + 1, 57, 0, 0, 0, 0, + 1, 58, 0, 0, 0, 0, + 1, 59, 0, 0, 0, 0, + 1, 60, 0, 0, 0, 0, + 1, 61, 0, 0, 0, 0, + 1, 62, 0, 0, 0, 0, + 1, 63, 0, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 1, 65, 0, 0, 0, 0, + 1, 66, 0, 0, 0, 0, + 1, 67, 0, 0, 0, 0, + 1, 68, 0, 0, 0, 0, + 1, 69, 0, 0, 0, 0, + 1, 70, 0, 0, 0, 0, + 1, 71, 0, 0, 0, 0, + 1, 72, 0, 0, 0, 0, + 1, 73, 0, 0, 0, 0, + 1, 74, 0, 0, 0, 0, + 1, 75, 0, 0, 0, 0, + 1, 76, 0, 0, 0, 0, + 1, 77, 0, 0, 0, 0, + 1, 78, 0, 0, 0, 0, + 1, 79, 0, 0, 0, 0, + 1, 80, 0, 0, 0, 0, + 1, 81, 0, 0, 0, 0, + 1, 82, 0, 0, 0, 0, + 1, 83, 0, 0, 0, 0, + 1, 84, 0, 0, 0, 0, + 1, 85, 0, 0, 0, 0, + 1, 86, 0, 0, 0, 0, + 1, 87, 0, 0, 0, 0, + 1, 88, 0, 0, 0, 0, + 1, 89, 0, 0, 0, 0, + 1, 90, 0, 0, 0, 0, + 1, 91, 0, 0, 0, 0, + 1, 92, 0, 0, 0, 0, + 1, 93, 0, 0, 0, 0, + 1, 94, 0, 0, 0, 0, + 1, 95, 0, 0, 0, 0, + 1, 96, 0, 0, 0, 0, + 1, 97, 0, 0, 0, 0, + 1, 98, 0, 0, 0, 0, + 1, 99, 0, 0, 0, 0, + 1, 100, 0, 0, 0, 0, + 1, 101, 0, 0, 0, 0, + 1, 102, 0, 0, 0, 0, + 1, 103, 0, 0, 0, 0, + 1, 104, 0, 0, 0, 0, + 1, 105, 0, 0, 0, 0, + 1, 106, 0, 0, 0, 0, + 1, 107, 0, 0, 0, 0, + 1, 108, 0, 0, 0, 0, + 1, 109, 0, 0, 0, 0, + 1, 110, 0, 0, 0, 0, + 1, 111, 0, 0, 0, 0, + 1, 112, 0, 0, 0, 0, + 1, 113, 0, 0, 0, 0, + 1, 114, 0, 0, 0, 0, + 1, 115, 0, 0, 0, 0, + 1, 116, 0, 0, 0, 0, + 1, 117, 0, 0, 0, 0, + 1, 118, 0, 0, 0, 0, + 1, 119, 0, 0, 0, 0, + 1, 120, 0, 0, 0, 0, + 1, 121, 0, 0, 0, 0, + 1, 122, 0, 0, 0, 0, + 1, 123, 0, 0, 0, 0, + 1, 124, 0, 0, 0, 0, + 1, 125, 0, 0, 0, 0, + 1, 126, 0, 0, 0, 0, + 1, 127, 0, 0, 0, 0, + 3, -30, -126, -84, 0, 0, + 1, 32, 0, 0, 0, 0, // not part of this charset + 3, -30, -128, -102, 0, 0, + 1, 32, 0, 0, 0, 0, // not part of this charset + 3, -30, -128, -98, 0, 0, + 3, -30, -128, -90, 0, 0, + 3, -30, -128, -96, 0, 0, + 3, -30, -128, -95, 0, 0, + 1, 32, 0, 0, 0, 0, // not part of this charset + 3, -30, -128, -80, 0, 0, + 2, -59, -96, 0, 0, 0, + 3, -30, -128, -71, 0, 0, + 2, -59, -102, 0, 0, 0, + 2, -59, -92, 0, 0, 0, + 2, -59, -67, 0, 0, 0, + 2, -59, -71, 0, 0, 0, + 1, 32, 0, 0, 0, 0, // not part of this charset + 3, -30, -128, -104, 0, 0, + 3, -30, -128, -103, 0, 0, + 3, -30, -128, -100, 0, 0, + 3, -30, -128, -99, 0, 0, + 3, -30, -128, -94, 0, 0, + 3, -30, -128, -109, 0, 0, + 3, -30, -128, -108, 0, 0, + 1, 32, 0, 0, 0, 0, // not part of this charset + 3, -30, -124, -94, 0, 0, + 2, -59, -95, 0, 0, 0, + 3, -30, -128, -70, 0, 0, + 2, -59, -101, 0, 0, 0, + 2, -59, -91, 0, 0, 0, + 2, -59, -66, 0, 0, 0, + 2, -59, -70, 0, 0, 0, + 2, -62, -96, 0, 0, 0, + 2, -53, -121, 0, 0, 0, + 2, -53, -104, 0, 0, 0, + 2, -59, -127, 0, 0, 0, + 2, -62, -92, 0, 0, 0, + 2, -60, -124, 0, 0, 0, + 2, -62, -90, 0, 0, 0, + 2, -62, -89, 0, 0, 0, + 2, -62, -88, 0, 0, 0, + 2, -62, -87, 0, 0, 0, + 2, -59, -98, 0, 0, 0, + 2, -62, -85, 0, 0, 0, + 2, -62, -84, 0, 0, 0, + 2, -62, -83, 0, 0, 0, + 2, -62, -82, 0, 0, 0, + 2, -59, -69, 0, 0, 0, + 2, -62, -80, 0, 0, 0, + 2, -62, -79, 0, 0, 0, + 2, -53, -101, 0, 0, 0, + 2, -59, -126, 0, 0, 0, + 2, -62, -76, 0, 0, 0, + 2, -62, -75, 0, 0, 0, + 2, -62, -74, 0, 0, 0, + 2, -62, -73, 0, 0, 0, + 2, -62, -72, 0, 0, 0, + 2, -60, -123, 0, 0, 0, + 2, -59, -97, 0, 0, 0, + 2, -62, -69, 0, 0, 0, + 2, -60, -67, 0, 0, 0, + 2, -53, -99, 0, 0, 0, + 2, -60, -66, 0, 0, 0, + 2, -59, -68, 0, 0, 0, + 2, -59, -108, 0, 0, 0, + 2, -61, -127, 0, 0, 0, + 2, -61, -126, 0, 0, 0, + 2, -60, -126, 0, 0, 0, + 2, -61, -124, 0, 0, 0, + 2, -60, -71, 0, 0, 0, + 2, -60, -122, 0, 0, 0, + 2, -61, -121, 0, 0, 0, + 2, -60, -116, 0, 0, 0, + 2, -61, -119, 0, 0, 0, + 2, -60, -104, 0, 0, 0, + 2, -61, -117, 0, 0, 0, + 2, -60, -102, 0, 0, 0, + 2, -61, -115, 0, 0, 0, + 2, -61, -114, 0, 0, 0, + 2, -60, -114, 0, 0, 0, + 2, -60, -112, 0, 0, 0, + 2, -59, -125, 0, 0, 0, + 2, -59, -121, 0, 0, 0, + 2, -61, -109, 0, 0, 0, + 2, -61, -108, 0, 0, 0, + 2, -59, -112, 0, 0, 0, + 2, -61, -106, 0, 0, 0, + 2, -61, -105, 0, 0, 0, + 2, -59, -104, 0, 0, 0, + 2, -59, -82, 0, 0, 0, + 2, -61, -102, 0, 0, 0, + 2, -59, -80, 0, 0, 0, + 2, -61, -100, 0, 0, 0, + 2, -61, -99, 0, 0, 0, + 2, -59, -94, 0, 0, 0, + 2, -61, -97, 0, 0, 0, + 2, -59, -107, 0, 0, 0, + 2, -61, -95, 0, 0, 0, + 2, -61, -94, 0, 0, 0, + 2, -60, -125, 0, 0, 0, + 2, -61, -92, 0, 0, 0, + 2, -60, -70, 0, 0, 0, + 2, -60, -121, 0, 0, 0, + 2, -61, -89, 0, 0, 0, + 2, -60, -115, 0, 0, 0, + 2, -61, -87, 0, 0, 0, + 2, -60, -103, 0, 0, 0, + 2, -61, -85, 0, 0, 0, + 2, -60, -101, 0, 0, 0, + 2, -61, -83, 0, 0, 0, + 2, -61, -82, 0, 0, 0, + 2, -60, -113, 0, 0, 0, + 2, -60, -111, 0, 0, 0, + 2, -59, -124, 0, 0, 0, + 2, -59, -120, 0, 0, 0, + 2, -61, -77, 0, 0, 0, + 2, -61, -76, 0, 0, 0, + 2, -59, -111, 0, 0, 0, + 2, -61, -74, 0, 0, 0, + 2, -61, -73, 0, 0, 0, + 2, -59, -103, 0, 0, 0, + 2, -59, -81, 0, 0, 0, + 2, -61, -70, 0, 0, 0, + 2, -59, -79, 0, 0, 0, + 2, -61, -68, 0, 0, 0, + 2, -61, -67, 0, 0, 0, + 2, -59, -93, 0, 0, 0, + 2, -53, -103, 0, 0, 0 }; /// Cyrillic alphabet such as Russian, Bulgarian, Serbian Cyrillic /// and other languages static char windows_1251[] = { - (char)0x1, (char)0x0, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x1, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x2, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x3, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x4, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x5, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x6, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x7, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x8, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x9, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0xa, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0xb, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0xc, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0xd, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0xe, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0xf, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x10, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x11, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x12, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x13, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x14, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x15, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x16, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x17, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x18, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x19, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x1a, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x1b, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x1c, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x1d, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x1e, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x1f, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x20, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x21, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x22, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x23, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x24, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x25, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x26, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x27, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x28, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x29, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x2a, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x2b, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x2c, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x2d, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x2e, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x2f, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x30, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x31, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x32, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x33, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x34, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x35, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x36, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x37, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x38, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x39, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x3a, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x3b, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x3c, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x3d, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x3e, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x3f, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x40, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x41, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x42, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x43, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x44, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x45, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x46, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x47, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x48, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x49, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x4a, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x4b, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x4c, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x4d, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x4e, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x4f, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x50, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x51, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x52, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x53, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x54, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x55, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x56, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x57, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x58, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x59, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x5a, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x5b, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x5c, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x5d, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x5e, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x5f, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x60, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x61, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x62, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x63, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x64, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x65, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x66, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x67, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x68, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x69, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x6a, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x6b, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x6c, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x6d, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x6e, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x6f, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x70, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x71, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x72, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x73, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x74, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x75, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x76, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x77, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x78, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x79, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x7a, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x7b, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x7c, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x7d, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x7e, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x7f, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x82, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x83, (char)0x0, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0x9a, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x93, (char)0x0, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0x9e, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0xa6, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0xa0, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0xa1, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x82, (char)0xac, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0xb0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x89, (char)0x0, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0xb9, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x8a, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x8c, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x8b, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x8f, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x92, (char)0x0, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0x98, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0x99, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0x9c, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0x9d, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0xa2, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0x93, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0x94, (char)0x0, (char)0x0, - (char)0x1, (char)0x20, (char)0x0, (char)0x0, (char)0x0, (char)0x0, // not part of this charset - (char)0x3, (char)0xe2, (char)0x84, (char)0xa2, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x99, (char)0x0, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0xba, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x9a, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x9c, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x9b, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x9f, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xa0, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x8e, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x9e, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x88, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xa4, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd2, (char)0x90, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xa6, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xa7, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x81, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xa9, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x84, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xab, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xac, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xad, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xae, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x87, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xb0, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xb1, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x86, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x96, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd2, (char)0x91, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xb5, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xb6, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xb7, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x91, (char)0x0, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x84, (char)0x96, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x94, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xbb, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x98, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x85, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x95, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x97, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x90, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x91, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x92, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x93, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x94, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x95, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x96, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x97, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x98, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x99, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x9a, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x9b, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x9c, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x9d, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x9e, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0x9f, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xa0, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xa1, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xa2, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xa3, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xa4, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xa5, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xa6, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xa7, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xa8, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xa9, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xaa, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xab, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xac, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xad, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xae, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xaf, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xb0, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xb1, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xb2, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xb3, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xb4, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xb5, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xb6, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xb7, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xb8, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xb9, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xba, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xbb, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xbc, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xbd, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xbe, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd0, (char)0xbf, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x80, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x81, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x82, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x83, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x84, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x85, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x86, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x87, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x88, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x89, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x8a, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x8b, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x8c, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x8d, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x8e, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xd1, (char)0x8f, (char)0x0, (char)0x0, (char)0x0 + 1, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, + 1, 2, 0, 0, 0, 0, + 1, 3, 0, 0, 0, 0, + 1, 4, 0, 0, 0, 0, + 1, 5, 0, 0, 0, 0, + 1, 6, 0, 0, 0, 0, + 1, 7, 0, 0, 0, 0, + 1, 8, 0, 0, 0, 0, + 1, 9, 0, 0, 0, 0, + 1, 10, 0, 0, 0, 0, + 1, 11, 0, 0, 0, 0, + 1, 12, 0, 0, 0, 0, + 1, 13, 0, 0, 0, 0, + 1, 14, 0, 0, 0, 0, + 1, 15, 0, 0, 0, 0, + 1, 16, 0, 0, 0, 0, + 1, 17, 0, 0, 0, 0, + 1, 18, 0, 0, 0, 0, + 1, 19, 0, 0, 0, 0, + 1, 20, 0, 0, 0, 0, + 1, 21, 0, 0, 0, 0, + 1, 22, 0, 0, 0, 0, + 1, 23, 0, 0, 0, 0, + 1, 24, 0, 0, 0, 0, + 1, 25, 0, 0, 0, 0, + 1, 26, 0, 0, 0, 0, + 1, 27, 0, 0, 0, 0, + 1, 28, 0, 0, 0, 0, + 1, 29, 0, 0, 0, 0, + 1, 30, 0, 0, 0, 0, + 1, 31, 0, 0, 0, 0, + 1, 32, 0, 0, 0, 0, + 1, 33, 0, 0, 0, 0, + 1, 34, 0, 0, 0, 0, + 1, 35, 0, 0, 0, 0, + 1, 36, 0, 0, 0, 0, + 1, 37, 0, 0, 0, 0, + 1, 38, 0, 0, 0, 0, + 1, 39, 0, 0, 0, 0, + 1, 40, 0, 0, 0, 0, + 1, 41, 0, 0, 0, 0, + 1, 42, 0, 0, 0, 0, + 1, 43, 0, 0, 0, 0, + 1, 44, 0, 0, 0, 0, + 1, 45, 0, 0, 0, 0, + 1, 46, 0, 0, 0, 0, + 1, 47, 0, 0, 0, 0, + 1, 48, 0, 0, 0, 0, + 1, 49, 0, 0, 0, 0, + 1, 50, 0, 0, 0, 0, + 1, 51, 0, 0, 0, 0, + 1, 52, 0, 0, 0, 0, + 1, 53, 0, 0, 0, 0, + 1, 54, 0, 0, 0, 0, + 1, 55, 0, 0, 0, 0, + 1, 56, 0, 0, 0, 0, + 1, 57, 0, 0, 0, 0, + 1, 58, 0, 0, 0, 0, + 1, 59, 0, 0, 0, 0, + 1, 60, 0, 0, 0, 0, + 1, 61, 0, 0, 0, 0, + 1, 62, 0, 0, 0, 0, + 1, 63, 0, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 1, 65, 0, 0, 0, 0, + 1, 66, 0, 0, 0, 0, + 1, 67, 0, 0, 0, 0, + 1, 68, 0, 0, 0, 0, + 1, 69, 0, 0, 0, 0, + 1, 70, 0, 0, 0, 0, + 1, 71, 0, 0, 0, 0, + 1, 72, 0, 0, 0, 0, + 1, 73, 0, 0, 0, 0, + 1, 74, 0, 0, 0, 0, + 1, 75, 0, 0, 0, 0, + 1, 76, 0, 0, 0, 0, + 1, 77, 0, 0, 0, 0, + 1, 78, 0, 0, 0, 0, + 1, 79, 0, 0, 0, 0, + 1, 80, 0, 0, 0, 0, + 1, 81, 0, 0, 0, 0, + 1, 82, 0, 0, 0, 0, + 1, 83, 0, 0, 0, 0, + 1, 84, 0, 0, 0, 0, + 1, 85, 0, 0, 0, 0, + 1, 86, 0, 0, 0, 0, + 1, 87, 0, 0, 0, 0, + 1, 88, 0, 0, 0, 0, + 1, 89, 0, 0, 0, 0, + 1, 90, 0, 0, 0, 0, + 1, 91, 0, 0, 0, 0, + 1, 92, 0, 0, 0, 0, + 1, 93, 0, 0, 0, 0, + 1, 94, 0, 0, 0, 0, + 1, 95, 0, 0, 0, 0, + 1, 96, 0, 0, 0, 0, + 1, 97, 0, 0, 0, 0, + 1, 98, 0, 0, 0, 0, + 1, 99, 0, 0, 0, 0, + 1, 100, 0, 0, 0, 0, + 1, 101, 0, 0, 0, 0, + 1, 102, 0, 0, 0, 0, + 1, 103, 0, 0, 0, 0, + 1, 104, 0, 0, 0, 0, + 1, 105, 0, 0, 0, 0, + 1, 106, 0, 0, 0, 0, + 1, 107, 0, 0, 0, 0, + 1, 108, 0, 0, 0, 0, + 1, 109, 0, 0, 0, 0, + 1, 110, 0, 0, 0, 0, + 1, 111, 0, 0, 0, 0, + 1, 112, 0, 0, 0, 0, + 1, 113, 0, 0, 0, 0, + 1, 114, 0, 0, 0, 0, + 1, 115, 0, 0, 0, 0, + 1, 116, 0, 0, 0, 0, + 1, 117, 0, 0, 0, 0, + 1, 118, 0, 0, 0, 0, + 1, 119, 0, 0, 0, 0, + 1, 120, 0, 0, 0, 0, + 1, 121, 0, 0, 0, 0, + 1, 122, 0, 0, 0, 0, + 1, 123, 0, 0, 0, 0, + 1, 124, 0, 0, 0, 0, + 1, 125, 0, 0, 0, 0, + 1, 126, 0, 0, 0, 0, + 1, 127, 0, 0, 0, 0, + 2, -48, -126, 0, 0, 0, + 2, -48, -125, 0, 0, 0, + 3, -30, -128, -102, 0, 0, + 2, -47, -109, 0, 0, 0, + 3, -30, -128, -98, 0, 0, + 3, -30, -128, -90, 0, 0, + 3, -30, -128, -96, 0, 0, + 3, -30, -128, -95, 0, 0, + 3, -30, -126, -84, 0, 0, + 3, -30, -128, -80, 0, 0, + 2, -48, -119, 0, 0, 0, + 3, -30, -128, -71, 0, 0, + 2, -48, -118, 0, 0, 0, + 2, -48, -116, 0, 0, 0, + 2, -48, -117, 0, 0, 0, + 2, -48, -113, 0, 0, 0, + 2, -47, -110, 0, 0, 0, + 3, -30, -128, -104, 0, 0, + 3, -30, -128, -103, 0, 0, + 3, -30, -128, -100, 0, 0, + 3, -30, -128, -99, 0, 0, + 3, -30, -128, -94, 0, 0, + 3, -30, -128, -109, 0, 0, + 3, -30, -128, -108, 0, 0, + 1, 32, 0, 0, 0, 0, // not part of this charset + 3, -30, -124, -94, 0, 0, + 2, -47, -103, 0, 0, 0, + 3, -30, -128, -70, 0, 0, + 2, -47, -102, 0, 0, 0, + 2, -47, -100, 0, 0, 0, + 2, -47, -101, 0, 0, 0, + 2, -47, -97, 0, 0, 0, + 2, -62, -96, 0, 0, 0, + 2, -48, -114, 0, 0, 0, + 2, -47, -98, 0, 0, 0, + 2, -48, -120, 0, 0, 0, + 2, -62, -92, 0, 0, 0, + 2, -46, -112, 0, 0, 0, + 2, -62, -90, 0, 0, 0, + 2, -62, -89, 0, 0, 0, + 2, -48, -127, 0, 0, 0, + 2, -62, -87, 0, 0, 0, + 2, -48, -124, 0, 0, 0, + 2, -62, -85, 0, 0, 0, + 2, -62, -84, 0, 0, 0, + 2, -62, -83, 0, 0, 0, + 2, -62, -82, 0, 0, 0, + 2, -48, -121, 0, 0, 0, + 2, -62, -80, 0, 0, 0, + 2, -62, -79, 0, 0, 0, + 2, -48, -122, 0, 0, 0, + 2, -47, -106, 0, 0, 0, + 2, -46, -111, 0, 0, 0, + 2, -62, -75, 0, 0, 0, + 2, -62, -74, 0, 0, 0, + 2, -62, -73, 0, 0, 0, + 2, -47, -111, 0, 0, 0, + 3, -30, -124, -106, 0, 0, + 2, -47, -108, 0, 0, 0, + 2, -62, -69, 0, 0, 0, + 2, -47, -104, 0, 0, 0, + 2, -48, -123, 0, 0, 0, + 2, -47, -107, 0, 0, 0, + 2, -47, -105, 0, 0, 0, + 2, -48, -112, 0, 0, 0, + 2, -48, -111, 0, 0, 0, + 2, -48, -110, 0, 0, 0, + 2, -48, -109, 0, 0, 0, + 2, -48, -108, 0, 0, 0, + 2, -48, -107, 0, 0, 0, + 2, -48, -106, 0, 0, 0, + 2, -48, -105, 0, 0, 0, + 2, -48, -104, 0, 0, 0, + 2, -48, -103, 0, 0, 0, + 2, -48, -102, 0, 0, 0, + 2, -48, -101, 0, 0, 0, + 2, -48, -100, 0, 0, 0, + 2, -48, -99, 0, 0, 0, + 2, -48, -98, 0, 0, 0, + 2, -48, -97, 0, 0, 0, + 2, -48, -96, 0, 0, 0, + 2, -48, -95, 0, 0, 0, + 2, -48, -94, 0, 0, 0, + 2, -48, -93, 0, 0, 0, + 2, -48, -92, 0, 0, 0, + 2, -48, -91, 0, 0, 0, + 2, -48, -90, 0, 0, 0, + 2, -48, -89, 0, 0, 0, + 2, -48, -88, 0, 0, 0, + 2, -48, -87, 0, 0, 0, + 2, -48, -86, 0, 0, 0, + 2, -48, -85, 0, 0, 0, + 2, -48, -84, 0, 0, 0, + 2, -48, -83, 0, 0, 0, + 2, -48, -82, 0, 0, 0, + 2, -48, -81, 0, 0, 0, + 2, -48, -80, 0, 0, 0, + 2, -48, -79, 0, 0, 0, + 2, -48, -78, 0, 0, 0, + 2, -48, -77, 0, 0, 0, + 2, -48, -76, 0, 0, 0, + 2, -48, -75, 0, 0, 0, + 2, -48, -74, 0, 0, 0, + 2, -48, -73, 0, 0, 0, + 2, -48, -72, 0, 0, 0, + 2, -48, -71, 0, 0, 0, + 2, -48, -70, 0, 0, 0, + 2, -48, -69, 0, 0, 0, + 2, -48, -68, 0, 0, 0, + 2, -48, -67, 0, 0, 0, + 2, -48, -66, 0, 0, 0, + 2, -48, -65, 0, 0, 0, + 2, -47, -128, 0, 0, 0, + 2, -47, -127, 0, 0, 0, + 2, -47, -126, 0, 0, 0, + 2, -47, -125, 0, 0, 0, + 2, -47, -124, 0, 0, 0, + 2, -47, -123, 0, 0, 0, + 2, -47, -122, 0, 0, 0, + 2, -47, -121, 0, 0, 0, + 2, -47, -120, 0, 0, 0, + 2, -47, -119, 0, 0, 0, + 2, -47, -118, 0, 0, 0, + 2, -47, -117, 0, 0, 0, + 2, -47, -116, 0, 0, 0, + 2, -47, -115, 0, 0, 0, + 2, -47, -114, 0, 0, 0, + 2, -47, -113, 0, 0, 0 }; /// Latin alphabet used by English and some other Western languages static char windows_1252[] = { - (char)0x1, (char)0x0, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x1, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x2, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x3, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x4, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x5, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x6, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x7, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x8, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x9, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0xa, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0xb, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0xc, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0xd, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0xe, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0xf, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x10, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x11, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x12, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x13, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x14, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x15, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x16, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x17, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x18, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x19, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x1a, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x1b, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x1c, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x1d, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x1e, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x1f, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x20, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x21, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x22, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x23, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x24, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x25, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x26, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x27, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x28, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x29, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x2a, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x2b, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x2c, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x2d, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x2e, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x2f, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x30, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x31, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x32, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x33, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x34, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x35, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x36, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x37, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x38, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x39, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x3a, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x3b, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x3c, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x3d, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x3e, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x3f, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x40, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x41, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x42, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x43, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x44, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x45, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x46, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x47, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x48, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x49, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x4a, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x4b, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x4c, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x4d, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x4e, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x4f, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x50, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x51, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x52, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x53, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x54, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x55, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x56, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x57, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x58, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x59, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x5a, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x5b, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x5c, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x5d, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x5e, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x5f, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x60, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x61, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x62, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x63, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x64, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x65, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x66, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x67, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x68, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x69, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x6a, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x6b, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x6c, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x6d, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x6e, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x6f, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x70, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x71, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x72, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x73, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x74, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x75, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x76, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x77, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x78, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x79, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x7a, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x7b, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x7c, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x7d, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x7e, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x7f, (char)0x0, (char)0x0, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x82, (char)0xac, (char)0x0, (char)0x0, - (char)0x1, (char)0x20, (char)0x0, (char)0x0, (char)0x0, (char)0x0, // not part of this charset - (char)0x3, (char)0xe2, (char)0x80, (char)0x9a, (char)0x0, (char)0x0, - (char)0x2, (char)0xc6, (char)0x92, (char)0x0, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0x9e, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0xa6, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0xa0, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0xa1, (char)0x0, (char)0x0, - (char)0x2, (char)0xcb, (char)0x86, (char)0x0, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0xb0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0xa0, (char)0x0, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0xb9, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0x92, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x20, (char)0x0, (char)0x0, (char)0x0, (char)0x0, // not part of this charset - (char)0x2, (char)0xc5, (char)0xbd, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x20, (char)0x0, (char)0x0, (char)0x0, (char)0x0, // not part of this charset - (char)0x1, (char)0x20, (char)0x0, (char)0x0, (char)0x0, (char)0x0, // not part of this charset - (char)0x3, (char)0xe2, (char)0x80, (char)0x98, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0x99, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0x9c, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0x9d, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0xa2, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0x93, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0x94, (char)0x0, (char)0x0, - (char)0x2, (char)0xcb, (char)0x9c, (char)0x0, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x84, (char)0xa2, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0xa1, (char)0x0, (char)0x0, (char)0x0, - (char)0x3, (char)0xe2, (char)0x80, (char)0xba, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0x93, (char)0x0, (char)0x0, (char)0x0, - (char)0x1, (char)0x20, (char)0x0, (char)0x0, (char)0x0, (char)0x0, // not part of this charset - (char)0x2, (char)0xc5, (char)0xbe, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc5, (char)0xb8, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xa0, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xa1, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xa2, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xa3, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xa4, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xa5, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xa6, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xa7, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xa8, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xa9, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xaa, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xab, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xac, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xad, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xae, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xaf, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xb0, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xb1, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xb2, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xb3, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xb4, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xb5, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xb6, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xb7, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xb8, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xb9, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xba, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xbb, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xbc, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xbd, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xbe, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc2, (char)0xbf, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x80, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x81, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x82, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x83, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x84, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x85, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x86, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x87, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x88, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x89, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x8a, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x8b, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x8c, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x8d, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x8e, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x8f, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x90, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x91, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x92, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x93, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x94, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x95, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x96, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x97, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x98, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x99, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x9a, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x9b, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x9c, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x9d, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x9e, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0x9f, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xa0, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xa1, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xa2, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xa3, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xa4, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xa5, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xa6, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xa7, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xa8, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xa9, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xaa, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xab, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xac, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xad, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xae, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xaf, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xb0, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xb1, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xb2, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xb3, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xb4, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xb5, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xb6, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xb7, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xb8, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xb9, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xba, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xbb, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xbc, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xbd, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xbe, (char)0x0, (char)0x0, (char)0x0, - (char)0x2, (char)0xc3, (char)0xbf, (char)0x0, (char)0x0, (char)0x0 + 1, 0, 0, 0, 0, 0, + 1, 1, 0, 0, 0, 0, + 1, 2, 0, 0, 0, 0, + 1, 3, 0, 0, 0, 0, + 1, 4, 0, 0, 0, 0, + 1, 5, 0, 0, 0, 0, + 1, 6, 0, 0, 0, 0, + 1, 7, 0, 0, 0, 0, + 1, 8, 0, 0, 0, 0, + 1, 9, 0, 0, 0, 0, + 1, 10, 0, 0, 0, 0, + 1, 11, 0, 0, 0, 0, + 1, 12, 0, 0, 0, 0, + 1, 13, 0, 0, 0, 0, + 1, 14, 0, 0, 0, 0, + 1, 15, 0, 0, 0, 0, + 1, 16, 0, 0, 0, 0, + 1, 17, 0, 0, 0, 0, + 1, 18, 0, 0, 0, 0, + 1, 19, 0, 0, 0, 0, + 1, 20, 0, 0, 0, 0, + 1, 21, 0, 0, 0, 0, + 1, 22, 0, 0, 0, 0, + 1, 23, 0, 0, 0, 0, + 1, 24, 0, 0, 0, 0, + 1, 25, 0, 0, 0, 0, + 1, 26, 0, 0, 0, 0, + 1, 27, 0, 0, 0, 0, + 1, 28, 0, 0, 0, 0, + 1, 29, 0, 0, 0, 0, + 1, 30, 0, 0, 0, 0, + 1, 31, 0, 0, 0, 0, + 1, 32, 0, 0, 0, 0, + 1, 33, 0, 0, 0, 0, + 1, 34, 0, 0, 0, 0, + 1, 35, 0, 0, 0, 0, + 1, 36, 0, 0, 0, 0, + 1, 37, 0, 0, 0, 0, + 1, 38, 0, 0, 0, 0, + 1, 39, 0, 0, 0, 0, + 1, 40, 0, 0, 0, 0, + 1, 41, 0, 0, 0, 0, + 1, 42, 0, 0, 0, 0, + 1, 43, 0, 0, 0, 0, + 1, 44, 0, 0, 0, 0, + 1, 45, 0, 0, 0, 0, + 1, 46, 0, 0, 0, 0, + 1, 47, 0, 0, 0, 0, + 1, 48, 0, 0, 0, 0, + 1, 49, 0, 0, 0, 0, + 1, 50, 0, 0, 0, 0, + 1, 51, 0, 0, 0, 0, + 1, 52, 0, 0, 0, 0, + 1, 53, 0, 0, 0, 0, + 1, 54, 0, 0, 0, 0, + 1, 55, 0, 0, 0, 0, + 1, 56, 0, 0, 0, 0, + 1, 57, 0, 0, 0, 0, + 1, 58, 0, 0, 0, 0, + 1, 59, 0, 0, 0, 0, + 1, 60, 0, 0, 0, 0, + 1, 61, 0, 0, 0, 0, + 1, 62, 0, 0, 0, 0, + 1, 63, 0, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 1, 65, 0, 0, 0, 0, + 1, 66, 0, 0, 0, 0, + 1, 67, 0, 0, 0, 0, + 1, 68, 0, 0, 0, 0, + 1, 69, 0, 0, 0, 0, + 1, 70, 0, 0, 0, 0, + 1, 71, 0, 0, 0, 0, + 1, 72, 0, 0, 0, 0, + 1, 73, 0, 0, 0, 0, + 1, 74, 0, 0, 0, 0, + 1, 75, 0, 0, 0, 0, + 1, 76, 0, 0, 0, 0, + 1, 77, 0, 0, 0, 0, + 1, 78, 0, 0, 0, 0, + 1, 79, 0, 0, 0, 0, + 1, 80, 0, 0, 0, 0, + 1, 81, 0, 0, 0, 0, + 1, 82, 0, 0, 0, 0, + 1, 83, 0, 0, 0, 0, + 1, 84, 0, 0, 0, 0, + 1, 85, 0, 0, 0, 0, + 1, 86, 0, 0, 0, 0, + 1, 87, 0, 0, 0, 0, + 1, 88, 0, 0, 0, 0, + 1, 89, 0, 0, 0, 0, + 1, 90, 0, 0, 0, 0, + 1, 91, 0, 0, 0, 0, + 1, 92, 0, 0, 0, 0, + 1, 93, 0, 0, 0, 0, + 1, 94, 0, 0, 0, 0, + 1, 95, 0, 0, 0, 0, + 1, 96, 0, 0, 0, 0, + 1, 97, 0, 0, 0, 0, + 1, 98, 0, 0, 0, 0, + 1, 99, 0, 0, 0, 0, + 1, 100, 0, 0, 0, 0, + 1, 101, 0, 0, 0, 0, + 1, 102, 0, 0, 0, 0, + 1, 103, 0, 0, 0, 0, + 1, 104, 0, 0, 0, 0, + 1, 105, 0, 0, 0, 0, + 1, 106, 0, 0, 0, 0, + 1, 107, 0, 0, 0, 0, + 1, 108, 0, 0, 0, 0, + 1, 109, 0, 0, 0, 0, + 1, 110, 0, 0, 0, 0, + 1, 111, 0, 0, 0, 0, + 1, 112, 0, 0, 0, 0, + 1, 113, 0, 0, 0, 0, + 1, 114, 0, 0, 0, 0, + 1, 115, 0, 0, 0, 0, + 1, 116, 0, 0, 0, 0, + 1, 117, 0, 0, 0, 0, + 1, 118, 0, 0, 0, 0, + 1, 119, 0, 0, 0, 0, + 1, 120, 0, 0, 0, 0, + 1, 121, 0, 0, 0, 0, + 1, 122, 0, 0, 0, 0, + 1, 123, 0, 0, 0, 0, + 1, 124, 0, 0, 0, 0, + 1, 125, 0, 0, 0, 0, + 1, 126, 0, 0, 0, 0, + 1, 127, 0, 0, 0, 0, + 3, -30, -126, -84, 0, 0, + 1, 32, 0, 0, 0, 0, // not part of this charset + 3, -30, -128, -102, 0, 0, + 2, -58, -110, 0, 0, 0, + 3, -30, -128, -98, 0, 0, + 3, -30, -128, -90, 0, 0, + 3, -30, -128, -96, 0, 0, + 3, -30, -128, -95, 0, 0, + 2, -53, -122, 0, 0, 0, + 3, -30, -128, -80, 0, 0, + 2, -59, -96, 0, 0, 0, + 3, -30, -128, -71, 0, 0, + 2, -59, -110, 0, 0, 0, + 1, 32, 0, 0, 0, 0, // not part of this charset + 2, -59, -67, 0, 0, 0, + 1, 32, 0, 0, 0, 0, // not part of this charset + 1, 32, 0, 0, 0, 0, // not part of this charset + 3, -30, -128, -104, 0, 0, + 3, -30, -128, -103, 0, 0, + 3, -30, -128, -100, 0, 0, + 3, -30, -128, -99, 0, 0, + 3, -30, -128, -94, 0, 0, + 3, -30, -128, -109, 0, 0, + 3, -30, -128, -108, 0, 0, + 2, -53, -100, 0, 0, 0, + 3, -30, -124, -94, 0, 0, + 2, -59, -95, 0, 0, 0, + 3, -30, -128, -70, 0, 0, + 2, -59, -109, 0, 0, 0, + 1, 32, 0, 0, 0, 0, // not part of this charset + 2, -59, -66, 0, 0, 0, + 2, -59, -72, 0, 0, 0, + 2, -62, -96, 0, 0, 0, + 2, -62, -95, 0, 0, 0, + 2, -62, -94, 0, 0, 0, + 2, -62, -93, 0, 0, 0, + 2, -62, -92, 0, 0, 0, + 2, -62, -91, 0, 0, 0, + 2, -62, -90, 0, 0, 0, + 2, -62, -89, 0, 0, 0, + 2, -62, -88, 0, 0, 0, + 2, -62, -87, 0, 0, 0, + 2, -62, -86, 0, 0, 0, + 2, -62, -85, 0, 0, 0, + 2, -62, -84, 0, 0, 0, + 2, -62, -83, 0, 0, 0, + 2, -62, -82, 0, 0, 0, + 2, -62, -81, 0, 0, 0, + 2, -62, -80, 0, 0, 0, + 2, -62, -79, 0, 0, 0, + 2, -62, -78, 0, 0, 0, + 2, -62, -77, 0, 0, 0, + 2, -62, -76, 0, 0, 0, + 2, -62, -75, 0, 0, 0, + 2, -62, -74, 0, 0, 0, + 2, -62, -73, 0, 0, 0, + 2, -62, -72, 0, 0, 0, + 2, -62, -71, 0, 0, 0, + 2, -62, -70, 0, 0, 0, + 2, -62, -69, 0, 0, 0, + 2, -62, -68, 0, 0, 0, + 2, -62, -67, 0, 0, 0, + 2, -62, -66, 0, 0, 0, + 2, -62, -65, 0, 0, 0, + 2, -61, -128, 0, 0, 0, + 2, -61, -127, 0, 0, 0, + 2, -61, -126, 0, 0, 0, + 2, -61, -125, 0, 0, 0, + 2, -61, -124, 0, 0, 0, + 2, -61, -123, 0, 0, 0, + 2, -61, -122, 0, 0, 0, + 2, -61, -121, 0, 0, 0, + 2, -61, -120, 0, 0, 0, + 2, -61, -119, 0, 0, 0, + 2, -61, -118, 0, 0, 0, + 2, -61, -117, 0, 0, 0, + 2, -61, -116, 0, 0, 0, + 2, -61, -115, 0, 0, 0, + 2, -61, -114, 0, 0, 0, + 2, -61, -113, 0, 0, 0, + 2, -61, -112, 0, 0, 0, + 2, -61, -111, 0, 0, 0, + 2, -61, -110, 0, 0, 0, + 2, -61, -109, 0, 0, 0, + 2, -61, -108, 0, 0, 0, + 2, -61, -107, 0, 0, 0, + 2, -61, -106, 0, 0, 0, + 2, -61, -105, 0, 0, 0, + 2, -61, -104, 0, 0, 0, + 2, -61, -103, 0, 0, 0, + 2, -61, -102, 0, 0, 0, + 2, -61, -101, 0, 0, 0, + 2, -61, -100, 0, 0, 0, + 2, -61, -99, 0, 0, 0, + 2, -61, -98, 0, 0, 0, + 2, -61, -97, 0, 0, 0, + 2, -61, -96, 0, 0, 0, + 2, -61, -95, 0, 0, 0, + 2, -61, -94, 0, 0, 0, + 2, -61, -93, 0, 0, 0, + 2, -61, -92, 0, 0, 0, + 2, -61, -91, 0, 0, 0, + 2, -61, -90, 0, 0, 0, + 2, -61, -89, 0, 0, 0, + 2, -61, -88, 0, 0, 0, + 2, -61, -87, 0, 0, 0, + 2, -61, -86, 0, 0, 0, + 2, -61, -85, 0, 0, 0, + 2, -61, -84, 0, 0, 0, + 2, -61, -83, 0, 0, 0, + 2, -61, -82, 0, 0, 0, + 2, -61, -81, 0, 0, 0, + 2, -61, -80, 0, 0, 0, + 2, -61, -79, 0, 0, 0, + 2, -61, -78, 0, 0, 0, + 2, -61, -77, 0, 0, 0, + 2, -61, -76, 0, 0, 0, + 2, -61, -75, 0, 0, 0, + 2, -61, -74, 0, 0, 0, + 2, -61, -73, 0, 0, 0, + 2, -61, -72, 0, 0, 0, + 2, -61, -71, 0, 0, 0, + 2, -61, -70, 0, 0, 0, + 2, -61, -69, 0, 0, 0, + 2, -61, -68, 0, 0, 0, + 2, -61, -67, 0, 0, 0, + 2, -61, -66, 0, 0, 0, + 2, -61, -65, 0, 0, 0 }; } From 3c3737ed78a81d05a0243687a12a1089d80c2994 Mon Sep 17 00:00:00 2001 From: Michael Mc Donnell Date: Wed, 29 Aug 2012 19:38:33 -0400 Subject: [PATCH 02/29] Write error message for exception and fix warning Provides details of what went wrong when reading the .esp and also fixes a warning on vs2010. --- apps/launcher/datafilespage.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/launcher/datafilespage.cpp b/apps/launcher/datafilespage.cpp index 8545be835..7ff2ce44c 100644 --- a/apps/launcher/datafilespage.cpp +++ b/apps/launcher/datafilespage.cpp @@ -351,6 +351,7 @@ bool DataFilesPage::setupDataFiles() } catch(std::runtime_error &e) { // An error occurred while reading the .esp + std::cerr << "Error reading .esp: " << e.what() << std::endl; continue; } } From 4f3eb3c34a1aae95d48c2aee0596d6778e29e60c Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 13 Sep 2012 00:54:32 +0200 Subject: [PATCH 03/29] character preview WIP --- apps/openmw/CMakeLists.txt | 2 +- apps/openmw/mwbase/world.hpp | 2 + apps/openmw/mwgui/inventorywindow.cpp | 21 +++++---- apps/openmw/mwgui/inventorywindow.hpp | 1 + apps/openmw/mwrender/characterpreview.cpp | 52 ++++++++++++++++++++++ apps/openmw/mwrender/characterpreview.hpp | 29 ++++++++++++ apps/openmw/mwrender/npcanimation.cpp | 9 ++-- apps/openmw/mwrender/npcanimation.hpp | 4 +- apps/openmw/mwrender/renderconst.hpp | 4 +- apps/openmw/mwrender/renderingmanager.cpp | 11 ++++- apps/openmw/mwrender/renderingmanager.hpp | 5 +++ apps/openmw/mwrender/shadows.cpp | 2 +- apps/openmw/mwrender/water.cpp | 2 +- apps/openmw/mwworld/worldimp.cpp | 5 +++ apps/openmw/mwworld/worldimp.hpp | 2 + files/mygui/openmw_inventory_window.layout | 8 +++- 16 files changed, 139 insertions(+), 20 deletions(-) create mode 100644 apps/openmw/mwrender/characterpreview.cpp create mode 100644 apps/openmw/mwrender/characterpreview.hpp diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index cffbc60c7..047cea760 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -16,7 +16,7 @@ source_group(game FILES ${GAME} ${GAME_HEADER}) add_openmw_dir (mwrender renderingmanager debugging sky player animation npcanimation creatureanimation actors objects renderinginterface localmap occlusionquery terrain terrainmaterial water shadows - compositors + compositors characterpreview ) add_openmw_dir (mwinput diff --git a/apps/openmw/mwbase/world.hpp b/apps/openmw/mwbase/world.hpp index 19405fb7a..5ecd1b1b9 100644 --- a/apps/openmw/mwbase/world.hpp +++ b/apps/openmw/mwbase/world.hpp @@ -271,6 +271,8 @@ namespace MWBase virtual void togglePlayerLooking(bool enable) = 0; virtual void renderPlayer() = 0; + + virtual void updateCharacterPreview(int sizeX, int sizeY) = 0; }; } diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index 6dc19944f..cf23ecd8f 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -48,6 +48,7 @@ namespace MWGui static_cast(mMainWidget)->eventWindowChangeCoord += MyGUI::newDelegate(this, &InventoryWindow::onWindowResize); getWidget(mAvatar, "Avatar"); + getWidget(mAvatarImage, "AvatarImage"); getWidget(mEncumbranceBar, "EncumbranceBar"); getWidget(mEncumbranceText, "EncumbranceBarT"); getWidget(mFilterAll, "AllButton"); @@ -100,6 +101,13 @@ namespace MWGui _sender->getSize().width - 12 - (_sender->getSize().height-44) * aspect - 15, _sender->getSize().height-44 ); drawItems(); + + MyGUI::IntSize size = mAvatarImage->getSize(); + + std::cout << "dims " << size.width << " " << size.height << std::endl; + MWBase::Environment::get().getWorld()->updateCharacterPreview (size.width, size.height); + + mAvatarImage->setImageCoord (MyGUI::IntCoord(0,0,size.width, size.height)); } void InventoryWindow::onFilterChanged(MyGUI::Widget* _sender) @@ -171,14 +179,7 @@ namespace MWGui drawItems(); - // update selected weapon icon - MWWorld::InventoryStore& invStore = MWWorld::Class::get(mPtr).getInventoryStore(mPtr); - MWWorld::ContainerStoreIterator weaponSlot = invStore.getSlot(MWWorld::InventoryStore::Slot_CarriedRight); - if (weaponSlot == invStore.end()) - mWindowManager.unsetSelectedWeapon(); - else - mWindowManager.setSelectedWeapon(*weaponSlot, 100); /// \todo track weapon durability - + notifyContentChanged(); } } @@ -265,6 +266,10 @@ namespace MWGui mWindowManager.unsetSelectedWeapon(); else mWindowManager.setSelectedWeapon(*weaponSlot, 100); /// \todo track weapon durability + + MyGUI::IntSize size = mAvatarImage->getSize(); + mAvatarImage->setImageCoord (MyGUI::IntCoord(0,0,size.width, size.height)); + MWBase::Environment::get().getWorld()->updateCharacterPreview (size.width, size.height); } void InventoryWindow::pickUpObject (MWWorld::Ptr object) diff --git a/apps/openmw/mwgui/inventorywindow.hpp b/apps/openmw/mwgui/inventorywindow.hpp index fbdb79977..4a385dd71 100644 --- a/apps/openmw/mwgui/inventorywindow.hpp +++ b/apps/openmw/mwgui/inventorywindow.hpp @@ -24,6 +24,7 @@ namespace MWGui protected: MyGUI::Widget* mAvatar; + MyGUI::ImageBox* mAvatarImage; MyGUI::TextBox* mArmorRating; MyGUI::ProgressBar* mEncumbranceBar; MyGUI::TextBox* mEncumbranceText; diff --git a/apps/openmw/mwrender/characterpreview.cpp b/apps/openmw/mwrender/characterpreview.cpp new file mode 100644 index 000000000..3d3f0a58d --- /dev/null +++ b/apps/openmw/mwrender/characterpreview.cpp @@ -0,0 +1,52 @@ +#include "characterpreview.hpp" + + +#include +#include + + +#include "renderconst.hpp" + +namespace MWRender +{ + + CharacterPreview::CharacterPreview(Ogre::SceneManager *sceneMgr, Ogre::SceneNode *node) + : mSceneMgr(sceneMgr) + { + mCamera = mSceneMgr->createCamera ("CharacterPreviewCamera"); + mCamera->setAspectRatio (0.5); + + mNode = node->createChildSceneNode (); + mNode->attachObject (mCamera); + + mNode->setPosition(0, 185, 70); + mNode->roll(Ogre::Degree(180)); + + mNode->pitch(Ogre::Degree(90)); + + mTexture = Ogre::TextureManager::getSingleton().createManual("CharacterPreview", + Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, 512, 1024, 0, Ogre::PF_A8R8G8B8, Ogre::TU_RENDERTARGET); + + mRenderTarget = mTexture->getBuffer()->getRenderTarget(); + mViewport = mRenderTarget->addViewport(mCamera); + mViewport->setOverlaysEnabled(false); + mViewport->setBackgroundColour(Ogre::ColourValue(0, 0, 0, 0)); + mViewport->setShadowsEnabled(false); + mViewport->setMaterialScheme("local_map"); + mViewport->setVisibilityMask (RV_Player); + mRenderTarget->setActive(true); + mRenderTarget->setAutoUpdated (false); + } + + void CharacterPreview::update(int sizeX, int sizeY) + { + bool wasVisible = mNode->getParentSceneNode()->getAttachedObject(0)->getVisible (); + mNode->getParentSceneNode()->setVisible(true, false); + //mViewport->setDimensions (0, 0, float(sizeX) / float(512), float(sizeY) / float(1024)); + + mRenderTarget->update(); + + mNode->getParentSceneNode()->setVisible(wasVisible, false); + } + +} diff --git a/apps/openmw/mwrender/characterpreview.hpp b/apps/openmw/mwrender/characterpreview.hpp new file mode 100644 index 000000000..e15d6c359 --- /dev/null +++ b/apps/openmw/mwrender/characterpreview.hpp @@ -0,0 +1,29 @@ +#ifndef MWRENDER_CHARACTERPREVIEW_H +#define MWRENDER_CHARACTERPREVIEW_H + +#include + +namespace MWRender +{ + + class CharacterPreview + { + public: + CharacterPreview(Ogre::SceneManager* sceneMgr, Ogre::SceneNode* node); + + void update(int sizeX, int sizeY); + + private: + Ogre::TexturePtr mTexture; + Ogre::RenderTarget* mRenderTarget; + Ogre::Viewport* mViewport; + + Ogre::Camera* mCamera; + + Ogre::SceneManager* mSceneMgr; + Ogre::SceneNode* mNode; + }; + +} + +#endif diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp index 4f98aebc4..392a79c96 100644 --- a/apps/openmw/mwrender/npcanimation.cpp +++ b/apps/openmw/mwrender/npcanimation.cpp @@ -45,7 +45,7 @@ NpcAnimation::~NpcAnimation() } -NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, OEngine::Render::OgreRenderer& _rend, MWWorld::InventoryStore& _inv) +NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, OEngine::Render::OgreRenderer& _rend, MWWorld::InventoryStore& _inv, bool player) : Animation(_rend), mStateID(-1), mInv(_inv), timeToChange(0), robe(mInv.end()), helmet(mInv.end()), shirt(mInv.end()), cuirass(mInv.end()), greaves(mInv.end()), @@ -53,6 +53,7 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, OEngine::Render::OgreRendere boots(mInv.end()), leftglove(mInv.end()), rightglove(mInv.end()), skirtiter(mInv.end()), pants(mInv.end()) + , mIsPlayer(player) { MWWorld::LiveCellRef *ref = ptr.get(); @@ -94,7 +95,7 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, OEngine::Render::OgreRendere { Ogre::Entity *base = mEntityList.mEntities[i]; - base->setVisibilityFlags(RV_Actors); + base->setVisibilityFlags(mIsPlayer ? RV_Player : RV_Actors); bool transparent = false; for(unsigned int j=0;j < base->getNumSubEntities();++j) { @@ -357,13 +358,13 @@ NifOgre::EntityList NpcAnimation::insertBoundedPart(const std::string &mesh, con mInsert, mesh); std::vector &parts = entities.mEntities; for(size_t i = 0;i < parts.size();i++) - parts[i]->setVisibilityFlags(RV_Actors); + parts[i]->setVisibilityFlags(mIsPlayer ? RV_Player : RV_Actors); return entities; } void NpcAnimation::runAnimation(float timepassed) { - if(timeToChange > .2) + //if(timeToChange > .2) { timeToChange = 0; updateParts(); diff --git a/apps/openmw/mwrender/npcanimation.hpp b/apps/openmw/mwrender/npcanimation.hpp index d4b2a5b9e..945dd210e 100644 --- a/apps/openmw/mwrender/npcanimation.hpp +++ b/apps/openmw/mwrender/npcanimation.hpp @@ -18,6 +18,8 @@ private: int mPartslots[27]; //Each part slot is taken by clothing, armor, or is empty int mPartPriorities[27]; + bool mIsPlayer; + //Bounded Parts NifOgre::EntityList lclavicle; NifOgre::EntityList rclavicle; @@ -66,7 +68,7 @@ private: MWWorld::ContainerStoreIterator skirtiter; public: - NpcAnimation(const MWWorld::Ptr& ptr, OEngine::Render::OgreRenderer& _rend, MWWorld::InventoryStore& _inv); + NpcAnimation(const MWWorld::Ptr& ptr, OEngine::Render::OgreRenderer& _rend, MWWorld::InventoryStore& _inv, bool player=false); virtual ~NpcAnimation(); NifOgre::EntityList insertBoundedPart(const std::string &mesh, const std::string &bonename); virtual void runAnimation(float timepassed); diff --git a/apps/openmw/mwrender/renderconst.hpp b/apps/openmw/mwrender/renderconst.hpp index 9f57833bb..194ca9da6 100644 --- a/apps/openmw/mwrender/renderconst.hpp +++ b/apps/openmw/mwrender/renderconst.hpp @@ -41,7 +41,7 @@ enum VisibilityFlags // Water RV_Water = 8, - // Actors (player, npcs, creatures) + // Actors (npcs, creatures) RV_Actors = 16, // Misc objects (containers, dynamic objects) @@ -54,6 +54,8 @@ enum VisibilityFlags RV_OcclusionQuery = 256, + RV_Player = 512, + RV_Map = RV_Terrain + RV_Statics + RV_StaticsSmall + RV_Misc + RV_Water /// \todo markers (normally hidden) diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 70d7de552..acb587d03 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -34,6 +34,7 @@ #include "water.hpp" #include "compositors.hpp" #include "npcanimation.hpp" +#include "characterpreview.hpp" using namespace MWRender; using namespace Ogre; @@ -159,6 +160,8 @@ RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const mDebugging = new Debugging(mMwRoot, engine); mLocalMap = new MWRender::LocalMap(&mRendering, this); + mCharacterPreview = new CharacterPreview(mRendering.getScene (), playerNode); + setMenuTransparency(Settings::Manager::getFloat("menu transparency", "GUI")); } @@ -175,6 +178,7 @@ RenderingManager::~RenderingManager () delete mOcclusionQuery; delete mCompositors; delete mWater; + delete mCharacterPreview; } MWRender::SkyManager* RenderingManager::getSkyManager() @@ -860,7 +864,7 @@ void RenderingManager::renderPlayer(const MWWorld::Ptr &ptr) new MWRender::NpcAnimation( ptr, mRendering, - MWWorld::Class::get(ptr).getInventoryStore(ptr) + MWWorld::Class::get(ptr).getInventoryStore(ptr), true ); mPlayer->setAnimation(anim); } @@ -882,4 +886,9 @@ bool RenderingManager::isPositionExplored (float nX, float nY, int x, int y, boo return mLocalMap->isPositionExplored(nX, nY, x, y, interior); } +void RenderingManager::updateCharacterPreview (int sizeX, int sizeY) +{ + mCharacterPreview->update(sizeX, sizeY); +} + } // namespace diff --git a/apps/openmw/mwrender/renderingmanager.hpp b/apps/openmw/mwrender/renderingmanager.hpp index e5be238bd..fe79c9400 100644 --- a/apps/openmw/mwrender/renderingmanager.hpp +++ b/apps/openmw/mwrender/renderingmanager.hpp @@ -43,6 +43,7 @@ namespace MWRender class LocalMap; class Water; class Compositors; + class CharacterPreview; class RenderingManager: private RenderingInterface, public Ogre::WindowEventListener { @@ -191,6 +192,8 @@ class RenderingManager: private RenderingInterface, public Ogre::WindowEventList virtual bool isPositionExplored (float nX, float nY, int x, int y, bool interior); ///< see MWRender::LocalMap::isPositionExplored + void updateCharacterPreview(int sizeX, int sizeY); + protected: virtual void windowResized(Ogre::RenderWindow* rw); virtual void windowClosed(Ogre::RenderWindow* rw); @@ -213,6 +216,8 @@ class RenderingManager: private RenderingInterface, public Ogre::WindowEventList TerrainManager* mTerrainManager; + CharacterPreview* mCharacterPreview; + MWRender::Water *mWater; OEngine::Render::OgreRenderer &mRendering; diff --git a/apps/openmw/mwrender/shadows.cpp b/apps/openmw/mwrender/shadows.cpp index 3d9f13243..fc28f1cb9 100644 --- a/apps/openmw/mwrender/shadows.cpp +++ b/apps/openmw/mwrender/shadows.cpp @@ -111,7 +111,7 @@ void Shadows::recreate() sh::Factory::getInstance ().setSharedParameter ("shadowFar_fadeStart", sh::makeProperty(shadowFar_fadeStart)); // Set visibility mask for the shadow render textures - int visibilityMask = RV_Actors * Settings::Manager::getBool("actor shadows", "Shadows") + int visibilityMask = (RV_Actors + RV_Player) * Settings::Manager::getBool("actor shadows", "Shadows") + (RV_Statics + RV_StaticsSmall) * Settings::Manager::getBool("statics shadows", "Shadows") + RV_Misc * Settings::Manager::getBool("misc shadows", "Shadows"); diff --git a/apps/openmw/mwrender/water.cpp b/apps/openmw/mwrender/water.cpp index 7100540fc..6a3eeb509 100644 --- a/apps/openmw/mwrender/water.cpp +++ b/apps/openmw/mwrender/water.cpp @@ -332,7 +332,7 @@ void Water::applyVisibilityMask() mVisibilityFlags = RV_Terrain * Settings::Manager::getBool("reflect terrain", "Water") + RV_Statics * Settings::Manager::getBool("reflect statics", "Water") + RV_StaticsSmall * Settings::Manager::getBool("reflect small statics", "Water") - + RV_Actors * Settings::Manager::getBool("reflect actors", "Water") + + (RV_Actors + RV_Player) * Settings::Manager::getBool("reflect actors", "Water") + RV_Misc * Settings::Manager::getBool("reflect misc", "Water") + RV_Sky; diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 869ce94d1..f88f5c320 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1222,4 +1222,9 @@ namespace MWWorld { mRendering->renderPlayer(mPlayer->getPlayer()); } + + void World::updateCharacterPreview (int sizeX, int sizeY) + { + mRendering->updateCharacterPreview(sizeX, sizeY); + } } diff --git a/apps/openmw/mwworld/worldimp.hpp b/apps/openmw/mwworld/worldimp.hpp index 6279343d4..5e8bc697e 100644 --- a/apps/openmw/mwworld/worldimp.hpp +++ b/apps/openmw/mwworld/worldimp.hpp @@ -307,6 +307,8 @@ namespace MWWorld } virtual void renderPlayer(); + + virtual void updateCharacterPreview(int sizeX, int sizeY); }; } diff --git a/files/mygui/openmw_inventory_window.layout b/files/mygui/openmw_inventory_window.layout index 1ffabe3b6..b9e14fffa 100644 --- a/files/mygui/openmw_inventory_window.layout +++ b/files/mygui/openmw_inventory_window.layout @@ -12,8 +12,12 @@ - - + + + + + + From 5155339cb65619ec69be8151f021e4de8054cc17 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 13 Sep 2012 14:56:50 +0200 Subject: [PATCH 04/29] character preview working --- apps/openmw/mwgui/inventorywindow.cpp | 12 ++++++------ apps/openmw/mwrender/characterpreview.cpp | 2 +- files/mygui/openmw_inventory_window.layout | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index cf23ecd8f..9ccf5cfe1 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -102,12 +102,10 @@ namespace MWGui _sender->getSize().height-44 ); drawItems(); - MyGUI::IntSize size = mAvatarImage->getSize(); + MyGUI::IntSize size = mAvatar->getSize(); - std::cout << "dims " << size.width << " " << size.height << std::endl; MWBase::Environment::get().getWorld()->updateCharacterPreview (size.width, size.height); - - mAvatarImage->setImageCoord (MyGUI::IntCoord(0,0,size.width, size.height)); + mAvatarImage->setSize(MyGUI::IntSize(std::max(mAvatar->getSize().width, 512), std::max(mAvatar->getSize().height, 1024))); } void InventoryWindow::onFilterChanged(MyGUI::Widget* _sender) @@ -267,9 +265,11 @@ namespace MWGui else mWindowManager.setSelectedWeapon(*weaponSlot, 100); /// \todo track weapon durability - MyGUI::IntSize size = mAvatarImage->getSize(); - mAvatarImage->setImageCoord (MyGUI::IntCoord(0,0,size.width, size.height)); + MyGUI::IntSize size = mAvatar->getSize(); + MWBase::Environment::get().getWorld()->updateCharacterPreview (size.width, size.height); + + mAvatarImage->setSize(MyGUI::IntSize(512, 1024)); } void InventoryWindow::pickUpObject (MWWorld::Ptr object) diff --git a/apps/openmw/mwrender/characterpreview.cpp b/apps/openmw/mwrender/characterpreview.cpp index 3d3f0a58d..fd25aab08 100644 --- a/apps/openmw/mwrender/characterpreview.cpp +++ b/apps/openmw/mwrender/characterpreview.cpp @@ -42,7 +42,7 @@ namespace MWRender { bool wasVisible = mNode->getParentSceneNode()->getAttachedObject(0)->getVisible (); mNode->getParentSceneNode()->setVisible(true, false); - //mViewport->setDimensions (0, 0, float(sizeX) / float(512), float(sizeY) / float(1024)); + mViewport->setDimensions (0, 0, std::min(1.f, float(sizeX) / float(512)), std::min(1.f, float(sizeY) / float(1024))); mRenderTarget->update(); diff --git a/files/mygui/openmw_inventory_window.layout b/files/mygui/openmw_inventory_window.layout index b9e14fffa..31bf58c34 100644 --- a/files/mygui/openmw_inventory_window.layout +++ b/files/mygui/openmw_inventory_window.layout @@ -15,9 +15,9 @@ - - - + + + From eef750e6b05b9c8ea8059274d50d650679f0edd5 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 13 Sep 2012 19:03:31 +0200 Subject: [PATCH 05/29] race selection preview --- apps/openmw/mwbase/world.hpp | 1 + apps/openmw/mwgui/inventorywindow.cpp | 2 + apps/openmw/mwgui/race.cpp | 15 +++-- apps/openmw/mwgui/race.hpp | 4 +- apps/openmw/mwrender/actors.cpp | 4 +- apps/openmw/mwrender/characterpreview.cpp | 70 +++++++++++++++++----- apps/openmw/mwrender/characterpreview.hpp | 33 ++++++++-- apps/openmw/mwrender/npcanimation.cpp | 16 +++-- apps/openmw/mwrender/npcanimation.hpp | 7 ++- apps/openmw/mwrender/player.cpp | 5 ++ apps/openmw/mwrender/player.hpp | 1 + apps/openmw/mwrender/renderconst.hpp | 2 +- apps/openmw/mwrender/renderingmanager.cpp | 26 ++++++-- apps/openmw/mwrender/renderingmanager.hpp | 9 ++- apps/openmw/mwrender/shadows.cpp | 2 +- apps/openmw/mwrender/water.cpp | 2 +- apps/openmw/mwworld/worldimp.cpp | 5 ++ apps/openmw/mwworld/worldimp.hpp | 1 + files/mygui/openmw_chargen_race.layout | 4 +- files/mygui/openmw_inventory_window.layout | 1 - libs/openengine/ogre/renderer.cpp | 4 +- 21 files changed, 166 insertions(+), 48 deletions(-) diff --git a/apps/openmw/mwbase/world.hpp b/apps/openmw/mwbase/world.hpp index 5ecd1b1b9..f56313ba3 100644 --- a/apps/openmw/mwbase/world.hpp +++ b/apps/openmw/mwbase/world.hpp @@ -273,6 +273,7 @@ namespace MWBase virtual void renderPlayer() = 0; virtual void updateCharacterPreview(int sizeX, int sizeY) = 0; + virtual void updateRaceSelectionPreview(float angle) = 0; }; } diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index 9ccf5cfe1..9df6d893d 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -106,6 +106,7 @@ namespace MWGui MWBase::Environment::get().getWorld()->updateCharacterPreview (size.width, size.height); mAvatarImage->setSize(MyGUI::IntSize(std::max(mAvatar->getSize().width, 512), std::max(mAvatar->getSize().height, 1024))); + mAvatarImage->setImageTexture("CharacterPreview"); } void InventoryWindow::onFilterChanged(MyGUI::Widget* _sender) @@ -270,6 +271,7 @@ namespace MWGui MWBase::Environment::get().getWorld()->updateCharacterPreview (size.width, size.height); mAvatarImage->setSize(MyGUI::IntSize(512, 1024)); + mAvatarImage->setImageTexture("CharacterPreview"); } void InventoryWindow::pickUpObject (MWWorld::Ptr object) diff --git a/apps/openmw/mwgui/race.cpp b/apps/openmw/mwgui/race.cpp index 370b30733..e1dc4af1a 100644 --- a/apps/openmw/mwgui/race.cpp +++ b/apps/openmw/mwgui/race.cpp @@ -25,15 +25,17 @@ RaceDialog::RaceDialog(MWBase::WindowManager& parWindowManager) , mHairIndex(0) , mFaceCount(10) , mHairCount(14) + , mCurrentAngle(0) { // Centre dialog center(); - // These are just demo values, you should replace these with - // real calls from outside the class later. - setText("AppearanceT", mWindowManager.getGameSettingString("sRaceMenu1", "Appearance")); - getWidget(mAppearanceBox, "AppearanceBox"); + getWidget(mPreviewImage, "PreviewImage"); + + MWBase::Environment::get().getWorld ()->updateRaceSelectionPreview (0); + + mPreviewImage->setImageTexture ("CharacterHeadPreview"); getWidget(mHeadRotate, "HeadRotate"); mHeadRotate->setScrollRange(50); @@ -149,7 +151,10 @@ void RaceDialog::onBackClicked(MyGUI::Widget* _sender) void RaceDialog::onHeadRotate(MyGUI::ScrollBar*, size_t _position) { - // TODO: Rotate head + float angle = (float(_position) / 49.f - 0.5) * 3.14 * 2; + float diff = angle - mCurrentAngle; + MWBase::Environment::get().getWorld ()->updateRaceSelectionPreview (diff); + mCurrentAngle += diff; } void RaceDialog::onSelectPreviousGender(MyGUI::Widget*) diff --git a/apps/openmw/mwgui/race.hpp b/apps/openmw/mwgui/race.hpp index 4aded28c3..c1517eb76 100644 --- a/apps/openmw/mwgui/race.hpp +++ b/apps/openmw/mwgui/race.hpp @@ -73,7 +73,7 @@ namespace MWGui void updateSkills(); void updateSpellPowers(); - MyGUI::CanvasPtr mAppearanceBox; + MyGUI::ImageBox* mPreviewImage; MyGUI::ListBox* mRaceList; MyGUI::ScrollBar* mHeadRotate; @@ -87,6 +87,8 @@ namespace MWGui int mFaceCount, mHairCount; std::string mCurrentRaceId; + + float mCurrentAngle; }; } #endif diff --git a/apps/openmw/mwrender/actors.cpp b/apps/openmw/mwrender/actors.cpp index 415d17241..15c89d7f5 100644 --- a/apps/openmw/mwrender/actors.cpp +++ b/apps/openmw/mwrender/actors.cpp @@ -3,6 +3,8 @@ #include #include +#include "renderconst.hpp" + using namespace Ogre; using namespace MWRender; @@ -23,7 +25,7 @@ void Actors::setMwRoot(Ogre::SceneNode* root){ void Actors::insertNPC(const MWWorld::Ptr& ptr, MWWorld::InventoryStore& inv){ insertBegin(ptr, true, true); - NpcAnimation* anim = new MWRender::NpcAnimation(ptr, mRend, inv); + NpcAnimation* anim = new MWRender::NpcAnimation(ptr, ptr.getRefData ().getBaseNode (), mRend, inv, RV_Actors); mAllActors[ptr] = anim; } diff --git a/apps/openmw/mwrender/characterpreview.cpp b/apps/openmw/mwrender/characterpreview.cpp index fd25aab08..21442782f 100644 --- a/apps/openmw/mwrender/characterpreview.cpp +++ b/apps/openmw/mwrender/characterpreview.cpp @@ -6,26 +6,31 @@ #include "renderconst.hpp" +#include "npcanimation.hpp" namespace MWRender { - CharacterPreview::CharacterPreview(Ogre::SceneManager *sceneMgr, Ogre::SceneNode *node) + CharacterPreview::CharacterPreview(Ogre::SceneManager *sceneMgr, Ogre::SceneNode *node, int sizeX, int sizeY, const std::string& name, + Ogre::Vector3 position, Ogre::Vector3 lookAt) : mSceneMgr(sceneMgr) + , mSizeX(sizeX) + , mSizeY(sizeY) { - mCamera = mSceneMgr->createCamera ("CharacterPreviewCamera"); - mCamera->setAspectRatio (0.5); + mCamera = mSceneMgr->createCamera (name); + mCamera->setAspectRatio (float(sizeX) / float(sizeY)); - mNode = node->createChildSceneNode (); - mNode->attachObject (mCamera); + mNode = node; + mNode->setVisible (false); - mNode->setPosition(0, 185, 70); - mNode->roll(Ogre::Degree(180)); + mCamera->setPosition(position); + mCamera->lookAt(lookAt); - mNode->pitch(Ogre::Degree(90)); + mCamera->setNearClipDistance (0.01); + mCamera->setFarClipDistance (1000); - mTexture = Ogre::TextureManager::getSingleton().createManual("CharacterPreview", - Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, 512, 1024, 0, Ogre::PF_A8R8G8B8, Ogre::TU_RENDERTARGET); + mTexture = Ogre::TextureManager::getSingleton().createManual(name, + Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, sizeX, sizeY, 0, Ogre::PF_A8R8G8B8, Ogre::TU_RENDERTARGET); mRenderTarget = mTexture->getBuffer()->getRenderTarget(); mViewport = mRenderTarget->addViewport(mCamera); @@ -33,20 +38,55 @@ namespace MWRender mViewport->setBackgroundColour(Ogre::ColourValue(0, 0, 0, 0)); mViewport->setShadowsEnabled(false); mViewport->setMaterialScheme("local_map"); - mViewport->setVisibilityMask (RV_Player); + mViewport->setVisibilityMask (RV_PlayerPreview); mRenderTarget->setActive(true); mRenderTarget->setAutoUpdated (false); } - void CharacterPreview::update(int sizeX, int sizeY) + // -------------------------------------------------------------------------------------------------- + + + InventoryPreview::InventoryPreview(Ogre::SceneManager *sceneMgr, Ogre::SceneNode *node) + : CharacterPreview(sceneMgr, node, 512, 1024, "CharacterPreview", Ogre::Vector3(0, 65, -180), Ogre::Vector3(0,65,0)) + , mAnimation(NULL) + { + + } + + void InventoryPreview::update(int sizeX, int sizeY) { - bool wasVisible = mNode->getParentSceneNode()->getAttachedObject(0)->getVisible (); - mNode->getParentSceneNode()->setVisible(true, false); + if (mAnimation) + mAnimation->forceUpdate (); + mViewport->setDimensions (0, 0, std::min(1.f, float(sizeX) / float(512)), std::min(1.f, float(sizeY) / float(1024))); + mNode->setOrientation (Ogre::Quaternion::IDENTITY); + + mNode->setVisible (true); mRenderTarget->update(); + mNode->setVisible (false); + } + + void InventoryPreview::setNpcAnimation (NpcAnimation *anim) + { + mAnimation = anim; + } + + // -------------------------------------------------------------------------------------------------- + + RaceSelectionPreview::RaceSelectionPreview(Ogre::SceneManager *sceneMgr, Ogre::SceneNode *node) + : CharacterPreview(sceneMgr, node, 512, 512, "CharacterHeadPreview", Ogre::Vector3(0, 120, -35), Ogre::Vector3(0,125,0)) + { - mNode->getParentSceneNode()->setVisible(wasVisible, false); + } + + void RaceSelectionPreview::update(float angle) + { + mNode->roll(Ogre::Radian(angle), Ogre::SceneNode::TS_LOCAL); + + mNode->setVisible (true); + mRenderTarget->update(); + mNode->setVisible (false); } } diff --git a/apps/openmw/mwrender/characterpreview.hpp b/apps/openmw/mwrender/characterpreview.hpp index e15d6c359..ba48ea17d 100644 --- a/apps/openmw/mwrender/characterpreview.hpp +++ b/apps/openmw/mwrender/characterpreview.hpp @@ -6,14 +6,15 @@ namespace MWRender { + class NpcAnimation; + class CharacterPreview { public: - CharacterPreview(Ogre::SceneManager* sceneMgr, Ogre::SceneNode* node); - - void update(int sizeX, int sizeY); + CharacterPreview(Ogre::SceneManager* sceneMgr, Ogre::SceneNode* node, int sizeX, int sizeY, const std::string& name, + Ogre::Vector3 position, Ogre::Vector3 lookAt); - private: + protected: Ogre::TexturePtr mTexture; Ogre::RenderTarget* mRenderTarget; Ogre::Viewport* mViewport; @@ -22,6 +23,30 @@ namespace MWRender Ogre::SceneManager* mSceneMgr; Ogre::SceneNode* mNode; + + int mSizeX; + int mSizeY; + }; + + class InventoryPreview : public CharacterPreview + { + public: + InventoryPreview(Ogre::SceneManager* sceneMgr, Ogre::SceneNode* node); + + void update(int sizeX, int sizeY); + + void setNpcAnimation (NpcAnimation* anim); + + private: + NpcAnimation* mAnimation; + }; + + class RaceSelectionPreview : public CharacterPreview + { + public: + RaceSelectionPreview(Ogre::SceneManager* sceneMgr, Ogre::SceneNode* node); + + void update(float angle); }; } diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp index 392a79c96..00b877ba0 100644 --- a/apps/openmw/mwrender/npcanimation.cpp +++ b/apps/openmw/mwrender/npcanimation.cpp @@ -45,15 +45,14 @@ NpcAnimation::~NpcAnimation() } -NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, OEngine::Render::OgreRenderer& _rend, MWWorld::InventoryStore& _inv, bool player) - : Animation(_rend), mStateID(-1), mInv(_inv), timeToChange(0), +NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, Ogre::SceneNode* node, OEngine::Render::OgreRenderer& _rend, MWWorld::InventoryStore& _inv, int visibilityFlags) + : Animation(_rend), mStateID(-1), mInv(_inv), timeToChange(0), mVisibilityFlags(visibilityFlags), robe(mInv.end()), helmet(mInv.end()), shirt(mInv.end()), cuirass(mInv.end()), greaves(mInv.end()), leftpauldron(mInv.end()), rightpauldron(mInv.end()), boots(mInv.end()), leftglove(mInv.end()), rightglove(mInv.end()), skirtiter(mInv.end()), pants(mInv.end()) - , mIsPlayer(player) { MWWorld::LiveCellRef *ref = ptr.get(); @@ -85,7 +84,7 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, OEngine::Render::OgreRendere std::cout << " Sex: Male" << " Height: " << race->data.height.male << "\n"; */ - mInsert = ptr.getRefData().getBaseNode(); + mInsert = node; assert(mInsert); std::string smodel = (!isBeast ? "meshes\\base_anim.nif" : "meshes\\base_animkna.nif"); @@ -95,7 +94,7 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, OEngine::Render::OgreRendere { Ogre::Entity *base = mEntityList.mEntities[i]; - base->setVisibilityFlags(mIsPlayer ? RV_Player : RV_Actors); + base->setVisibilityFlags(mVisibilityFlags); bool transparent = false; for(unsigned int j=0;j < base->getNumSubEntities();++j) { @@ -358,7 +357,7 @@ NifOgre::EntityList NpcAnimation::insertBoundedPart(const std::string &mesh, con mInsert, mesh); std::vector &parts = entities.mEntities; for(size_t i = 0;i < parts.size();i++) - parts[i]->setVisibilityFlags(mIsPlayer ? RV_Player : RV_Actors); + parts[i]->setVisibilityFlags(mVisibilityFlags); return entities; } @@ -582,4 +581,9 @@ void NpcAnimation::addPartGroup(int group, int priority, std::vector& parts); + + void forceUpdate(); }; } diff --git a/apps/openmw/mwrender/player.cpp b/apps/openmw/mwrender/player.cpp index 3ccc08022..297cb8d7a 100644 --- a/apps/openmw/mwrender/player.cpp +++ b/apps/openmw/mwrender/player.cpp @@ -35,6 +35,11 @@ namespace MWRender mPreviewCam.yaw = 0.f; mPreviewCam.offset = 400.f; } + + Player::~Player() + { + delete mAnimation; + } bool Player::rotate(const Ogre::Vector3 &rot, bool adjust) { diff --git a/apps/openmw/mwrender/player.hpp b/apps/openmw/mwrender/player.hpp index 8dd313b7f..b4d8983e4 100644 --- a/apps/openmw/mwrender/player.hpp +++ b/apps/openmw/mwrender/player.hpp @@ -63,6 +63,7 @@ namespace MWRender public: Player (Ogre::Camera *camera, Ogre::SceneNode* mNode); + ~Player(); /// Set where the player is looking at. Uses Morrowind (euler) angles /// \param rot Rotation angles in radians diff --git a/apps/openmw/mwrender/renderconst.hpp b/apps/openmw/mwrender/renderconst.hpp index 194ca9da6..e6ecb5150 100644 --- a/apps/openmw/mwrender/renderconst.hpp +++ b/apps/openmw/mwrender/renderconst.hpp @@ -54,7 +54,7 @@ enum VisibilityFlags RV_OcclusionQuery = 256, - RV_Player = 512, + RV_PlayerPreview = 512, RV_Map = RV_Terrain + RV_Statics + RV_StaticsSmall + RV_Misc + RV_Water diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index acb587d03..d2a51f5f1 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -160,8 +160,6 @@ RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const mDebugging = new Debugging(mMwRoot, engine); mLocalMap = new MWRender::LocalMap(&mRendering, this); - mCharacterPreview = new CharacterPreview(mRendering.getScene (), playerNode); - setMenuTransparency(Settings::Manager::getFloat("menu transparency", "GUI")); } @@ -178,7 +176,9 @@ RenderingManager::~RenderingManager () delete mOcclusionQuery; delete mCompositors; delete mWater; - delete mCharacterPreview; + delete mInventoryPreview; + delete mRaceSelectionPreview; + delete mPreviewAnimation; } MWRender::SkyManager* RenderingManager::getSkyManager() @@ -862,11 +862,20 @@ void RenderingManager::renderPlayer(const MWWorld::Ptr &ptr) { MWRender::NpcAnimation *anim = new MWRender::NpcAnimation( - ptr, + ptr, ptr.getRefData ().getBaseNode (), mRendering, - MWWorld::Class::get(ptr).getInventoryStore(ptr), true + MWWorld::Class::get(ptr).getInventoryStore(ptr), RV_Actors ); mPlayer->setAnimation(anim); + + MWWorld::InventoryStore& invStore = MWWorld::Class::get(ptr).getInventoryStore (ptr); + + Ogre::SceneNode* previewNode = mMwRoot->createChildSceneNode (); + mPreviewAnimation = new NpcAnimation(ptr, previewNode, mRendering, invStore, RV_PlayerPreview); + + mInventoryPreview = new InventoryPreview(mRendering.getScene (), previewNode); + mInventoryPreview->setNpcAnimation (mPreviewAnimation); + mRaceSelectionPreview = new RaceSelectionPreview(mRendering.getScene (), previewNode); } void RenderingManager::getPlayerData(Ogre::Vector3 &eyepos, float &pitch, float &yaw) @@ -888,7 +897,12 @@ bool RenderingManager::isPositionExplored (float nX, float nY, int x, int y, boo void RenderingManager::updateCharacterPreview (int sizeX, int sizeY) { - mCharacterPreview->update(sizeX, sizeY); + mInventoryPreview->update(sizeX, sizeY); +} + +void RenderingManager::updateRaceSelectionPreview (float angle) +{ + mRaceSelectionPreview->update(angle); } } // namespace diff --git a/apps/openmw/mwrender/renderingmanager.hpp b/apps/openmw/mwrender/renderingmanager.hpp index fe79c9400..cbad67472 100644 --- a/apps/openmw/mwrender/renderingmanager.hpp +++ b/apps/openmw/mwrender/renderingmanager.hpp @@ -43,7 +43,8 @@ namespace MWRender class LocalMap; class Water; class Compositors; - class CharacterPreview; + class InventoryPreview; + class RaceSelectionPreview; class RenderingManager: private RenderingInterface, public Ogre::WindowEventListener { @@ -193,6 +194,7 @@ class RenderingManager: private RenderingInterface, public Ogre::WindowEventList ///< see MWRender::LocalMap::isPositionExplored void updateCharacterPreview(int sizeX, int sizeY); + void updateRaceSelectionPreview(float angle); protected: virtual void windowResized(Ogre::RenderWindow* rw); @@ -216,7 +218,8 @@ class RenderingManager: private RenderingInterface, public Ogre::WindowEventList TerrainManager* mTerrainManager; - CharacterPreview* mCharacterPreview; + InventoryPreview* mInventoryPreview; + RaceSelectionPreview* mRaceSelectionPreview; MWRender::Water *mWater; @@ -247,6 +250,8 @@ class RenderingManager: private RenderingInterface, public Ogre::WindowEventList MWRender::Shadows* mShadows; MWRender::Compositors* mCompositors; + + MWRender::NpcAnimation* mPreviewAnimation; }; } diff --git a/apps/openmw/mwrender/shadows.cpp b/apps/openmw/mwrender/shadows.cpp index fc28f1cb9..3d9f13243 100644 --- a/apps/openmw/mwrender/shadows.cpp +++ b/apps/openmw/mwrender/shadows.cpp @@ -111,7 +111,7 @@ void Shadows::recreate() sh::Factory::getInstance ().setSharedParameter ("shadowFar_fadeStart", sh::makeProperty(shadowFar_fadeStart)); // Set visibility mask for the shadow render textures - int visibilityMask = (RV_Actors + RV_Player) * Settings::Manager::getBool("actor shadows", "Shadows") + int visibilityMask = RV_Actors * Settings::Manager::getBool("actor shadows", "Shadows") + (RV_Statics + RV_StaticsSmall) * Settings::Manager::getBool("statics shadows", "Shadows") + RV_Misc * Settings::Manager::getBool("misc shadows", "Shadows"); diff --git a/apps/openmw/mwrender/water.cpp b/apps/openmw/mwrender/water.cpp index 6a3eeb509..7100540fc 100644 --- a/apps/openmw/mwrender/water.cpp +++ b/apps/openmw/mwrender/water.cpp @@ -332,7 +332,7 @@ void Water::applyVisibilityMask() mVisibilityFlags = RV_Terrain * Settings::Manager::getBool("reflect terrain", "Water") + RV_Statics * Settings::Manager::getBool("reflect statics", "Water") + RV_StaticsSmall * Settings::Manager::getBool("reflect small statics", "Water") - + (RV_Actors + RV_Player) * Settings::Manager::getBool("reflect actors", "Water") + + RV_Actors * Settings::Manager::getBool("reflect actors", "Water") + RV_Misc * Settings::Manager::getBool("reflect misc", "Water") + RV_Sky; diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index f88f5c320..005b94ffa 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1227,4 +1227,9 @@ namespace MWWorld { mRendering->updateCharacterPreview(sizeX, sizeY); } + + void World::updateRaceSelectionPreview (float angle) + { + mRendering->updateRaceSelectionPreview(angle); + } } diff --git a/apps/openmw/mwworld/worldimp.hpp b/apps/openmw/mwworld/worldimp.hpp index 5e8bc697e..20da6f729 100644 --- a/apps/openmw/mwworld/worldimp.hpp +++ b/apps/openmw/mwworld/worldimp.hpp @@ -309,6 +309,7 @@ namespace MWWorld virtual void renderPlayer(); virtual void updateCharacterPreview(int sizeX, int sizeY); + virtual void updateRaceSelectionPreview(float angle); }; } diff --git a/files/mygui/openmw_chargen_race.layout b/files/mygui/openmw_chargen_race.layout index 3d32ffd9a..6891f5d93 100644 --- a/files/mygui/openmw_chargen_race.layout +++ b/files/mygui/openmw_chargen_race.layout @@ -8,7 +8,9 @@ - + + + diff --git a/files/mygui/openmw_inventory_window.layout b/files/mygui/openmw_inventory_window.layout index 31bf58c34..4f295212b 100644 --- a/files/mygui/openmw_inventory_window.layout +++ b/files/mygui/openmw_inventory_window.layout @@ -13,7 +13,6 @@ - diff --git a/libs/openengine/ogre/renderer.cpp b/libs/openengine/ogre/renderer.cpp index e342f4c5f..2764410ad 100644 --- a/libs/openengine/ogre/renderer.cpp +++ b/libs/openengine/ogre/renderer.cpp @@ -188,7 +188,7 @@ void OgreRenderer::createWindow(const std::string &title, const WindowSettings& mWindow = mRoot->createRenderWindow(title, settings.window_x, settings.window_y, settings.fullscreen, ¶ms); // create the semi-transparent black background texture used by the GUI. - // has to be created in code with TU_DYNAMIC_WRITE_ONLY_DISCARDABLE param + // has to be created in code with TU_DYNAMIC_WRITE_ONLY param // so that it can be modified at runtime. Ogre::TextureManager::getSingleton().createManual( "transparent.png", @@ -197,7 +197,7 @@ void OgreRenderer::createWindow(const std::string &title, const WindowSettings& 1, 1, 0, Ogre::PF_A8R8G8B8, - Ogre::TU_DYNAMIC_WRITE_ONLY_DISCARDABLE); + Ogre::TU_DYNAMIC_WRITE_ONLY); } void OgreRenderer::createScene(const std::string& camName, float fov, float nearClip) From 6ac2a12296f92a3e55b3d2c1b6771aed5ab72270 Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 14 Sep 2012 14:34:18 +0200 Subject: [PATCH 06/29] item selection working on the preview --- CMakeLists.txt | 1 + apps/openmw/mwbase/world.hpp | 1 + apps/openmw/mwgui/inventorywindow.cpp | 30 +++++ apps/openmw/mwgui/inventorywindow.hpp | 6 + apps/openmw/mwgui/tooltips.cpp | 13 ++- apps/openmw/mwrender/characterpreview.cpp | 16 +++ apps/openmw/mwrender/characterpreview.hpp | 15 +++ apps/openmw/mwrender/npcanimation.cpp | 59 +++++----- apps/openmw/mwrender/npcanimation.hpp | 4 +- apps/openmw/mwrender/renderingmanager.cpp | 6 + apps/openmw/mwrender/renderingmanager.hpp | 1 + apps/openmw/mwworld/worldimp.cpp | 15 +++ apps/openmw/mwworld/worldimp.hpp | 1 + extern/shiny | 2 +- files/CMakeLists.txt | 4 +- files/materials/selection.mat | 8 ++ files/materials/selection.shader | 24 ++++ files/materials/selection.shaderset | 15 +++ files/mygui/openmw_chargen_race.layout | 2 +- files/mygui/openmw_inventory_window.layout | 1 + libs/openengine/ogre/selectionbuffer.cpp | 123 +++++++++++++++++++++ libs/openengine/ogre/selectionbuffer.hpp | 54 +++++++++ 22 files changed, 367 insertions(+), 34 deletions(-) create mode 100644 files/materials/selection.mat create mode 100644 files/materials/selection.shader create mode 100644 files/materials/selection.shaderset create mode 100644 libs/openengine/ogre/selectionbuffer.cpp create mode 100644 libs/openengine/ogre/selectionbuffer.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index b5b0884e4..e01b3d26b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,6 +103,7 @@ set(OENGINE_OGRE ${LIBDIR}/openengine/ogre/fader.cpp ${LIBDIR}/openengine/ogre/imagerotate.cpp ${LIBDIR}/openengine/ogre/atlas.cpp + ${LIBDIR}/openengine/ogre/selectionbuffer.cpp ) set(OENGINE_GUI ${LIBDIR}/openengine/gui/manager.cpp diff --git a/apps/openmw/mwbase/world.hpp b/apps/openmw/mwbase/world.hpp index f56313ba3..0865f6383 100644 --- a/apps/openmw/mwbase/world.hpp +++ b/apps/openmw/mwbase/world.hpp @@ -274,6 +274,7 @@ namespace MWBase virtual void updateCharacterPreview(int sizeX, int sizeY) = 0; virtual void updateRaceSelectionPreview(float angle) = 0; + virtual MWWorld::Ptr getCharacterPreviewItemSelected(int posX, int posY) = 0; }; } diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index 9df6d893d..7e46aeb03 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -44,6 +44,8 @@ namespace MWGui : ContainerBase(dragAndDrop) , WindowPinnableBase("openmw_inventory_window.layout", parWindowManager) , mTrading(false) + , mAvatarClickedPosX(0) + , mAvatarClickedPosY(0) { static_cast(mMainWidget)->eventWindowChangeCoord += MyGUI::newDelegate(this, &InventoryWindow::onWindowResize); @@ -107,6 +109,7 @@ namespace MWGui MWBase::Environment::get().getWorld()->updateCharacterPreview (size.width, size.height); mAvatarImage->setSize(MyGUI::IntSize(std::max(mAvatar->getSize().width, 512), std::max(mAvatar->getSize().height, 1024))); mAvatarImage->setImageTexture("CharacterPreview"); + mAvatarImage->setImageTexture("SelectionBuffer"); } void InventoryWindow::onFilterChanged(MyGUI::Widget* _sender) @@ -180,6 +183,28 @@ namespace MWGui notifyContentChanged(); } + else + { + MyGUI::IntPoint mousePos = MyGUI::InputManager::getInstance ().getLastPressedPosition (MyGUI::MouseButton::Left); + MyGUI::IntPoint relPos = mousePos - mAvatar->getAbsolutePosition (); + int realX = int(float(relPos.left) / float(mAvatar->getSize().width) * 512.f ); + int realY = int(float(relPos.top) / float(mAvatar->getSize().height) * 1024.f ); + MWWorld::Ptr itemSelected = MWBase::Environment::get().getWorld ()->getCharacterPreviewItemSelected (realX, realY); + if (itemSelected.isEmpty ()) + return; + + + for (unsigned int i=0; i < mContainerWidget->getChildCount (); ++i) + { + MyGUI::Widget* w = mContainerWidget->getChildAt (i); + + if (*w->getUserData() == itemSelected) + { + onSelectedItem(w); + return; + } + } + } } std::vector InventoryWindow::getEquippedItems() @@ -336,4 +361,9 @@ namespace MWGui text->setCaption(getCountString(count)); mDragAndDrop->mDraggedFrom = this; } + + MyGUI::IntCoord InventoryWindow::getAvatarScreenCoord () + { + return mAvatar->getAbsoluteCoord (); + } } diff --git a/apps/openmw/mwgui/inventorywindow.hpp b/apps/openmw/mwgui/inventorywindow.hpp index 4a385dd71..288f32704 100644 --- a/apps/openmw/mwgui/inventorywindow.hpp +++ b/apps/openmw/mwgui/inventorywindow.hpp @@ -22,6 +22,8 @@ namespace MWGui int getPlayerGold(); + MyGUI::IntCoord getAvatarScreenCoord(); + protected: MyGUI::Widget* mAvatar; MyGUI::ImageBox* mAvatarImage; @@ -38,6 +40,10 @@ namespace MWGui MyGUI::Button* mFilterMagic; MyGUI::Button* mFilterMisc; + int mAvatarClickedPosX; + int mAvatarClickedPosY; + + bool mTrading; void onWindowResize(MyGUI::Window* _sender); diff --git a/apps/openmw/mwgui/tooltips.cpp b/apps/openmw/mwgui/tooltips.cpp index 7aee26bcc..3306ea5c2 100644 --- a/apps/openmw/mwgui/tooltips.cpp +++ b/apps/openmw/mwgui/tooltips.cpp @@ -14,6 +14,7 @@ #include "map_window.hpp" #include "widgets.hpp" +#include "inventorywindow.hpp" using namespace MWGui; using namespace MyGUI; @@ -162,12 +163,22 @@ void ToolTips::onFrame(float frameDuration) return; } - if (type == "ItemPtr") { mFocusObject = *focus->getUserData(); tooltipSize = getToolTipViaPtr(false); } + else if (type == "AvatarItemSelection") + { + MyGUI::IntCoord avatarPos = mWindowManager->getInventoryWindow ()->getAvatarScreenCoord (); + MyGUI::IntPoint relMousePos = MyGUI::InputManager::getInstance ().getMousePosition () - MyGUI::IntPoint(avatarPos.left, avatarPos.top); + int realX = int(float(relMousePos.left) / float(avatarPos.width) * 512.f ); + int realY = int(float(relMousePos.top) / float(avatarPos.height) * 1024.f ); + MWWorld::Ptr item = MWBase::Environment::get().getWorld ()->getCharacterPreviewItemSelected (realX, realY); + + mFocusObject = item; + tooltipSize = getToolTipViaPtr(false); + } else if (type == "Spell") { ToolTipInfo info; diff --git a/apps/openmw/mwrender/characterpreview.cpp b/apps/openmw/mwrender/characterpreview.cpp index 21442782f..4a450fad9 100644 --- a/apps/openmw/mwrender/characterpreview.cpp +++ b/apps/openmw/mwrender/characterpreview.cpp @@ -4,6 +4,8 @@ #include #include +#include + #include "renderconst.hpp" #include "npcanimation.hpp" @@ -50,7 +52,12 @@ namespace MWRender : CharacterPreview(sceneMgr, node, 512, 1024, "CharacterPreview", Ogre::Vector3(0, 65, -180), Ogre::Vector3(0,65,0)) , mAnimation(NULL) { + mSelectionBuffer = new OEngine::Render::SelectionBuffer(mCamera, 512, 1024, RV_PlayerPreview); + } + InventoryPreview::~InventoryPreview() + { + delete mSelectionBuffer; } void InventoryPreview::update(int sizeX, int sizeY) @@ -63,7 +70,10 @@ namespace MWRender mNode->setOrientation (Ogre::Quaternion::IDENTITY); mNode->setVisible (true); + mRenderTarget->update(); + mSelectionBuffer->update(); + mNode->setVisible (false); } @@ -72,6 +82,12 @@ namespace MWRender mAnimation = anim; } + int InventoryPreview::getSlotSelected (int posX, int posY) + { + std::cout << posX << " " << posY << std::endl; + return mSelectionBuffer->getSelected (posX, posY); + } + // -------------------------------------------------------------------------------------------------- RaceSelectionPreview::RaceSelectionPreview(Ogre::SceneManager *sceneMgr, Ogre::SceneNode *node) diff --git a/apps/openmw/mwrender/characterpreview.hpp b/apps/openmw/mwrender/characterpreview.hpp index ba48ea17d..fd406ceb5 100644 --- a/apps/openmw/mwrender/characterpreview.hpp +++ b/apps/openmw/mwrender/characterpreview.hpp @@ -2,6 +2,16 @@ #define MWRENDER_CHARACTERPREVIEW_H #include +#include + + +namespace OEngine +{ +namespace Render +{ +class SelectionBuffer; +} +} namespace MWRender { @@ -32,13 +42,18 @@ namespace MWRender { public: InventoryPreview(Ogre::SceneManager* sceneMgr, Ogre::SceneNode* node); + virtual ~InventoryPreview(); void update(int sizeX, int sizeY); + int getSlotSelected(int posX, int posY); + void setNpcAnimation (NpcAnimation* anim); private: NpcAnimation* mAnimation; + + OEngine::Render::SelectionBuffer* mSelectionBuffer; }; class RaceSelectionPreview : public CharacterPreview diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp index 00b877ba0..c039b8d44 100644 --- a/apps/openmw/mwrender/npcanimation.cpp +++ b/apps/openmw/mwrender/npcanimation.cpp @@ -94,6 +94,8 @@ NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, Ogre::SceneNode* node, OEngi { Ogre::Entity *base = mEntityList.mEntities[i]; + base->getUserObjectBindings ().setUserAny (Ogre::Any(-1)); + base->setVisibilityFlags(mVisibilityFlags); bool transparent = false; for(unsigned int j=0;j < base->getNumSubEntities();++j) @@ -351,13 +353,16 @@ void NpcAnimation::updateParts() } } -NifOgre::EntityList NpcAnimation::insertBoundedPart(const std::string &mesh, const std::string &bonename) +NifOgre::EntityList NpcAnimation::insertBoundedPart(const std::string &mesh, int group, const std::string &bonename) { NifOgre::EntityList entities = NIFLoader::createEntities(mEntityList.mSkelBase, bonename, mInsert, mesh); std::vector &parts = entities.mEntities; for(size_t i = 0;i < parts.size();i++) + { parts[i]->setVisibilityFlags(mVisibilityFlags); + parts[i]->getUserObjectBindings ().setUserAny (Ogre::Any(group)); + } return entities; } @@ -480,83 +485,83 @@ bool NpcAnimation::addOrReplaceIndividualPart(int type, int group, int priority, switch(type) { case ESM::PRT_Head: //0 - head = insertBoundedPart(mesh, "Head"); + head = insertBoundedPart(mesh, group, "Head"); break; case ESM::PRT_Hair: //1 - hair = insertBoundedPart(mesh, "Head"); + hair = insertBoundedPart(mesh, group, "Head"); break; case ESM::PRT_Neck: //2 - neck = insertBoundedPart(mesh, "Neck"); + neck = insertBoundedPart(mesh, group, "Neck"); break; case ESM::PRT_Cuirass: //3 - chest = insertBoundedPart(mesh, "Chest"); + chest = insertBoundedPart(mesh, group, "Chest"); break; case ESM::PRT_Groin: //4 - groin = insertBoundedPart(mesh, "Groin"); + groin = insertBoundedPart(mesh, group, "Groin"); break; case ESM::PRT_Skirt: //5 - skirt = insertBoundedPart(mesh, "Groin"); + skirt = insertBoundedPart(mesh, group, "Groin"); break; case ESM::PRT_RHand: //6 - rHand = insertBoundedPart(mesh, "Right Hand"); + rHand = insertBoundedPart(mesh, group, "Right Hand"); break; case ESM::PRT_LHand: //7 - lHand = insertBoundedPart(mesh, "Left Hand"); + lHand = insertBoundedPart(mesh, group, "Left Hand"); break; case ESM::PRT_RWrist: //8 - rWrist = insertBoundedPart(mesh, "Right Wrist"); + rWrist = insertBoundedPart(mesh, group, "Right Wrist"); break; case ESM::PRT_LWrist: //9 - lWrist = insertBoundedPart(mesh, "Left Wrist"); + lWrist = insertBoundedPart(mesh, group, "Left Wrist"); break; case ESM::PRT_Shield: //10 break; case ESM::PRT_RForearm: //11 - rForearm = insertBoundedPart(mesh, "Right Forearm"); + rForearm = insertBoundedPart(mesh, group, "Right Forearm"); break; case ESM::PRT_LForearm: //12 - lForearm = insertBoundedPart(mesh, "Left Forearm"); + lForearm = insertBoundedPart(mesh, group, "Left Forearm"); break; case ESM::PRT_RUpperarm: //13 - rupperArm = insertBoundedPart(mesh, "Right Upper Arm"); + rupperArm = insertBoundedPart(mesh, group, "Right Upper Arm"); break; case ESM::PRT_LUpperarm: //14 - lupperArm = insertBoundedPart(mesh, "Left Upper Arm"); + lupperArm = insertBoundedPart(mesh, group, "Left Upper Arm"); break; case ESM::PRT_RFoot: //15 - rfoot = insertBoundedPart(mesh, "Right Foot"); + rfoot = insertBoundedPart(mesh, group, "Right Foot"); break; case ESM::PRT_LFoot: //16 - lfoot = insertBoundedPart(mesh, "Left Foot"); + lfoot = insertBoundedPart(mesh, group, "Left Foot"); break; case ESM::PRT_RAnkle: //17 - rAnkle = insertBoundedPart(mesh, "Right Ankle"); + rAnkle = insertBoundedPart(mesh, group, "Right Ankle"); break; case ESM::PRT_LAnkle: //18 - lAnkle = insertBoundedPart(mesh, "Left Ankle"); + lAnkle = insertBoundedPart(mesh, group, "Left Ankle"); break; case ESM::PRT_RKnee: //19 - rKnee = insertBoundedPart(mesh, "Right Knee"); + rKnee = insertBoundedPart(mesh, group, "Right Knee"); break; case ESM::PRT_LKnee: //20 - lKnee = insertBoundedPart(mesh, "Left Knee"); + lKnee = insertBoundedPart(mesh, group, "Left Knee"); break; case ESM::PRT_RLeg: //21 - rUpperLeg = insertBoundedPart(mesh, "Right Upper Leg"); + rUpperLeg = insertBoundedPart(mesh, group, "Right Upper Leg"); break; case ESM::PRT_LLeg: //22 - lUpperLeg = insertBoundedPart(mesh, "Left Upper Leg"); + lUpperLeg = insertBoundedPart(mesh, group, "Left Upper Leg"); break; case ESM::PRT_RPauldron: //23 - rclavicle = insertBoundedPart(mesh , "Right Clavicle"); + rclavicle = insertBoundedPart(mesh , group, "Right Clavicle"); break; case ESM::PRT_LPauldron: //24 - lclavicle = insertBoundedPart(mesh, "Left Clavicle"); + lclavicle = insertBoundedPart(mesh, group, "Left Clavicle"); break; case ESM::PRT_Weapon: //25 break; case ESM::PRT_Tail: //26 - tail = insertBoundedPart(mesh, "Tail"); + tail = insertBoundedPart(mesh, group, "Tail"); break; } return true; @@ -575,7 +580,7 @@ void NpcAnimation::addPartGroup(int group, int priority, std::vectorgetStore().bodyParts.search(part.male); if(bodypart) - addOrReplaceIndividualPart(part.part, group,priority,"meshes\\" + bodypart->model); + addOrReplaceIndividualPart(part.part, group, priority,"meshes\\" + bodypart->model); else reserveIndividualPart(part.part, group, priority); } diff --git a/apps/openmw/mwrender/npcanimation.hpp b/apps/openmw/mwrender/npcanimation.hpp index fe66d733a..699c6648d 100644 --- a/apps/openmw/mwrender/npcanimation.hpp +++ b/apps/openmw/mwrender/npcanimation.hpp @@ -18,8 +18,6 @@ private: int mPartslots[27]; //Each part slot is taken by clothing, armor, or is empty int mPartPriorities[27]; - bool mIsPlayer; - //Bounded Parts NifOgre::EntityList lclavicle; NifOgre::EntityList rclavicle; @@ -73,7 +71,7 @@ public: NpcAnimation(const MWWorld::Ptr& ptr, Ogre::SceneNode* node, OEngine::Render::OgreRenderer& _rend, MWWorld::InventoryStore& _inv, int visibilityFlags); virtual ~NpcAnimation(); - NifOgre::EntityList insertBoundedPart(const std::string &mesh, const std::string &bonename); + NifOgre::EntityList insertBoundedPart(const std::string &mesh, int group, const std::string &bonename); virtual void runAnimation(float timepassed); void updateParts(); void removeEntities(NifOgre::EntityList &entities); diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index d2a51f5f1..a1ad77caf 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -905,4 +905,10 @@ void RenderingManager::updateRaceSelectionPreview (float angle) mRaceSelectionPreview->update(angle); } +int RenderingManager::getCharacterPreviewSlotSelected(int posX, int posY) +{ + std::cout << "SLOT IS " << mInventoryPreview->getSlotSelected(posX, posY) << std::endl; + return mInventoryPreview->getSlotSelected(posX, posY); +} + } // namespace diff --git a/apps/openmw/mwrender/renderingmanager.hpp b/apps/openmw/mwrender/renderingmanager.hpp index cbad67472..42fcb1502 100644 --- a/apps/openmw/mwrender/renderingmanager.hpp +++ b/apps/openmw/mwrender/renderingmanager.hpp @@ -195,6 +195,7 @@ class RenderingManager: private RenderingInterface, public Ogre::WindowEventList void updateCharacterPreview(int sizeX, int sizeY); void updateRaceSelectionPreview(float angle); + int getCharacterPreviewSlotSelected(int posX, int posY); protected: virtual void windowResized(Ogre::RenderWindow* rw); diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 005b94ffa..a38cdd5ff 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1232,4 +1232,19 @@ namespace MWWorld { mRendering->updateRaceSelectionPreview(angle); } + + MWWorld::Ptr World::getCharacterPreviewItemSelected(int posX, int posY) + { + int slot = mRendering->getCharacterPreviewSlotSelected(posX, posY); + + if (slot == -1) + return MWWorld::Ptr(); + + MWWorld::Ptr player = getPlayer().getPlayer (); + MWWorld::InventoryStore& invStore = MWWorld::Class::get(player).getInventoryStore(player); + if (invStore.getSlot(slot) != invStore.end()) + return *invStore.getSlot (slot); + else + return MWWorld::Ptr(); + } } diff --git a/apps/openmw/mwworld/worldimp.hpp b/apps/openmw/mwworld/worldimp.hpp index 20da6f729..cd7286861 100644 --- a/apps/openmw/mwworld/worldimp.hpp +++ b/apps/openmw/mwworld/worldimp.hpp @@ -310,6 +310,7 @@ namespace MWWorld virtual void updateCharacterPreview(int sizeX, int sizeY); virtual void updateRaceSelectionPreview(float angle); + virtual MWWorld::Ptr getCharacterPreviewItemSelected(int posX, int posY); }; } diff --git a/extern/shiny b/extern/shiny index 716841523..4750676ac 160000 --- a/extern/shiny +++ b/extern/shiny @@ -1 +1 @@ -Subproject commit 7168415233905de2864eec71ed4312cb8f83059b +Subproject commit 4750676ac46a7aaa86bca53dc68c5a1ba11f3bc1 diff --git a/files/CMakeLists.txt b/files/CMakeLists.txt index 3e99f5745..e8426afb7 100644 --- a/files/CMakeLists.txt +++ b/files/CMakeLists.txt @@ -40,7 +40,9 @@ set(MATERIAL_FILES water.mat water.shader water.shaderset - + selection.mat + selection.shader + selection.shaderset ) copy_all_files(${CMAKE_CURRENT_SOURCE_DIR}/water "${OpenMW_BINARY_DIR}/resources/water/" "${WATER_FILES}") diff --git a/files/materials/selection.mat b/files/materials/selection.mat new file mode 100644 index 000000000..a76dd7179 --- /dev/null +++ b/files/materials/selection.mat @@ -0,0 +1,8 @@ +material SelectionColour +{ + pass + { + vertex_program selection_vertex + fragment_program selection_fragment + } +} diff --git a/files/materials/selection.shader b/files/materials/selection.shader new file mode 100644 index 000000000..095a31259 --- /dev/null +++ b/files/materials/selection.shader @@ -0,0 +1,24 @@ +#include "core.h" + +#ifdef SH_VERTEX_SHADER + + SH_BEGIN_PROGRAM + shUniform(float4x4, wvp) @shAutoConstant(wvp, worldviewproj_matrix) + + SH_START_PROGRAM + { + shOutputPosition = shMatrixMult(wvp, shInputPosition); + } + +#else + + SH_BEGIN_PROGRAM + shUniform(float4, colour) @shAutoConstant(colour, custom, 1) + + SH_START_PROGRAM + { + shOutputColour(0) = colour; + //shOutputColour(0) = float4(1,0,0,1); + } + +#endif diff --git a/files/materials/selection.shaderset b/files/materials/selection.shaderset new file mode 100644 index 000000000..c90826282 --- /dev/null +++ b/files/materials/selection.shaderset @@ -0,0 +1,15 @@ +shader_set selection_vertex +{ + source selection.shader + type vertex + profiles_cg vs_2_0 arbvp1 + profiles_hlsl vs_2_0 +} + +shader_set selection_fragment +{ + source selection.shader + type fragment + profiles_cg ps_2_x ps_2_0 ps arbfp1 + profiles_hlsl ps_2_0 +} diff --git a/files/mygui/openmw_chargen_race.layout b/files/mygui/openmw_chargen_race.layout index 6891f5d93..b69073899 100644 --- a/files/mygui/openmw_chargen_race.layout +++ b/files/mygui/openmw_chargen_race.layout @@ -14,7 +14,7 @@ - + diff --git a/files/mygui/openmw_inventory_window.layout b/files/mygui/openmw_inventory_window.layout index 4f295212b..86dee558f 100644 --- a/files/mygui/openmw_inventory_window.layout +++ b/files/mygui/openmw_inventory_window.layout @@ -12,6 +12,7 @@ + diff --git a/libs/openengine/ogre/selectionbuffer.cpp b/libs/openengine/ogre/selectionbuffer.cpp new file mode 100644 index 000000000..99489f008 --- /dev/null +++ b/libs/openengine/ogre/selectionbuffer.cpp @@ -0,0 +1,123 @@ +#include "selectionbuffer.hpp" + +#include +#include +#include +#include + +#include + +namespace OEngine +{ +namespace Render +{ + + SelectionBuffer::SelectionBuffer(Ogre::Camera *camera, int sizeX, int sizeY, int visibilityFlags) + { + mTexture = Ogre::TextureManager::getSingleton().createManual("SelectionBuffer", + Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, sizeX, sizeY, 0, Ogre::PF_R8G8B8, Ogre::TU_RENDERTARGET); + + mRenderTarget = mTexture->getBuffer()->getRenderTarget(); + Ogre::Viewport* vp = mRenderTarget->addViewport(camera); + vp->setOverlaysEnabled(false); + vp->setBackgroundColour(Ogre::ColourValue(0, 0, 0, 0)); + vp->setShadowsEnabled(false); + vp->setMaterialScheme("selectionbuffer"); + vp->setVisibilityMask (visibilityFlags); + mRenderTarget->setActive(true); + mRenderTarget->setAutoUpdated (false); + + mCurrentColour = Ogre::ColourValue(0.3, 0.3, 0.3); + } + + SelectionBuffer::~SelectionBuffer() + { + Ogre::TextureManager::getSingleton ().remove("SelectionBuffer"); + } + + void SelectionBuffer::update () + { + Ogre::MaterialManager::getSingleton ().addListener (this); + + mRenderTarget->update(); + + Ogre::MaterialManager::getSingleton ().removeListener (this); + + mTexture->convertToImage(mBuffer); + } + + int SelectionBuffer::getSelected(int xPos, int yPos) + { + Ogre::ColourValue clr = mBuffer.getColourAt (xPos, yPos, 0); + clr.a = 1; + if (mColourMap.find(clr) != mColourMap.end()) + return mColourMap[clr]; + else + return -1; // nothing selected + } + + Ogre::Technique* SelectionBuffer::handleSchemeNotFound ( + unsigned short schemeIndex, const Ogre::String &schemeName, Ogre::Material *originalMaterial, + unsigned short lodIndex, const Ogre::Renderable *rend) + { + if (schemeName == "selectionbuffer") + { + sh::Factory::getInstance ()._ensureMaterial ("SelectionColour", "Default"); + + Ogre::MaterialPtr m = Ogre::MaterialManager::getSingleton ().getByName("SelectionColour"); + + + if(typeid(*rend) == typeid(Ogre::SubEntity)) + { + const Ogre::SubEntity *subEntity = static_cast(rend); + int id = subEntity->getParent ()->getUserObjectBindings().getUserAny().get(); + std::cout << "found ID:" << id << " entity name is " << subEntity->getParent()->getName() << std::endl; + bool found = false; + Ogre::ColourValue colour; + for (std::map::iterator it = mColourMap.begin(); it != mColourMap.end(); ++it) + { + if (it->second == id) + { + found = true; + colour = it->first; + } + } + + + if (!found) + { + getNextColour(); + const_cast(subEntity)->setCustomParameter(1, Ogre::Vector4(mCurrentColour.r, mCurrentColour.g, mCurrentColour.b, 1.0)); + mColourMap[mCurrentColour] = id; + } + else + { + const_cast(subEntity)->setCustomParameter(1, Ogre::Vector4(colour.r, colour.g, colour.b, 1.0)); + } + + assert(m->getTechnique(1)); + return m->getTechnique(1); + } + else + throw std::runtime_error("selectionbuffer only works with entities"); + } + return NULL; + } + + void SelectionBuffer::getNextColour () + { + Ogre::ARGB color = (float(rand()) / float(RAND_MAX)) * std::numeric_limits::max(); + + if (mCurrentColour.getAsARGB () == color) + { + getNextColour(); + return; + } + + mCurrentColour.setAsARGB(color); + mCurrentColour.a = 1; + } + + +} +} diff --git a/libs/openengine/ogre/selectionbuffer.hpp b/libs/openengine/ogre/selectionbuffer.hpp new file mode 100644 index 000000000..c487b24b0 --- /dev/null +++ b/libs/openengine/ogre/selectionbuffer.hpp @@ -0,0 +1,54 @@ +#ifndef OENGINE_SELECTIONBUFFER_H +#define OENGINE_SELECTIONBUFFER_H + + +#include +#include +#include + +namespace OEngine +{ +namespace Render +{ + + struct cmp_ColourValue + { + bool operator()(const Ogre::ColourValue &a, const Ogre::ColourValue &b) const + { + return a.getAsBGRA() < b.getAsBGRA(); + } + }; + + class SelectionBuffer : public Ogre::MaterialManager::Listener + { + public: + SelectionBuffer(Ogre::Camera* camera, int sizeX, int sizeY, int visibilityFlags); + virtual ~SelectionBuffer(); + + int getSelected(int xPos, int yPos); + ///< @return ID of the selected object + + void update(); + + virtual Ogre::Technique* handleSchemeNotFound ( + unsigned short schemeIndex, const Ogre::String &schemeName, Ogre::Material *originalMaterial, + unsigned short lodIndex, const Ogre::Renderable *rend); + + + private: + Ogre::TexturePtr mTexture; + Ogre::RenderTexture* mRenderTarget; + + Ogre::Image mBuffer; + + std::map mColourMap; + + Ogre::ColourValue mCurrentColour; + + void getNextColour(); + }; + +} +} + +#endif From 1f7e044fadd45b0658f08595d113b56d59f4d5f8 Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 14 Sep 2012 14:41:19 +0200 Subject: [PATCH 07/29] removed some debug stuff --- apps/openmw/mwgui/inventorywindow.cpp | 2 -- apps/openmw/mwrender/characterpreview.cpp | 1 - apps/openmw/mwrender/renderingmanager.cpp | 1 - libs/openengine/ogre/selectionbuffer.cpp | 1 - 4 files changed, 5 deletions(-) diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index 7e46aeb03..f5091eea6 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -109,7 +109,6 @@ namespace MWGui MWBase::Environment::get().getWorld()->updateCharacterPreview (size.width, size.height); mAvatarImage->setSize(MyGUI::IntSize(std::max(mAvatar->getSize().width, 512), std::max(mAvatar->getSize().height, 1024))); mAvatarImage->setImageTexture("CharacterPreview"); - mAvatarImage->setImageTexture("SelectionBuffer"); } void InventoryWindow::onFilterChanged(MyGUI::Widget* _sender) @@ -294,7 +293,6 @@ namespace MWGui MyGUI::IntSize size = mAvatar->getSize(); MWBase::Environment::get().getWorld()->updateCharacterPreview (size.width, size.height); - mAvatarImage->setSize(MyGUI::IntSize(512, 1024)); mAvatarImage->setImageTexture("CharacterPreview"); } diff --git a/apps/openmw/mwrender/characterpreview.cpp b/apps/openmw/mwrender/characterpreview.cpp index 4a450fad9..1be78a0f7 100644 --- a/apps/openmw/mwrender/characterpreview.cpp +++ b/apps/openmw/mwrender/characterpreview.cpp @@ -84,7 +84,6 @@ namespace MWRender int InventoryPreview::getSlotSelected (int posX, int posY) { - std::cout << posX << " " << posY << std::endl; return mSelectionBuffer->getSelected (posX, posY); } diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index a1ad77caf..4b77da5e1 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -907,7 +907,6 @@ void RenderingManager::updateRaceSelectionPreview (float angle) int RenderingManager::getCharacterPreviewSlotSelected(int posX, int posY) { - std::cout << "SLOT IS " << mInventoryPreview->getSlotSelected(posX, posY) << std::endl; return mInventoryPreview->getSlotSelected(posX, posY); } diff --git a/libs/openengine/ogre/selectionbuffer.cpp b/libs/openengine/ogre/selectionbuffer.cpp index 99489f008..7b9e6f984 100644 --- a/libs/openengine/ogre/selectionbuffer.cpp +++ b/libs/openengine/ogre/selectionbuffer.cpp @@ -71,7 +71,6 @@ namespace Render { const Ogre::SubEntity *subEntity = static_cast(rend); int id = subEntity->getParent ()->getUserObjectBindings().getUserAny().get(); - std::cout << "found ID:" << id << " entity name is " << subEntity->getParent()->getName() << std::endl; bool found = false; Ogre::ColourValue colour; for (std::map::iterator it = mColourMap.begin(); it != mColourMap.end(); ++it) From 565aad378333f9a07152694ad2c462365f850d46 Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 14 Sep 2012 14:49:56 +0200 Subject: [PATCH 08/29] changed a method for ogre 1.8.0 --- libs/openengine/ogre/selectionbuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/openengine/ogre/selectionbuffer.cpp b/libs/openengine/ogre/selectionbuffer.cpp index 7b9e6f984..3ecb99f3b 100644 --- a/libs/openengine/ogre/selectionbuffer.cpp +++ b/libs/openengine/ogre/selectionbuffer.cpp @@ -70,7 +70,7 @@ namespace Render if(typeid(*rend) == typeid(Ogre::SubEntity)) { const Ogre::SubEntity *subEntity = static_cast(rend); - int id = subEntity->getParent ()->getUserObjectBindings().getUserAny().get(); + int id = Ogre::any_cast(subEntity->getParent ()->getUserObjectBindings().getUserAny()); bool found = false; Ogre::ColourValue colour; for (std::map::iterator it = mColourMap.begin(); it != mColourMap.end(); ++it) From a308d2e38a35db50d173408750086915fd6e2884 Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 14 Sep 2012 15:33:24 +0200 Subject: [PATCH 09/29] fixed exception, fixed armor label obscuring the items --- apps/openmw/mwgui/tooltips.cpp | 3 ++- files/mygui/openmw_inventory_window.layout | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwgui/tooltips.cpp b/apps/openmw/mwgui/tooltips.cpp index 3306ea5c2..039df2269 100644 --- a/apps/openmw/mwgui/tooltips.cpp +++ b/apps/openmw/mwgui/tooltips.cpp @@ -177,7 +177,8 @@ void ToolTips::onFrame(float frameDuration) MWWorld::Ptr item = MWBase::Environment::get().getWorld ()->getCharacterPreviewItemSelected (realX, realY); mFocusObject = item; - tooltipSize = getToolTipViaPtr(false); + if (!mFocusObject.isEmpty ()) + tooltipSize = getToolTipViaPtr(false); } else if (type == "Spell") { diff --git a/files/mygui/openmw_inventory_window.layout b/files/mygui/openmw_inventory_window.layout index 86dee558f..3a60916f7 100644 --- a/files/mygui/openmw_inventory_window.layout +++ b/files/mygui/openmw_inventory_window.layout @@ -18,6 +18,7 @@ + From 7c59b83419809721f03a107d74be13434cf12597 Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 14 Sep 2012 17:10:10 +0200 Subject: [PATCH 10/29] performance optimization --- apps/openmw/mwgui/inventorywindow.cpp | 16 ++++++++-------- apps/openmw/mwgui/inventorywindow.hpp | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index f5091eea6..dffd14d17 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -44,8 +44,8 @@ namespace MWGui : ContainerBase(dragAndDrop) , WindowPinnableBase("openmw_inventory_window.layout", parWindowManager) , mTrading(false) - , mAvatarClickedPosX(0) - , mAvatarClickedPosY(0) + , mLastXSize(0) + , mLastYSize(0) { static_cast(mMainWidget)->eventWindowChangeCoord += MyGUI::newDelegate(this, &InventoryWindow::onWindowResize); @@ -102,13 +102,13 @@ namespace MWGui mRightPane->getPosition().top, _sender->getSize().width - 12 - (_sender->getSize().height-44) * aspect - 15, _sender->getSize().height-44 ); - drawItems(); - MyGUI::IntSize size = mAvatar->getSize(); - - MWBase::Environment::get().getWorld()->updateCharacterPreview (size.width, size.height); - mAvatarImage->setSize(MyGUI::IntSize(std::max(mAvatar->getSize().width, 512), std::max(mAvatar->getSize().height, 1024))); - mAvatarImage->setImageTexture("CharacterPreview"); + if (mMainWidget->getSize().width != mLastXSize || mMainWidget->getSize().height != mLastYSize) + { + drawItems(); + mLastXSize = mMainWidget->getSize().width; + mLastYSize = mMainWidget->getSize().height; + } } void InventoryWindow::onFilterChanged(MyGUI::Widget* _sender) diff --git a/apps/openmw/mwgui/inventorywindow.hpp b/apps/openmw/mwgui/inventorywindow.hpp index 288f32704..f17431597 100644 --- a/apps/openmw/mwgui/inventorywindow.hpp +++ b/apps/openmw/mwgui/inventorywindow.hpp @@ -40,8 +40,8 @@ namespace MWGui MyGUI::Button* mFilterMagic; MyGUI::Button* mFilterMisc; - int mAvatarClickedPosX; - int mAvatarClickedPosY; + int mLastXSize; + int mLastYSize; bool mTrading; From 35f7216f2f52b4b21e89ecdf974f731ca18add84 Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 14 Sep 2012 17:25:32 +0200 Subject: [PATCH 11/29] fixed some things --- apps/openmw/mwgui/inventorywindow.cpp | 3 ++- apps/openmw/mwrender/npcanimation.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index dffd14d17..66a8efe5d 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -92,6 +92,7 @@ namespace MWGui mBoughtItems.clear(); onWindowResize(static_cast(mMainWidget)); + drawItems(); } void InventoryWindow::onWindowResize(MyGUI::Window* _sender) @@ -293,7 +294,7 @@ namespace MWGui MyGUI::IntSize size = mAvatar->getSize(); MWBase::Environment::get().getWorld()->updateCharacterPreview (size.width, size.height); - mAvatarImage->setSize(MyGUI::IntSize(512, 1024)); + mAvatarImage->setSize(MyGUI::IntSize(std::max(mAvatar->getSize().width, 512), std::max(mAvatar->getSize().height, 1024))); mAvatarImage->setImageTexture("CharacterPreview"); } diff --git a/apps/openmw/mwrender/npcanimation.cpp b/apps/openmw/mwrender/npcanimation.cpp index c039b8d44..c386193c8 100644 --- a/apps/openmw/mwrender/npcanimation.cpp +++ b/apps/openmw/mwrender/npcanimation.cpp @@ -368,7 +368,7 @@ NifOgre::EntityList NpcAnimation::insertBoundedPart(const std::string &mesh, int void NpcAnimation::runAnimation(float timepassed) { - //if(timeToChange > .2) + if(timeToChange > .2) { timeToChange = 0; updateParts(); From b76a28f69ce5357b60501b1fd2f6aca6b9c8469a Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 14 Sep 2012 19:44:00 +0200 Subject: [PATCH 12/29] beginnings of the gui --- apps/openmw/CMakeLists.txt | 2 +- apps/openmw/mwgui/levelupdialog.cpp | 63 ++++++++ apps/openmw/mwgui/levelupdialog.hpp | 30 ++++ apps/openmw/mwgui/mode.hpp | 2 + apps/openmw/mwgui/windowmanagerimp.cpp | 3 + apps/openmw/mwgui/windowmanagerimp.hpp | 2 + files/mygui/CMakeLists.txt | 5 +- .../{openmw.font.xml => openmw_font.xml} | 0 files/mygui/openmw_levelup_dialog.layout | 146 ++++++++++++++++++ ...{openmw.pointer.xml => openmw_pointer.xml} | 0 10 files changed, 250 insertions(+), 3 deletions(-) create mode 100644 apps/openmw/mwgui/levelupdialog.cpp create mode 100644 apps/openmw/mwgui/levelupdialog.hpp rename files/mygui/{openmw.font.xml => openmw_font.xml} (100%) create mode 100644 files/mygui/openmw_levelup_dialog.layout rename files/mygui/{openmw.pointer.xml => openmw_pointer.xml} (100%) diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index b9ea8041d..1870a93f8 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -29,7 +29,7 @@ add_openmw_dir (mwgui map_window window_pinnable_base cursorreplace tooltips scrollwindow bookwindow list formatting inventorywindow container hud countdialog tradewindow settingswindow confirmationdialog alchemywindow referenceinterface spellwindow mainmenu quickkeysmenu - itemselection spellbuyingwindow loadingscreen + itemselection spellbuyingwindow loadingscreen levelupdialog ) add_openmw_dir (mwdialogue diff --git a/apps/openmw/mwgui/levelupdialog.cpp b/apps/openmw/mwgui/levelupdialog.cpp new file mode 100644 index 000000000..9f57a2bdd --- /dev/null +++ b/apps/openmw/mwgui/levelupdialog.cpp @@ -0,0 +1,63 @@ +#include "levelupdialog.hpp" + +#include + +#include "../mwbase/windowmanager.hpp" +#include "../mwbase/environment.hpp" + +namespace MWGui +{ + + LevelupDialog::LevelupDialog(MWBase::WindowManager &parWindowManager) + : WindowBase("openmw_levelup_dialog.layout", parWindowManager) + { + getWidget(mOkButton, "OkButton"); + getWidget(mClassImage, "ClassImage"); + getWidget(mLevelText, "LevelText"); + + mOkButton->eventMouseButtonClick += MyGUI::newDelegate(this, &LevelupDialog::onOkButtonClicked); + + for (int i=1; i<9; ++i) + { + MyGUI::TextBox* t; + getWidget(t, "AttribVal" + boost::lexical_cast(i)); + + MyGUI::Button* b; + getWidget(b, "Attrib" + boost::lexical_cast(i)); + b->setUserData (i-1); + b->eventMouseButtonClick += MyGUI::newDelegate(this, &LevelupDialog::onAttributeClicked); + + mAttributeValues.push_back(t); + + getWidget(t, "AttribMultiplier" + boost::lexical_cast(i)); + + t->setCaption("x2"); + mAttributeMultipliers.push_back(t); + } + + center(); + + open(); + } + + void LevelupDialog::open() + { + center(); + + mClassImage->setImageTexture ("textures\\levelup\\acrobat.dds"); + + /// \todo replace this with INI-imported texts + int level = 2; + mLevelText->setCaptionWithReplacing("#{sLevelUpMenu1} " + boost::lexical_cast(level)); + } + + void LevelupDialog::onOkButtonClicked (MyGUI::Widget* sender) + { + MWBase::Environment::get().getWindowManager ()->messageBox("#{sNotifyMessage36}", std::vector()); + } + + void LevelupDialog::onAttributeClicked (MyGUI::Widget *sender) + { + int index = *sender->getUserData(); + } +} diff --git a/apps/openmw/mwgui/levelupdialog.hpp b/apps/openmw/mwgui/levelupdialog.hpp new file mode 100644 index 000000000..181868e9e --- /dev/null +++ b/apps/openmw/mwgui/levelupdialog.hpp @@ -0,0 +1,30 @@ +#ifndef MWGUI_LEVELUPDIALOG_H +#define MWGUI_LEVELUPDIALOG_H + +#include "window_base.hpp" + +namespace MWGui +{ + + class LevelupDialog : public WindowBase + { + public: + LevelupDialog(MWBase::WindowManager& parWindowManager); + + virtual void open(); + + private: + MyGUI::Button* mOkButton; + MyGUI::ImageBox* mClassImage; + MyGUI::TextBox* mLevelText; + + std::vector mAttributeValues; + std::vector mAttributeMultipliers; + + void onOkButtonClicked (MyGUI::Widget* sender); + void onAttributeClicked (MyGUI::Widget* sender); + }; + +} + +#endif diff --git a/apps/openmw/mwgui/mode.hpp b/apps/openmw/mwgui/mode.hpp index 7e1adcf8b..eb2c52b26 100644 --- a/apps/openmw/mwgui/mode.hpp +++ b/apps/openmw/mwgui/mode.hpp @@ -22,6 +22,8 @@ namespace MWGui GM_Rest, GM_SpellBuying, + GM_Levelup, + // Startup character creation dialogs GM_Name, GM_Race, diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index 99f476574..670f6122e 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -44,6 +44,7 @@ #include "spellwindow.hpp" #include "quickkeysmenu.hpp" #include "loadingscreen.hpp" +#include "levelupdialog.hpp" using namespace MWGui; @@ -147,6 +148,7 @@ WindowManager::WindowManager( mAlchemyWindow = new AlchemyWindow(*this); mSpellWindow = new SpellWindow(*this); mQuickKeysMenu = new QuickKeysMenu(*this); + mLevelupDialog = new LevelupDialog(*this); mLoadingScreen = new LoadingScreen(mOgre->getScene (), mOgre->getWindow (), *this); mLoadingScreen->onResChange (w,h); @@ -200,6 +202,7 @@ WindowManager::~WindowManager() delete mAlchemyWindow; delete mSpellWindow; delete mLoadingScreen; + delete mLevelupDialog; cleanupGarbage(); diff --git a/apps/openmw/mwgui/windowmanagerimp.hpp b/apps/openmw/mwgui/windowmanagerimp.hpp index e16b03e43..09d2f0c7d 100644 --- a/apps/openmw/mwgui/windowmanagerimp.hpp +++ b/apps/openmw/mwgui/windowmanagerimp.hpp @@ -62,6 +62,7 @@ namespace MWGui class AlchemyWindow; class QuickKeysMenu; class LoadingScreen; + class LevelupDialog; class WindowManager : public MWBase::WindowManager { @@ -224,6 +225,7 @@ namespace MWGui SpellWindow* mSpellWindow; QuickKeysMenu* mQuickKeysMenu; LoadingScreen* mLoadingScreen; + LevelupDialog* mLevelupDialog; CharacterCreation* mCharGen; diff --git a/files/mygui/CMakeLists.txt b/files/mygui/CMakeLists.txt index fdf447e69..55230fa76 100644 --- a/files/mygui/CMakeLists.txt +++ b/files/mygui/CMakeLists.txt @@ -35,7 +35,7 @@ set(MYGUI_FILES openmw_dialogue_window.layout openmw_dialogue_window_skin.xml openmw_edit.skin.xml - openmw.font.xml + openmw_font.xml openmw_hud_box.skin.xml openmw_hud_energybar.skin.xml openmw_hud.layout @@ -51,7 +51,7 @@ set(MYGUI_FILES openmw_map_window.layout openmw_map_window_skin.xml openmw_messagebox.layout - openmw.pointer.xml + openmw_pointer.xml openmw_progress.skin.xml openmw_resources.xml openmw_scroll.layout @@ -72,6 +72,7 @@ set(MYGUI_FILES openmw_magicselection_dialog.layout openmw_spell_buying_window.layout openmw_loading_screen.layout + openmw_levelup_dialog.layout smallbars.png VeraMono.ttf markers.png diff --git a/files/mygui/openmw.font.xml b/files/mygui/openmw_font.xml similarity index 100% rename from files/mygui/openmw.font.xml rename to files/mygui/openmw_font.xml diff --git a/files/mygui/openmw_levelup_dialog.layout b/files/mygui/openmw_levelup_dialog.layout new file mode 100644 index 000000000..6525a1e41 --- /dev/null +++ b/files/mygui/openmw_levelup_dialog.layout @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/files/mygui/openmw.pointer.xml b/files/mygui/openmw_pointer.xml similarity index 100% rename from files/mygui/openmw.pointer.xml rename to files/mygui/openmw_pointer.xml From b7c9285b24b1d9bd205ee36a5bf6676fd10d35be Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Fri, 14 Sep 2012 21:12:16 +0200 Subject: [PATCH 13/29] added support for out of world rendering --- apps/openmw/CMakeLists.txt | 2 +- apps/openmw/mwbase/world.hpp | 7 +++++++ apps/openmw/mwrender/externalrendering.hpp | 23 ++++++++++++++++++++++ apps/openmw/mwrender/renderingmanager.cpp | 6 ++++++ apps/openmw/mwrender/renderingmanager.hpp | 7 +++++-- apps/openmw/mwworld/worldimp.cpp | 5 +++++ apps/openmw/mwworld/worldimp.hpp | 2 ++ 7 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 apps/openmw/mwrender/externalrendering.hpp diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index b9ea8041d..79d7f7af9 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -16,7 +16,7 @@ source_group(game FILES ${GAME} ${GAME_HEADER}) add_openmw_dir (mwrender renderingmanager debugging sky player animation npcanimation creatureanimation actors objects renderinginterface localmap occlusionquery terrain terrainmaterial water shadows - compositors + compositors externalrendering ) add_openmw_dir (mwinput diff --git a/apps/openmw/mwbase/world.hpp b/apps/openmw/mwbase/world.hpp index 19405fb7a..a83d6906f 100644 --- a/apps/openmw/mwbase/world.hpp +++ b/apps/openmw/mwbase/world.hpp @@ -35,6 +35,11 @@ namespace ESMS struct ESMStore; } +namespace MWRender +{ + class ExternalRendering; +} + namespace MWWorld { class CellStore; @@ -271,6 +276,8 @@ namespace MWBase virtual void togglePlayerLooking(bool enable) = 0; virtual void renderPlayer() = 0; + + virtual void setupExternalRendering (MWRender::ExternalRendering& rendering) = 0; }; } diff --git a/apps/openmw/mwrender/externalrendering.hpp b/apps/openmw/mwrender/externalrendering.hpp new file mode 100644 index 000000000..33c9afd87 --- /dev/null +++ b/apps/openmw/mwrender/externalrendering.hpp @@ -0,0 +1,23 @@ +#ifndef GAME_RENDERING_EXTERNALRENDERING_H +#define GAME_RENDERING_EXTERNALRENDERING_H + +namespace Ogre +{ + class SceneManager; +} + +namespace MWRender +{ + /// \brief Base class for out of world rendering + class ExternalRendering + { + public: + + virtual void setup (Ogre::SceneManager *sceneManager) = 0; + + virtual ~ExternalRendering() {} + }; +} + +#endif + diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index 70d7de552..da49442f6 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -34,6 +34,7 @@ #include "water.hpp" #include "compositors.hpp" #include "npcanimation.hpp" +#include "externalrendering.hpp" using namespace MWRender; using namespace Ogre; @@ -882,4 +883,9 @@ bool RenderingManager::isPositionExplored (float nX, float nY, int x, int y, boo return mLocalMap->isPositionExplored(nX, nY, x, y, interior); } +void RenderingManager::setupExternalRendering (MWRender::ExternalRendering& rendering) +{ + rendering.setup (mRendering.getScene()); +} + } // namespace diff --git a/apps/openmw/mwrender/renderingmanager.hpp b/apps/openmw/mwrender/renderingmanager.hpp index e5be238bd..e994e4909 100644 --- a/apps/openmw/mwrender/renderingmanager.hpp +++ b/apps/openmw/mwrender/renderingmanager.hpp @@ -43,6 +43,7 @@ namespace MWRender class LocalMap; class Water; class Compositors; + class ExternalRendering; class RenderingManager: private RenderingInterface, public Ogre::WindowEventListener { @@ -185,12 +186,14 @@ class RenderingManager: private RenderingInterface, public Ogre::WindowEventList static bool waterShaderSupported(); - virtual void getInteriorMapPosition (Ogre::Vector2 position, float& nX, float& nY, int &x, int& y); + void getInteriorMapPosition (Ogre::Vector2 position, float& nX, float& nY, int &x, int& y); ///< see MWRender::LocalMap::getInteriorMapPosition - virtual bool isPositionExplored (float nX, float nY, int x, int y, bool interior); + bool isPositionExplored (float nX, float nY, int x, int y, bool interior); ///< see MWRender::LocalMap::isPositionExplored + void setupExternalRendering (MWRender::ExternalRendering& rendering); + protected: virtual void windowResized(Ogre::RenderWindow* rw); virtual void windowClosed(Ogre::RenderWindow* rw); diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 869ce94d1..27c354aef 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1222,4 +1222,9 @@ namespace MWWorld { mRendering->renderPlayer(mPlayer->getPlayer()); } + + void World::setupExternalRendering (MWRender::ExternalRendering& rendering) + { + mRendering->setupExternalRendering (rendering); + } } diff --git a/apps/openmw/mwworld/worldimp.hpp b/apps/openmw/mwworld/worldimp.hpp index 6279343d4..96e6ae3f8 100644 --- a/apps/openmw/mwworld/worldimp.hpp +++ b/apps/openmw/mwworld/worldimp.hpp @@ -307,6 +307,8 @@ namespace MWWorld } virtual void renderPlayer(); + + virtual void setupExternalRendering (MWRender::ExternalRendering& rendering); }; } From 3e794a6087bfb708c151170dab8a0e508c66affa Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 15 Sep 2012 01:02:07 +0200 Subject: [PATCH 14/29] remove useless member and removed a warning --- apps/openmw/mwrender/renderingmanager.cpp | 5 ++--- apps/openmw/mwrender/renderingmanager.hpp | 2 -- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index fea08f108..308a01688 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -95,7 +95,7 @@ RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const if (filter == "anisotropic") tfo = TFO_ANISOTROPIC; else if (filter == "trilinear") tfo = TFO_TRILINEAR; else if (filter == "bilinear") tfo = TFO_BILINEAR; - else if (filter == "none") tfo = TFO_NONE; + else /*if (filter == "none")*/ tfo = TFO_NONE; MaterialManager::getSingleton().setDefaultTextureFiltering(tfo); MaterialManager::getSingleton().setDefaultAnisotropy( (filter == "anisotropic") ? Settings::Manager::getInt("anisotropy", "General") : 1 ); @@ -176,7 +176,6 @@ RenderingManager::~RenderingManager () delete mOcclusionQuery; delete mCompositors; delete mWater; - delete mPreviewAnimation; } MWRender::SkyManager* RenderingManager::getSkyManager() @@ -725,7 +724,7 @@ void RenderingManager::processChangedSettings(const Settings::CategorySettingVec if (filter == "anisotropic") tfo = TFO_ANISOTROPIC; else if (filter == "trilinear") tfo = TFO_TRILINEAR; else if (filter == "bilinear") tfo = TFO_BILINEAR; - else if (filter == "none") tfo = TFO_NONE; + else /*if (filter == "none")*/ tfo = TFO_NONE; MaterialManager::getSingleton().setDefaultTextureFiltering(tfo); MaterialManager::getSingleton().setDefaultAnisotropy( (filter == "anisotropic") ? Settings::Manager::getInt("anisotropy", "General") : 1 ); diff --git a/apps/openmw/mwrender/renderingmanager.hpp b/apps/openmw/mwrender/renderingmanager.hpp index b7944c9b9..e994e4909 100644 --- a/apps/openmw/mwrender/renderingmanager.hpp +++ b/apps/openmw/mwrender/renderingmanager.hpp @@ -245,8 +245,6 @@ class RenderingManager: private RenderingInterface, public Ogre::WindowEventList MWRender::Shadows* mShadows; MWRender::Compositors* mCompositors; - - MWRender::NpcAnimation* mPreviewAnimation; }; } From 76b494100e367ecbe5ae80d5cf67f710fd235f6d Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 15 Sep 2012 17:12:42 +0200 Subject: [PATCH 15/29] finished? --- apps/openmw/mwbase/windowmanager.hpp | 2 +- apps/openmw/mwgui/charactercreation.cpp | 8 +- apps/openmw/mwgui/charactercreation.hpp | 14 +-- apps/openmw/mwgui/hud.cpp | 2 +- apps/openmw/mwgui/hud.hpp | 2 +- apps/openmw/mwgui/levelupdialog.cpp | 145 +++++++++++++++++++++- apps/openmw/mwgui/levelupdialog.hpp | 9 ++ apps/openmw/mwgui/review.cpp | 6 +- apps/openmw/mwgui/review.hpp | 6 +- apps/openmw/mwgui/stats_window.cpp | 16 ++- apps/openmw/mwgui/stats_window.hpp | 2 +- apps/openmw/mwgui/windowmanagerimp.cpp | 7 +- apps/openmw/mwgui/windowmanagerimp.hpp | 4 +- apps/openmw/mwinput/inputmanagerimp.cpp | 9 ++ apps/openmw/mwinput/inputmanagerimp.hpp | 1 + apps/openmw/mwmechanics/actors.cpp | 2 +- apps/openmw/mwmechanics/creaturestats.cpp | 35 ++++-- apps/openmw/mwmechanics/creaturestats.hpp | 29 +++-- apps/openmw/mwmechanics/npcstats.cpp | 70 ++++++++++- apps/openmw/mwmechanics/npcstats.hpp | 11 ++ apps/openmw/mwscript/docs/vmformat.txt | 6 +- apps/openmw/mwscript/statsextensions.cpp | 50 ++++++++ files/mygui/openmw_levelup_dialog.layout | 10 +- 23 files changed, 380 insertions(+), 66 deletions(-) diff --git a/apps/openmw/mwbase/windowmanager.hpp b/apps/openmw/mwbase/windowmanager.hpp index 58fe180e9..6e4c10625 100644 --- a/apps/openmw/mwbase/windowmanager.hpp +++ b/apps/openmw/mwbase/windowmanager.hpp @@ -118,7 +118,7 @@ namespace MWBase /// Set value for the given ID. virtual void setValue (const std::string& id, const MWMechanics::Stat& value) = 0; virtual void setValue (int parSkill, const MWMechanics::Stat& value) = 0; - virtual void setValue (const std::string& id, const MWMechanics::DynamicStat& value) = 0; + virtual void setValue (const std::string& id, const MWMechanics::DynamicStat& value) = 0; virtual void setValue (const std::string& id, const std::string& value) = 0; virtual void setValue (const std::string& id, int value) = 0; diff --git a/apps/openmw/mwgui/charactercreation.cpp b/apps/openmw/mwgui/charactercreation.cpp index 7d63f6922..0005b78ad 100644 --- a/apps/openmw/mwgui/charactercreation.cpp +++ b/apps/openmw/mwgui/charactercreation.cpp @@ -151,7 +151,7 @@ void CharacterCreation::setValue (const std::string& id, const MWMechanics::Stat } } -void CharacterCreation::setValue (const std::string& id, const MWMechanics::DynamicStat& value) +void CharacterCreation::setValue (const std::string& id, const MWMechanics::DynamicStat& value) { if (mReviewDialog) { @@ -294,17 +294,17 @@ void CharacterCreation::spawnDialog(const char id) } } -void CharacterCreation::setPlayerHealth (const MWMechanics::DynamicStat& value) +void CharacterCreation::setPlayerHealth (const MWMechanics::DynamicStat& value) { mPlayerHealth = value; } -void CharacterCreation::setPlayerMagicka (const MWMechanics::DynamicStat& value) +void CharacterCreation::setPlayerMagicka (const MWMechanics::DynamicStat& value) { mPlayerMagicka = value; } -void CharacterCreation::setPlayerFatigue (const MWMechanics::DynamicStat& value) +void CharacterCreation::setPlayerFatigue (const MWMechanics::DynamicStat& value) { mPlayerFatigue = value; } diff --git a/apps/openmw/mwgui/charactercreation.hpp b/apps/openmw/mwgui/charactercreation.hpp index d65763d0c..28ced2e70 100644 --- a/apps/openmw/mwgui/charactercreation.hpp +++ b/apps/openmw/mwgui/charactercreation.hpp @@ -35,14 +35,14 @@ namespace MWGui //Show a dialog void spawnDialog(const char id); - void setPlayerHealth (const MWMechanics::DynamicStat& value); + void setPlayerHealth (const MWMechanics::DynamicStat& value); - void setPlayerMagicka (const MWMechanics::DynamicStat& value); + void setPlayerMagicka (const MWMechanics::DynamicStat& value); - void setPlayerFatigue (const MWMechanics::DynamicStat& value); + void setPlayerFatigue (const MWMechanics::DynamicStat& value); void setValue (const std::string& id, const MWMechanics::Stat& value); - void setValue (const std::string& id, const MWMechanics::DynamicStat& value); + void setValue (const std::string& id, const MWMechanics::DynamicStat& value); void setValue(const ESM::Skill::SkillEnum parSkill, const MWMechanics::Stat& value); void configureSkills (const SkillList& major, const SkillList& minor); @@ -65,9 +65,9 @@ namespace MWGui std::string mPlayerRaceId; std::string mPlayerBirthSignId; ESM::Class mPlayerClass; - MWMechanics::DynamicStat mPlayerHealth; - MWMechanics::DynamicStat mPlayerMagicka; - MWMechanics::DynamicStat mPlayerFatigue; + MWMechanics::DynamicStat mPlayerHealth; + MWMechanics::DynamicStat mPlayerMagicka; + MWMechanics::DynamicStat mPlayerFatigue; //Class generation vars unsigned mGenerateClassStep; // Keeps track of current step in Generate Class dialog diff --git a/apps/openmw/mwgui/hud.cpp b/apps/openmw/mwgui/hud.cpp index b14833553..72dc0c7fb 100644 --- a/apps/openmw/mwgui/hud.cpp +++ b/apps/openmw/mwgui/hud.cpp @@ -161,7 +161,7 @@ void HUD::setEffect(const char *img) mEffect1->setImageTexture(img); } -void HUD::setValue(const std::string& id, const MWMechanics::DynamicStat& value) +void HUD::setValue(const std::string& id, const MWMechanics::DynamicStat& value) { static const char *ids[] = { diff --git a/apps/openmw/mwgui/hud.hpp b/apps/openmw/mwgui/hud.hpp index de4228e87..013ad59f0 100644 --- a/apps/openmw/mwgui/hud.hpp +++ b/apps/openmw/mwgui/hud.hpp @@ -14,7 +14,7 @@ namespace MWGui public: HUD(int width, int height, int fpsLevel, DragAndDrop* dragAndDrop); void setEffect(const char *img); - void setValue (const std::string& id, const MWMechanics::DynamicStat& value); + void setValue (const std::string& id, const MWMechanics::DynamicStat& value); void setFPS(float fps); void setTriangleCount(unsigned int count); void setBatchCount(unsigned int count); diff --git a/apps/openmw/mwgui/levelupdialog.cpp b/apps/openmw/mwgui/levelupdialog.cpp index 9f57a2bdd..610c22bf7 100644 --- a/apps/openmw/mwgui/levelupdialog.cpp +++ b/apps/openmw/mwgui/levelupdialog.cpp @@ -4,6 +4,17 @@ #include "../mwbase/windowmanager.hpp" #include "../mwbase/environment.hpp" +#include "../mwbase/world.hpp" + +#include "../mwworld/player.hpp" +#include "../mwworld/class.hpp" + +#include "../mwmechanics/creaturestats.hpp" +#include "../mwmechanics/npcstats.hpp" +#include "../mwmechanics/stat.hpp" + +#include +#include namespace MWGui { @@ -26,6 +37,7 @@ namespace MWGui getWidget(b, "Attrib" + boost::lexical_cast(i)); b->setUserData (i-1); b->eventMouseButtonClick += MyGUI::newDelegate(this, &LevelupDialog::onAttributeClicked); + mAttributes.push_back(b); mAttributeValues.push_back(t); @@ -35,29 +47,152 @@ namespace MWGui mAttributeMultipliers.push_back(t); } + int curX = mMainWidget->getWidth()/2 - (16 + 2) * 1.5; + for (int i=0; i<3; ++i) + { + MyGUI::ImageBox* image = mMainWidget->createWidget("ImageBox", MyGUI::IntCoord(curX,250,16,16), MyGUI::Align::Default); + image->setImageTexture ("icons\\tx_goldicon.dds"); + curX += 24+2; + mCoins.push_back(image); + } + center(); + } + + void LevelupDialog::setAttributeValues() + { + MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayer().getPlayer(); + MWMechanics::CreatureStats& creatureStats = MWWorld::Class::get(player).getCreatureStats (player); + MWMechanics::NpcStats& pcStats = MWWorld::Class::get(player).getNpcStats (player); + + for (int i=0; i<8; ++i) + { + int val = creatureStats.getAttribute (i).getBase (); + if (std::find(mSpentAttributes.begin(), mSpentAttributes.end(), i) != mSpentAttributes.end()) + { + val += pcStats.getLevelupAttributeMultiplier (i); + } + + if (val >= 100) + val = 100; + + mAttributeValues[i]->setCaption(boost::lexical_cast(val)); + } + } + + + void LevelupDialog::resetCoins () + { + int curX = mMainWidget->getWidth()/2 - (16 + 2) * 1.5; + for (int i=0; i<3; ++i) + { + MyGUI::ImageBox* image = mCoins[i]; + image->setCoord(MyGUI::IntCoord(curX,250,16,16)); + curX += 24+2; + } + } + + void LevelupDialog::assignCoins () + { + resetCoins(); + for (unsigned int i=0; igetCaption() == "" ? 0 : 30; + + MyGUI::IntPoint pos = mAttributes[attribute]->getAbsolutePosition() - mMainWidget->getAbsolutePosition() - MyGUI::IntPoint(24+xdiff,-4); + image->setPosition(pos); + } - open(); + setAttributeValues(); } void LevelupDialog::open() { + MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayer().getPlayer(); + MWMechanics::CreatureStats& creatureStats = MWWorld::Class::get(player).getCreatureStats (player); + MWMechanics::NpcStats& pcStats = MWWorld::Class::get(player).getNpcStats (player); + center(); - mClassImage->setImageTexture ("textures\\levelup\\acrobat.dds"); + mSpentAttributes.clear(); + resetCoins(); + + setAttributeValues(); + + // set class image + const ESM::Class& playerClass = MWBase::Environment::get().getWorld ()->getPlayer ().getClass (); + // retrieve the ID to this class + std::string classId; + std::map list = MWBase::Environment::get().getWorld()->getStore ().classes.list; + for (std::map::iterator it = list.begin(); it != list.end(); ++it) + { + if (playerClass.name == it->second.name) + classId = it->first; + } + mClassImage->setImageTexture ("textures\\levelup\\" + classId + ".dds"); /// \todo replace this with INI-imported texts - int level = 2; + int level = creatureStats.getLevel ()+1; mLevelText->setCaptionWithReplacing("#{sLevelUpMenu1} " + boost::lexical_cast(level)); + + for (int i=0; i<8; ++i) + { + MyGUI::TextBox* text = mAttributeMultipliers[i]; + int mult = pcStats.getLevelupAttributeMultiplier (i); + text->setCaption(mult <= 1 ? "" : "x" + boost::lexical_cast(mult)); + } } void LevelupDialog::onOkButtonClicked (MyGUI::Widget* sender) { - MWBase::Environment::get().getWindowManager ()->messageBox("#{sNotifyMessage36}", std::vector()); + MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayer().getPlayer(); + MWMechanics::CreatureStats& creatureStats = MWWorld::Class::get(player).getCreatureStats (player); + MWMechanics::NpcStats& pcStats = MWWorld::Class::get(player).getNpcStats (player); + + if (mSpentAttributes.size() < 3) + MWBase::Environment::get().getWindowManager ()->messageBox("#{sNotifyMessage36}", std::vector()); + else + { + // increase attributes + for (int i=0; i<3; ++i) + { + MWMechanics::Stat& attribute = creatureStats.getAttribute(mSpentAttributes[i]); + attribute.setBase (attribute.getBase () + pcStats.getLevelupAttributeMultiplier (mSpentAttributes[i])); + + if (attribute.getBase() >= 100) + attribute.setBase(100); + } + + // "When you gain a level, in addition to increasing three primary attributes, your Health + // will automatically increase by 10% of your Endurance attribute. If you increased Endurance this level, + // the Health increase is calculated from the increased Endurance" + creatureStats.increaseLevelHealthBonus (creatureStats.getAttribute(ESM::Attribute::Endurance).getBase() * 0.1f); + + creatureStats.setLevel (creatureStats.getLevel()+1); + pcStats.levelUp (); + + mWindowManager.removeGuiMode (GM_Rest); + } + } void LevelupDialog::onAttributeClicked (MyGUI::Widget *sender) { - int index = *sender->getUserData(); + int attribute = *sender->getUserData(); + + std::vector::iterator found = std::find(mSpentAttributes.begin(), mSpentAttributes.end(), attribute); + if (found != mSpentAttributes.end()) + mSpentAttributes.erase (found); + else + { + if (mSpentAttributes.size() == 3) + mSpentAttributes[2] = attribute; + else + mSpentAttributes.push_back(attribute); + } + assignCoins(); } } diff --git a/apps/openmw/mwgui/levelupdialog.hpp b/apps/openmw/mwgui/levelupdialog.hpp index 181868e9e..f5b24530d 100644 --- a/apps/openmw/mwgui/levelupdialog.hpp +++ b/apps/openmw/mwgui/levelupdialog.hpp @@ -18,11 +18,20 @@ namespace MWGui MyGUI::ImageBox* mClassImage; MyGUI::TextBox* mLevelText; + std::vector mAttributes; std::vector mAttributeValues; std::vector mAttributeMultipliers; + std::vector mCoins; + + std::vector mSpentAttributes; void onOkButtonClicked (MyGUI::Widget* sender); void onAttributeClicked (MyGUI::Widget* sender); + + void assignCoins(); + void resetCoins(); + + void setAttributeValues(); }; } diff --git a/apps/openmw/mwgui/review.cpp b/apps/openmw/mwgui/review.cpp index 76b211b18..411fead08 100644 --- a/apps/openmw/mwgui/review.cpp +++ b/apps/openmw/mwgui/review.cpp @@ -134,21 +134,21 @@ void ReviewDialog::setBirthSign(const std::string& signId) } } -void ReviewDialog::setHealth(const MWMechanics::DynamicStat& value) +void ReviewDialog::setHealth(const MWMechanics::DynamicStat& value) { mHealth->setValue(value.getCurrent(), value.getModified()); std::string valStr = boost::lexical_cast(value.getCurrent()) + "/" + boost::lexical_cast(value.getModified()); mHealth->setUserString("Caption_HealthDescription", "#{sHealthDesc}\n" + valStr); } -void ReviewDialog::setMagicka(const MWMechanics::DynamicStat& value) +void ReviewDialog::setMagicka(const MWMechanics::DynamicStat& value) { mMagicka->setValue(value.getCurrent(), value.getModified()); std::string valStr = boost::lexical_cast(value.getCurrent()) + "/" + boost::lexical_cast(value.getModified()); mMagicka->setUserString("Caption_HealthDescription", "#{sIntDesc}\n" + valStr); } -void ReviewDialog::setFatigue(const MWMechanics::DynamicStat& value) +void ReviewDialog::setFatigue(const MWMechanics::DynamicStat& value) { mFatigue->setValue(value.getCurrent(), value.getModified()); std::string valStr = boost::lexical_cast(value.getCurrent()) + "/" + boost::lexical_cast(value.getModified()); diff --git a/apps/openmw/mwgui/review.hpp b/apps/openmw/mwgui/review.hpp index 058e3cff3..2b0740234 100644 --- a/apps/openmw/mwgui/review.hpp +++ b/apps/openmw/mwgui/review.hpp @@ -35,9 +35,9 @@ namespace MWGui void setClass(const ESM::Class& class_); void setBirthSign (const std::string &signId); - void setHealth(const MWMechanics::DynamicStat& value); - void setMagicka(const MWMechanics::DynamicStat& value); - void setFatigue(const MWMechanics::DynamicStat& value); + void setHealth(const MWMechanics::DynamicStat& value); + void setMagicka(const MWMechanics::DynamicStat& value); + void setFatigue(const MWMechanics::DynamicStat& value); void setAttribute(ESM::Attribute::AttributeID attributeId, const MWMechanics::Stat& value); diff --git a/apps/openmw/mwgui/stats_window.cpp b/apps/openmw/mwgui/stats_window.cpp index ffbfd7d78..88bc3dc90 100644 --- a/apps/openmw/mwgui/stats_window.cpp +++ b/apps/openmw/mwgui/stats_window.cpp @@ -95,6 +95,7 @@ void StatsWindow::setBar(const std::string& name, const std::string& tname, int getWidget(pt, name); pt->setProgressRange(max); pt->setProgressPosition(val); + std::cout << "set bar " << name << val << " " << max << std::endl; std::stringstream out; out << val << "/" << max; @@ -137,7 +138,7 @@ void StatsWindow::setValue (const std::string& id, const MWMechanics::Stat& } } -void StatsWindow::setValue (const std::string& id, const MWMechanics::DynamicStat& value) +void StatsWindow::setValue (const std::string& id, const MWMechanics::DynamicStat& value) { static const char *ids[] = { @@ -150,7 +151,7 @@ void StatsWindow::setValue (const std::string& id, const MWMechanics::DynamicSta if (ids[i]==id) { std::string id (ids[i]); - setBar (id, id + "T", value.getCurrent(), value.getModified()); + setBar (id, id + "T", static_cast(value.getCurrent()), static_cast(value.getModified())); // health, magicka, fatigue tooltip MyGUI::Widget* w; @@ -236,12 +237,21 @@ void StatsWindow::configureSkills (const std::vector& major, const std::vec void StatsWindow::onFrame () { - if (mMainWidget->getVisible()) + if (!mMainWidget->getVisible()) return; MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer(); MWMechanics::NpcStats PCstats = MWWorld::Class::get(player).getNpcStats(player); + // level progress + MyGUI::Widget* levelWidget; + for (int i=0; i<2; ++i) + { + getWidget(levelWidget, i==0 ? "Level_str" : "LevelText"); + levelWidget->setUserString("RangePosition_LevelProgress", boost::lexical_cast(PCstats.getLevelProgress())); + levelWidget->setUserString("Caption_LevelProgressText", boost::lexical_cast(PCstats.getLevelProgress()) + "/10"); + } + setFactions(PCstats.getFactionRanks()); setBirthSign(MWBase::Environment::get().getWorld()->getPlayer().getBirthsign()); diff --git a/apps/openmw/mwgui/stats_window.hpp b/apps/openmw/mwgui/stats_window.hpp index 73c4706dd..75f8c568b 100644 --- a/apps/openmw/mwgui/stats_window.hpp +++ b/apps/openmw/mwgui/stats_window.hpp @@ -32,7 +32,7 @@ namespace MWGui /// Set value for the given ID. void setValue (const std::string& id, const MWMechanics::Stat& value); - void setValue (const std::string& id, const MWMechanics::DynamicStat& value); + void setValue (const std::string& id, const MWMechanics::DynamicStat& value); void setValue (const std::string& id, const std::string& value); void setValue (const std::string& id, int value); void setValue(const ESM::Skill::SkillEnum parSkill, const MWMechanics::Stat& value); diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index 670f6122e..465f2c239 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -250,6 +250,7 @@ void WindowManager::updateVisible() mAlchemyWindow->setVisible(false); mSpellWindow->setVisible(false); mQuickKeysMenu->setVisible(false); + mLevelupDialog->setVisible(false); mHud->setVisible(true); @@ -301,6 +302,9 @@ void WindowManager::updateVisible() case GM_Alchemy: mAlchemyWindow->setVisible(true); break; + case GM_Rest: + mLevelupDialog->setVisible(true); + break; case GM_Name: case GM_Race: case GM_Class: @@ -398,8 +402,9 @@ void WindowManager::setValue (int parSkill, const MWMechanics::Stat& valu mPlayerSkillValues[parSkill] = value; } -void WindowManager::setValue (const std::string& id, const MWMechanics::DynamicStat& value) +void WindowManager::setValue (const std::string& id, const MWMechanics::DynamicStat& value) { + std::cout << " set value " << id << value.getModified () << std::endl; mStatsWindow->setValue (id, value); mHud->setValue (id, value); mCharGen->setValue(id, value); diff --git a/apps/openmw/mwgui/windowmanagerimp.hpp b/apps/openmw/mwgui/windowmanagerimp.hpp index 09d2f0c7d..131029ed4 100644 --- a/apps/openmw/mwgui/windowmanagerimp.hpp +++ b/apps/openmw/mwgui/windowmanagerimp.hpp @@ -118,7 +118,7 @@ namespace MWGui ///< Set value for the given ID. virtual void setValue (const std::string& id, const MWMechanics::Stat& value); virtual void setValue (int parSkill, const MWMechanics::Stat& value); - virtual void setValue (const std::string& id, const MWMechanics::DynamicStat& value); + virtual void setValue (const std::string& id, const MWMechanics::DynamicStat& value); virtual void setValue (const std::string& id, const std::string& value); virtual void setValue (const std::string& id, int value); @@ -243,7 +243,7 @@ namespace MWGui std::map > mPlayerAttributes; SkillList mPlayerMajorSkills, mPlayerMinorSkills; std::map > mPlayerSkillValues; - MWMechanics::DynamicStat mPlayerHealth, mPlayerMagicka, mPlayerFatigue; + MWMechanics::DynamicStat mPlayerHealth, mPlayerMagicka, mPlayerFatigue; MyGUI::Gui *mGui; // Gui diff --git a/apps/openmw/mwinput/inputmanagerimp.cpp b/apps/openmw/mwinput/inputmanagerimp.cpp index b198785d2..724dccd8e 100644 --- a/apps/openmw/mwinput/inputmanagerimp.cpp +++ b/apps/openmw/mwinput/inputmanagerimp.cpp @@ -190,6 +190,9 @@ namespace MWInput case A_ToggleWeapon: toggleWeapon (); break; + case A_Rest: + rest(); + break; case A_ToggleSpell: toggleSpell (); break; @@ -543,6 +546,12 @@ namespace MWInput } } + void InputManager::rest() + { + if (!mWindows.isGuiMode ()) + mWindows.pushGuiMode (MWGui::GM_Rest); + } + void InputManager::screenshot() { mEngine.screenshot(); diff --git a/apps/openmw/mwinput/inputmanagerimp.hpp b/apps/openmw/mwinput/inputmanagerimp.hpp index 7d03f1d5b..5e6169f68 100644 --- a/apps/openmw/mwinput/inputmanagerimp.hpp +++ b/apps/openmw/mwinput/inputmanagerimp.hpp @@ -168,6 +168,7 @@ namespace MWInput void toggleWalking(); void toggleAutoMove(); void exitNow(); + void rest(); void quickKey (int index); void showQuickKeysMenu(); diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index bd037df9f..b4cc40fec 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -68,7 +68,7 @@ namespace MWMechanics creatureStats.getMagicEffects().get (EffectKey (84)).mMagnitude * 0.1 + 0.5; creatureStats.getHealth().setBase( - static_cast (0.5 * (strength + endurance))); + static_cast (0.5 * (strength + endurance)) + creatureStats.getLevelHealthBonus ()); creatureStats.getMagicka().setBase( static_cast (intelligence + magickaFactor * intelligence)); diff --git a/apps/openmw/mwmechanics/creaturestats.cpp b/apps/openmw/mwmechanics/creaturestats.cpp index 91a9225fe..fc0523141 100644 --- a/apps/openmw/mwmechanics/creaturestats.cpp +++ b/apps/openmw/mwmechanics/creaturestats.cpp @@ -9,6 +9,21 @@ namespace MWMechanics { + CreatureStats::CreatureStats() + : mLevelHealthBonus(0.f) + { + } + + void CreatureStats::increaseLevelHealthBonus (float value) + { + mLevelHealthBonus += value; + } + + float CreatureStats::getLevelHealthBonus () const + { + return mLevelHealthBonus; + } + const AiSequence& CreatureStats::getAiSequence() const { return mAiSequence; @@ -40,17 +55,17 @@ namespace MWMechanics return mAttributes[index]; } - const DynamicStat &CreatureStats::getHealth() const + const DynamicStat &CreatureStats::getHealth() const { return mDynamic[0]; } - const DynamicStat &CreatureStats::getMagicka() const + const DynamicStat &CreatureStats::getMagicka() const { return mDynamic[1]; } - const DynamicStat &CreatureStats::getFatigue() const + const DynamicStat &CreatureStats::getFatigue() const { return mDynamic[2]; } @@ -103,22 +118,22 @@ namespace MWMechanics return mAttributes[index]; } - DynamicStat &CreatureStats::getHealth() + DynamicStat &CreatureStats::getHealth() { return mDynamic[0]; } - DynamicStat &CreatureStats::getMagicka() + DynamicStat &CreatureStats::getMagicka() { return mDynamic[1]; } - DynamicStat &CreatureStats::getFatigue() + DynamicStat &CreatureStats::getFatigue() { return mDynamic[2]; } - DynamicStat &CreatureStats::getDynamic(int index) + DynamicStat &CreatureStats::getDynamic(int index) { if (index < 0 || index > 2) { throw std::runtime_error("dynamic stat index is out of range"); @@ -154,17 +169,17 @@ namespace MWMechanics mAttributes[index] = value; } - void CreatureStats::setHealth(const DynamicStat &value) + void CreatureStats::setHealth(const DynamicStat &value) { mDynamic[0] = value; } - void CreatureStats::setMagicka(const DynamicStat &value) + void CreatureStats::setMagicka(const DynamicStat &value) { mDynamic[1] = value; } - void CreatureStats::setFatigue(const DynamicStat &value) + void CreatureStats::setFatigue(const DynamicStat &value) { mDynamic[2] = value; } diff --git a/apps/openmw/mwmechanics/creaturestats.hpp b/apps/openmw/mwmechanics/creaturestats.hpp index a6fb6779a..7a1e46f56 100644 --- a/apps/openmw/mwmechanics/creaturestats.hpp +++ b/apps/openmw/mwmechanics/creaturestats.hpp @@ -19,7 +19,7 @@ namespace MWMechanics class CreatureStats { Stat mAttributes[8]; - DynamicStat mDynamic[3]; // health, magicka, fatigue + DynamicStat mDynamic[3]; // health, magicka, fatigue int mLevel; Spells mSpells; ActiveSpells mActiveSpells; @@ -30,15 +30,18 @@ namespace MWMechanics int mAlarm; AiSequence mAiSequence; + float mLevelHealthBonus; + public: + CreatureStats(); const Stat & getAttribute(int index) const; - const DynamicStat & getHealth() const; + const DynamicStat & getHealth() const; - const DynamicStat & getMagicka() const; + const DynamicStat & getMagicka() const; - const DynamicStat & getFatigue() const; + const DynamicStat & getFatigue() const; const Spells & getSpells() const; @@ -59,13 +62,13 @@ namespace MWMechanics Stat & getAttribute(int index); - DynamicStat & getHealth(); + DynamicStat & getHealth(); - DynamicStat & getMagicka(); + DynamicStat & getMagicka(); - DynamicStat & getFatigue(); + DynamicStat & getFatigue(); - DynamicStat & getDynamic(int index); + DynamicStat & getDynamic(int index); Spells & getSpells(); @@ -76,11 +79,11 @@ namespace MWMechanics void setAttribute(int index, const Stat &value); - void setHealth(const DynamicStat &value); + void setHealth(const DynamicStat &value); - void setMagicka(const DynamicStat &value); + void setMagicka(const DynamicStat &value); - void setFatigue(const DynamicStat &value); + void setFatigue(const DynamicStat &value); void setSpells(const Spells &spells); @@ -104,6 +107,10 @@ namespace MWMechanics float getFatigueTerm() const; ///< Return effective fatigue + + // small hack to allow the fact that Health permanently increases by 10% of endurance on each level up + void increaseLevelHealthBonus(float value); + float getLevelHealthBonus() const; }; } diff --git a/apps/openmw/mwmechanics/npcstats.cpp b/apps/openmw/mwmechanics/npcstats.cpp index d2908e26e..fc99c44a8 100644 --- a/apps/openmw/mwmechanics/npcstats.cpp +++ b/apps/openmw/mwmechanics/npcstats.cpp @@ -12,10 +12,16 @@ #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" +#include "../mwbase/windowmanager.hpp" MWMechanics::NpcStats::NpcStats() : mMovementFlags (0), mDrawState (DrawState_Nothing) -{} +, mLevelProgress(0) +{ + mSkillIncreases.resize (ESM::Attribute::Length); + for (int i=0; i (base)!=level) + { + // skill leveled up base = level+1; + // if this is a major or minor skill of the class, increase level progress + //bool levelProgress = false; + bool levelProgress = true; + for (int i=0; i<2; ++i) + for (int j=0; j<5; ++j) + { + int skill = class_.data.skills[j][i]; + if (skill == skillIndex) + levelProgress = true; + } + + if (!levelProgress) + std::cout <<"This is not a level skilL" << std::endl; + + mLevelProgress += levelProgress; + + // check the attribute this skill belongs to + const ESM::Skill* skill = MWBase::Environment::get().getWorld ()->getStore ().skills.find(skillIndex); + ++mSkillIncreases[skill->data.attribute]; + + if (mLevelProgress >= 10) + { + // levelup is possible now + MWBase::Environment::get().getWindowManager ()->messageBox ("#{sLevelUpMsg}", std::vector()); + } + } + getSkill (skillIndex).setBase (base); } + +int MWMechanics::NpcStats::getLevelProgress () const +{ + return mLevelProgress; +} + +void MWMechanics::NpcStats::levelUp() +{ + mLevelProgress -= 10; + for (int i=0; i #include #include +#include #include "stat.hpp" #include "drawstate.hpp" @@ -45,6 +46,10 @@ namespace MWMechanics unsigned int mMovementFlags; Stat mSkill[27]; + int mLevelProgress; // 0-10 + + std::vector mSkillIncreases; // number of skill increases for each attribute + public: NpcStats(); @@ -73,6 +78,12 @@ namespace MWMechanics void useSkill (int skillIndex, const ESM::Class& class_, int usageType = -1); ///< Increase skill by usage. + + int getLevelProgress() const; + + int getLevelupAttributeMultiplier(int attribute) const; + + void levelUp(); }; } diff --git a/apps/openmw/mwscript/docs/vmformat.txt b/apps/openmw/mwscript/docs/vmformat.txt index 59b9bca35..8052c6a08 100644 --- a/apps/openmw/mwscript/docs/vmformat.txt +++ b/apps/openmw/mwscript/docs/vmformat.txt @@ -183,4 +183,8 @@ op 0x2000172: GetStartingAngle op 0x2000173: GetStartingAngle, explicit reference op 0x2000174: ToggleVanityMode op 0x2000175-0x200018B: Get controls disabled -opcodes 0x200018C-0x3ffffff unused +op 0x200018C: GetLevel +op 0x200018D: GetLevel, explicit reference +op 0x200018E: SetLevel +op 0x200018F: SetLevel, explicit reference +opcodes 0x200018F-0x3ffffff unused diff --git a/apps/openmw/mwscript/statsextensions.cpp b/apps/openmw/mwscript/statsextensions.cpp index 5113c9dbf..f49d684a5 100644 --- a/apps/openmw/mwscript/statsextensions.cpp +++ b/apps/openmw/mwscript/statsextensions.cpp @@ -32,6 +32,42 @@ namespace MWScript { namespace Stats { + template + class OpGetLevel : public Interpreter::Opcode0 + { + public: + + virtual void execute (Interpreter::Runtime& runtime) + { + MWWorld::Ptr ptr = R()(runtime); + + Interpreter::Type_Integer value = + MWWorld::Class::get (ptr) + .getCreatureStats (ptr) + .getLevel(); + + runtime.push (value); + } + }; + + template + class OpSetLevel : public Interpreter::Opcode0 + { + public: + + virtual void execute (Interpreter::Runtime& runtime) + { + MWWorld::Ptr ptr = R()(runtime); + + Interpreter::Type_Integer value = runtime[0].mInteger; + runtime.pop(); + + MWWorld::Class::get (ptr) + .getCreatureStats (ptr) + .setLevel(value); + } + }; + template class OpGetAttribute : public Interpreter::Opcode0 { @@ -592,6 +628,11 @@ namespace MWScript const int opcodeModDisposition = 0x200014d; const int opcodeModDispositionExplicit = 0x200014e; + const int opcodeGetLevel = 0x200018c; + const int opcodeGetLevelExplicit = 0x200018d; + const int opcodeSetLevel = 0x200018e; + const int opcodeSetLevelExplicit = 0x200018f; + void registerExtensions (Compiler::Extensions& extensions) { static const char *attributes[numberOfAttributes] = @@ -674,6 +715,9 @@ namespace MWScript extensions.registerInstruction("moddisposition","l",opcodeModDisposition, opcodeModDispositionExplicit); extensions.registerFunction("getpcrank",'l',"/S",opcodeGetPCRank,opcodeGetPCRankExplicit); + + extensions.registerInstruction("setlevel", "l", opcodeSetLevel, opcodeSetLevelExplicit); + extensions.registerFunction("getlevel", 'l', "", opcodeGetLevel, opcodeGetLevelExplicit); } void installOpcodes (Interpreter::Interpreter& interpreter) @@ -745,6 +789,12 @@ namespace MWScript interpreter.installSegment5(opcodeModDispositionExplicit,new OpModDisposition); interpreter.installSegment3(opcodeGetPCRank,new OpGetPCRank); interpreter.installSegment3(opcodeGetPCRankExplicit,new OpGetPCRank); + + interpreter.installSegment5 (opcodeGetLevel, new OpGetLevel); + interpreter.installSegment5 (opcodeGetLevelExplicit, new OpGetLevel); + interpreter.installSegment5 (opcodeSetLevel, new OpSetLevel); + interpreter.installSegment5 (opcodeSetLevelExplicit, new OpSetLevel); + } } } diff --git a/files/mygui/openmw_levelup_dialog.layout b/files/mygui/openmw_levelup_dialog.layout index 6525a1e41..86e65e99a 100644 --- a/files/mygui/openmw_levelup_dialog.layout +++ b/files/mygui/openmw_levelup_dialog.layout @@ -4,7 +4,7 @@ - + @@ -31,7 +31,6 @@ - @@ -45,7 +44,6 @@ - @@ -59,7 +57,6 @@ - @@ -73,7 +70,6 @@ - @@ -88,7 +84,6 @@ - @@ -102,7 +97,6 @@ - @@ -116,7 +110,6 @@ - @@ -130,7 +123,6 @@ - From b34b894d6a743bbc423321f3ba72ce19f520a3eb Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 15 Sep 2012 17:20:47 +0200 Subject: [PATCH 16/29] removed some debug stuff --- apps/openmw/mwgui/levelupdialog.cpp | 1 - apps/openmw/mwgui/stats_window.cpp | 1 - apps/openmw/mwgui/windowmanagerimp.cpp | 1 - apps/openmw/mwmechanics/npcstats.cpp | 11 ++--------- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/apps/openmw/mwgui/levelupdialog.cpp b/apps/openmw/mwgui/levelupdialog.cpp index 610c22bf7..3616283d9 100644 --- a/apps/openmw/mwgui/levelupdialog.cpp +++ b/apps/openmw/mwgui/levelupdialog.cpp @@ -43,7 +43,6 @@ namespace MWGui getWidget(t, "AttribMultiplier" + boost::lexical_cast(i)); - t->setCaption("x2"); mAttributeMultipliers.push_back(t); } diff --git a/apps/openmw/mwgui/stats_window.cpp b/apps/openmw/mwgui/stats_window.cpp index 88bc3dc90..701c39b0d 100644 --- a/apps/openmw/mwgui/stats_window.cpp +++ b/apps/openmw/mwgui/stats_window.cpp @@ -95,7 +95,6 @@ void StatsWindow::setBar(const std::string& name, const std::string& tname, int getWidget(pt, name); pt->setProgressRange(max); pt->setProgressPosition(val); - std::cout << "set bar " << name << val << " " << max << std::endl; std::stringstream out; out << val << "/" << max; diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index 465f2c239..8f7c0d17a 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -404,7 +404,6 @@ void WindowManager::setValue (int parSkill, const MWMechanics::Stat& valu void WindowManager::setValue (const std::string& id, const MWMechanics::DynamicStat& value) { - std::cout << " set value " << id << value.getModified () << std::endl; mStatsWindow->setValue (id, value); mHud->setValue (id, value); mCharGen->setValue(id, value); diff --git a/apps/openmw/mwmechanics/npcstats.cpp b/apps/openmw/mwmechanics/npcstats.cpp index fc99c44a8..2980aed59 100644 --- a/apps/openmw/mwmechanics/npcstats.cpp +++ b/apps/openmw/mwmechanics/npcstats.cpp @@ -128,10 +128,7 @@ float MWMechanics::NpcStats::getSkillGain (int skillIndex, const ESM::Class& cla throw std::runtime_error ("invalid skill specialisation factor"); } - //return 1.0 / (level +1) * (1.0 / (skillFactor)) * typeFactor * specialisationFactor; - - ///FIXME: TEST FOR FASTER LEVELLING - return 1.0 / (level +1) * (1.0 / (skillFactor/100)) * typeFactor * specialisationFactor; + return 1.0 / (level +1) * (1.0 / (skillFactor)) * typeFactor * specialisationFactor; } void MWMechanics::NpcStats::useSkill (int skillIndex, const ESM::Class& class_, int usageType) @@ -148,8 +145,7 @@ void MWMechanics::NpcStats::useSkill (int skillIndex, const ESM::Class& class_, base = level+1; // if this is a major or minor skill of the class, increase level progress - //bool levelProgress = false; - bool levelProgress = true; + bool levelProgress = false; for (int i=0; i<2; ++i) for (int j=0; j<5; ++j) { @@ -158,9 +154,6 @@ void MWMechanics::NpcStats::useSkill (int skillIndex, const ESM::Class& class_, levelProgress = true; } - if (!levelProgress) - std::cout <<"This is not a level skilL" << std::endl; - mLevelProgress += levelProgress; // check the attribute this skill belongs to From 234f8fa5d57b41f40347250cbebead2f6f5b8253 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 15 Sep 2012 18:35:59 +0200 Subject: [PATCH 17/29] added the missing sound & notification for skill increase --- apps/openmw/mwmechanics/npcstats.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apps/openmw/mwmechanics/npcstats.cpp b/apps/openmw/mwmechanics/npcstats.cpp index 2980aed59..2c8cc06de 100644 --- a/apps/openmw/mwmechanics/npcstats.cpp +++ b/apps/openmw/mwmechanics/npcstats.cpp @@ -4,6 +4,8 @@ #include #include +#include + #include #include #include @@ -13,6 +15,7 @@ #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" #include "../mwbase/windowmanager.hpp" +#include "../mwbase/soundmanager.hpp" MWMechanics::NpcStats::NpcStats() : mMovementFlags (0), mDrawState (DrawState_Nothing) @@ -160,6 +163,16 @@ void MWMechanics::NpcStats::useSkill (int skillIndex, const ESM::Class& class_, const ESM::Skill* skill = MWBase::Environment::get().getWorld ()->getStore ().skills.find(skillIndex); ++mSkillIncreases[skill->data.attribute]; + // Play sound & skill progress notification + /// \todo check if character is the player, if levelling is ever implemented for NPCs + MWBase::Environment::get().getSoundManager ()->playSound ("skillraise", 1, 1); + + std::stringstream message; + message << boost::format(MWBase::Environment::get().getWindowManager ()->getGameSettingString ("sNotifyMessage39", "")) + % std::string("#{" + ESM::Skill::sSkillNameIds[skillIndex] + "}") + % base; + MWBase::Environment::get().getWindowManager ()->messageBox(message.str(), std::vector()); + if (mLevelProgress >= 10) { // levelup is possible now From f5237ff1a65e7b56b54750c826173ad4bfec5312 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 15 Sep 2012 19:06:56 +0200 Subject: [PATCH 18/29] skill gain from books --- apps/openmw/mwmechanics/npcstats.cpp | 74 +++++++++++++++++----------- apps/openmw/mwmechanics/npcstats.hpp | 2 + apps/openmw/mwworld/actionread.cpp | 24 +++++++++ 3 files changed, 70 insertions(+), 30 deletions(-) diff --git a/apps/openmw/mwmechanics/npcstats.cpp b/apps/openmw/mwmechanics/npcstats.cpp index 2c8cc06de..0f5d2c95e 100644 --- a/apps/openmw/mwmechanics/npcstats.cpp +++ b/apps/openmw/mwmechanics/npcstats.cpp @@ -145,40 +145,54 @@ void MWMechanics::NpcStats::useSkill (int skillIndex, const ESM::Class& class_, if (static_cast (base)!=level) { // skill leveled up + increaseSkill(skillIndex, class_, false); + } + else + getSkill (skillIndex).setBase (base); +} + +void MWMechanics::NpcStats::increaseSkill(int skillIndex, const ESM::Class &class_, bool preserveProgress) +{ + float base = getSkill (skillIndex).getBase(); + + int level = static_cast (base); + + if (preserveProgress) + base += 1; + else base = level+1; - // if this is a major or minor skill of the class, increase level progress - bool levelProgress = false; - for (int i=0; i<2; ++i) - for (int j=0; j<5; ++j) - { - int skill = class_.data.skills[j][i]; - if (skill == skillIndex) - levelProgress = true; - } - - mLevelProgress += levelProgress; - - // check the attribute this skill belongs to - const ESM::Skill* skill = MWBase::Environment::get().getWorld ()->getStore ().skills.find(skillIndex); - ++mSkillIncreases[skill->data.attribute]; - - // Play sound & skill progress notification - /// \todo check if character is the player, if levelling is ever implemented for NPCs - MWBase::Environment::get().getSoundManager ()->playSound ("skillraise", 1, 1); - - std::stringstream message; - message << boost::format(MWBase::Environment::get().getWindowManager ()->getGameSettingString ("sNotifyMessage39", "")) - % std::string("#{" + ESM::Skill::sSkillNameIds[skillIndex] + "}") - % base; - MWBase::Environment::get().getWindowManager ()->messageBox(message.str(), std::vector()); - - if (mLevelProgress >= 10) + // if this is a major or minor skill of the class, increase level progress + bool levelProgress = false; + for (int i=0; i<2; ++i) + for (int j=0; j<5; ++j) { - // levelup is possible now - MWBase::Environment::get().getWindowManager ()->messageBox ("#{sLevelUpMsg}", std::vector()); + int skill = class_.data.skills[j][i]; + if (skill == skillIndex) + levelProgress = true; } - } + + mLevelProgress += levelProgress; + + // check the attribute this skill belongs to + const ESM::Skill* skill = MWBase::Environment::get().getWorld ()->getStore ().skills.find(skillIndex); + ++mSkillIncreases[skill->data.attribute]; + + // Play sound & skill progress notification + /// \todo check if character is the player, if levelling is ever implemented for NPCs + MWBase::Environment::get().getSoundManager ()->playSound ("skillraise", 1, 1); + + std::stringstream message; + message << boost::format(MWBase::Environment::get().getWindowManager ()->getGameSettingString ("sNotifyMessage39", "")) + % std::string("#{" + ESM::Skill::sSkillNameIds[skillIndex] + "}") + % base; + MWBase::Environment::get().getWindowManager ()->messageBox(message.str(), std::vector()); + + if (mLevelProgress >= 10) + { + // levelup is possible now + MWBase::Environment::get().getWindowManager ()->messageBox ("#{sLevelUpMsg}", std::vector()); + } getSkill (skillIndex).setBase (base); } diff --git a/apps/openmw/mwmechanics/npcstats.hpp b/apps/openmw/mwmechanics/npcstats.hpp index ea8f92609..7c3055783 100644 --- a/apps/openmw/mwmechanics/npcstats.hpp +++ b/apps/openmw/mwmechanics/npcstats.hpp @@ -79,6 +79,8 @@ namespace MWMechanics void useSkill (int skillIndex, const ESM::Class& class_, int usageType = -1); ///< Increase skill by usage. + void increaseSkill (int skillIndex, const ESM::Class& class_, bool preserveProgress); + int getLevelProgress() const; int getLevelupAttributeMultiplier(int attribute) const; diff --git a/apps/openmw/mwworld/actionread.cpp b/apps/openmw/mwworld/actionread.cpp index 7fb2b23e7..d049bf5b5 100644 --- a/apps/openmw/mwworld/actionread.cpp +++ b/apps/openmw/mwworld/actionread.cpp @@ -2,10 +2,18 @@ #include "../mwbase/environment.hpp" #include "../mwbase/windowmanager.hpp" +#include "../mwbase/world.hpp" + +#include "../mwworld/player.hpp" +#include "../mwworld/class.hpp" + +#include "../mwmechanics/npcstats.hpp" #include "../mwgui/bookwindow.hpp" #include "../mwgui/scrollwindow.hpp" +#include + namespace MWWorld { ActionRead::ActionRead (const MWWorld::Ptr& object) : Action (false, object) @@ -26,5 +34,21 @@ namespace MWWorld MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Book); MWBase::Environment::get().getWindowManager()->getBookWindow()->open(getTarget()); } + + if (ref->base->data.skillID >= 0 && ref->base->data.skillID < ESM::Skill::Length) + { + MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayer().getPlayer(); + MWMechanics::NpcStats& npcStats = MWWorld::Class::get(player).getNpcStats (player); + MWWorld::LiveCellRef *playerRef = player.get(); + const ESM::Class *class_ = MWBase::Environment::get().getWorld()->getStore().classes.find ( + playerRef->base->cls); + + npcStats.increaseSkill (ref->base->data.skillID, *class_, true); + + // Remove skill from the book + /// \todo This will have to be changed later + const_cast(ref->base)->data.skillID = -1; + } + } } From 0dc242c60318896730243c6c292d27f92d272b11 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 15 Sep 2012 19:10:48 +0200 Subject: [PATCH 19/29] don't increase skill beyond 100 --- apps/openmw/mwmechanics/npcstats.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/openmw/mwmechanics/npcstats.cpp b/apps/openmw/mwmechanics/npcstats.cpp index 0f5d2c95e..f2b7df6cb 100644 --- a/apps/openmw/mwmechanics/npcstats.cpp +++ b/apps/openmw/mwmechanics/npcstats.cpp @@ -157,6 +157,9 @@ void MWMechanics::NpcStats::increaseSkill(int skillIndex, const ESM::Class &clas int level = static_cast (base); + if (level == 100) + return; + if (preserveProgress) base += 1; else From cf358fa79d1e401b4025f6db39b9252192fe63a2 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 15 Sep 2012 19:20:13 +0200 Subject: [PATCH 20/29] >= instead of == --- apps/openmw/mwmechanics/npcstats.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/npcstats.cpp b/apps/openmw/mwmechanics/npcstats.cpp index f2b7df6cb..5e3896af2 100644 --- a/apps/openmw/mwmechanics/npcstats.cpp +++ b/apps/openmw/mwmechanics/npcstats.cpp @@ -157,7 +157,7 @@ void MWMechanics::NpcStats::increaseSkill(int skillIndex, const ESM::Class &clas int level = static_cast (base); - if (level == 100) + if (level >= 100) return; if (preserveProgress) From 3e5ab069a64d1a4cf5c1eec5f4aa5d8dde0aaca7 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 15 Sep 2012 19:52:18 +0200 Subject: [PATCH 21/29] remove the const cast --- apps/openmw/mwworld/actionread.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwworld/actionread.cpp b/apps/openmw/mwworld/actionread.cpp index d049bf5b5..f21fd35ec 100644 --- a/apps/openmw/mwworld/actionread.cpp +++ b/apps/openmw/mwworld/actionread.cpp @@ -45,9 +45,8 @@ namespace MWWorld npcStats.increaseSkill (ref->base->data.skillID, *class_, true); - // Remove skill from the book - /// \todo This will have to be changed later - const_cast(ref->base)->data.skillID = -1; + /// \todo Remove skill from the book. Right now you can read as many times as you want + /// and the skill will still increase. } } From 9cf1cbc89b514b744f6e9d667bfba76bd45beef4 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 15 Sep 2012 20:03:53 +0200 Subject: [PATCH 22/29] remove book skill gain --- apps/openmw/mwworld/actionread.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/openmw/mwworld/actionread.cpp b/apps/openmw/mwworld/actionread.cpp index f21fd35ec..fe5e2d58f 100644 --- a/apps/openmw/mwworld/actionread.cpp +++ b/apps/openmw/mwworld/actionread.cpp @@ -35,6 +35,8 @@ namespace MWWorld MWBase::Environment::get().getWindowManager()->getBookWindow()->open(getTarget()); } + /* + // Skill gain from books if (ref->base->data.skillID >= 0 && ref->base->data.skillID < ESM::Skill::Length) { MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayer().getPlayer(); @@ -48,6 +50,7 @@ namespace MWWorld /// \todo Remove skill from the book. Right now you can read as many times as you want /// and the skill will still increase. } + */ } } From 896428c129124d64f8479380881f1b1bd4568847 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 15 Sep 2012 20:18:41 +0200 Subject: [PATCH 23/29] enableRestMenu & enableLevelupMenu --- apps/openmw/mwbase/windowmanager.hpp | 3 +++ apps/openmw/mwgui/windowmanagerimp.cpp | 1 + apps/openmw/mwgui/windowmanagerimp.hpp | 5 +++++ apps/openmw/mwinput/inputmanagerimp.cpp | 7 +++++-- apps/openmw/mwscript/guiextensions.cpp | 16 +++++++++++----- 5 files changed, 25 insertions(+), 7 deletions(-) diff --git a/apps/openmw/mwbase/windowmanager.hpp b/apps/openmw/mwbase/windowmanager.hpp index 6e4c10625..0fd78225a 100644 --- a/apps/openmw/mwbase/windowmanager.hpp +++ b/apps/openmw/mwbase/windowmanager.hpp @@ -219,6 +219,9 @@ namespace MWBase virtual void setLoadingProgress (const std::string& stage, int depth, int current, int total) = 0; virtual void loadingDone() = 0; + + virtual void enableRest() = 0; + virtual bool getRestEnabled() = 0; }; } diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index 8f7c0d17a..0241cc734 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -85,6 +85,7 @@ WindowManager::WindowManager( , mGarbageDialogs() , mShown(GW_ALL) , mAllowed(newGame ? GW_None : GW_ALL) + , mRestAllowed(newGame ? false : true) , mShowFPSLevel(fpsLevel) , mFPS(0.0f) , mTriangleCount(0) diff --git a/apps/openmw/mwgui/windowmanagerimp.hpp b/apps/openmw/mwgui/windowmanagerimp.hpp index 131029ed4..a02aa17b5 100644 --- a/apps/openmw/mwgui/windowmanagerimp.hpp +++ b/apps/openmw/mwgui/windowmanagerimp.hpp @@ -200,6 +200,9 @@ namespace MWGui virtual void setLoadingProgress (const std::string& stage, int depth, int current, int total); virtual void loadingDone(); + virtual void enableRest() { mRestAllowed = true; } + virtual bool getRestEnabled() { return mRestAllowed; } + private: OEngine::GUI::MyGUIManager *mGuiManager; HUD *mHud; @@ -260,6 +263,8 @@ namespace MWGui allow() and disableAll(). */ GuiWindow mAllowed; + // is the rest window allowed? + bool mRestAllowed; void updateVisible(); // Update visibility of all windows based on mode, shown and allowed settings diff --git a/apps/openmw/mwinput/inputmanagerimp.cpp b/apps/openmw/mwinput/inputmanagerimp.cpp index 724dccd8e..c3e131440 100644 --- a/apps/openmw/mwinput/inputmanagerimp.cpp +++ b/apps/openmw/mwinput/inputmanagerimp.cpp @@ -548,8 +548,11 @@ namespace MWInput void InputManager::rest() { - if (!mWindows.isGuiMode ()) - mWindows.pushGuiMode (MWGui::GM_Rest); + if (!mWindows.getRestEnabled () || mWindows.isGuiMode ()) + return; + + /// \todo check if resting is currently allowed (enemies nearby?) + mWindows.pushGuiMode (MWGui::GM_Rest); } void InputManager::screenshot() diff --git a/apps/openmw/mwscript/guiextensions.cpp b/apps/openmw/mwscript/guiextensions.cpp index d740e5feb..7f3b9777b 100644 --- a/apps/openmw/mwscript/guiextensions.cpp +++ b/apps/openmw/mwscript/guiextensions.cpp @@ -30,6 +30,16 @@ namespace MWScript } }; + class OpEnableRest : public Interpreter::Opcode0 + { + public: + + virtual void execute (Interpreter::Runtime& runtime) + { + MWBase::Environment::get().getWindowManager()->enableRest(); + } + }; + class OpShowDialogue : public Interpreter::Opcode0 { MWGui::GuiMode mDialogue; @@ -146,12 +156,8 @@ opcodeEnableStatsReviewMenu); interpreter.installSegment5 (opcodeEnableStatsMenu, new OpEnableWindow (MWGui::GW_Stats)); - /* Not done yet. Enabling rest mode is not really a gui - issue, it's a gameplay issue. - interpreter.installSegment5 (opcodeEnableRest, - new OpEnableDialogue (MWGui::GM_Rest)); - */ + new OpEnableRest ()); interpreter.installSegment5 (opcodeShowRestMenu, new OpShowDialogue (MWGui::GM_Rest)); From c161a3850fe2ef9806dbbfcc780c819d2de589b7 Mon Sep 17 00:00:00 2001 From: Michael Mc Donnell Date: Sat, 15 Sep 2012 15:36:22 -0400 Subject: [PATCH 24/29] Use correct type for iterator Fixes building on Windows with vs2010. --- libs/openengine/ogre/selectionbuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/openengine/ogre/selectionbuffer.cpp b/libs/openengine/ogre/selectionbuffer.cpp index 3ecb99f3b..8dd12b653 100644 --- a/libs/openengine/ogre/selectionbuffer.cpp +++ b/libs/openengine/ogre/selectionbuffer.cpp @@ -73,7 +73,7 @@ namespace Render int id = Ogre::any_cast(subEntity->getParent ()->getUserObjectBindings().getUserAny()); bool found = false; Ogre::ColourValue colour; - for (std::map::iterator it = mColourMap.begin(); it != mColourMap.end(); ++it) + for (std::map::iterator it = mColourMap.begin(); it != mColourMap.end(); ++it) { if (it->second == id) { From f21faf197c0be14d82b25ccd425c1547a36ba7aa Mon Sep 17 00:00:00 2001 From: Edmondo Tommasina Date: Sat, 15 Sep 2012 22:19:44 +0200 Subject: [PATCH 25/29] =?UTF-8?q?selectionbuffer.cpp:=20fix=20=E2=80=98run?= =?UTF-8?q?time=5Ferror=E2=80=99=20is=20not=20a=20member=20of=20=E2=80=98s?= =?UTF-8?q?td=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/openengine/ogre/selectionbuffer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/openengine/ogre/selectionbuffer.cpp b/libs/openengine/ogre/selectionbuffer.cpp index 3ecb99f3b..cb7f41a1c 100644 --- a/libs/openengine/ogre/selectionbuffer.cpp +++ b/libs/openengine/ogre/selectionbuffer.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include From 256dff0a29c4cc9030384f49ee1c3e228a024095 Mon Sep 17 00:00:00 2001 From: Michael Mc Donnell Date: Sat, 15 Sep 2012 16:21:07 -0400 Subject: [PATCH 26/29] Disable warning 4800 for Visual Studio Visual Studio 2010 complains about constructs such as: int myInt = 1; bool myBool = myInt; Which are fine with most compilers. It would instead like: int myInt = 1; bool myBool = (myInt != 0); Warning 4800 is just an optimization warning and is therefore safe to disable. This patch disables warning 4800. --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e01b3d26b..0a24998d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -513,6 +513,7 @@ if (WIN32) 4309 # Variable overflow, trying to store 128 in a signed char for example 4355 # Using 'this' in member initialization list 4701 # Potentially uninitialized local variable used + 4800 # Boolean optimization warning, e.g. myBool = (myInt != 0) instead of myBool = myInt ) foreach(d ${WARNINGS_DISABLE}) @@ -524,6 +525,7 @@ if (WIN32) set_target_properties(omwlauncher PROPERTIES COMPILE_FLAGS ${WARNINGS}) endif (BUILD_LAUNCHER) set_target_properties(openmw PROPERTIES COMPILE_FLAGS ${WARNINGS}) + set_target_properties(esmtool PROPERTIES COMPILE_FLAGS ${WARNINGS}) endif(MSVC) # Same for MinGW From 97326ffdbf62009c3e2e6ae6734676c402372430 Mon Sep 17 00:00:00 2001 From: Pieter van der Kloet Date: Sun, 16 Sep 2012 03:01:48 +0200 Subject: [PATCH 27/29] Fixed data-local directory handling in the launcher --- apps/launcher/datafilespage.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/launcher/datafilespage.cpp b/apps/launcher/datafilespage.cpp index 64816fae5..69ed6defa 100644 --- a/apps/launcher/datafilespage.cpp +++ b/apps/launcher/datafilespage.cpp @@ -208,12 +208,10 @@ bool DataFilesPage::setupDataFiles() std::string local = variables["data-local"].as(); if (!local.empty()) { - mDataLocal.push_back(Files::PathContainer::value_type(local)); + mDataDirs.push_back(Files::PathContainer::value_type(local)); + mDataLocal.push_back(Files::PathContainer::value_type(local)); // For config writing } - if (mDataDirs.size()>1) - mDataDirs.resize (1); - mCfgMgr.processPaths(mDataDirs); while (mDataDirs.empty()) { From 4bcc34f4f963cfdd8319a74611c9d96cf07c2e73 Mon Sep 17 00:00:00 2001 From: Pieter van der Kloet Date: Sun, 16 Sep 2012 04:28:51 +0200 Subject: [PATCH 28/29] Re-enabled and fixed multiple data directory handling in the launcher --- apps/launcher/datafilespage.cpp | 154 ++++++++++++++++++-------------- apps/launcher/datafilespage.hpp | 1 + 2 files changed, 86 insertions(+), 69 deletions(-) diff --git a/apps/launcher/datafilespage.cpp b/apps/launcher/datafilespage.cpp index 69ed6defa..266a38101 100644 --- a/apps/launcher/datafilespage.cpp +++ b/apps/launcher/datafilespage.cpp @@ -189,71 +189,8 @@ void DataFilesPage::setupConfig() } -bool DataFilesPage::setupDataFiles() +void DataFilesPage::addDataFiles(Files::Collections &fileCollections, const QString &encoding) { - // We use the Configuration Manager to retrieve the configuration values - boost::program_options::variables_map variables; - boost::program_options::options_description desc; - - desc.add_options() - ("data", boost::program_options::value()->default_value(Files::PathContainer(), "data")->multitoken()) - ("data-local", boost::program_options::value()->default_value("")) - ("fs-strict", boost::program_options::value()->implicit_value(true)->default_value(false)) - ("encoding", boost::program_options::value()->default_value("win1252")); - - mCfgMgr.readConfiguration(variables, desc); - - // Put the paths in a boost::filesystem vector to use with Files::Collections - mDataDirs = Files::PathContainer(variables["data"].as()); - - std::string local = variables["data-local"].as(); - if (!local.empty()) { - mDataDirs.push_back(Files::PathContainer::value_type(local)); - mDataLocal.push_back(Files::PathContainer::value_type(local)); // For config writing - } - - mCfgMgr.processPaths(mDataDirs); - - while (mDataDirs.empty()) { - QMessageBox msgBox; - msgBox.setWindowTitle("Error detecting Morrowind installation"); - msgBox.setIcon(QMessageBox::Warning); - msgBox.setStandardButtons(QMessageBox::Cancel); - msgBox.setText(tr("
Could not find the Data Files location

\ - The directory containing the data files was not found.

\ - Press \"Browse...\" to specify the location manually.
")); - - QAbstractButton *dirSelectButton = - msgBox.addButton(tr("B&rowse..."), QMessageBox::ActionRole); - - msgBox.exec(); - - if (msgBox.clickedButton() == dirSelectButton) { - - // Show a custom dir selection dialog which only accepts valid dirs - QString selectedDir = FileDialog::getExistingDirectory( - this, tr("Select Data Files Directory"), - QDir::currentPath(), - QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); - - // Add the user selected data directory - if (!selectedDir.isEmpty()) { - mDataDirs.push_back(Files::PathContainer::value_type(selectedDir.toStdString())); - mCfgMgr.processPaths(mDataDirs); - } else { - // Cancel from within the dir selection dialog - return false; - } - - } else { - // Cancel - return false; - } - } - - // Create a file collection for the data dirs - Files::Collections fileCollections(mDataDirs, !variables["fs-strict"].as()); - // First we add all the master files const Files::MultiDirCollection &esm = fileCollections.getCollection(".esm"); unsigned int i = 0; // Row number @@ -281,7 +218,7 @@ bool DataFilesPage::setupDataFiles() ESMReader fileReader; QStringList availableMasters; // Will contain all found masters - fileReader.setEncoding(variables["encoding"].as()); + fileReader.setEncoding(encoding.toStdString()); fileReader.open(iter->second.string()); // First we fill the availableMasters and the mMastersWidget @@ -352,6 +289,81 @@ bool DataFilesPage::setupDataFiles() } } + +} + + +bool DataFilesPage::setupDataFiles() +{ + // We use the Configuration Manager to retrieve the configuration values + boost::program_options::variables_map variables; + boost::program_options::options_description desc; + + desc.add_options() + ("data", boost::program_options::value()->default_value(Files::PathContainer(), "data")->multitoken()) + ("data-local", boost::program_options::value()->default_value("")) + ("fs-strict", boost::program_options::value()->implicit_value(true)->default_value(false)) + ("encoding", boost::program_options::value()->default_value("win1252")); + + mCfgMgr.readConfiguration(variables, desc); + + // Put the paths in a boost::filesystem vector to use with Files::Collections + mDataDirs = Files::PathContainer(variables["data"].as()); + + std::string local = variables["data-local"].as(); + if (!local.empty()) { + mDataLocal.push_back(Files::PathContainer::value_type(local)); + } + + mCfgMgr.processPaths(mDataDirs); + mCfgMgr.processPaths(mDataLocal); + + while (mDataDirs.empty()) { + QMessageBox msgBox; + msgBox.setWindowTitle("Error detecting Morrowind installation"); + msgBox.setIcon(QMessageBox::Warning); + msgBox.setStandardButtons(QMessageBox::Cancel); + msgBox.setText(tr("
Could not find the Data Files location

\ + The directory containing the data files was not found.

\ + Press \"Browse...\" to specify the location manually.
")); + + QAbstractButton *dirSelectButton = + msgBox.addButton(tr("B&rowse..."), QMessageBox::ActionRole); + + msgBox.exec(); + + if (msgBox.clickedButton() == dirSelectButton) { + + // Show a custom dir selection dialog which only accepts valid dirs + QString selectedDir = FileDialog::getExistingDirectory( + this, tr("Select Data Files Directory"), + QDir::currentPath(), + QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); + + // Add the user selected data directory + if (!selectedDir.isEmpty()) { + mDataDirs.push_back(Files::PathContainer::value_type(selectedDir.toStdString())); + mCfgMgr.processPaths(mDataDirs); + } else { + // Cancel from within the dir selection dialog + return false; + } + + } else { + // Cancel + return false; + } + } + + // Add the plugins in the data directories + Files::Collections dataCollections(mDataDirs, !variables["fs-strict"].as()); + Files::Collections dataLocalCollections(mDataLocal, !variables["fs-strict"].as()); + + addDataFiles(dataCollections, QString::fromStdString(variables["encoding"].as())); + addDataFiles(dataLocalCollections, QString::fromStdString(variables["encoding"].as())); + + mDataFilesModel->sort(0); + readConfig(); return true; } @@ -1137,11 +1149,13 @@ void DataFilesPage::writeConfig(QString profile) path = QString::fromStdString(it->string()); path.remove(QChar('\"')); + QDir dir(path); + // Make sure the string is quoted when it contains spaces if (path.contains(" ")) { - gameConfig << "data=\"" << path << "\"" << endl; + gameConfig << "data=\"" << dir.absolutePath() << "\"" << endl; } else { - gameConfig << "data=" << path << endl; + gameConfig << "data=" << dir.absolutePath() << endl; } } @@ -1150,10 +1164,12 @@ void DataFilesPage::writeConfig(QString profile) path = QString::fromStdString(mDataLocal.front().string()); path.remove(QChar('\"')); + QDir dir(path); + if (path.contains(" ")) { - gameConfig << "data-local=\"" << path << "\"" << endl; + gameConfig << "data-local=\"" << dir.absolutePath() << "\"" << endl; } else { - gameConfig << "data-local=" << path << endl; + gameConfig << "data-local=" << dir.absolutePath() << endl; } } diff --git a/apps/launcher/datafilespage.hpp b/apps/launcher/datafilespage.hpp index 5078f6428..83b318677 100644 --- a/apps/launcher/datafilespage.hpp +++ b/apps/launcher/datafilespage.hpp @@ -89,6 +89,7 @@ private: const QStringList checkedPlugins(); const QStringList selectedMasters(); + void addDataFiles(Files::Collections &fileCollections, const QString &encoding); void addPlugins(const QModelIndex &index); void removePlugins(const QModelIndex &index); void uncheckPlugins(); From 42d25c0af001c80ea7c17364e3aee07959725d62 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 16 Sep 2012 20:56:49 +0200 Subject: [PATCH 29/29] fix resources, I renamed those in the last commit, but only in one place --- files/mygui/core.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/mygui/core.xml b/files/mygui/core.xml index e1fb1b5e2..ea1627875 100644 --- a/files/mygui/core.xml +++ b/files/mygui/core.xml @@ -4,8 +4,8 @@ - - + +