Subversion Repositories eduke32

Rev

Rev 4997 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4997 Rev 5000
Line 18... Line 18...
18
along with this program; if not, write to the Free Software
18
along with this program; if not, write to the Free Software
19
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20
*/
20
*/
21
//-------------------------------------------------------------------------
21
//-------------------------------------------------------------------------
22
22
-
 
23
#include "compat.h"
23
#include "duke3d.h"
24
#include "duke3d.h"
24
#include "renderlayer.h"
25
#include "renderlayer.h"
25
#include "net.h"
26
#include "net.h"
26
#include "player.h"
27
#include "player.h"
27
#include "mouse.h"
28
#include "mouse.h"
Line 257... Line 258...
257
static MenuLink_t MEO_ ## EntryName = { LinkID, MA_Advance, };\
258
static MenuLink_t MEO_ ## EntryName = { LinkID, MA_Advance, };\
258
static MenuEntry_t ME_ ## EntryName = MAKE_MENUENTRY( Title, &MF_Redfont, &Format, &MEO_ ## EntryName, Link )
259
static MenuEntry_t ME_ ## EntryName = MAKE_MENUENTRY( Title, &MF_Redfont, &Format, &MEO_ ## EntryName, Link )
259
260
260
261
261
MAKE_MENU_TOP_ENTRYLINK( "New Game", MEF_MainMenu, MAIN_NEWGAME, MENU_EPISODE );
262
MAKE_MENU_TOP_ENTRYLINK( "New Game", MEF_MainMenu, MAIN_NEWGAME, MENU_EPISODE );
-
 
263
#ifdef DROIDMENU
-
 
264
MAKE_MENU_TOP_ENTRYLINK( "Resume Game", MEF_MainMenu, MAIN_RESUMEGAME, MENU_CLOSE );
-
 
265
#endif
262
MAKE_MENU_TOP_ENTRYLINK( "New Game", MEF_MainMenu, MAIN_NEWGAME_INGAME, MENU_NEWVERIFY );
266
MAKE_MENU_TOP_ENTRYLINK( "New Game", MEF_MainMenu, MAIN_NEWGAME_INGAME, MENU_NEWVERIFY );
263
static MenuLink_t MEO_MAIN_NEWGAME_NETWORK = { MENU_NETWORK, MA_Advance, };
267
static MenuLink_t MEO_MAIN_NEWGAME_NETWORK = { MENU_NETWORK, MA_Advance, };
264
MAKE_MENU_TOP_ENTRYLINK( "Save Game", MEF_MainMenu, MAIN_SAVEGAME, MENU_SAVE );
268
MAKE_MENU_TOP_ENTRYLINK( "Save Game", MEF_MainMenu, MAIN_SAVEGAME, MENU_SAVE );
265
MAKE_MENU_TOP_ENTRYLINK( "Load Game", MEF_MainMenu, MAIN_LOADGAME, MENU_LOAD );
269
MAKE_MENU_TOP_ENTRYLINK( "Load Game", MEF_MainMenu, MAIN_LOADGAME, MENU_LOAD );
266
MAKE_MENU_TOP_ENTRYLINK( "Options", MEF_MainMenu, MAIN_OPTIONS, MENU_OPTIONS );
270
MAKE_MENU_TOP_ENTRYLINK( "Options", MEF_MainMenu, MAIN_OPTIONS, MENU_OPTIONS );
Line 282... Line 286...
282
    &ME_MAIN_CREDITS,
286
    &ME_MAIN_CREDITS,
283
    &ME_MAIN_QUIT,
287
    &ME_MAIN_QUIT,
