diff options
author | Filippos Karapetis | 2015-07-17 10:38:06 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2015-12-15 00:05:02 +0100 |
commit | 047df0b0e8d85593dd8200a169f0a68a66c138c2 (patch) | |
tree | b28401d118378bf810bf9b185362bfc3376c6b69 /engines | |
parent | 79ed1e1f05dc1537f666018bc7240a5d96835b5b (diff) | |
download | scummvm-rg350-047df0b0e8d85593dd8200a169f0a68a66c138c2.tar.gz scummvm-rg350-047df0b0e8d85593dd8200a169f0a68a66c138c2.tar.bz2 scummvm-rg350-047df0b0e8d85593dd8200a169f0a68a66c138c2.zip |
LAB: Simplify usage of createButton()
Diffstat (limited to 'engines')
-rw-r--r-- | engines/lab/engine.cpp | 68 | ||||
-rw-r--r-- | engines/lab/interface.cpp | 3 |
2 files changed, 37 insertions, 34 deletions
diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp index 9af2a22fb6..661cbdfb84 100644 --- a/engines/lab/engine.cpp +++ b/engines/lab/engine.cpp @@ -263,45 +263,45 @@ bool setUpScreens() { y = VGAScaleY(173) - SVGACord(2); if (g_lab->getPlatform() == Common::kPlatformWindows) { - MoveGadgetList = createButton(VGAScaleX(1), y, 0, 't', MoveImages[0], MoveImages[1]); + MoveGadgetList = createButton(1, y, 0, 't', MoveImages[0], MoveImages[1]); curgad = MoveGadgetList; - curgad->NextGadget = createButton(VGAScaleX(33), y, 1, 'm', MoveImages[2], MoveImages[3]); + curgad->NextGadget = createButton(33, y, 1, 'm', MoveImages[2], MoveImages[3]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(65), y, 2, 'o', MoveImages[4], MoveImages[5]); + curgad->NextGadget = createButton(65, y, 2, 'o', MoveImages[4], MoveImages[5]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(97), y, 3, 'c', MoveImages[6], MoveImages[7]); + curgad->NextGadget = createButton(97, y, 3, 'c', MoveImages[6], MoveImages[7]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(129), y, 4, 'l', MoveImages[8], MoveImages[9]); + curgad->NextGadget = createButton(129, y, 4, 'l', MoveImages[8], MoveImages[9]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(161), y, 5, 'i', MoveImages[12], MoveImages[13]); + curgad->NextGadget = createButton(161, y, 5, 'i', MoveImages[12], MoveImages[13]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(193), y, 6, VKEY_LTARROW, MoveImages[14], MoveImages[15]); + curgad->NextGadget = createButton(193, y, 6, VKEY_LTARROW, MoveImages[14], MoveImages[15]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(225), y, 7, VKEY_UPARROW, MoveImages[16], MoveImages[17]); + curgad->NextGadget = createButton(225, y, 7, VKEY_UPARROW, MoveImages[16], MoveImages[17]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(257), y, 8, VKEY_RTARROW, MoveImages[18], MoveImages[19]); + curgad->NextGadget = createButton(257, y, 8, VKEY_RTARROW, MoveImages[18], MoveImages[19]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(289), y, 9, 'p', MoveImages[10], MoveImages[11]); + curgad->NextGadget = createButton(289, y, 9, 'p', MoveImages[10], MoveImages[11]); } else { - MoveGadgetList = createButton(VGAScaleX(1), y, 0, 0, MoveImages[0], MoveImages[1]); + MoveGadgetList = createButton(1, y, 0, 0, MoveImages[0], MoveImages[1]); curgad = MoveGadgetList; - curgad->NextGadget = createButton(VGAScaleX(33), y, 1, 0, MoveImages[2], MoveImages[3]); + curgad->NextGadget = createButton(33, y, 1, 0, MoveImages[2], MoveImages[3]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(65), y, 2, 0, MoveImages[4], MoveImages[5]); + curgad->NextGadget = createButton(65, y, 2, 0, MoveImages[4], MoveImages[5]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(97), y, 3, 0, MoveImages[6], MoveImages[7]); + curgad->NextGadget = createButton(97, y, 3, 0, MoveImages[6], MoveImages[7]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(129), y, 4, 0, MoveImages[8], MoveImages[9]); + curgad->NextGadget = createButton(129, y, 4, 0, MoveImages[8], MoveImages[9]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(161), y, 5, 0, MoveImages[12], MoveImages[13]); + curgad->NextGadget = createButton(161, y, 5, 0, MoveImages[12], MoveImages[13]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(193), y, 6, 0, MoveImages[14], MoveImages[15]); + curgad->NextGadget = createButton(193, y, 6, 0, MoveImages[14], MoveImages[15]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(225), y, 7, 0, MoveImages[16], MoveImages[17]); + curgad->NextGadget = createButton(225, y, 7, 0, MoveImages[16], MoveImages[17]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(257), y, 8, 0, MoveImages[18], MoveImages[19]); + curgad->NextGadget = createButton(257, y, 8, 0, MoveImages[18], MoveImages[19]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(289), y, 9, 0, MoveImages[10], MoveImages[11]); + curgad->NextGadget = createButton(289, y, 9, 0, MoveImages[10], MoveImages[11]); } file = openPartial("P:Inv"); @@ -321,37 +321,37 @@ bool setUpScreens() { for (counter = 0; counter < 10; counter++) readImage(buffer, &(InvImages[counter])); - InvGadgetList = createButton(VGAScaleX(24), y, 0, 'm', InvImages[0], InvImages[1]); + InvGadgetList = createButton(24, y, 0, 'm', InvImages[0], InvImages[1]); curgad = InvGadgetList; - curgad->NextGadget = createButton(VGAScaleX(56), y, 1, 'g', InvImages[2], InvImages[3]); + curgad->NextGadget = createButton(56, y, 1, 'g', InvImages[2], InvImages[3]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(94), y, 2, 'u', InvImages[4], InvImages[5]); + curgad->NextGadget = createButton(94, y, 2, 'u', InvImages[4], InvImages[5]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(126), y, 3, 'l', MoveImages[8], MoveImages[9]); + curgad->NextGadget = createButton(126, y, 3, 'l', MoveImages[8], MoveImages[9]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(164), y, 4, VKEY_LTARROW, MoveImages[14], MoveImages[15]); + curgad->NextGadget = createButton(164, y, 4, VKEY_LTARROW, MoveImages[14], MoveImages[15]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(196), y, 5, VKEY_RTARROW, MoveImages[18], MoveImages[19]); + curgad->NextGadget = createButton(196, y, 5, VKEY_RTARROW, MoveImages[18], MoveImages[19]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(234), y, 6, 'b', InvImages[6], InvImages[7]); + curgad->NextGadget = createButton(234, y, 6, 'b', InvImages[6], InvImages[7]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(266), y, 7, 'f', InvImages[8], InvImages[9]); + curgad->NextGadget = createButton(266, y, 7, 'f', InvImages[8], InvImages[9]); curgad = curgad->NextGadget; } else { for (counter = 0; counter < 6; counter++) readImage(buffer, &(InvImages[counter])); - InvGadgetList = createButton(VGAScaleX(58), y, 0, 0, InvImages[0], InvImages[1]); + InvGadgetList = createButton(58, y, 0, 0, InvImages[0], InvImages[1]); curgad = InvGadgetList; - curgad->NextGadget = createButton(VGAScaleX(90), y, 1, 0, InvImages[2], InvImages[3]); + curgad->NextGadget = createButton(90, y, 1, 0, InvImages[2], InvImages[3]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(128), y, 2, 0, InvImages[4], InvImages[5]); + curgad->NextGadget = createButton(128, y, 2, 0, InvImages[4], InvImages[5]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(160), y, 3, 0, MoveImages[8], MoveImages[9]); + curgad->NextGadget = createButton(160, y, 3, 0, MoveImages[8], MoveImages[9]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(198), y, 4, 0, MoveImages[14], MoveImages[15]); + curgad->NextGadget = createButton(198, y, 4, 0, MoveImages[14], MoveImages[15]); curgad = curgad->NextGadget; - curgad->NextGadget = createButton(VGAScaleX(230), y, 5, 0, MoveImages[18], MoveImages[19]); + curgad->NextGadget = createButton(230, y, 5, 0, MoveImages[18], MoveImages[19]); curgad = curgad->NextGadget; } diff --git a/engines/lab/interface.cpp b/engines/lab/interface.cpp index 62d35c1e03..cffa054a8e 100644 --- a/engines/lab/interface.cpp +++ b/engines/lab/interface.cpp @@ -28,6 +28,7 @@ * */ +#include "lab/labfun.h" #include "lab/stddefines.h" #include "lab/interface.h" #include "lab/timing.h" @@ -44,6 +45,8 @@ Common::KeyState _keyPressed; Gadget *createButton(uint16 x, uint16 y, uint16 id, uint16 key, Image *im, Image *imalt) { Gadget *gptr; + x = VGAScaleX(x); + if ((gptr = new Gadget())) { gptr->x = x; gptr->y = y; |