From 01a7e7ad60819d247bfe815a8e2183a46c1c6437 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Thu, 9 Jun 2011 08:20:53 +0200 Subject: CGE: Add several sources based on headers --- engines/cge/vmenu.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 engines/cge/vmenu.h (limited to 'engines/cge/vmenu.h') diff --git a/engines/cge/vmenu.h b/engines/cge/vmenu.h new file mode 100644 index 0000000000..c4d3a8df18 --- /dev/null +++ b/engines/cge/vmenu.h @@ -0,0 +1,45 @@ +#ifndef __VMENU__ +#define __VMENU__ + +#include "talk.h" + +#define MB_VM 1 +#define MB_HM 3 + + + +typedef struct { char * Text; void (* Proc)(void); } CHOICE; + + + + + + +class MENU_BAR : public TALK +{ +public: + MENU_BAR (word w); +}; + + + + + + + +class VMENU : public TALK +{ + word Items; + CHOICE * Menu; +public: + static VMENU * Addr; + static int Recent; + MENU_BAR * Bar; + VMENU (CHOICE * list, int x, int y); + ~VMENU (void); + void Touch (word mask, int x, int y); +}; + + + +#endif -- cgit v1.2.3 From 03c540abffe39a7ea32173c2cf8f5e70d371588b Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 10 Jun 2011 07:45:18 +0200 Subject: CGE: Add default header, fix some includes --- engines/cge/vmenu.h | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'engines/cge/vmenu.h') diff --git a/engines/cge/vmenu.h b/engines/cge/vmenu.h index c4d3a8df18..23c354b504 100644 --- a/engines/cge/vmenu.h +++ b/engines/cge/vmenu.h @@ -1,7 +1,34 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +/* + * This code is based on original Soltys source code + * Copyright (c) 1994-1995 Janus B. Wisniewski and L.K. Avalon + */ + #ifndef __VMENU__ #define __VMENU__ -#include "talk.h" +#include "cge/talk.h" #define MB_VM 1 #define MB_HM 3 -- cgit v1.2.3 From 7d88b9e4cde321ec210c5da022046639a316179b Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 10 Jun 2011 19:02:13 +0200 Subject: CGE: Suppress typedef for byte, word and dword. --- engines/cge/vmenu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/cge/vmenu.h') diff --git a/engines/cge/vmenu.h b/engines/cge/vmenu.h index 23c354b504..d2b70145df 100644 --- a/engines/cge/vmenu.h +++ b/engines/cge/vmenu.h @@ -45,7 +45,7 @@ typedef struct { char * Text; void (* Proc)(void); } CHOICE; class MENU_BAR : public TALK { public: - MENU_BAR (word w); + MENU_BAR (uint16 w); }; @@ -56,7 +56,7 @@ public: class VMENU : public TALK { - word Items; + uint16 Items; CHOICE * Menu; public: static VMENU * Addr; @@ -64,7 +64,7 @@ public: MENU_BAR * Bar; VMENU (CHOICE * list, int x, int y); ~VMENU (void); - void Touch (word mask, int x, int y); + void Touch (uint16 mask, int x, int y); }; -- cgit v1.2.3 From 29065d302a9bf8bcaa18c4225e27b218bde67242 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 10 Jun 2011 22:57:09 +0200 Subject: CGE: Add namespaces --- engines/cge/vmenu.h | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'engines/cge/vmenu.h') diff --git a/engines/cge/vmenu.h b/engines/cge/vmenu.h index d2b70145df..cdbabf9966 100644 --- a/engines/cge/vmenu.h +++ b/engines/cge/vmenu.h @@ -30,18 +30,15 @@ #include "cge/talk.h" +namespace CGE { + #define MB_VM 1 #define MB_HM 3 - typedef struct { char * Text; void (* Proc)(void); } CHOICE; - - - - class MENU_BAR : public TALK { public: @@ -49,11 +46,6 @@ public: }; - - - - - class VMENU : public TALK { uint16 Items; @@ -67,6 +59,6 @@ public: void Touch (uint16 mask, int x, int y); }; - +} // End of namespace CGE #endif -- cgit v1.2.3 From ffc2aa4e4f41aa679d773ccafdec87bf8d7b5e85 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Mon, 13 Jun 2011 11:57:24 +0200 Subject: CGE: Format code --- engines/cge/vmenu.h | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'engines/cge/vmenu.h') diff --git a/engines/cge/vmenu.h b/engines/cge/vmenu.h index cdbabf9966..ecec9d51b5 100644 --- a/engines/cge/vmenu.h +++ b/engines/cge/vmenu.h @@ -25,38 +25,39 @@ * Copyright (c) 1994-1995 Janus B. Wisniewski and L.K. Avalon */ -#ifndef __VMENU__ -#define __VMENU__ +#ifndef __VMENU__ +#define __VMENU__ -#include "cge/talk.h" +#include "cge/talk.h" namespace CGE { -#define MB_VM 1 -#define MB_HM 3 +#define MB_VM 1 +#define MB_HM 3 -typedef struct { char * Text; void (* Proc)(void); } CHOICE; +typedef struct { + char *Text; + void (* Proc)(void); +} CHOICE; -class MENU_BAR : public TALK -{ +class MENU_BAR : public TALK { public: - MENU_BAR (uint16 w); + MENU_BAR(uint16 w); }; -class VMENU : public TALK -{ - uint16 Items; - CHOICE * Menu; +class VMENU : public TALK { + uint16 Items; + CHOICE *Menu; public: - static VMENU * Addr; - static int Recent; - MENU_BAR * Bar; - VMENU (CHOICE * list, int x, int y); - ~VMENU (void); - void Touch (uint16 mask, int x, int y); + static VMENU *Addr; + static int Recent; + MENU_BAR *Bar; + VMENU(CHOICE *list, int x, int y); + ~VMENU(void); + void Touch(uint16 mask, int x, int y); }; } // End of namespace CGE -- cgit v1.2.3 From 083d6ff6122cb2faf0a4330eb480bb9f77afa255 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Mon, 27 Jun 2011 01:03:47 +0200 Subject: CGE: remove some if(n)def DEMO by using a new flag. Added CGEEngine in several classes in order to do so. --- engines/cge/vmenu.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'engines/cge/vmenu.h') diff --git a/engines/cge/vmenu.h b/engines/cge/vmenu.h index ecec9d51b5..61645d2c55 100644 --- a/engines/cge/vmenu.h +++ b/engines/cge/vmenu.h @@ -38,13 +38,15 @@ namespace CGE { typedef struct { char *Text; - void (* Proc)(void); + void (CGEEngine::*Proc)(); } CHOICE; class MENU_BAR : public TALK { public: - MENU_BAR(uint16 w); + MENU_BAR(CGEEngine *vm, uint16 w); +private: + CGEEngine *_vm; }; @@ -55,9 +57,11 @@ public: static VMENU *Addr; static int Recent; MENU_BAR *Bar; - VMENU(CHOICE *list, int x, int y); - ~VMENU(void); + VMENU(CGEEngine *vm, CHOICE *list, int x, int y); + ~VMENU(); void Touch(uint16 mask, int x, int y); +private: + CGEEngine *_vm; }; } // End of namespace CGE -- cgit v1.2.3 From 315bbd348d490d3edf6f5dcfb58ffcc9ecde83b3 Mon Sep 17 00:00:00 2001 From: eriktorbjorn Date: Mon, 27 Jun 2011 19:25:24 +0200 Subject: CGE: Fix some GCC compile errors and warnings. --- engines/cge/vmenu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/cge/vmenu.h') diff --git a/engines/cge/vmenu.h b/engines/cge/vmenu.h index 61645d2c55..3c38576a40 100644 --- a/engines/cge/vmenu.h +++ b/engines/cge/vmenu.h @@ -37,7 +37,7 @@ namespace CGE { typedef struct { - char *Text; + const char *Text; void (CGEEngine::*Proc)(); } CHOICE; -- cgit v1.2.3 From 6833daab84a39a3d5dd0afcb176245f8678b28de Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 2 Jul 2011 16:23:32 +1000 Subject: CGE: Added engine prefix to header file #defines --- engines/cge/vmenu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/cge/vmenu.h') diff --git a/engines/cge/vmenu.h b/engines/cge/vmenu.h index 3c38576a40..2bb3cef88d 100644 --- a/engines/cge/vmenu.h +++ b/engines/cge/vmenu.h @@ -25,8 +25,8 @@ * Copyright (c) 1994-1995 Janus B. Wisniewski and L.K. Avalon */ -#ifndef __VMENU__ -#define __VMENU__ +#ifndef __CGE_VMENU__ +#define __CGE_VMENU__ #include "cge/talk.h" -- cgit v1.2.3 From 72ae475c97e6f0ba1cae2f7aa0bc2860e45de495 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 2 Jul 2011 20:04:30 +1000 Subject: CGE: Fix naming of touch() virtual methods, and fixed keyboard handling --- engines/cge/vmenu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/cge/vmenu.h') diff --git a/engines/cge/vmenu.h b/engines/cge/vmenu.h index 2bb3cef88d..c2fc096e83 100644 --- a/engines/cge/vmenu.h +++ b/engines/cge/vmenu.h @@ -59,7 +59,7 @@ public: MENU_BAR *Bar; VMENU(CGEEngine *vm, CHOICE *list, int x, int y); ~VMENU(); - void Touch(uint16 mask, int x, int y); + virtual void touch(uint16 mask, int x, int y); private: CGEEngine *_vm; }; -- cgit v1.2.3 From 4116189395a87959f1981ca7ebae0604aa4ca9a4 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 3 Jul 2011 11:28:22 +0200 Subject: CGE: Some more renaming (WIP) --- engines/cge/vmenu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/cge/vmenu.h') diff --git a/engines/cge/vmenu.h b/engines/cge/vmenu.h index c2fc096e83..88a2766040 100644 --- a/engines/cge/vmenu.h +++ b/engines/cge/vmenu.h @@ -42,7 +42,7 @@ typedef struct { } CHOICE; -class MENU_BAR : public TALK { +class MENU_BAR : public Talk { public: MENU_BAR(CGEEngine *vm, uint16 w); private: @@ -50,7 +50,7 @@ private: }; -class VMENU : public TALK { +class VMENU : public Talk { uint16 Items; CHOICE *Menu; public: -- cgit v1.2.3 From c313d2cce8d647265f192400c667d72824874dbc Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 3 Jul 2011 16:22:26 +0200 Subject: CGE: Even more renaming (WIP) --- engines/cge/vmenu.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'engines/cge/vmenu.h') diff --git a/engines/cge/vmenu.h b/engines/cge/vmenu.h index 88a2766040..6b4eb85a53 100644 --- a/engines/cge/vmenu.h +++ b/engines/cge/vmenu.h @@ -36,29 +36,29 @@ namespace CGE { #define MB_HM 3 -typedef struct { - const char *Text; +struct Choice { + const char *_text; void (CGEEngine::*Proc)(); -} CHOICE; +}; -class MENU_BAR : public Talk { +class MenuBar : public Talk { public: - MENU_BAR(CGEEngine *vm, uint16 w); + MenuBar(CGEEngine *vm, uint16 w); private: CGEEngine *_vm; }; -class VMENU : public Talk { - uint16 Items; - CHOICE *Menu; +class Vmenu : public Talk { + uint16 _items; + Choice *_menu; public: - static VMENU *Addr; - static int Recent; - MENU_BAR *Bar; - VMENU(CGEEngine *vm, CHOICE *list, int x, int y); - ~VMENU(); + static Vmenu *_addr; + static int _recent; + MenuBar *_bar; + Vmenu(CGEEngine *vm, Choice *list, int x, int y); + ~Vmenu(); virtual void touch(uint16 mask, int x, int y); private: CGEEngine *_vm; -- cgit v1.2.3 From a073e78ba1fb4be357660a03aa0c387d80df3aab Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 19 Jul 2011 07:50:07 +0200 Subject: CGE: Rename constants (WIP) --- engines/cge/vmenu.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engines/cge/vmenu.h') diff --git a/engines/cge/vmenu.h b/engines/cge/vmenu.h index 6b4eb85a53..93979b5895 100644 --- a/engines/cge/vmenu.h +++ b/engines/cge/vmenu.h @@ -32,8 +32,10 @@ namespace CGE { -#define MB_VM 1 -#define MB_HM 3 +#define kMenuBarVM 1 +#define kMenuBarHM 3 +#define kMenuBarLT LGRAY +#define kMenuBarRB DGRAY struct Choice { -- cgit v1.2.3 From bb591b5415bcf63f554c14d5be9d74bba9e5b6cc Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 21 Aug 2011 11:15:28 +0200 Subject: CGE: Some clean up in Vga class --- engines/cge/vmenu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/cge/vmenu.h') diff --git a/engines/cge/vmenu.h b/engines/cge/vmenu.h index 93979b5895..0ddcfdb91d 100644 --- a/engines/cge/vmenu.h +++ b/engines/cge/vmenu.h @@ -34,8 +34,8 @@ namespace CGE { #define kMenuBarVM 1 #define kMenuBarHM 3 -#define kMenuBarLT LGRAY -#define kMenuBarRB DGRAY +#define kMenuBarLT kVgaColLightGray +#define kMenuBarRB kVgaColDarkGray struct Choice { -- cgit v1.2.3 From 690d94eb0376252818b5c27e86e0c70a6d01435d Mon Sep 17 00:00:00 2001 From: Strangerke Date: Thu, 1 Sep 2011 00:32:20 +0200 Subject: CGE: Take fingolfin's remark into account: suppress the two leading underscore in define names --- engines/cge/vmenu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/cge/vmenu.h') diff --git a/engines/cge/vmenu.h b/engines/cge/vmenu.h index 0ddcfdb91d..30fcb53f4b 100644 --- a/engines/cge/vmenu.h +++ b/engines/cge/vmenu.h @@ -25,8 +25,8 @@ * Copyright (c) 1994-1995 Janus B. Wisniewski and L.K. Avalon */ -#ifndef __CGE_VMENU__ -#define __CGE_VMENU__ +#ifndef CGE_VMENU_H +#define CGE_VMENU_H #include "cge/talk.h" -- cgit v1.2.3 From 27328f254639a0db8a4d8c26afcfc8b605adf353 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Mon, 5 Sep 2011 21:21:42 +0200 Subject: CGE: Little cleanup of vmenu --- engines/cge/vmenu.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'engines/cge/vmenu.h') diff --git a/engines/cge/vmenu.h b/engines/cge/vmenu.h index 30fcb53f4b..b8740a9e93 100644 --- a/engines/cge/vmenu.h +++ b/engines/cge/vmenu.h @@ -53,8 +53,6 @@ private: class Vmenu : public Talk { - uint16 _items; - Choice *_menu; public: static Vmenu *_addr; static int _recent; @@ -63,7 +61,12 @@ public: ~Vmenu(); virtual void touch(uint16 mask, int x, int y); private: + char *_vmgt; CGEEngine *_vm; + uint16 _items; + Choice *_menu; + + char *VMGather(Choice *list); }; } // End of namespace CGE -- cgit v1.2.3 From 938c08ae589eaa9b0cafc02478997f34bf7d598d Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 16 Sep 2011 20:31:11 +0200 Subject: CGE: Get rid of some more global functions and static members --- engines/cge/vmenu.h | 1 - 1 file changed, 1 deletion(-) (limited to 'engines/cge/vmenu.h') diff --git a/engines/cge/vmenu.h b/engines/cge/vmenu.h index b8740a9e93..89ef7a9484 100644 --- a/engines/cge/vmenu.h +++ b/engines/cge/vmenu.h @@ -51,7 +51,6 @@ private: CGEEngine *_vm; }; - class Vmenu : public Talk { public: static Vmenu *_addr; -- cgit v1.2.3