Files
source/Laptop/BobbyRUsed.cpp
T
Wanne 73be285e09 Fixes (by Moa)
-SGP debugging now works again (corrected some typos and one missing include).
-Memmory debugging works again (wrong types corrected)
-Laptop screen heigth macro and all references is now usable. (was 'C: y + A' 'D: B - C' which translates to 'D: B - y + A' instead of 'D: B - y - A')
-Laptop screens do not need to rerender as often then before as the laptop screen width/heigth macros works now and invalidating screen will do the trick -> almost no render calls neccessary.
-MercProfile.ubMiscFlag was used instead of .ubMiscFlag2 -> enter sector action schedule for soldiers which dont need to be insertered is now canceled as intended

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6509 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-10-19 12:47:53 +00:00

110 lines
2.4 KiB
C++

#ifdef PRECOMPILEDHEADERS
#include "Laptop All.h"
#else
#include "laptop.h"
#include "BobbyRUsed.h"
#include "BobbyR.h"
#include "BobbyRGuns.h"
#include "Utilities.h"
#include "WCheck.h"
#include "WordWrap.h"
#include "Text.h"
#endif
UINT32 guiUsedBackground;
UINT32 guiUsedGrid;
void GameInitBobbyRUsed()
{
}
BOOLEAN EnterBobbyRUsed()
{
VOBJECT_DESC VObjectDesc;
//gfBigImageMouseRegionCreated = FALSE;
// load the background graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("LAPTOP\\usedbackground.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiUsedBackground));
// load the gunsgrid graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("LAPTOP\\usedgrid.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiUsedGrid));
InitBobbyBrTitle();
guiPrevUsedFilterMode = -1;
guiCurrentUsedFilterMode = -1;
SetFirstLastPagesForUsed(guiCurrentUsedFilterMode);
//Draw menu bar
InitBobbyMenuBar( );
InitBobbyRUsedFilterBar();
RenderBobbyRUsed( );
return(TRUE);
}
void ExitBobbyRUsed()
{
DeleteVideoObjectFromIndex(guiUsedBackground);
DeleteVideoObjectFromIndex(guiUsedGrid);
DeleteBobbyMenuBar();
DeleteBobbyRUsedFilter();
DeleteBobbyBrTitle();
DeleteMouseRegionForBigImage();
giCurrentSubPage = gusCurWeaponIndex;
guiLastBobbyRayPage = LAPTOP_MODE_BOBBY_R_USED;
}
void HandleBobbyRUsed()
{
HandleBobbyRGuns();
}
void RenderBobbyRUsed()
{
HVOBJECT hPixHandle;
WebPageTileBackground(BOBBYR_NUM_HORIZONTAL_TILES, BOBBYR_NUM_VERTICAL_TILES, BOBBYR_BACKGROUND_WIDTH, BOBBYR_BACKGROUND_HEIGHT, guiUsedBackground);
//Display title at top of page
//DisplayBobbyRBrTitle();
// GunForm
GetVideoObject(&hPixHandle, guiUsedGrid);
BltVideoObject(FRAME_BUFFER, hPixHandle, 0, BOBBYR_GRIDLOC_X, BOBBYR_GRIDLOC_Y, VO_BLT_SRCTRANSPARENCY,NULL);
DisplayItemInfo(BOBBYR_USED_ITEMS, guiCurrentUsedFilterMode);
UpdateButtonText(guiCurrentLaptopMode);
UpdateUsedFilterButtons();
MarkButtonsDirty( );
RenderWWWProgramTitleBar( );
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
//Moa removed below. See comment above LAPTOP_SCREEN_UL_X in laptop.h
// fReDrawScreenFlag = TRUE;
//fPausedReDrawScreenFlag = TRUE;
}