284
};
288
};
285
289
286
static MenuEntry_t *MEL_MAIN_INGAME[] = {
290
static MenuEntry_t *MEL_MAIN_INGAME[] = {
-
 
291
#ifdef DROIDMENU
-
 
292
    &ME_MAIN_RESUMEGAME,
-
 
293
#else
287
    &ME_MAIN_NEWGAME_INGAME,
294
    &ME_MAIN_NEWGAME_INGAME,
-
 
295
#endif
288
    &ME_MAIN_SAVEGAME,
296
    &ME_MAIN_SAVEGAME,
289
    &ME_MAIN_LOADGAME,
297
    &ME_MAIN_LOADGAME,
290
    &ME_MAIN_OPTIONS,
298
    &ME_MAIN_OPTIONS,
291
#ifndef DROIDMENU
299
#ifndef DROIDMENU
292
    &ME_MAIN_HELP,
300
    &ME_MAIN_HELP,
293
#endif
-
 
294
    &ME_MAIN_QUITTOTITLE,
301
    &ME_MAIN_QUITTOTITLE,
295
    &ME_MAIN_QUITGAME,
302
    &ME_MAIN_QUITGAME,
-
 
303
#else
-
 
304
    &ME_MAIN_QUITTOTITLE,
-
 
305
#endif
296
};
306
};
297
307
298
// Episode and Skill will be dynamically generated after CONs are parsed
308
// Episode and Skill will be dynamically generated after CONs are parsed
299
static MenuLink_t MEO_EPISODE = { MENU_SKILL, MA_Advance, };
309
static MenuLink_t MEO_EPISODE = { MENU_SKILL, MA_Advance, };
300
static MenuLink_t MEO_EPISODE_SHAREWARE = { MENU_BUYDUKE, MA_Advance, };
310
static MenuLink_t MEO_EPISODE_SHAREWARE = { MENU_BUYDUKE, MA_Advance, };
Line 4252... Line 4262...
4252
static int32_t M_RunMenuInput_MouseAdvance(void)
4262
static int32_t M_RunMenuInput_MouseAdvance(void)
4253
{
4263
{
4254
    return MOUSEACTIVECONDITIONAL(!m_mousecaught && mousepressstate == Mouse_Released);
4264
    return MOUSEACTIVECONDITIONAL(!m_mousecaught && mousepressstate == Mouse_Released);
4255
}
4265
}
4256
4266
4257
#if !defined __ANDROID__
4267
#if !defined EDUKE32_TOUCH_DEVICES
4258
static int32_t M_RunMenuInput_MouseReturn_status;
4268
static int32_t M_RunMenuInput_MouseReturn_status;
4259
4269
4260
static void M_RunMenu_MouseReturn(Menu_t *cm, const vec2_t origin)
4270
static void M_RunMenu_MouseReturn(Menu_t *cm, const vec2_t origin)
4261
{
4271
{
4262
#if !defined EDUKE32_TOUCH_DEVICES
-
 
4263
    if (!MOUSEACTIVECONDITION)
4272
    if (!MOUSEACTIVECONDITION)
4264
        return;
4273
        return;
4265
#endif
-
 
4266
4274
4267
    if (cm->menuID == MENU_MAIN)
4275
    if (cm->menuID == MENU_MAIN)
4268
        return;
4276
        return;
4269
4277
4270
    rotatesprite_(origin.x + (tilesiz[SELECTDIR].y << 16), 0, 65536, 512, SELECTDIR,
4278
    rotatesprite_(origin.x + (tilesiz[SELECTDIR].y << 16), 0, 65536, 512, SELECTDIR,
Line 4274... Line 4282...
4274
}
4282
}
4275
#endif
4283
#endif
4276
4284
4277
static int32_t M_RunMenuInput_MouseReturn(void)
4285
static int32_t M_RunMenuInput_MouseReturn(void)
4278
{
4286
{
4279
#if !defined __ANDROID__
-
 
4280
#if !defined EDUKE32_TOUCH_DEVICES
4287
#if !defined EDUKE32_TOUCH_DEVICES
4281
    if (!MOUSEACTIVECONDITION)
4288
    if (!MOUSEACTIVECONDITION)
4282
    {
4289
    {
4283
        M_RunMenuInput_MouseReturn_status = 0;
4290
        M_RunMenuInput_MouseReturn_status = 0;
4284
        return 0;
4291
        return 0;
4285
    }
4292
    }
4286
#endif
-
 
4287
4293
4288
    if (g_currentMenu == MENU_MAIN)
4294
    if (g_currentMenu == MENU_MAIN)
4289
        return 0;
4295
        return 0;
4290
4296
4291
    const int32_t MouseReturnRegionX = x_widescreen_left();
4297
    const int32_t MouseReturnRegionX = x_widescreen_left();
Line 4296... Line 4302...
4296
        return !m_mousecaught && mousepressstate == Mouse_Released && M_MouseWithinBounds(&m_mousedownpos, MouseReturnRegionX, 0, tilesiz[SELECTDIR].y<<15, tilesiz[SELECTDIR].x<<16);
4302
        return !m_mousecaught && mousepressstate == Mouse_Released && M_MouseWithinBounds(&m_mousedownpos, MouseReturnRegionX, 0, tilesiz[SELECTDIR].y<<15, tilesiz[SELECTDIR].x<<16);
4297
    }
4303
    }
4298
4304
4299
    M_RunMenuInput_MouseReturn_status = 0;
4305
    M_RunMenuInput_MouseReturn_status = 0;
4300
#endif
4306
#endif
-
 
4307
4301
    return 0;
4308
    return 0;
4302
}
4309
}
4303
4310
4304
static void M_RunMenu_AbbreviateNameIntoBuffer(const char* name, int32_t entrylength)
4311
static void M_RunMenu_AbbreviateNameIntoBuffer(const char* name, int32_t entrylength)
4305
{
4312
{
Line 4557... Line 4564...
4557
4564
4558
            break;
4565
            break;
4559
        }
4566
        }
4560
    }
4567
    }
4561
4568
4562
#if !defined __ANDROID__
4569
#if !defined EDUKE32_TOUCH_DEVICES
4563
    M_RunMenu_MouseReturn(cm, origin);
4570
    M_RunMenu_MouseReturn(cm, origin);
4564
#endif
4571
#endif
4565
}
4572
}
4566
4573
4567
/*
4574
/*