From 637be83cf5b129b7e55de97c5988f4dfa3c397bf Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 26 Apr 2012 09:43:55 +1000 Subject: TONY: Start of work converting over MPAL sub-system --- engines/tony/mpal/mpal.h | 769 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 769 insertions(+) create mode 100644 engines/tony/mpal/mpal.h (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h new file mode 100644 index 0000000000..73e2dec50f --- /dev/null +++ b/engines/tony/mpal/mpal.h @@ -0,0 +1,769 @@ +/* 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. + * + * + */ +/************************************************************************** + * 様様様様様様様様様様様様様様様様様 * + * ... Spyral Software snc * + * . x#""*$Nu -= We create much MORE than ALL =- * + * d*#R$. R ^#$o 様様様様様様様様様様様様様様様様様 * + * .F ^$k $ "$b * + * ." $b u "$ #$L * + * P $c :*$L"$L '$k Project: MPAL................... * + * d @$N. $. d ^$b^$k $c * + * F 4 "$c '$ $ #$u#$u '$ Module: MPAL Main Include file. * + * 4 4k *N #b .> '$N'*$u * * + * M $L #$ $ 8 "$c'#$b.. .@ Author: Giovanni Bajo.......... * + * M '$u "$u :" *$. "#*#" * + * M '$N. " F ^$k Desc: Main Include file for * + * 4> ^R$oue# d using MPAL.DLL......... * + * '$ "" @ ....................... * + * #b u# * + * $b .@" OS: [ ] DOS [X] WIN95 [ ] OS/2 * + * #$u .d" * + * '*$e. .zR".@ 様様様様様様様様様様様様様様様様様 * + * "*$$beooee$*" @"M This source code is * + * """ '$.? Copyright (C) Spyral Software * + * '$d> ALL RIGHTS RESERVED * + * '$> 様様様様様様様様様様様様様様様様様 * + * * + **************************************************************************/ + + +/****************************************************************************\ +* Copyright Notice +\****************************************************************************/ + +/* + * A Spyral Software Production: + * + * MPAL - MultiPurpose Adventure Language + * (C) 1997 Giovanni Bajo and Luca Giusti + * ALL RIGHTS RESERVED + * + * + */ + + +/****************************************************************************\ +* General Introduction +\****************************************************************************/ + +/* + * MPAL (MultiPurpose Adventure Language) is a high level language + * for the definition of adventure. Through the use of MPAL you can describe + * storyboard the adventure, and then use it with any user interface. + * In fact, unlike many other similar products, MPAL is not programmed through + * the whole adventure, but are defined only the locations, objects, as they may + * interact with each other, etc.. thus making MPAL useful for any type of adventure. + */ + +/****************************************************************************\ +* Structure +\****************************************************************************/ + +/* + * MPAL consists of two main files: MPAL.DLL and MPAL.H + * The first is the DLL that contains the code to interface with MPAL + * adventures, the second is the header that defines the prototypes + * functions. MPAL is compiled for Win32, and it can therefore be used with + * any compiler that supports Win32 DLL (Watcom C++, Visual C++, + * Delphi, etc.), and therefore compatible with both Windows 95 and Windows NT. + * + * To use the DLL, and 'obviously need to create a library for symbols to export. + * + */ + + +/****************************************************************************\ +* Custom Functions +\****************************************************************************/ + +/* + * A custom function and a function specified by the program that uses the + * library, to perform the particular code. The custom functions are + * retrieved from the library as specified in the source MPAL, and in particular + * in defining the behavior of an item with some action. + * + * To use the custom functions, you need to prepare an array of + * pointers to functions (such as using the type casting LPCUSTOMFUNCTION, + * (defined below), and pass it as second parameter to mpalInit (). Note you + * must specify the size of the array, as elements of pointers and which do not + * contain the same: the library will call it only those functions specified in + * the source MPAL. It can be useful, for debugging reasons, do not bet + * the shares of arrays used to debugging function, to avoid unpleasant crash, + * if it has been made an error in source and / or some oversight in the code. + * + */ + +#ifndef __MPAL_H +#define __MPAL_H + +#include "common/scummsys.h" +#include "common/rect.h" + +/****************************************************************************\ +* Macro definitions and structures +\****************************************************************************/ + +/* OK value for the error codes */ +#define OK 0 + +#define MAXFRAMES 400 // frame animation of an object +#define MAXPATTERN 40 // pattern of animation of an object + +#define MAXPOLLINGLOCATIONS 64 + +#define EXPORT +#define LPSTR char * + +/****************************************************************************\ +* enum QueryCoordinates +* --------------------- +* Description: Macro for use with queries that may refer to X and Y co-ordinates +\****************************************************************************/ + +enum QueryCoordinates { + MPQ_X, + MPQ_Y +}; + + +/****************************************************************************\ +* enum QueryTypes +* --------------- +* Description: Query can be used with mpalQuery (). In practice corresponds +* all claims that can do at the library +\****************************************************************************/ + +enum QueryTypes { + /* General Query */ + MPQ_VERSION=10, + + MPQ_GLOBAL_VAR=50, + MPQ_RESOURCE, + MPQ_MESSAGE, + + /* Query on leases */ + MPQ_LOCATION_IMAGE=100, + MPQ_LOCATION_SIZE, + + /* Queries about items */ + MPQ_ITEM_LIST=200, + MPQ_ITEM_DATA, + MPQ_ITEM_PATTERN, + MPQ_ITEM_NAME, + MPQ_ITEM_IS_ACTIVE, + + /* Query dialog */ + MPQ_DIALOG_PERIOD=300, + MPQ_DIALOG_WAITFORCHOICE, + MPQ_DIALOG_SELECTLIST, + MPQ_DIALOG_SELECTION, + + /* Query execution */ + MPQ_DO_ACTION=400, + MPQ_DO_DIALOG +}; + + +/****************************************************************************\ +* typedef ITEM +* ------------ +* Description: Framework to manage the animation of an item +\****************************************************************************/ + +typedef struct { + char *frames[MAXFRAMES]; + Common::Rect frameslocations[MAXFRAMES]; + Common::Rect bbox[MAXFRAMES]; + short pattern[MAXPATTERN][MAXFRAMES]; + short speed; + char numframe; + char numpattern; + char curframe; + char curpattern; + short destX, destY; + signed char Zvalue; + short objectID; + char TAG; +} ITEM; +typedef ITEM *LPITEM; + + +/****************************************************************************\ +* typedef LPCUSTOMFUNCTION +* ------------------------ +* Description: Define a custom function, to use the language MPAL +* to perform various controls as a result of an action +\****************************************************************************/ + +typedef void (*LPCUSTOMFUNCTION)(uint32, uint32, uint32, uint32); +typedef LPCUSTOMFUNCTION *LPLPCUSTOMFUNCTION; + + +/****************************************************************************\ +* typedef LPITEMIRQFUNCTION +* ------------------------- +* Description: Define an IRQ of an item that is called when the +* pattern changes or the status of an item +\****************************************************************************/ + +typedef void (*LPITEMIRQFUNCTION)(uint32, int, int); +typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; + + +/****************************************************************************\ +* Macrofunctions query +\****************************************************************************/ + +/****************************************************************************\ +* +* Function: uint32 mpalQueryVersion(void); +* +* Description: Gets the current version of MPAL +* +* Return: Version number (0x1232 = 1.2.3b) +* +\****************************************************************************/ + +#define mpalQueryVersion() \ + (uint16)mpalQuery(MPQ_VERSION) + + + +/****************************************************************************\ +* +* Function: uint32 mpalQueryGlobalVar(LPSTR lpszVarName); +* +* Description: Gets the numerical value of a global variable +* +* Input: LPSTR lpszVarName Nome della variabile (ASCIIZ) +* +* Return: Valore della variabile +* +* Note: This query was implemented for debugging. The program, +* if well designed, should not need to access variables from +* within the library. +* +\****************************************************************************/ + +#define mpalQueryGlobalVar(lpszVarName) \ + (uint32)mpalQuery(MPQ_GLOBAL_VAR,(LPSTR)(lpszVarName)) + + + +/****************************************************************************\ +* +* Function: HGLOBAL mpalQueryResource(uint32 dwResId); +* +* Description: Provides access to a resource inside the .MPC file +* +* Input: uint32 dwResId ID della risorsa +* +* Return: Handle to a memory area containing the resource, +* ready for use. +* +\****************************************************************************/ + +#define mpalQueryResource(dwResId) \ + (HGLOBAL)mpalQuery(MPQ_RESOURCE,(uint32)(dwResId)) + + + +/****************************************************************************\ +* +* Function: LPSTR mpalQueryMessage(uint32 nMsg); +* +* Description: Returns a message. +* +* Input: uint32 nMsg Message number +* +* Return: ASCIIZ message +* +* Note: The returned pointer must be freed with GlobalFree() +* after use. The message will be in ASCIIZ format. +* +\****************************************************************************/ + +#define mpalQueryMessage(nMsg) \ + (LPSTR)mpalQuery(MPQ_MESSAGE,(uint32)(nMsg)) + + + +/****************************************************************************\ +* +* Function: HGLOBAL mpalQueryLocationImage(uint32 nLoc); +* +* Description: Provides a image image +* +* Input: uint32 nLoc Locazion number +* +* Return: Returns a picture handle +* +\****************************************************************************/ + +#define mpalQueryLocationImage(nLoc) \ + (HGLOBAL)mpalQuery(MPQ_LOCATION_IMAGE,(uint32)(nLoc)) + + + +/****************************************************************************\ +* +* Function: uint32 mpalQueryLocationSize(uint32 nLoc, uint32 dwCoord); +* +* Description: Request the x or y size of a location in pixels +* +* Input: uint32 nLoc Location number +* uint32 dwCoord MPQ_Xr o MPQ_Y +* +* Return: Size +* +\****************************************************************************/ + +#define mpalQueryLocationSize(nLoc,dwCoord) \ + (uint32)mpalQuery(MPQ_LOCATION_SIZE,(uint32)(nLoc),(uint32)(dwCoord)) + + + +/****************************************************************************\ +* +* Function: uint32 * mpalQueryItemList(uint32 nLoc); +* +* Description: Provides the list of objects in the lease. +* +* Input: uint32 nLoc Location number +* +* Return: List of objects (accessible by Item [0], Item [1], etc.) +* +\****************************************************************************/ + +#define mpalQueryItemList(nLoc) \ + (uint32 *)mpalQuery(MPQ_ITEM_LIST,(uint32)(nLoc)) + + + +/****************************************************************************\ +* +* Function: LPBKGANIM mpalQueryItemData(uint32 nItem); +* +* Description: Provides information on an item +*e +* Input: uint32 nItem Item number +* +* Return: structure filled with requested information +* +\****************************************************************************/ + +#define mpalQueryItemData(nItem) \ + (LPITEM)mpalQuery(MPQ_ITEM_DATA,(uint32)(nItem)) + + + +/****************************************************************************\ +* +* Function: uint32 mpalQueryItemPattern(uint32 nItem); +* +* Description: Provides the current pattern of an item +* +* Input: uint32 nItem Item number +* +* Return: Number of animation patterns to be executed. +* +* Note: By default, the pattern of 0 indicates that we should +* do nothing. +* +\****************************************************************************/ + +#define mpalQueryItemPattern(nItem) \ + (uint32)mpalQuery(MPQ_ITEM_PATTERN,(uint32)(nItem)) + + + +/****************************************************************************\ +* +* Function: bool mpalQueryItemIsActive(uint32 nItem); +* +* Description: Returns true if an item is active +* +* Input: uint32 nItem Item number +* +* Return: TRUE if the item is active, FALSE otherwise +* +\****************************************************************************/ + +#define mpalQueryItemIsActive(nItem) \ + (bool)mpalQuery(MPQ_ITEM_IS_ACTIVE,(uint32)(nItem)) + + +/****************************************************************************\ +* +* Function: void mpalQueryItemName(uint32 nItem, LPSTR lpszName); +* +* Description: Returns the name of an item +* +* Input: uint32 nItem Item number +* LPSTR lpszName Pointer to a buffer of at least 33 bytes +* that will be filled with the name +* +* Note: If the item is not active (ie. if its status or number +* is less than or equal to 0), the string will be empty. +* +\****************************************************************************/ + +#define mpalQueryItemName(nItem,lpszName) \ + (uint32)mpalQuery(MPQ_ITEM_NAME,(uint32)(nItem),(LPSTR)(lpszName)) + + + +/****************************************************************************\ +* +* Function: LPSTR mpalQueryDialogPeriod(uint32 nDialog, uint32 nPeriod); +* +* Description: Returns a sentence of dialog. +* +* Input: uint32 nDialog Dialog number +* uint32 nPeriod Number of words +* +* Return: A pointer to the string of words, or NULL on failure. +* +* Note: The string must be freed after use by GlobalFree (). +* +* Unlike normal messages, the sentences of dialogue +* are formed by a single string terminated with 0. +* +\****************************************************************************/ + +#define mpalQueryDialogPeriod(nPeriod) \ + (LPSTR)mpalQuery(MPQ_DIALOG_PERIOD,(uint32)(nPeriod)) + + + +/****************************************************************************\ +* +* Function: int mpalQueryDialogWaitForChoice(void); +* +* Description: Wait until the moment in which the need is signaled +* to make a choice by the user. +* +* Return: Number of choice to be made, or -1 if the dialogue is finished. +* +\****************************************************************************/ + +#define mpalQueryDialogWaitForChoice() \ + (int)mpalQuery(MPQ_DIALOG_WAITFORCHOICE) + + + +/****************************************************************************\ +* +* Function: uint32 * mpalQueryDialogSelectList(uint32 nChoice); +* +* Description: Requires a list of various options for some choice within +* the current dialog. + +* Input: uint32 nChoice Choice number +* +* Return: A pointer to an array containing the data matched to each option. +* +* Note: The figure 'a uint32 specified in the source to which MPAL +* You can 'assign meaning that the more' suits. +* +* The pointer msut be freed after use by GlobalFree(). +* +\****************************************************************************/ + +#define mpalQueryDialogSelectList(nChoice) \ + (uint32 *)mpalQuery(MPQ_DIALOG_SELECTLIST,(uint32)(nChoice)) + + + +/****************************************************************************\ +* +* Function: bool mpalQueryDialogSelection(uint32 nChoice, uint32 dwData); +* +* Description: Warns the library that the user has selected, in a certain +* choice of the current dialog, corresponding option +* at a certain given. +* +* Input: uint32 nChoice Choice number of the choice that +* was in progress +* uint32 dwData Option that was selected by the user. +* +* Return: TRUE if all OK, FALSE on failure. +* +* Note: After execution of this query, MPAL continue +* Groups according to the execution of the dialogue. And necessary so the game +* remains on hold again for another Chosen by mpalQueryDialogWaitForChoice (). +* +\****************************************************************************/ + +#define mpalQueryDialogSelection(nChoice,dwData) \ + (bool)mpalQuery(MPQ_DIALOG_SELECTION,(uint32)(nChoice),(uint32)(dwData)) + + + +/****************************************************************************\ +* +* Function: HANDLE mpalQueryDoAction(uint32 nAction, uint32 nItem, +* uint32 dwParam); +* +* Description: Warns the library an action was performed on a Object. +* The library will call 'custom functions, if necessary. +* +* Input: uint32 nAction Action number +* uint32 nItem Item number +* uint32 dwParam Action parameter +* +* Return: Handle to the thread that is performing the action, or +* INVALID_HANDLE_VALUE if the action is not 'defined for +* the item, or the item and 'off. +* +* Note: The parameter is used primarily to implement actions +* as "U.S." involving two objects together. The action will be executed only +* if the item is active, ie if its status is a positive number greater than 0. +* +\****************************************************************************/ + +#define mpalQueryDoAction(nAction,nItem,dwParam) \ + (HANDLE)mpalQuery(MPQ_DO_ACTION,(uint32)(nAction),(uint32)(nItem),(uint32)(dwParam)) + + + +/****************************************************************************\ +* +* Function: HANDLE mpalQueryDoDialog(uint32 nDialog, uint32 nGroup); +* +* Description: Warns the library a dialogue was required. +* +* Input: uint32 nDialog Dialog number +* uint32 nGroup Group number to use +* +* Return: Handle to the thread that is running the box, or +* INVALID_HANDLE_VALUE if the dialogue does not exist. +* +\****************************************************************************/ + +#define mpalQueryDoDialog(nDialog,nGroup) \ + (HANDLE)mpalQuery(MPQ_DO_DIALOG,(uint32)(nDialog),(uint32)(nGroup)) + + + +/****************************************************************************\ +* Functions exported DLL +\****************************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif + +/****************************************************************************\ +* +* Function: bool mpalInit(LPSTR lpszMpcFileName, LPSTR lpszMprFileName, +* LPLPCUSTOMFUNCTION lplpcfArray); +* +* Description: Initializes the MPAL library, and opens an .MPC file, which +* will be 'used for all queries +* +* Input: LPSTR lpszMpcFileName Name of the .MPC file, including extension +* LPSTR lpszMprFileName Name of the .MPR file, including extension +* LPLPCUSTOMFUNCTION Array of pointers to custom functions +* +* Return: TRUE if all OK, FALSE on failure +* +\****************************************************************************/ + +bool EXPORT mpalInit(LPSTR lpszFileName, LPSTR lpszMprFileName, + LPLPCUSTOMFUNCTION lplpcfArray); + + + +/****************************************************************************\ +* +* Function: uint32 mpalQuery(uint16 wQueryType, ...); +* +* Description: This is the general function to communicate with the library, +* To request information about what is in the .MPC file +* +* Input: uint16 wQueryType Type of query. The list is in +* the QueryTypes enum. +* +* Return: 4 bytes depending on the type of query +* +* Note: I _strongly_ recommended to use macros defined above to use +* the query, since it helps avoid any unpleasant bugs due to +* forgeting parameters. +* +\****************************************************************************/ + +uint32 EXPORT mpalQuery(uint16 wQueryType, ...); + + + +/****************************************************************************\ +* +* Function: bool mpalExecuteScript(int nScript); +* +* Description: Execute a script. The script runs on multitasking by a thread. +* +* Input: int nScript Script number to run +* +* Return: TRUE if the script 'was launched, FALSE on failure +* +\****************************************************************************/ + +bool EXPORT mpalExecuteScript(int nScript); + + + +/****************************************************************************\ +* +* Function: uint32 mpalGetError(void); +* +* Description: Returns the current MPAL error code +* +* Return: Error code +* +\****************************************************************************/ + +uint32 EXPORT mpalGetError(void); + + + +/****************************************************************************\ +* +* Function: void mpalInstallItemIrq(LPITEMIRQFUNCTION lpiifCustom); +* +* Description: Install a custom routine That will be called by MPAL +* every time the pattern of an item has-been changed. +* +* Input: LPITEMIRQFUNCTION lpiifCustom Custom function to install +* +\****************************************************************************/ + +void EXPORT mpalInstallItemIrq(LPITEMIRQFUNCTION lpiifCustom); + + +/****************************************************************************\ +* +* Function: bool mpalStartIdlePoll(int nLoc); +* +* Description: Process the idle actions of the items on one location. +* +* Input: int nLoc Number of the location whose items +* must be processed for idle actions. +* +* Return: TRUE if all OK, and FALSE if it exceeded the maximum limit. +* +* Note: The maximum number of locations that can be polled +* simultaneously is defined defined by MAXPOLLINGFUNCIONS +* +\****************************************************************************/ + +bool EXPORT mpalStartIdlePoll(int nLoc); + + +/****************************************************************************\ +* +* Function: bool mpalEndIdlePoll(int nLoc); +* +* Description: Stop processing the idle actions of the items on one location. +* +* Input: int nLoc Number of the location +* +* Return: TRUE if all OK, FALSE if the specified location was not +* in the process of polling +* +\****************************************************************************/ + +bool EXPORT mpalEndIdlePoll(int nLoc); + + + +/****************************************************************************\ +* +* Function: int mpalLoadState(LPBYTE buf); +* +* Description: Load a save state from a buffer. +* +* Input: LPBYTE buf Buffer where to store the state +* +* Return: Length of the state in bytes +* +\****************************************************************************/ + +int EXPORT mpalLoadState(byte *buf); + + + +/****************************************************************************\ +* +* Function: void mpalSaveState(LPBYTE buf); +* +* Description: Store the save state into a buffer. The buffer must be +* length at least the size specified with mpalGetSaveStateSize +* +* Input: LPBYTE buf Buffer where to store the state +* +\****************************************************************************/ + +void EXPORT mpalSaveState(byte *buf); + + + +/****************************************************************************\ +* +* Function: int mpalGetSaveStateSize(void); +* +* Description: Acquire the length of a save state +* +* Return: Length in bytes +* +\****************************************************************************/ + +int EXPORT mpalGetSaveStateSize(void); + +#ifdef __cplusplus +} +#endif + +/****************************************************************************\ +* +* Function: void LockVar(void); +* +* Description: Locka le variabili per accederci +* +\****************************************************************************/ + +extern void LockVar(void); + +/****************************************************************************\ +* +* Function: void UnlockVar(void); +* +* Description: Unlocka le variabili dopo l'uso +* +\****************************************************************************/ + +extern void UnlockVar(void); + +#endif + -- cgit v1.2.3 From f955745ebf9aba0525de8196dc90de99fce6eab3 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 27 Apr 2012 01:32:46 +1000 Subject: TONY: Extra compilation changes and stubs so core MPAL code compiles --- engines/tony/mpal/mpal.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index 73e2dec50f..70b49a1fd9 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -114,12 +114,16 @@ * */ -#ifndef __MPAL_H -#define __MPAL_H +#ifndef TONY_MPAL_H +#define TONY_MPAL_H #include "common/scummsys.h" #include "common/rect.h" +namespace Tony { + +namespace MPAL { + /****************************************************************************\ * Macro definitions and structures \****************************************************************************/ @@ -765,5 +769,9 @@ extern void LockVar(void); extern void UnlockVar(void); +} // end of namespace MPAL + +} // end of namespace Tony + #endif -- cgit v1.2.3 From 9482eac1f2fc7202eb4aaa72f63552bd35f5c66e Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 4 May 2012 22:09:24 +1000 Subject: TONY: Some formatting fixes --- engines/tony/mpal/mpal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index 70b49a1fd9..26c4283018 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -271,7 +271,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; \****************************************************************************/ #define mpalQueryGlobalVar(lpszVarName) \ - (uint32)mpalQuery(MPQ_GLOBAL_VAR,(LPSTR)(lpszVarName)) + (uint32)mpalQuery(MPQ_GLOBAL_VAR,(const char *)(lpszVarName)) -- cgit v1.2.3 From 23cd3b7730c292539649578d1aea373812e6b4ce Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 4 May 2012 22:28:51 +1000 Subject: TONY: Fixed many warnings identified by gcc --- engines/tony/mpal/mpal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index 26c4283018..d800be60b8 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -595,7 +595,7 @@ extern "C" { * \****************************************************************************/ -bool EXPORT mpalInit(LPSTR lpszFileName, LPSTR lpszMprFileName, +bool EXPORT mpalInit(const char *lpszFileName, const char *lpszMprFileName, LPLPCUSTOMFUNCTION lplpcfArray); -- cgit v1.2.3 From 3184a5a874f3cfaa75424e7efb21f1cca3702988 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 4 May 2012 22:58:42 +1000 Subject: TONY: Fix warnings about return values not being used --- engines/tony/mpal/mpal.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index d800be60b8..e66f1fdb7e 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -523,7 +523,8 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; #define mpalQueryDialogSelection(nChoice,dwData) \ (bool)mpalQuery(MPQ_DIALOG_SELECTION,(uint32)(nChoice),(uint32)(dwData)) - +#define mpalQueryDialogSelectionU32(nChoice, dwData) \ + mpalQuery(MPQ_DIALOG_SELECTION,(uint32)(nChoice),(uint32)(dwData)) /****************************************************************************\ * @@ -547,9 +548,11 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; * \****************************************************************************/ -#define mpalQueryDoAction(nAction,nItem,dwParam) \ - (HANDLE)mpalQuery(MPQ_DO_ACTION,(uint32)(nAction),(uint32)(nItem),(uint32)(dwParam)) +#define mpalQueryDoAction(nAction, nItem, dwParam) \ + (HANDLE)mpalQuery(MPQ_DO_ACTION, (uint32)(nAction), (uint32)(nItem), (uint32)(dwParam)) +#define mpalQueryDoActionU32(nAction, nItem, dwParam) \ + mpalQuery(MPQ_DO_ACTION, (uint32)(nAction), (uint32)(nItem), (uint32)(dwParam)) /****************************************************************************\ @@ -569,6 +572,8 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; #define mpalQueryDoDialog(nDialog,nGroup) \ (HANDLE)mpalQuery(MPQ_DO_DIALOG,(uint32)(nDialog),(uint32)(nGroup)) +#define mpalQueryDoDialogU32(nDialog, nGroup) \ + mpalQuery(MPQ_DO_DIALOG,(uint32)(nDialog),(uint32)(nGroup)) /****************************************************************************\ -- cgit v1.2.3 From 10deebed553fc5d458a20756d963835aa1a86afe Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 6 May 2012 12:21:29 +1000 Subject: TONY: Beginnings of refactoring Tony engine's threads to use coroutines --- engines/tony/mpal/mpal.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index e66f1fdb7e..3c2e62d992 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -119,6 +119,7 @@ #include "common/scummsys.h" #include "common/rect.h" +#include "tony/coroutine.h" namespace Tony { @@ -220,7 +221,7 @@ typedef ITEM *LPITEM; * to perform various controls as a result of an action \****************************************************************************/ -typedef void (*LPCUSTOMFUNCTION)(uint32, uint32, uint32, uint32); +typedef void (*LPCUSTOMFUNCTION)(CORO_PARAM, uint32, uint32, uint32, uint32); typedef LPCUSTOMFUNCTION *LPLPCUSTOMFUNCTION; -- cgit v1.2.3 From 770e55d06578f7f51959ea331da7baaaaa0e360d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 6 May 2012 15:18:03 +1000 Subject: TONY: Further conversion of initially launched threads to processes. This includes all the dependent routines that they call. --- engines/tony/mpal/mpal.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index 3c2e62d992..9da963d39e 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -704,8 +704,7 @@ bool EXPORT mpalStartIdlePoll(int nLoc); * \****************************************************************************/ -bool EXPORT mpalEndIdlePoll(int nLoc); - +void mpalEndIdlePoll(CORO_PARAM, int nLoc, bool *result); /****************************************************************************\ -- cgit v1.2.3 From 156d8cdb733fe03688da9e2e9844b722681bed7f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 6 May 2012 21:24:55 +1000 Subject: TONY: Bugfix for waitForSingleObject, and added action process debug information --- engines/tony/mpal/mpal.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index 9da963d39e..c9f8625744 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -119,6 +119,7 @@ #include "common/scummsys.h" #include "common/rect.h" +#include "common/str.h" #include "tony/coroutine.h" namespace Tony { @@ -602,7 +603,7 @@ extern "C" { \****************************************************************************/ bool EXPORT mpalInit(const char *lpszFileName, const char *lpszMprFileName, - LPLPCUSTOMFUNCTION lplpcfArray); + LPLPCUSTOMFUNCTION lplpcfArray, Common::String *lpcfStrings); -- cgit v1.2.3 From 0b8974ec4ab37ef056ac50c098d3fe8045ec172b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 6 May 2012 23:51:11 +1000 Subject: TONY: Beginnings of converting dialog processes to coroutines --- engines/tony/mpal/mpal.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index c9f8625744..5517a6518c 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -474,10 +474,8 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; * \****************************************************************************/ -#define mpalQueryDialogWaitForChoice() \ - (int)mpalQuery(MPQ_DIALOG_WAITFORCHOICE) - - +#define mpalQueryDialogWaitForChoice(dwRet) \ + CORO_INVOKE_2(mpalQueryCoro, dwRet, MPQ_DIALOG_WAITFORCHOICE) /****************************************************************************\ * @@ -627,7 +625,7 @@ bool EXPORT mpalInit(const char *lpszFileName, const char *lpszMprFileName, uint32 EXPORT mpalQuery(uint16 wQueryType, ...); - +void mpalQueryCoro(CORO_PARAM, uint32 *dwRet, uint16 wQueryType, ...); /****************************************************************************\ * -- cgit v1.2.3 From 5a069cdc861538fe763de48de8628d7d754f7959 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 9 May 2012 23:15:41 +1000 Subject: TONY: Refactored out usage of nullContext in favour of proper coroutines --- engines/tony/mpal/mpal.h | 59 +++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 31 deletions(-) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index 5517a6518c..9a85f2df17 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -156,7 +156,7 @@ enum QueryCoordinates { /****************************************************************************\ * enum QueryTypes * --------------- -* Description: Query can be used with mpalQuery (). In practice corresponds +* Description: Query can be used with mpalQuery methods. In practice corresponds * all claims that can do at the library \****************************************************************************/ @@ -252,7 +252,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; \****************************************************************************/ #define mpalQueryVersion() \ - (uint16)mpalQuery(MPQ_VERSION) + (uint16)mpalQueryDWORD(MPQ_VERSION) @@ -273,7 +273,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; \****************************************************************************/ #define mpalQueryGlobalVar(lpszVarName) \ - (uint32)mpalQuery(MPQ_GLOBAL_VAR,(const char *)(lpszVarName)) + mpalQueryDWORD(MPQ_GLOBAL_VAR, (const char *)(lpszVarName)) @@ -291,7 +291,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; \****************************************************************************/ #define mpalQueryResource(dwResId) \ - (HGLOBAL)mpalQuery(MPQ_RESOURCE,(uint32)(dwResId)) + mpalQueryHANDLE(MPQ_RESOURCE, (uint32)(dwResId)) @@ -311,7 +311,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; \****************************************************************************/ #define mpalQueryMessage(nMsg) \ - (LPSTR)mpalQuery(MPQ_MESSAGE,(uint32)(nMsg)) + (LPSTR)mpalQueryHANDLE(MPQ_MESSAGE, (uint32)(nMsg)) @@ -328,7 +328,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; \****************************************************************************/ #define mpalQueryLocationImage(nLoc) \ - (HGLOBAL)mpalQuery(MPQ_LOCATION_IMAGE,(uint32)(nLoc)) + mpalQueryHANDLE(MPQ_LOCATION_IMAGE, (uint32)(nLoc)) @@ -346,7 +346,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; \****************************************************************************/ #define mpalQueryLocationSize(nLoc,dwCoord) \ - (uint32)mpalQuery(MPQ_LOCATION_SIZE,(uint32)(nLoc),(uint32)(dwCoord)) + mpalQueryDWORD(MPQ_LOCATION_SIZE,(uint32)(nLoc),(uint32)(dwCoord)) @@ -361,9 +361,9 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; * Return: List of objects (accessible by Item [0], Item [1], etc.) * \****************************************************************************/ - +// TODO: Check if the results of this are endian safe #define mpalQueryItemList(nLoc) \ - (uint32 *)mpalQuery(MPQ_ITEM_LIST,(uint32)(nLoc)) + (uint32 *)mpalQueryHANDLE(MPQ_ITEM_LIST,(uint32)(nLoc)) @@ -380,7 +380,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; \****************************************************************************/ #define mpalQueryItemData(nItem) \ - (LPITEM)mpalQuery(MPQ_ITEM_DATA,(uint32)(nItem)) + (LPITEM)mpalQueryHANDLE(MPQ_ITEM_DATA,(uint32)(nItem)) @@ -400,7 +400,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; \****************************************************************************/ #define mpalQueryItemPattern(nItem) \ - (uint32)mpalQuery(MPQ_ITEM_PATTERN,(uint32)(nItem)) + mpalQueryDWORD(MPQ_ITEM_PATTERN,(uint32)(nItem)) @@ -417,7 +417,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; \****************************************************************************/ #define mpalQueryItemIsActive(nItem) \ - (bool)mpalQuery(MPQ_ITEM_IS_ACTIVE,(uint32)(nItem)) + (bool)mpalQueryDWORD(MPQ_ITEM_IS_ACTIVE,(uint32)(nItem)) /****************************************************************************\ @@ -435,8 +435,8 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; * \****************************************************************************/ -#define mpalQueryItemName(nItem,lpszName) \ - (uint32)mpalQuery(MPQ_ITEM_NAME,(uint32)(nItem),(LPSTR)(lpszName)) +#define mpalQueryItemName(nItem, lpszName) \ + mpalQueryHANDLE(MPQ_ITEM_NAME,(uint32)(nItem), (LPSTR)(lpszName)) @@ -459,7 +459,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; \****************************************************************************/ #define mpalQueryDialogPeriod(nPeriod) \ - (LPSTR)mpalQuery(MPQ_DIALOG_PERIOD,(uint32)(nPeriod)) + (LPSTR)mpalQueryHANDLE(MPQ_DIALOG_PERIOD, (uint32)(nPeriod)) @@ -475,7 +475,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; \****************************************************************************/ #define mpalQueryDialogWaitForChoice(dwRet) \ - CORO_INVOKE_2(mpalQueryCoro, dwRet, MPQ_DIALOG_WAITFORCHOICE) + CORO_INVOKE_2(mpalQueryCORO, MPQ_DIALOG_WAITFORCHOICE, dwRet) /****************************************************************************\ * @@ -496,7 +496,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; \****************************************************************************/ #define mpalQueryDialogSelectList(nChoice) \ - (uint32 *)mpalQuery(MPQ_DIALOG_SELECTLIST,(uint32)(nChoice)) + (uint32 *)mpalQueryHANDLE(MPQ_DIALOG_SELECTLIST,(uint32)(nChoice)) @@ -521,10 +521,8 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; \****************************************************************************/ #define mpalQueryDialogSelection(nChoice,dwData) \ - (bool)mpalQuery(MPQ_DIALOG_SELECTION,(uint32)(nChoice),(uint32)(dwData)) + (bool)mpalQueryDWORD(MPQ_DIALOG_SELECTION,(uint32)(nChoice),(uint32)(dwData)) -#define mpalQueryDialogSelectionU32(nChoice, dwData) \ - mpalQuery(MPQ_DIALOG_SELECTION,(uint32)(nChoice),(uint32)(dwData)) /****************************************************************************\ * @@ -539,7 +537,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; * uint32 dwParam Action parameter * * Return: Handle to the thread that is performing the action, or -* INVALID_HANDLE_VALUE if the action is not 'defined for +* INVALID_PID_VALUE if the action is not 'defined for * the item, or the item and 'off. * * Note: The parameter is used primarily to implement actions @@ -549,10 +547,8 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; \****************************************************************************/ #define mpalQueryDoAction(nAction, nItem, dwParam) \ - (HANDLE)mpalQuery(MPQ_DO_ACTION, (uint32)(nAction), (uint32)(nItem), (uint32)(dwParam)) + mpalQueryDWORD(MPQ_DO_ACTION, (uint32)(nAction), (uint32)(nItem), (uint32)(dwParam)) -#define mpalQueryDoActionU32(nAction, nItem, dwParam) \ - mpalQuery(MPQ_DO_ACTION, (uint32)(nAction), (uint32)(nItem), (uint32)(dwParam)) /****************************************************************************\ @@ -565,15 +561,12 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; * uint32 nGroup Group number to use * * Return: Handle to the thread that is running the box, or -* INVALID_HANDLE_VALUE if the dialogue does not exist. +* INVALID_PID_VALUE if the dialogue does not exist. * \****************************************************************************/ #define mpalQueryDoDialog(nDialog,nGroup) \ - (HANDLE)mpalQuery(MPQ_DO_DIALOG,(uint32)(nDialog),(uint32)(nGroup)) - -#define mpalQueryDoDialogU32(nDialog, nGroup) \ - mpalQuery(MPQ_DO_DIALOG,(uint32)(nDialog),(uint32)(nGroup)) + mpalQueryHANDLE(MPQ_DO_DIALOG, (uint32)(nDialog),(uint32)(nGroup)) /****************************************************************************\ @@ -623,9 +616,13 @@ bool EXPORT mpalInit(const char *lpszFileName, const char *lpszMprFileName, * \****************************************************************************/ -uint32 EXPORT mpalQuery(uint16 wQueryType, ...); +typedef void *HANDLE; + +uint32 mpalQueryDWORD(uint16 wQueryType, ...); + +HANDLE mpalQueryHANDLE(uint16 wQueryType, ...); -void mpalQueryCoro(CORO_PARAM, uint32 *dwRet, uint16 wQueryType, ...); +void mpalQueryCORO(CORO_PARAM, uint16 wQueryType, uint32 *dwRet, ...); /****************************************************************************\ * -- cgit v1.2.3 From 724deb6b84b8a5f5a3aa96adc2a512c962f7081a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 11 May 2012 08:44:50 +1000 Subject: TONY: Bugfixes for showing the credits screen. --- engines/tony/mpal/mpal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index 9a85f2df17..cd46219b57 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -566,7 +566,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; \****************************************************************************/ #define mpalQueryDoDialog(nDialog,nGroup) \ - mpalQueryHANDLE(MPQ_DO_DIALOG, (uint32)(nDialog),(uint32)(nGroup)) + mpalQueryDWORD(MPQ_DO_DIALOG, (uint32)(nDialog),(uint32)(nGroup)) /****************************************************************************\ -- cgit v1.2.3 From 68c1b0b0e46b0575a4670d1ffda2fa3c8ae94ed8 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 11 May 2012 23:15:59 +1000 Subject: TONY: Refactored Tony to use the Common coroutine scheduler --- engines/tony/mpal/mpal.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index cd46219b57..49601bc1e9 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -118,9 +118,9 @@ #define TONY_MPAL_H #include "common/scummsys.h" +#include "common/coroutines.h" #include "common/rect.h" #include "common/str.h" -#include "tony/coroutine.h" namespace Tony { @@ -537,7 +537,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; * uint32 dwParam Action parameter * * Return: Handle to the thread that is performing the action, or -* INVALID_PID_VALUE if the action is not 'defined for +* CORO_INVALID_PID_VALUE if the action is not 'defined for * the item, or the item and 'off. * * Note: The parameter is used primarily to implement actions @@ -561,7 +561,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; * uint32 nGroup Group number to use * * Return: Handle to the thread that is running the box, or -* INVALID_PID_VALUE if the dialogue does not exist. +* CORO_INVALID_PID_VALUE if the dialogue does not exist. * \****************************************************************************/ -- cgit v1.2.3 From 65ec900cebbfdbf453cdcdb8ec24f86bd797fdcd Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 12 May 2012 11:01:20 +1000 Subject: TONY: Removed old extern, PASCAL, and EXPORT function modifiers --- engines/tony/mpal/mpal.h | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index 49601bc1e9..1d298b4f26 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -138,7 +138,6 @@ namespace MPAL { #define MAXPOLLINGLOCATIONS 64 -#define EXPORT #define LPSTR char * /****************************************************************************\ @@ -570,12 +569,9 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; /****************************************************************************\ -* Functions exported DLL +* Functions exported to the main game \****************************************************************************/ -#ifdef __cplusplus -extern "C" { -#endif /****************************************************************************\ * @@ -593,7 +589,7 @@ extern "C" { * \****************************************************************************/ -bool EXPORT mpalInit(const char *lpszFileName, const char *lpszMprFileName, +bool mpalInit(const char *lpszFileName, const char *lpszMprFileName, LPLPCUSTOMFUNCTION lplpcfArray, Common::String *lpcfStrings); @@ -636,7 +632,7 @@ void mpalQueryCORO(CORO_PARAM, uint16 wQueryType, uint32 *dwRet, ...); * \****************************************************************************/ -bool EXPORT mpalExecuteScript(int nScript); +bool mpalExecuteScript(int nScript); @@ -650,7 +646,7 @@ bool EXPORT mpalExecuteScript(int nScript); * \****************************************************************************/ -uint32 EXPORT mpalGetError(void); +uint32 mpalGetError(void); @@ -665,7 +661,7 @@ uint32 EXPORT mpalGetError(void); * \****************************************************************************/ -void EXPORT mpalInstallItemIrq(LPITEMIRQFUNCTION lpiifCustom); +void mpalInstallItemIrq(LPITEMIRQFUNCTION lpiifCustom); /****************************************************************************\ @@ -684,7 +680,7 @@ void EXPORT mpalInstallItemIrq(LPITEMIRQFUNCTION lpiifCustom); * \****************************************************************************/ -bool EXPORT mpalStartIdlePoll(int nLoc); +bool mpalStartIdlePoll(int nLoc); /****************************************************************************\ @@ -715,7 +711,7 @@ void mpalEndIdlePoll(CORO_PARAM, int nLoc, bool *result); * \****************************************************************************/ -int EXPORT mpalLoadState(byte *buf); +int mpalLoadState(byte *buf); @@ -730,7 +726,7 @@ int EXPORT mpalLoadState(byte *buf); * \****************************************************************************/ -void EXPORT mpalSaveState(byte *buf); +void mpalSaveState(byte *buf); @@ -744,11 +740,8 @@ void EXPORT mpalSaveState(byte *buf); * \****************************************************************************/ -int EXPORT mpalGetSaveStateSize(void); +int mpalGetSaveStateSize(void); -#ifdef __cplusplus -} -#endif /****************************************************************************\ * -- cgit v1.2.3 From 63e3b47857fe5a507858b4256b1f3f4d7fe50c22 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 13 May 2012 00:53:09 +1000 Subject: TONY: Fix compiler warnings --- engines/tony/mpal/mpal.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index 1d298b4f26..319f71c6a8 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -522,6 +522,9 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; #define mpalQueryDialogSelection(nChoice,dwData) \ (bool)mpalQueryDWORD(MPQ_DIALOG_SELECTION,(uint32)(nChoice),(uint32)(dwData)) +#define mpalQueryDialogSelectionDWORD(nChoice,dwData) \ + mpalQueryDWORD(MPQ_DIALOG_SELECTION,(uint32)(nChoice),(uint32)(dwData)) + /****************************************************************************\ * -- cgit v1.2.3 From d67a5162addcc143c870ed35000212bdd7d7ab2c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 18 May 2012 21:48:03 +1000 Subject: TONY: Converting method comments to DOXYGEN format --- engines/tony/mpal/mpal.h | 705 +++++++++++++++++------------------------------ 1 file changed, 251 insertions(+), 454 deletions(-) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index 319f71c6a8..a14bfd1895 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -126,6 +126,12 @@ namespace Tony { namespace MPAL { +/****************************************************************************\ +* Type definitions +\****************************************************************************/ + +typedef void *HANDLE; + /****************************************************************************\ * Macro definitions and structures \****************************************************************************/ @@ -140,25 +146,19 @@ namespace MPAL { #define LPSTR char * -/****************************************************************************\ -* enum QueryCoordinates -* --------------------- -* Description: Macro for use with queries that may refer to X and Y co-ordinates -\****************************************************************************/ - +/** + * Macro for use with queries that may refer to X and Y co-ordinates + */ enum QueryCoordinates { MPQ_X, MPQ_Y }; -/****************************************************************************\ -* enum QueryTypes -* --------------- -* Description: Query can be used with mpalQuery methods. In practice corresponds -* all claims that can do at the library -\****************************************************************************/ - +/** + * Query can be used with mpalQuery methods. In practice corresponds all claims + * that can do at the library + */ enum QueryTypes { /* General Query */ MPQ_VERSION=10, @@ -189,13 +189,9 @@ enum QueryTypes { MPQ_DO_DIALOG }; - -/****************************************************************************\ -* typedef ITEM -* ------------ -* Description: Framework to manage the animation of an item -\****************************************************************************/ - +/** + * Framework to manage the animation of an item + */ typedef struct { char *frames[MAXFRAMES]; Common::Rect frameslocations[MAXFRAMES]; @@ -214,311 +210,188 @@ typedef struct { typedef ITEM *LPITEM; -/****************************************************************************\ -* typedef LPCUSTOMFUNCTION -* ------------------------ -* Description: Define a custom function, to use the language MPAL -* to perform various controls as a result of an action -\****************************************************************************/ - +/** + * Define a custom function, to use the language MPAL to perform various controls as a result of an action + */ typedef void (*LPCUSTOMFUNCTION)(CORO_PARAM, uint32, uint32, uint32, uint32); typedef LPCUSTOMFUNCTION *LPLPCUSTOMFUNCTION; - -/****************************************************************************\ -* typedef LPITEMIRQFUNCTION -* ------------------------- -* Description: Define an IRQ of an item that is called when the -* pattern changes or the status of an item -\****************************************************************************/ - +/** + * + * Define an IRQ of an item that is called when the pattern changes or the status of an item + */ typedef void (*LPITEMIRQFUNCTION)(uint32, int, int); typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; +/** + * @defgroup Macrofunctions query + * + * The following are defines used for simplifying calling the mpalQuery variants + */ -/****************************************************************************\ -* Macrofunctions query -\****************************************************************************/ - -/****************************************************************************\ -* -* Function: uint32 mpalQueryVersion(void); -* -* Description: Gets the current version of MPAL -* -* Return: Version number (0x1232 = 1.2.3b) -* -\****************************************************************************/ - +/** + * Gets the current version of MPAL + * + * @returns Version number (0x1232 = 1.2.3b) + */ #define mpalQueryVersion() \ (uint16)mpalQueryDWORD(MPQ_VERSION) - - -/****************************************************************************\ -* -* Function: uint32 mpalQueryGlobalVar(LPSTR lpszVarName); -* -* Description: Gets the numerical value of a global variable -* -* Input: LPSTR lpszVarName Nome della variabile (ASCIIZ) -* -* Return: Valore della variabile -* -* Note: This query was implemented for debugging. The program, -* if well designed, should not need to access variables from -* within the library. -* -\****************************************************************************/ - +/** + * Gets the numerical value of a global variable + * + * @param lpszVarName Nome della variabile (ASCIIZ) + * @returns Global variable value + * @remarks This query was implemented for debugging. The program, + * if well designed, should not need to access variables from + * within the library. + */ #define mpalQueryGlobalVar(lpszVarName) \ mpalQueryDWORD(MPQ_GLOBAL_VAR, (const char *)(lpszVarName)) - -/****************************************************************************\ -* -* Function: HGLOBAL mpalQueryResource(uint32 dwResId); -* -* Description: Provides access to a resource inside the .MPC file -* -* Input: uint32 dwResId ID della risorsa -* -* Return: Handle to a memory area containing the resource, -* ready for use. -* -\****************************************************************************/ - +/** + * Provides access to a resource inside the .MPC file + * + * @param dwResId Resource Id + * @returns Handle to a memory area containing the resource, ready for use. + */ #define mpalQueryResource(dwResId) \ mpalQueryHANDLE(MPQ_RESOURCE, (uint32)(dwResId)) - -/****************************************************************************\ -* -* Function: LPSTR mpalQueryMessage(uint32 nMsg); -* -* Description: Returns a message. -* -* Input: uint32 nMsg Message number -* -* Return: ASCIIZ message -* -* Note: The returned pointer must be freed with GlobalFree() +/** + * Returns a message. + * + * @param nMsg Message number + * @returns ASCIIZ message + * @remarks The returned pointer must be freed via the memory manager * after use. The message will be in ASCIIZ format. -* -\****************************************************************************/ - +*/ #define mpalQueryMessage(nMsg) \ (LPSTR)mpalQueryHANDLE(MPQ_MESSAGE, (uint32)(nMsg)) - -/****************************************************************************\ -* -* Function: HGLOBAL mpalQueryLocationImage(uint32 nLoc); -* -* Description: Provides a image image -* -* Input: uint32 nLoc Locazion number -* -* Return: Returns a picture handle -* -\****************************************************************************/ - +/** + * Provides a location image + * @return Returns a picture handle + */ #define mpalQueryLocationImage(nLoc) \ mpalQueryHANDLE(MPQ_LOCATION_IMAGE, (uint32)(nLoc)) - -/****************************************************************************\ -* -* Function: uint32 mpalQueryLocationSize(uint32 nLoc, uint32 dwCoord); -* -* Description: Request the x or y size of a location in pixels -* -* Input: uint32 nLoc Location number -* uint32 dwCoord MPQ_Xr o MPQ_Y -* -* Return: Size -* -\****************************************************************************/ - +/** + * Request the x or y size of a location in pixels + * + * @param nLoc Location number + * @param dwCoord MPQ_X or MPQ_Y coordinate to retrieve + * @returns Size + */ #define mpalQueryLocationSize(nLoc,dwCoord) \ mpalQueryDWORD(MPQ_LOCATION_SIZE,(uint32)(nLoc),(uint32)(dwCoord)) - -/****************************************************************************\ -* -* Function: uint32 * mpalQueryItemList(uint32 nLoc); -* -* Description: Provides the list of objects in the lease. -* -* Input: uint32 nLoc Location number -* -* Return: List of objects (accessible by Item [0], Item [1], etc.) -* -\****************************************************************************/ -// TODO: Check if the results of this are endian safe +/** + * Provides the list of objects in a location. + * + * @param nLoc Location number + * @returns List of objects (accessible by Item [0], Item [1], etc.) + */ +// TODO: Determine if this is endian safe #define mpalQueryItemList(nLoc) \ (uint32 *)mpalQueryHANDLE(MPQ_ITEM_LIST,(uint32)(nLoc)) - -/****************************************************************************\ -* -* Function: LPBKGANIM mpalQueryItemData(uint32 nItem); -* -* Description: Provides information on an item -*e -* Input: uint32 nItem Item number -* -* Return: structure filled with requested information -* -\****************************************************************************/ - +/** + * Provides information on an item + * + * @param nItem Item number + * @returns Structure filled with requested information + */ #define mpalQueryItemData(nItem) \ (LPITEM)mpalQueryHANDLE(MPQ_ITEM_DATA,(uint32)(nItem)) - -/****************************************************************************\ -* -* Function: uint32 mpalQueryItemPattern(uint32 nItem); -* -* Description: Provides the current pattern of an item -* -* Input: uint32 nItem Item number -* -* Return: Number of animation patterns to be executed. -* -* Note: By default, the pattern of 0 indicates that we should -* do nothing. -* -\****************************************************************************/ - +/** + * Provides the current pattern of an item + * + * @param nItem Item number + * @returns Number of animation patterns to be executed. + * @remarks By default, the pattern of 0 indicates that we should do nothing. + */ #define mpalQueryItemPattern(nItem) \ mpalQueryDWORD(MPQ_ITEM_PATTERN,(uint32)(nItem)) - -/****************************************************************************\ -* -* Function: bool mpalQueryItemIsActive(uint32 nItem); -* -* Description: Returns true if an item is active -* -* Input: uint32 nItem Item number -* -* Return: TRUE if the item is active, FALSE otherwise -* -\****************************************************************************/ - +/** + * Returns true if an item is active + * + * @param nItem Item number + * @returns TRUE if the item is active, FALSE otherwise + */ #define mpalQueryItemIsActive(nItem) \ (bool)mpalQueryDWORD(MPQ_ITEM_IS_ACTIVE,(uint32)(nItem)) -/****************************************************************************\ -* -* Function: void mpalQueryItemName(uint32 nItem, LPSTR lpszName); -* -* Description: Returns the name of an item -* -* Input: uint32 nItem Item number -* LPSTR lpszName Pointer to a buffer of at least 33 bytes -* that will be filled with the name -* -* Note: If the item is not active (ie. if its status or number -* is less than or equal to 0), the string will be empty. -* -\****************************************************************************/ - +/** + * Returns the name of an item + * + * @param nItem Item number + * @param lpszName Pointer to a buffer of at least 33 bytes + * that will be filled with the name + * @remarks If the item is not active (ie. if its status or number + * is less than or equal to 0), the string will be empty. + */ #define mpalQueryItemName(nItem, lpszName) \ mpalQueryHANDLE(MPQ_ITEM_NAME,(uint32)(nItem), (LPSTR)(lpszName)) - -/****************************************************************************\ -* -* Function: LPSTR mpalQueryDialogPeriod(uint32 nDialog, uint32 nPeriod); -* -* Description: Returns a sentence of dialog. -* -* Input: uint32 nDialog Dialog number -* uint32 nPeriod Number of words -* -* Return: A pointer to the string of words, or NULL on failure. -* -* Note: The string must be freed after use by GlobalFree (). -* -* Unlike normal messages, the sentences of dialogue -* are formed by a single string terminated with 0. -* -\****************************************************************************/ - +/** + * Returns a sentence of dialog. + * + * @param nDialog Dialog number + * @param nPeriod Number of words + * @returns A pointer to the string of words, or NULL on failure. + * @remarks The string must be freed after use using the memory manager. + * Unlike normal messages, the sentences of dialogue are formed by a single + * string terminated with 0. + */ #define mpalQueryDialogPeriod(nPeriod) \ (LPSTR)mpalQueryHANDLE(MPQ_DIALOG_PERIOD, (uint32)(nPeriod)) - -/****************************************************************************\ -* -* Function: int mpalQueryDialogWaitForChoice(void); -* -* Description: Wait until the moment in which the need is signaled -* to make a choice by the user. -* -* Return: Number of choice to be made, or -1 if the dialogue is finished. -* -\****************************************************************************/ - +/** + * Wait until the moment in which the need is signaled to make a choice by the user. + * @returns Number of choice to be made, or -1 if the dialogue is finished. + */ #define mpalQueryDialogWaitForChoice(dwRet) \ CORO_INVOKE_2(mpalQueryCORO, MPQ_DIALOG_WAITFORCHOICE, dwRet) -/****************************************************************************\ -* -* Function: uint32 * mpalQueryDialogSelectList(uint32 nChoice); -* -* Description: Requires a list of various options for some choice within -* the current dialog. - -* Input: uint32 nChoice Choice number -* -* Return: A pointer to an array containing the data matched to each option. -* -* Note: The figure 'a uint32 specified in the source to which MPAL -* You can 'assign meaning that the more' suits. -* -* The pointer msut be freed after use by GlobalFree(). -* -\****************************************************************************/ +/** + * Requires a list of various options for some choice within the current dialog. + * + * @param nChoice Choice number + * @returns A pointer to an array containing the data matched to each option. + * @remarks The figure 'a uint32 specified in the source to which MPAL + * You can assign meaning that the more' suits. + * The pointer msut be freed after use using the memory memory. + */ #define mpalQueryDialogSelectList(nChoice) \ (uint32 *)mpalQueryHANDLE(MPQ_DIALOG_SELECTLIST,(uint32)(nChoice)) - -/****************************************************************************\ -* -* Function: bool mpalQueryDialogSelection(uint32 nChoice, uint32 dwData); -* -* Description: Warns the library that the user has selected, in a certain -* choice of the current dialog, corresponding option -* at a certain given. -* -* Input: uint32 nChoice Choice number of the choice that -* was in progress -* uint32 dwData Option that was selected by the user. -* -* Return: TRUE if all OK, FALSE on failure. -* -* Note: After execution of this query, MPAL continue -* Groups according to the execution of the dialogue. And necessary so the game -* remains on hold again for another Chosen by mpalQueryDialogWaitForChoice (). -* -\****************************************************************************/ - +/** + * Warns the library that the user has selected, in a certain choice of the current dialog, + * corresponding option at a certain given. + * + * @param nChoice Choice number of the choice that was in progress + * @param dwData Option that was selected by the user. + * @returns TRUE if all OK, FALSE on failure. + * @remarks After execution of this query, MPAL continue + * Groups according to the execution of the dialogue. And necessary so the game + * remains on hold again for another chosen by mpalQueryDialogWaitForChoice (). + */ #define mpalQueryDialogSelection(nChoice,dwData) \ (bool)mpalQueryDWORD(MPQ_DIALOG_SELECTION,(uint32)(nChoice),(uint32)(dwData)) @@ -526,245 +399,169 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; mpalQueryDWORD(MPQ_DIALOG_SELECTION,(uint32)(nChoice),(uint32)(dwData)) -/****************************************************************************\ -* -* Function: HANDLE mpalQueryDoAction(uint32 nAction, uint32 nItem, -* uint32 dwParam); -* -* Description: Warns the library an action was performed on a Object. -* The library will call 'custom functions, if necessary. -* -* Input: uint32 nAction Action number -* uint32 nItem Item number -* uint32 dwParam Action parameter -* -* Return: Handle to the thread that is performing the action, or -* CORO_INVALID_PID_VALUE if the action is not 'defined for -* the item, or the item and 'off. -* -* Note: The parameter is used primarily to implement actions -* as "U.S." involving two objects together. The action will be executed only -* if the item is active, ie if its status is a positive number greater than 0. -* -\****************************************************************************/ - +/** + * Warns the library an action was performed on a Object. + * The library will call custom functions, if necessary. + * + * @param nAction Action number + * @param nItem Item number + * @param dwParam Action parameter + * @returns Handle to the thread that is performing the action, or CORO_INVALID_PID_VALUE + * if the action is not defined for the item, or the item is inactive. + * @remarks The parameter is used primarily to implement actions + * as "U.S." involving two objects together. The action will be executed only + * if the item is active, ie if its status is a positive number greater than 0. + */ #define mpalQueryDoAction(nAction, nItem, dwParam) \ mpalQueryDWORD(MPQ_DO_ACTION, (uint32)(nAction), (uint32)(nItem), (uint32)(dwParam)) - -/****************************************************************************\ -* -* Function: HANDLE mpalQueryDoDialog(uint32 nDialog, uint32 nGroup); -* -* Description: Warns the library a dialogue was required. -* -* Input: uint32 nDialog Dialog number -* uint32 nGroup Group number to use -* -* Return: Handle to the thread that is running the box, or -* CORO_INVALID_PID_VALUE if the dialogue does not exist. -* -\****************************************************************************/ - +/** + * Warns the library a dialogue was required. + * + * @param nDialog Dialog number + * @param nGroup Group number to use + * @returns Handle to the thread that is running the box, or + * CORO_INVALID_PID_VALUE if the dialogue does not exist. + */ #define mpalQueryDoDialog(nDialog,nGroup) \ mpalQueryDWORD(MPQ_DO_DIALOG, (uint32)(nDialog),(uint32)(nGroup)) -/****************************************************************************\ -* Functions exported to the main game -\****************************************************************************/ - +/** + * @defgroup Functions exported to the main game + */ -/****************************************************************************\ -* -* Function: bool mpalInit(LPSTR lpszMpcFileName, LPSTR lpszMprFileName, -* LPLPCUSTOMFUNCTION lplpcfArray); -* -* Description: Initializes the MPAL library, and opens an .MPC file, which -* will be 'used for all queries -* -* Input: LPSTR lpszMpcFileName Name of the .MPC file, including extension -* LPSTR lpszMprFileName Name of the .MPR file, including extension -* LPLPCUSTOMFUNCTION Array of pointers to custom functions -* -* Return: TRUE if all OK, FALSE on failure -* -\****************************************************************************/ +/** + * Initializes the MPAL library, and opens an .MPC file, which will be 'used for all queries + * @param lpszMpcFileName Name of the .MPC file, including extension + * @param lpszMprFileName Name of the .MPR file, including extension + * @param lplpcfArray Array of pointers to custom functions + * @returns TRUE if all OK, FALSE on failure + */ bool mpalInit(const char *lpszFileName, const char *lpszMprFileName, LPLPCUSTOMFUNCTION lplpcfArray, Common::String *lpcfStrings); - -/****************************************************************************\ -* -* Function: uint32 mpalQuery(uint16 wQueryType, ...); -* -* Description: This is the general function to communicate with the library, -* To request information about what is in the .MPC file -* -* Input: uint16 wQueryType Type of query. The list is in -* the QueryTypes enum. -* -* Return: 4 bytes depending on the type of query -* -* Note: I _strongly_ recommended to use macros defined above to use -* the query, since it helps avoid any unpleasant bugs due to -* forgeting parameters. -* -\****************************************************************************/ - -typedef void *HANDLE; - +/** + * This is a general function to communicate with the library, to request information + * about what is in the .MPC file + * + * @param wQueryType Type of query. The list is in the QueryTypes enum. + * @returns 4 bytes depending on the type of query + * @remarks This is the specialised version of the original single mpalQuery + * method that returns numeric results. + */ uint32 mpalQueryDWORD(uint16 wQueryType, ...); +/** + * This is a general function to communicate with the library, to request information + * about what is in the .MPC file + * + * @param wQueryType Type of query. The list is in the QueryTypes enum. + * @returns 4 bytes depending on the type of query + * @remarks This is the specialised version of the original single mpalQuery + * method that returns a pointer or handle. + */ HANDLE mpalQueryHANDLE(uint16 wQueryType, ...); +/** + * This is a general function to communicate with the library, to request information + * about what is in the .MPC file + * + * @param wQueryType Type of query. The list is in the QueryTypes enum. + * @returns 4 bytes depending on the type of query + * @remarks This is the specialised version of the original single mpalQuery + * method that needs to run within a co-routine context. + */ void mpalQueryCORO(CORO_PARAM, uint16 wQueryType, uint32 *dwRet, ...); -/****************************************************************************\ -* -* Function: bool mpalExecuteScript(int nScript); -* -* Description: Execute a script. The script runs on multitasking by a thread. -* -* Input: int nScript Script number to run -* -* Return: TRUE if the script 'was launched, FALSE on failure -* -\****************************************************************************/ +/** + * Execute a script. The script runs on multitasking by a thread. + * + * @param nScript Script number to run + * @returns TRUE if the script 'was launched, FALSE on failure + */ bool mpalExecuteScript(int nScript); - -/****************************************************************************\ -* -* Function: uint32 mpalGetError(void); -* -* Description: Returns the current MPAL error code -* -* Return: Error code -* -\****************************************************************************/ - +/** + * Returns the current MPAL error code + * + * @returns Error code + */ uint32 mpalGetError(void); - -/****************************************************************************\ -* -* Function: void mpalInstallItemIrq(LPITEMIRQFUNCTION lpiifCustom); -* -* Description: Install a custom routine That will be called by MPAL -* every time the pattern of an item has-been changed. -* -* Input: LPITEMIRQFUNCTION lpiifCustom Custom function to install -* -\****************************************************************************/ - +/** + * Install a custom routine That will be called by MPAL every time the pattern + * of an item has been changed. + * + * @param lpiifCustom Custom function to install + */ void mpalInstallItemIrq(LPITEMIRQFUNCTION lpiifCustom); -/****************************************************************************\ -* -* Function: bool mpalStartIdlePoll(int nLoc); -* -* Description: Process the idle actions of the items on one location. -* -* Input: int nLoc Number of the location whose items -* must be processed for idle actions. -* -* Return: TRUE if all OK, and FALSE if it exceeded the maximum limit. -* -* Note: The maximum number of locations that can be polled -* simultaneously is defined defined by MAXPOLLINGFUNCIONS -* -\****************************************************************************/ - +/** + * Process the idle actions of the items on one location. + * + * @param nLoc Number of the location whose items must be processed + * for idle actions. + * @returns TRUE if all OK, and FALSE if it exceeded the maximum limit. + * @remarks The maximum number of locations that can be polled + * simultaneously is defined defined by MAXPOLLINGFUNCIONS + */ bool mpalStartIdlePoll(int nLoc); -/****************************************************************************\ -* -* Function: bool mpalEndIdlePoll(int nLoc); -* -* Description: Stop processing the idle actions of the items on one location. -* -* Input: int nLoc Number of the location -* -* Return: TRUE if all OK, FALSE if the specified location was not -* in the process of polling -* -\****************************************************************************/ - +/** + * Stop processing the idle actions of the items on one location. + * + * @param nLo Number of the location + * @returns TRUE if all OK, FALSE if the specified location was not + * in the process of polling + */ void mpalEndIdlePoll(CORO_PARAM, int nLoc, bool *result); -/****************************************************************************\ -* -* Function: int mpalLoadState(LPBYTE buf); -* -* Description: Load a save state from a buffer. -* -* Input: LPBYTE buf Buffer where to store the state -* -* Return: Length of the state in bytes -* -\****************************************************************************/ - +/** + * Load a save state from a buffer. + * + * @param buf Buffer where to store the state + * @returns Length of the state buffer in bytes + */ int mpalLoadState(byte *buf); - -/****************************************************************************\ -* -* Function: void mpalSaveState(LPBYTE buf); -* -* Description: Store the save state into a buffer. The buffer must be -* length at least the size specified with mpalGetSaveStateSize -* -* Input: LPBYTE buf Buffer where to store the state -* -\****************************************************************************/ - +/** + * Store the save state into a buffer. The buffer must be + * length at least the size specified with mpalGetSaveStateSize + * + * @param buf Buffer where to store the state + */ void mpalSaveState(byte *buf); - -/****************************************************************************\ -* -* Function: int mpalGetSaveStateSize(void); -* -* Description: Acquire the length of a save state -* -* Return: Length in bytes -* -\****************************************************************************/ - +/** + * Retrieve the length of a save state + * + * @returns Length in bytes + */ int mpalGetSaveStateSize(void); -/****************************************************************************\ -* -* Function: void LockVar(void); -* -* Description: Locka le variabili per accederci -* -\****************************************************************************/ - -extern void LockVar(void); +/** + * Locks the variables for access + */ +void LockVar(void); -/****************************************************************************\ -* -* Function: void UnlockVar(void); -* -* Description: Unlocka le variabili dopo l'uso -* -\****************************************************************************/ -extern void UnlockVar(void); +/** + * Unlocks variables after use + */ +void UnlockVar(void); } // end of namespace MPAL -- cgit v1.2.3 From c38bbce20cf69748012863dcd08c575ba6b56c9d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 20 May 2012 16:11:25 +1000 Subject: TONY: Remove original header --- engines/tony/mpal/mpal.h | 40 ++-------------------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index a14bfd1895..1bf19ef1bb 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -20,46 +20,10 @@ * * */ -/************************************************************************** - * 様様様様様様様様様様様様様様様様様 * - * ... Spyral Software snc * - * . x#""*$Nu -= We create much MORE than ALL =- * - * d*#R$. R ^#$o 様様様様様様様様様様様様様様様様様 * - * .F ^$k $ "$b * - * ." $b u "$ #$L * - * P $c :*$L"$L '$k Project: MPAL................... * - * d @$N. $. d ^$b^$k $c * - * F 4 "$c '$ $ #$u#$u '$ Module: MPAL Main Include file. * - * 4 4k *N #b .> '$N'*$u * * - * M $L #$ $ 8 "$c'#$b.. .@ Author: Giovanni Bajo.......... * - * M '$u "$u :" *$. "#*#" * - * M '$N. " F ^$k Desc: Main Include file for * - * 4> ^R$oue# d using MPAL.DLL......... * - * '$ "" @ ....................... * - * #b u# * - * $b .@" OS: [ ] DOS [X] WIN95 [ ] OS/2 * - * #$u .d" * - * '*$e. .zR".@ 様様様様様様様様様様様様様様様様様 * - * "*$$beooee$*" @"M This source code is * - * """ '$.? Copyright (C) Spyral Software * - * '$d> ALL RIGHTS RESERVED * - * '$> 様様様様様様様様様様様様様様様様様 * - * * - **************************************************************************/ - - -/****************************************************************************\ -* Copyright Notice -\****************************************************************************/ - /* - * A Spyral Software Production: - * - * MPAL - MultiPurpose Adventure Language - * (C) 1997 Giovanni Bajo and Luca Giusti - * ALL RIGHTS RESERVED - * + * This code is based on original Tony Tough source code * + * Copyright (c) 1997-2003 Nayma Software */ -- cgit v1.2.3 From cd15e483ed64274049142a2e6838962d794c3ff5 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Thu, 7 Jun 2012 21:14:59 +0200 Subject: TONY: Some more renaming --- engines/tony/mpal/mpal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index 1bf19ef1bb..fb3d019051 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -519,13 +519,13 @@ int mpalGetSaveStateSize(void); /** * Locks the variables for access */ -void LockVar(void); +void lockVar(void); /** * Unlocks variables after use */ -void UnlockVar(void); +void unlockVar(void); } // end of namespace MPAL -- cgit v1.2.3 From d4777379d23b70aa07feec3ef2e90fcf376f4117 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 8 Jun 2012 23:00:48 +1000 Subject: TONY: Refactored the memory manager to increase performance --- engines/tony/mpal/mpal.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index fb3d019051..f23eaf8e4a 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -85,17 +85,12 @@ #include "common/coroutines.h" #include "common/rect.h" #include "common/str.h" +#include "tony/mpal/memory.h" namespace Tony { namespace MPAL { -/****************************************************************************\ -* Type definitions -\****************************************************************************/ - -typedef void *HANDLE; - /****************************************************************************\ * Macro definitions and structures \****************************************************************************/ -- cgit v1.2.3 From a50b1f32c1de667cd2d73535b07e62b000cf4483 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 9 Jun 2012 13:05:48 +1000 Subject: TONY: Fixes for deallocating MPC and MPAL data --- engines/tony/mpal/mpal.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index f23eaf8e4a..198083f851 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -402,6 +402,10 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; bool mpalInit(const char *lpszFileName, const char *lpszMprFileName, LPLPCUSTOMFUNCTION lplpcfArray, Common::String *lpcfStrings); +/** + * Frees resources allocated by the MPAL subsystem + */ +void mpalFree(); /** * This is a general function to communicate with the library, to request information -- cgit v1.2.3 From 44ee26e6c99383dd9cec1392afae958faaf87b12 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 10 Jun 2012 23:56:37 +0200 Subject: TONY: Rename variables in loc.h and mpal.h --- engines/tony/mpal/mpal.h | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index 198083f851..9ea0c40bbc 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -152,19 +152,19 @@ enum QueryTypes { * Framework to manage the animation of an item */ typedef struct { - char *frames[MAXFRAMES]; - Common::Rect frameslocations[MAXFRAMES]; - Common::Rect bbox[MAXFRAMES]; - short pattern[MAXPATTERN][MAXFRAMES]; - short speed; - char numframe; - char numpattern; - char curframe; - char curpattern; - short destX, destY; - signed char Zvalue; - short objectID; - char TAG; + char *_frames[MAXFRAMES]; + Common::Rect _frameslocations[MAXFRAMES]; + Common::Rect _bbox[MAXFRAMES]; + short _pattern[MAXPATTERN][MAXFRAMES]; + short _speed; + char _numframe; + char _numpattern; + char _curframe; + char _curpattern; + short _destX, _destY; + signed char _destZ; + short _objectID; +// char TAG; } ITEM; typedef ITEM *LPITEM; @@ -247,7 +247,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; * @returns Size */ #define mpalQueryLocationSize(nLoc,dwCoord) \ - mpalQueryDWORD(MPQ_LOCATION_SIZE,(uint32)(nLoc),(uint32)(dwCoord)) + mpalQueryDWORD(MPQ_LOCATION_SIZE, (uint32)(nLoc), (uint32)(dwCoord)) /** @@ -258,7 +258,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; */ // TODO: Determine if this is endian safe #define mpalQueryItemList(nLoc) \ - (uint32 *)mpalQueryHANDLE(MPQ_ITEM_LIST,(uint32)(nLoc)) + (uint32 *)mpalQueryHANDLE(MPQ_ITEM_LIST, (uint32)(nLoc)) /** @@ -268,7 +268,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; * @returns Structure filled with requested information */ #define mpalQueryItemData(nItem) \ - (LPITEM)mpalQueryHANDLE(MPQ_ITEM_DATA,(uint32)(nItem)) + (LPITEM)mpalQueryHANDLE(MPQ_ITEM_DATA, (uint32)(nItem)) /** @@ -279,7 +279,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; * @remarks By default, the pattern of 0 indicates that we should do nothing. */ #define mpalQueryItemPattern(nItem) \ - mpalQueryDWORD(MPQ_ITEM_PATTERN,(uint32)(nItem)) + mpalQueryDWORD(MPQ_ITEM_PATTERN, (uint32)(nItem)) /** @@ -289,7 +289,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; * @returns TRUE if the item is active, FALSE otherwise */ #define mpalQueryItemIsActive(nItem) \ - (bool)mpalQueryDWORD(MPQ_ITEM_IS_ACTIVE,(uint32)(nItem)) + (bool)mpalQueryDWORD(MPQ_ITEM_IS_ACTIVE, (uint32)(nItem)) /** @@ -302,7 +302,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; * is less than or equal to 0), the string will be empty. */ #define mpalQueryItemName(nItem, lpszName) \ - mpalQueryHANDLE(MPQ_ITEM_NAME,(uint32)(nItem), (LPSTR)(lpszName)) + mpalQueryHANDLE(MPQ_ITEM_NAME, (uint32)(nItem), (LPSTR)(lpszName)) /** @@ -337,7 +337,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; * The pointer msut be freed after use using the memory memory. */ #define mpalQueryDialogSelectList(nChoice) \ - (uint32 *)mpalQueryHANDLE(MPQ_DIALOG_SELECTLIST,(uint32)(nChoice)) + (uint32 *)mpalQueryHANDLE(MPQ_DIALOG_SELECTLIST, (uint32)(nChoice)) /** @@ -351,11 +351,11 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; * Groups according to the execution of the dialogue. And necessary so the game * remains on hold again for another chosen by mpalQueryDialogWaitForChoice (). */ -#define mpalQueryDialogSelection(nChoice,dwData) \ - (bool)mpalQueryDWORD(MPQ_DIALOG_SELECTION,(uint32)(nChoice),(uint32)(dwData)) +#define mpalQueryDialogSelection(nChoice, dwData) \ + (bool)mpalQueryDWORD(MPQ_DIALOG_SELECTION, (uint32)(nChoice), (uint32)(dwData)) -#define mpalQueryDialogSelectionDWORD(nChoice,dwData) \ - mpalQueryDWORD(MPQ_DIALOG_SELECTION,(uint32)(nChoice),(uint32)(dwData)) +#define mpalQueryDialogSelectionDWORD(nChoice, dwData) \ + mpalQueryDWORD(MPQ_DIALOG_SELECTION, (uint32)(nChoice), (uint32)(dwData)) /** -- cgit v1.2.3 From a91553efeb0e2beaf942fc3f7db30868ac8c6afa Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 17 Jun 2012 09:09:18 +1000 Subject: TONY: Cleaned up the @defgroup comments --- engines/tony/mpal/mpal.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index 9ea0c40bbc..1ec96c97d0 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -187,6 +187,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; * * The following are defines used for simplifying calling the mpalQuery variants */ +//@{ /** * Gets the current version of MPAL @@ -386,11 +387,12 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; #define mpalQueryDoDialog(nDialog,nGroup) \ mpalQueryDWORD(MPQ_DO_DIALOG, (uint32)(nDialog),(uint32)(nGroup)) +//@} /** * @defgroup Functions exported to the main game */ - +//@{ /** * Initializes the MPAL library, and opens an .MPC file, which will be 'used for all queries @@ -526,6 +528,8 @@ void lockVar(void); */ void unlockVar(void); +//@} + } // end of namespace MPAL } // end of namespace Tony -- cgit v1.2.3 From e8a6f61f8815fcf36e7a43383695c74b8925993f Mon Sep 17 00:00:00 2001 From: Strangerke Date: Mon, 18 Jun 2012 08:24:33 +0200 Subject: TONY: Remove useless void in function declaration --- engines/tony/mpal/mpal.h | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index 1ec96c97d0..251e78afdf 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -327,7 +327,6 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; #define mpalQueryDialogWaitForChoice(dwRet) \ CORO_INVOKE_2(mpalQueryCORO, MPQ_DIALOG_WAITFORCHOICE, dwRet) - /** * Requires a list of various options for some choice within the current dialog. * @@ -340,7 +339,6 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; #define mpalQueryDialogSelectList(nChoice) \ (uint32 *)mpalQueryHANDLE(MPQ_DIALOG_SELECTLIST, (uint32)(nChoice)) - /** * Warns the library that the user has selected, in a certain choice of the current dialog, * corresponding option at a certain given. @@ -358,7 +356,6 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; #define mpalQueryDialogSelectionDWORD(nChoice, dwData) \ mpalQueryDWORD(MPQ_DIALOG_SELECTION, (uint32)(nChoice), (uint32)(dwData)) - /** * Warns the library an action was performed on a Object. * The library will call custom functions, if necessary. @@ -375,7 +372,6 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; #define mpalQueryDoAction(nAction, nItem, dwParam) \ mpalQueryDWORD(MPQ_DO_ACTION, (uint32)(nAction), (uint32)(nItem), (uint32)(dwParam)) - /** * Warns the library a dialogue was required. * @@ -387,8 +383,6 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; #define mpalQueryDoDialog(nDialog,nGroup) \ mpalQueryDWORD(MPQ_DO_DIALOG, (uint32)(nDialog),(uint32)(nGroup)) -//@} - /** * @defgroup Functions exported to the main game */ @@ -442,7 +436,6 @@ HANDLE mpalQueryHANDLE(uint16 wQueryType, ...); */ void mpalQueryCORO(CORO_PARAM, uint16 wQueryType, uint32 *dwRet, ...); - /** * Execute a script. The script runs on multitasking by a thread. * @@ -451,14 +444,12 @@ void mpalQueryCORO(CORO_PARAM, uint16 wQueryType, uint32 *dwRet, ...); */ bool mpalExecuteScript(int nScript); - /** * Returns the current MPAL error code * * @returns Error code */ -uint32 mpalGetError(void); - +uint32 mpalGetError(); /** * Install a custom routine That will be called by MPAL every time the pattern @@ -468,7 +459,6 @@ uint32 mpalGetError(void); */ void mpalInstallItemIrq(LPITEMIRQFUNCTION lpiifCustom); - /** * Process the idle actions of the items on one location. * @@ -480,7 +470,6 @@ void mpalInstallItemIrq(LPITEMIRQFUNCTION lpiifCustom); */ bool mpalStartIdlePoll(int nLoc); - /** * Stop processing the idle actions of the items on one location. * @@ -499,7 +488,6 @@ void mpalEndIdlePoll(CORO_PARAM, int nLoc, bool *result); */ int mpalLoadState(byte *buf); - /** * Store the save state into a buffer. The buffer must be * length at least the size specified with mpalGetSaveStateSize @@ -508,27 +496,22 @@ int mpalLoadState(byte *buf); */ void mpalSaveState(byte *buf); - /** * Retrieve the length of a save state * * @returns Length in bytes */ -int mpalGetSaveStateSize(void); - +int mpalGetSaveStateSize(); /** * Locks the variables for access */ -void lockVar(void); - +void lockVar(); /** * Unlocks variables after use */ -void unlockVar(void); - -//@} +void unlockVar(); } // end of namespace MPAL -- cgit v1.2.3 From d2b33ca4cce2794e7b4fcf3ccb3f00dc74fff68d Mon Sep 17 00:00:00 2001 From: Strangerke Date: Tue, 28 Aug 2012 23:25:50 +0200 Subject: TONY: Janitorial - remove trailing spaces --- engines/tony/mpal/mpal.h | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index 251e78afdf..20f2b0b170 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -34,9 +34,9 @@ /* * MPAL (MultiPurpose Adventure Language) is a high level language * for the definition of adventure. Through the use of MPAL you can describe - * storyboard the adventure, and then use it with any user interface. - * In fact, unlike many other similar products, MPAL is not programmed through - * the whole adventure, but are defined only the locations, objects, as they may + * storyboard the adventure, and then use it with any user interface. + * In fact, unlike many other similar products, MPAL is not programmed through + * the whole adventure, but are defined only the locations, objects, as they may * interact with each other, etc.. thus making MPAL useful for any type of adventure. */ @@ -64,16 +64,16 @@ /* * A custom function and a function specified by the program that uses the * library, to perform the particular code. The custom functions are - * retrieved from the library as specified in the source MPAL, and in particular + * retrieved from the library as specified in the source MPAL, and in particular * in defining the behavior of an item with some action. * * To use the custom functions, you need to prepare an array of - * pointers to functions (such as using the type casting LPCUSTOMFUNCTION, + * pointers to functions (such as using the type casting LPCUSTOMFUNCTION, * (defined below), and pass it as second parameter to mpalInit (). Note you - * must specify the size of the array, as elements of pointers and which do not - * contain the same: the library will call it only those functions specified in - * the source MPAL. It can be useful, for debugging reasons, do not bet - * the shares of arrays used to debugging function, to avoid unpleasant crash, + * must specify the size of the array, as elements of pointers and which do not + * contain the same: the library will call it only those functions specified in + * the source MPAL. It can be useful, for debugging reasons, do not bet + * the shares of arrays used to debugging function, to avoid unpleasant crash, * if it has been made an error in source and / or some oversight in the code. * */ @@ -115,7 +115,7 @@ enum QueryCoordinates { /** - * Query can be used with mpalQuery methods. In practice corresponds all claims + * Query can be used with mpalQuery methods. In practice corresponds all claims * that can do at the library */ enum QueryTypes { @@ -176,7 +176,7 @@ typedef void (*LPCUSTOMFUNCTION)(CORO_PARAM, uint32, uint32, uint32, uint32); typedef LPCUSTOMFUNCTION *LPLPCUSTOMFUNCTION; /** - * + * * Define an IRQ of an item that is called when the pattern changes or the status of an item */ typedef void (*LPITEMIRQFUNCTION)(uint32, int, int); @@ -202,8 +202,8 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; * * @param lpszVarName Nome della variabile (ASCIIZ) * @returns Global variable value - * @remarks This query was implemented for debugging. The program, - * if well designed, should not need to access variables from + * @remarks This query was implemented for debugging. The program, + * if well designed, should not need to access variables from * within the library. */ #define mpalQueryGlobalVar(lpszVarName) \ @@ -313,7 +313,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; * @param nPeriod Number of words * @returns A pointer to the string of words, or NULL on failure. * @remarks The string must be freed after use using the memory manager. - * Unlike normal messages, the sentences of dialogue are formed by a single + * Unlike normal messages, the sentences of dialogue are formed by a single * string terminated with 0. */ #define mpalQueryDialogPeriod(nPeriod) \ @@ -340,14 +340,14 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; (uint32 *)mpalQueryHANDLE(MPQ_DIALOG_SELECTLIST, (uint32)(nChoice)) /** - * Warns the library that the user has selected, in a certain choice of the current dialog, + * Warns the library that the user has selected, in a certain choice of the current dialog, * corresponding option at a certain given. * * @param nChoice Choice number of the choice that was in progress * @param dwData Option that was selected by the user. * @returns TRUE if all OK, FALSE on failure. - * @remarks After execution of this query, MPAL continue - * Groups according to the execution of the dialogue. And necessary so the game + * @remarks After execution of this query, MPAL continue + * Groups according to the execution of the dialogue. And necessary so the game * remains on hold again for another chosen by mpalQueryDialogWaitForChoice (). */ #define mpalQueryDialogSelection(nChoice, dwData) \ @@ -357,15 +357,15 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; mpalQueryDWORD(MPQ_DIALOG_SELECTION, (uint32)(nChoice), (uint32)(dwData)) /** - * Warns the library an action was performed on a Object. + * Warns the library an action was performed on a Object. * The library will call custom functions, if necessary. * * @param nAction Action number * @param nItem Item number * @param dwParam Action parameter - * @returns Handle to the thread that is performing the action, or CORO_INVALID_PID_VALUE + * @returns Handle to the thread that is performing the action, or CORO_INVALID_PID_VALUE * if the action is not defined for the item, or the item is inactive. - * @remarks The parameter is used primarily to implement actions + * @remarks The parameter is used primarily to implement actions * as "U.S." involving two objects together. The action will be executed only * if the item is active, ie if its status is a positive number greater than 0. */ @@ -452,7 +452,7 @@ bool mpalExecuteScript(int nScript); uint32 mpalGetError(); /** - * Install a custom routine That will be called by MPAL every time the pattern + * Install a custom routine That will be called by MPAL every time the pattern * of an item has been changed. * * @param lpiifCustom Custom function to install @@ -462,7 +462,7 @@ void mpalInstallItemIrq(LPITEMIRQFUNCTION lpiifCustom); /** * Process the idle actions of the items on one location. * - * @param nLoc Number of the location whose items must be processed + * @param nLoc Number of the location whose items must be processed * for idle actions. * @returns TRUE if all OK, and FALSE if it exceeded the maximum limit. * @remarks The maximum number of locations that can be polled -- cgit v1.2.3 From 766eadeef98e6adcd52e5fb5325a1f7586572402 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 29 Aug 2012 22:47:33 +0200 Subject: TONY: Translate some remaining Italian comments --- engines/tony/mpal/mpal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index 20f2b0b170..4c8ca481b0 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -200,7 +200,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; /** * Gets the numerical value of a global variable * - * @param lpszVarName Nome della variabile (ASCIIZ) + * @param lpszVarName Variable name (ASCIIZ) * @returns Global variable value * @remarks This query was implemented for debugging. The program, * if well designed, should not need to access variables from -- cgit v1.2.3 From 825e0896dc52c26e7e31447a434619e190e5c183 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Wed, 29 Aug 2012 23:25:14 +0200 Subject: TONY: Replace C-style comments by C++-style ones. Also translate some more Italian comments --- engines/tony/mpal/mpal.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index 4c8ca481b0..492889d88a 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -95,7 +95,7 @@ namespace MPAL { * Macro definitions and structures \****************************************************************************/ -/* OK value for the error codes */ +// OK value for the error codes #define OK 0 #define MAXFRAMES 400 // frame animation of an object @@ -119,31 +119,31 @@ enum QueryCoordinates { * that can do at the library */ enum QueryTypes { - /* General Query */ + // General Query MPQ_VERSION=10, MPQ_GLOBAL_VAR=50, MPQ_RESOURCE, MPQ_MESSAGE, - /* Query on leases */ + // Query on leases MPQ_LOCATION_IMAGE=100, MPQ_LOCATION_SIZE, - /* Queries about items */ + // Queries about items MPQ_ITEM_LIST=200, MPQ_ITEM_DATA, MPQ_ITEM_PATTERN, MPQ_ITEM_NAME, MPQ_ITEM_IS_ACTIVE, - /* Query dialog */ + // Query dialog MPQ_DIALOG_PERIOD=300, MPQ_DIALOG_WAITFORCHOICE, MPQ_DIALOG_SELECTLIST, MPQ_DIALOG_SELECTION, - /* Query execution */ + // Query execution MPQ_DO_ACTION=400, MPQ_DO_DIALOG }; -- cgit v1.2.3 From 7fbfbc8e6b57729e1a5008d256b28b0571f1c3b6 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 31 Aug 2012 23:08:02 +0200 Subject: TONY: Rename some more variables and structures --- engines/tony/mpal/mpal.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index 492889d88a..1af0f2c9e9 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -120,31 +120,31 @@ enum QueryCoordinates { */ enum QueryTypes { // General Query - MPQ_VERSION=10, + MPQ_VERSION = 10, - MPQ_GLOBAL_VAR=50, + MPQ_GLOBAL_VAR = 50, MPQ_RESOURCE, MPQ_MESSAGE, // Query on leases - MPQ_LOCATION_IMAGE=100, + MPQ_LOCATION_IMAGE = 100, MPQ_LOCATION_SIZE, // Queries about items - MPQ_ITEM_LIST=200, + MPQ_ITEM_LIST = 200, MPQ_ITEM_DATA, MPQ_ITEM_PATTERN, MPQ_ITEM_NAME, MPQ_ITEM_IS_ACTIVE, // Query dialog - MPQ_DIALOG_PERIOD=300, + MPQ_DIALOG_PERIOD = 300, MPQ_DIALOG_WAITFORCHOICE, MPQ_DIALOG_SELECTLIST, MPQ_DIALOG_SELECTION, // Query execution - MPQ_DO_ACTION=400, + MPQ_DO_ACTION = 400, MPQ_DO_DIALOG }; @@ -164,7 +164,6 @@ typedef struct { short _destX, _destY; signed char _destZ; short _objectID; -// char TAG; } ITEM; typedef ITEM *LPITEM; -- cgit v1.2.3 From f2df769aab10e719cc4fba6cb71e1500eb3acae4 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 1 Sep 2012 00:25:35 +0200 Subject: TONY: More renaming --- engines/tony/mpal/mpal.h | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index 1af0f2c9e9..c5f505063f 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -100,11 +100,8 @@ namespace MPAL { #define MAXFRAMES 400 // frame animation of an object #define MAXPATTERN 40 // pattern of animation of an object - #define MAXPOLLINGLOCATIONS 64 -#define LPSTR char * - /** * Macro for use with queries that may refer to X and Y co-ordinates */ @@ -113,7 +110,6 @@ enum QueryCoordinates { MPQ_Y }; - /** * Query can be used with mpalQuery methods. In practice corresponds all claims * that can do at the library @@ -164,8 +160,8 @@ typedef struct { short _destX, _destY; signed char _destZ; short _objectID; -} ITEM; -typedef ITEM *LPITEM; +} Item; +typedef Item *LpItem; /** @@ -228,7 +224,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; * after use. The message will be in ASCIIZ format. */ #define mpalQueryMessage(nMsg) \ - (LPSTR)mpalQueryHANDLE(MPQ_MESSAGE, (uint32)(nMsg)) + (char *)mpalQueryHANDLE(MPQ_MESSAGE, (uint32)(nMsg)) /** @@ -246,7 +242,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; * @param dwCoord MPQ_X or MPQ_Y coordinate to retrieve * @returns Size */ -#define mpalQueryLocationSize(nLoc,dwCoord) \ +#define mpalQueryLocationSize(nLoc, dwCoord) \ mpalQueryDWORD(MPQ_LOCATION_SIZE, (uint32)(nLoc), (uint32)(dwCoord)) @@ -268,7 +264,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; * @returns Structure filled with requested information */ #define mpalQueryItemData(nItem) \ - (LPITEM)mpalQueryHANDLE(MPQ_ITEM_DATA, (uint32)(nItem)) + (LpItem)mpalQueryHANDLE(MPQ_ITEM_DATA, (uint32)(nItem)) /** @@ -302,7 +298,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; * is less than or equal to 0), the string will be empty. */ #define mpalQueryItemName(nItem, lpszName) \ - mpalQueryHANDLE(MPQ_ITEM_NAME, (uint32)(nItem), (LPSTR)(lpszName)) + mpalQueryHANDLE(MPQ_ITEM_NAME, (uint32)(nItem), (char *)(lpszName)) /** @@ -316,7 +312,7 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; * string terminated with 0. */ #define mpalQueryDialogPeriod(nPeriod) \ - (LPSTR)mpalQueryHANDLE(MPQ_DIALOG_PERIOD, (uint32)(nPeriod)) + (char *)mpalQueryHANDLE(MPQ_DIALOG_PERIOD, (uint32)(nPeriod)) /** @@ -379,8 +375,8 @@ typedef LPITEMIRQFUNCTION* LPLPITEMIRQFUNCTION; * @returns Handle to the thread that is running the box, or * CORO_INVALID_PID_VALUE if the dialogue does not exist. */ -#define mpalQueryDoDialog(nDialog,nGroup) \ - mpalQueryDWORD(MPQ_DO_DIALOG, (uint32)(nDialog),(uint32)(nGroup)) +#define mpalQueryDoDialog(nDialog, nGroup) \ + mpalQueryDWORD(MPQ_DO_DIALOG, (uint32)(nDialog), (uint32)(nGroup)) /** * @defgroup Functions exported to the main game @@ -422,7 +418,7 @@ uint32 mpalQueryDWORD(uint16 wQueryType, ...); * @remarks This is the specialised version of the original single mpalQuery * method that returns a pointer or handle. */ -HANDLE mpalQueryHANDLE(uint16 wQueryType, ...); +MpalHandle mpalQueryHANDLE(uint16 wQueryType, ...); /** * This is a general function to communicate with the library, to request information -- cgit v1.2.3 From 25f4a3fb0838a8ed658e76eabd78f3ce2f5661e6 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Thu, 6 Sep 2012 00:23:59 +0200 Subject: TONY: Misc cleanup --- engines/tony/mpal/mpal.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/tony/mpal/mpal.h') diff --git a/engines/tony/mpal/mpal.h b/engines/tony/mpal/mpal.h index c5f505063f..5e1b02b3fc 100644 --- a/engines/tony/mpal/mpal.h +++ b/engines/tony/mpal/mpal.h @@ -102,6 +102,8 @@ namespace MPAL { #define MAXPATTERN 40 // pattern of animation of an object #define MAXPOLLINGLOCATIONS 64 +#define GETARG(type) va_arg(v, type) + /** * Macro for use with queries that may refer to X and Y co-ordinates */ -- cgit v1.2.3