123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100 |
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Copyright 2016 RWS Inc, All Rights Reserved
- //
- // This program is free software; you can redistribute it and/or modify
- // it under the terms of version 2 of the GNU General Public License as published by
- // the Free Software Foundation
- //
- // 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
- //
- // menus.cpp
- // Project: Postal
- //
- // This module contains the actual menu data (structs, strings, etc.)
- //
- // History:
- // 12/05/96 MJR Started.
- //
- // 12/19/96 JMI Menus contained a pointer to guiItem which was a not-yet-
- // created gui from my old menu sample code. Removed ptr.
- // Typo in name of MainMenuTile.bmp.
- //
- // 12/19/96 JMI Offset menu items so they didn't overwrite menu heading
- // and moved "Ready?" from verify exit menu to the heading.
- //
- // 01/27/97 JMI Added more menus (High Scores, Options, and Start).
- //
- // 01/28/97 JMI Added new menu background and indicator for two menus
- // (Main and VerifyExit).
- //
- // 01/28/97 JMI Was setting menu box to not transparent instead of trans-
- // parent. Fixed.
- //
- // 01/29/97 JMI Now uses SampleMaster to play a sample when a choice is
- // made from the main menu.
- //
- // 01/30/97 JMI Added cheezy brighten/darken effect via scrollbar in
- // options menu.
- //
- // 01/31/97 JMI Made all menus uppercase. Also, uses flesh menu and
- // smash font for all menus now. Adjusted menu paths
- // so they are in the res/Menus dir and font paths so
- // they are in the res/Fonts dir.
- //
- // 01/31/97 JMI Adjusted menu sizes such that the flesh menu could be
- // shown.
- //
- // 02/02/97 JMI Added support for -1 passed on MenuChoice callback
- // indicating change in focused menu item. Added use of
- // new child struct in Menu struct, MenuGui. Relocated
- // title text on some menus. Resized font on some menus
- // to fit better. Got rid of PalTran func which was doing
- // nothing now that game.cpp does CLUT red shift/fade.
- //
- // 02/03/97 JMI Now menuClientGame invokes the options menu, if selected.
- // Adjusted paths for SAK dir.
- //
- // 02/04/97 JMI Now uses functions in game.cpp to get and set the gamma
- // level.
- //
- // 02/04/97 JMI Forgot to release memfile used to get scrollbar for options
- // menu.
- //
- // 02/10/97 JMI rspReleaseResource() now takes a ptr to a ptr.
- //
- // 02/19/97 JMI More implementation for Start Game menu.
- //
- // 03/06/97 JMI Added g_menuVerifyQuitGame.
- //
- // 03/07/97 JMI Added Load menu option on main menu.
- //
- // 03/28/97 JMI Disabled help and ordering info.
- //
- // 04/07/97 JMI When I added the Load menu option, I must've screwed up
- // the StartGameMenu() choice function so that it always
- // started a game. Fixed.
- //
- // 04/07/97 JMI Now uses g_GameSettings.m_szServerName for the server name.
- //
- // 04/08/97 JMI Added multiplayer options menu (menuMultiOptions).
- //
- // 04/11/97 JMI Added record and play demo options to Start Game Menu.
- //
- // 04/14/97 JMI Swapped positions of Record and Play menu options.
- //
- // 04/21/97 JMI Added menuEditor and utilized new auto go back
- // functionality in Menu API.
- //
- // 04/21/97 JMI menuEditor now specifies the palette indices to be set by
- // the Menu API.
- //
- // 04/22/97 JMI Added controls menu and sub menus for keyboard, mouse, and
- // joystick. Only the mouse sub menu is partially implemented
- // functionally (the rest are not yet implemented).
- //
- // 04/22/97 JMI Added checkbox for enabling mouse input.
- //
- // 04/22/97 JMI Separated game start options into 3 categories, single
- // player, multiplayer, and demo.
- //
- // 04/22/97 JMI Updated menuClient to work as the in game menu for Play.cpp.
- //
- // 04/22/97 JMI No longer uses chdir() to get the open dialog into the
- // correct directory. Now we simply default szRealmName
- // to the path of the dir we want to save under.
- //
- // 04/22/97 JMI Now VerifyQuitMenuChoice handles menuClientGame instead of
- // g_menuVerifyQuit.
- //
- // 04/24/97 JMI Took out the ! in "Postal!" title of main menu.
- //
- // 04/24/97 JMI Now uses the centering flag for header text and
- // two new flags for shadowing the header and the items.
- // Now colors are specified as RGBA and background font
- // color must be transparent (not offered as an option).
- //
- // 04/24/97 JMI Change menuClientGame's "GAME MENU" to "MENU".
- //
- // 04/25/97 JMI Changed menu item text shadow color to be more blood like.
- // Unified all menu header and item text sizes.
- // Scooted menu items in a bit to avoid having the bullet in-
- // dicator go off the menu.
- //
- // 04/25/97 JMI StartSingleMenu() was not calling Play_SetRealmName(NULL)
- // to clear the realm name so the game went in level order.
- //
- // 05/06/97 JMI Now the Gamma GUI displays text next to the scrollbar.
- //
- // 05/07/97 JMI Now the range of the Gamma GUI text is -50 to +50.
- //
- // 05/15/97 JMI Added the menu for disabling features like alpha blending
- // and X-ray effect.
- //
- // 05/22/97 JMI Added 3D lighting to the features that can be disabled.
- //
- // 05/23/97 JMI Added particle effects to the features that can be disabled.
- //
- // 05/25/97 JMI Swapped positions of Join and Host on Multiplayer menu.
- //
- // 05/29/97 JMI Now, when g_GameSettings.m_sServer is set,
- // g_GameSettings.m_sClient is set as well.
- //
- // 06/11/97 JMI Added g_MenuSettings.
- //
- // 06/12/97 MJR Moved much of the callback code from here into game.cpp.
- //
- // 07/01/97 JMI Now plays a different sound for a selected item vs. an
- // item selection change.
- //
- // 07/03/97 JMI Now calls Game_ControlsMenu() with choices from
- // menuControls.
- //
- // 07/04/97 JMI Added the appropriate amount of items for the keyboard,
- // mouse, and joystick menus.
- // Also, moved 'Use Mouse' to Options menu.
- // Also, changed "CONTROLS" option on Options menu to "EDIT
- // CONTROLS", "KEYBOARD" to "EDIT KEYS", and collapsed
- // "MOUSE" & "JOYSTICK" into "EDIT BUTTONS".
- //
- // 07/07/97 JMI Added callbacks for menuJoystick.
- //
- // 07/12/97 JMI Removed menuHighScores and its reference by menuMain.
- // Also, adjusted MenuChoice switch values to compensate for
- // choices after 'High Scores' being pushed back (3..5
- // became 2..4).
- //
- // 07/13/97 JMI Added Challenge option from menuStart that leads to new
- // menuChallenge menu.
- //
- // 07/14/97 JMI Added difficulty slider to menuOptions.
- //
- // 07/16/97 JMI Added menuVolumes and path from menuOptions.
- //
- // 07/18/97 JMI Got rid of bogus immitation PlaySample functions.
- // Now there is one PlaySample() function. Also, you now
- // MUST specify a category and you don't have to specify a
- // SoundInstance ptr to specify a volume.
- // Also, added an '_' in "START GAME".
- //
- // 07/18/97 JMI Changed "LOAD" to "LOAD_LEVEL" and added some underscores
- // for spaces in "LOAD GAME" and "THE GAUNTLET".
- //
- // 07/19/97 JMI Added 'Volume Distancing' to menuFeatures.
- // Now 'Options' launches many other menus for the options:
- // menuVideo, menuAudio, menuPlayOptions, menuInput.
- //
- // 07/21/97 JMI Changed "FEATURES" menu to "PERFORMANCE".
- //
- // 07/29/97 JMI Now uses in-thumb area for text representation of current
- // gamma value. The gamma range can be adjusted from the
- // scrollbar file like before, but now, the range in the
- // scrollbar will be mapped to the range GAMMA_RANGE so the
- // user's control can be more or less granular than the actual
- // gamma range.
- //
- // 08/01/97 JMI Now there's a 'SETUP' option on the menuStartMulti that
- // goes to menuMultiOptions.
- // Also, changed 'Other' in multi options menu to net port.
- //
- // 08/03/97 BRH Added network protocol option to the multiplayer setup
- // menu.
- //
- // 08/04/97 JMI Added sliders for mouse sensitivities (X & Y).
- // Added menu with sliders for all facets of rotation.
- //
- // 08/04/97 JMI Added performance option for playing ambient sounds.
- //
- // 08/05/97 JMI Added multiplayer option for connection type.
- //
- // 08/05/97 JMI Added 'Touch Organ' option to menuAudioOptions.
- //
- // 08/06/97 JMI Changed "MOUSE SENS. X" and "... Y" to better names and
- // use Columnize Guis flag on menuControls.
- //
- // 08/07/97 BRH Fixed problem where the port numnber was not getting
- // set from the gui.
- //
- // 08/12/97 JMI Added some '...'s to try that concept with menus where you
- // want to know.
- //
- // 08/13/97 MJR Added Host Name gui.
- //
- // 08/14/97 JMI Converted menu callbacks to returning true to accept or
- // false to deny.
- //
- // 08/15/97 JRD Added separate postal organ menu,
- //
- // 08/17/97 BRH Got rid of violence option on PlayOptions menu, and
- // got rid of help on the main menu.
- //
- // 08/17/97 JMI Now releases protocol chooser GUI.
- //
- // 08/17/97 JMI menuOrgan was calling AudioOptionsInit() and
- // AudioOptionsChoice() so choices on the organ menu were
- // affecting audio options. Changed to no init and
- // Organ_MenuChoice() as the choice callback.
- // Also, added two lines explaining briefly that you can hit
- // A..Z and 0..9 to play with the organ.
- //
- // 08/17/97 JMI Changed wording on menuOrgan.
- //
- // 08/17/97 MJR Now loads from g_resmgrShell, and uses new menu bg's.
- //
- // 08/18/97 BRH Changed protocol gui from an REdit to an RTxt gui.
- //
- // 08/20/97 BRH Added new samples for the new pain and suffering volume
- // adjustment categories.
- //
- // MJR Changed multiplayer-related menus and added a new one.
- //
- // 08/23/97 JMI Now the init/kill callback for the main menu calls game.cpp
- // to hook it in.
- //
- // 08/23/97 JMI Added better player color menu feedback.
- //
- // 08/23/97 JMI Moved ms_apszPlayerColorDescriptions[] from here into
- // CGameSettings where it can be used more generally.
- //
- // 08/24/97 MJR Lots of tuning for consistancy, wording, etc.
- // More and more tuning.
- // Removed grip-zone-radius stuff -- no longer needed.
- //
- // 08/25/97 MJR Made the color stuff into macros so they could easily be
- // changed for all menus. Changed the RGB values, but the
- // color mapping didn't seem to be affected!!!
- //
- // 08/25/97 JMI Colors were mapping to windows static colors so they did
- // not apparently change. Added mappable range to all menus
- // and made it so all menus set the palette as well.
- // Also, added code for new difficulty GUI which provides a
- // slider and a text area.
- // Also, changed the unspecified sound category sampler to
- // the mine beep.
- // Also, now scales the ranges of the sound sliders to between
- // 0 to 10 for the user and sets the value scaled to the selected
- // category's adjusted value for the current quality.
- //
- // 08/26/97 JMI Changed difficulty strings and name of PLAY menu to
- // DIFFICULTY. Also, changed the DIFFICULTY item to something
- // shorter like SET.
- //
- // 08/27/97 JMI Now when you choose 'Defaults' from the Mixer menu, it
- // plays all the samples at the default volume for feedback
- // (rather than just the last one).
- //
- // 08/27/97 JMI Took all underscores out of menu titles and items now that
- // RPrefs supports spaces in vars and sections.
- //
- // 08/27/97 JMI Changed "PLAY" option on Options menu to "DIFFICULTY".
- //
- // 08/27/97 JMI Now displays rotation degree values as integrals.
- // Also, all menus no use g_fontPostal for their helper GUIs.
- //
- // 08/27/97 JMI Removed "BACK" menu items. Actually replaced with a
- // disabled "". Note that this is not required by the menu
- // system. That is, you can set the cancel item to an item
- // that doesn't exist. The problem is there's no mechanism for
- // specifying the one after the last item and so each menu would
- // have to constantly be updated.
- // Also, now enter on any item in the mixer will play all the
- // sounds simultaneously so you can get an idea of their
- // combined levels.
- // Also, changed sampler for Unspecified to the empty weapon
- // noise (was mine beep).
- //
- // 09/02/97 JMI Added browse option to menuStartDemo.
- //
- // 09/04/97 JMI Removed browse option from menuStartDemo.
- //
- // 09/06/97 JMI No longer displays the Demo menu even for an instant if
- // g_GameSettings.m_sCanRecordDemos is FALSE.
- //
- // 09/17/97 JMI Menus now use localizable string variables from localize.*.
- //
- // 09/26/97 JMI Now uses the 'Restore defaults' string from localize.
- //
- // 09/26/97 JMI Resized menus to fit localization text for French & German:
- //
- // Menu Change Language that caused
- // ====================== ========== =======================
- // g_menuVerifyQuitGame SM -> MD French, German
- // menuVerifyExit SM -> MD French, German
- // menuOptions SM -> MD French, German
- // menuRotation MD -> LG French
- // menuStart SM -> MD French, German
- // menuStartSingle SM -> MD French, German
- // menuStartMulti SM -> MD French, German
- // menuChallenge SM -> MD German
- // menuJoinMulti MD -> LG French, German
- //
- // 10/10/97 JMI Put menuJoystick back on menuControls based on conditional
- // compile option ALLOW_JOYSTICK. Also, updated
- // ControlsChoice() amd ControlsInit() to handle these cases.
- //
- // 10/13/97 JMI Moved g_pszControlsMenu_UseJoystick to localize.* and took
- // out 'TEMP' comments.
- // Also, made 'Controls' menu a large menu b/c the new
- // joystick options were pushing things off the edge.
- //
- // 12/01/97 BRH Added #ifdef SPAWN sections to menus so that that spawn
- // verison of the game has different menus that only allow
- // them to join a multiplayer game.
- //
- // 12/04/97 BRH Added additional option for single player missions so they
- // can play the original postal levels or the add on pack
- // levels.
- //
- // 10/07/99 JMI Conditional remove Add On start menu option when in
- // SUPER_POSTAL target.
- //
- // 03/30/00 MJR Switched to START_MENU_ADDON_ITEM to control whether
- // the START menu has an Add-On item.
- //
- ////////////////////////////////////////////////////////////////////////////////
- #define MENUS_CPP
- #include "RSPiX.h"
- #ifdef PATHS_IN_INCLUDES
- #include "WishPiX/Menu/menu.h"
- #else
- #include "menu.h"
- #endif
- #include "menus.h"
- #include "game.h"
- #include "play.h"
- #include "SampleMaster.h"
- #include "input.h"
- #include "gameedit.h"
- #include "input.h"
- #include "MenuSettings.h"
- #include "InputSettingsDlg.h"
- #include "socket.h"
- #include "organ.h"
- #include "net.h"
- #include "CompileOptions.h" // For ALLOW_JOYSTICK macro.
- #include "update.h"
- #ifdef WIN32
- #include <direct.h>
- #else
- #include <unistd.h>
- #endif
- ////////////////////////////////////////////////////////////////////////////////
- // Macros/types/etc.
- ////////////////////////////////////////////////////////////////////////////////
- #define MENU_BG_SM "Menu/menu_sm.bmp"
- #define MENU_BG_MD "Menu/menu_md.bmp"
- #define MENU_BG_LG "Menu/menu_lg.bmp"
- #define MENU_RECT_SM 20, 20, 280, 350
- #define MENU_HEAD_Y_SM -149
- #define MENU_ITEM_X_SM 70
- #define MENU_ITEM_Y_SM -101
- #define MENU_ITEM_SPACE_Y_SM 4
- #define MENU_ITEM_IND_SPACE_X_SM 5
- #define MENU_RECT_MD 20, 20, 450, 460
- #define MENU_HEAD_Y_MD -196
- #define MENU_ITEM_X_MD 60
- #define MENU_ITEM_Y_MD -140
- #define MENU_ITEM_SPACE_Y_MD 4
- #define MENU_ITEM_IND_SPACE_X_MD 5
- #define MENU_RECT_LG 0, 0, 640, 480
- #define MENU_HEAD_Y_LG -195
- #define MENU_ITEM_X_LG 60
- #define MENU_ITEM_Y_LG -95
- #define MENU_ITEM_SPACE_Y_LG 4
- #define MENU_ITEM_IND_SPACE_X_LG 5
- #define MENU_INDICATOR "Menu/bullet.bmp"
- #define SMASH_FONT "Fonts/smash.fnt"
- #define HEAD_FONT_HEIGHT 36
- #define ITEM_FONT_HEIGHT 28
- #define ITEM_FONT_HEIGHT_SMALLER 24
- // This is used when setting up font's for GUI's. The size doesn't matter, but we do have to
- // supply a value, so just for kicks, let's use the same one each time. Since we use RFont to
- // try to figure out how many font sizes are used, we want this to be a cached size.
- #define DEFAULT_GUI_FONT_HEIGHT 19
- #define HEAD_COLOR MAKE_U32_COLOR(160, 0, 0, 0)
- #define HEAD_SHADOW_COLOR MAKE_U32_COLOR( 64, 16, 16, 0)
- #define ITEM_COLOR MAKE_U32_COLOR(160, 0, 0, 0)
- #define ITEM_SHADOW_COLOR MAKE_U32_COLOR( 64, 16, 16, 0)
- // Background color index for where there is no menu graphic.
- #define MENU_BG_COLOR 252
- // Starting palette entry to set.
- #define PAL_SET_START 0
- // Number of palette entries to set.
- #define PAL_SET_NUM 230
- // Starting palette entry we can map menu colors to.
- #define PAL_MAP_START 10
- // Number of palette entries we can map menu colors to.
- #define PAL_MAP_NUM 236
- #define GUI_GAMMA_FILE "Menu/GammaSB.gui"
- #define GUI_CONNECT_IP_FILE "Menu/JoinIP.gui"
- #define GUI_HOST_NAME_FILE "Menu/HostName.gui"
- #define PLAYER_NAME_GUI_FILE "Menu/PlayerName.gui"
- #define PLAYER_COLOR_GUI_FILE "Menu/PlayerColor.gui"
- #define GUI_CHECKBOX_FILE "Menu/CheckBox0.gui"
- #define GUI_DIFFICULTY_FILE "Menu/Difficulty.gui"
- #define GUI_VOLUME_FILE "Menu/VolumeSB.gui"
- #define NET_PORT_GUI_FILE "Menu/NetPort.gui"
- #define NET_PROTO_GUI_FILE "Menu/NetProto.gui"
- #define NET_CONNECTION_GUI_FILE "Menu/NetConnectionTxt.gui"
- #define GUI_MOUSE_SENSITIVITY_FILE "Menu/MouseSensitivitySB.gui"
- #define GUI_ROTATION_FILE "Menu/RotationSB.gui"
- #define GUI_TAP_ROTATION_FILE "Menu/TapRotationSB.gui"
- #define GUI_ID_GRIPRADIUS_VAL 10
- #define GUI_ID_GAMMA_VAL 10
- #define GUI_ID_SENSITIVITY_VAL 10
- #define GUI_ID_ROTATION_VAL 10
- #define GUI_ID_VOLUME_VAL 10
- #define GUI_ID_DIFFICULTY_SLIDER 8000
- #define GUI_ID_DIFFICULTY_TEXT 8001
- #define GUI_ID_DIFFICULTY_VAL 8002
- #define MIN_GAMMA_VAL 50
- #define MAX_GAMMA_VAL 205
- #define GAMMA_RANGE (MAX_GAMMA_VAL - MIN_GAMMA_VAL)
- #define USER_VOLUME_RANGE 11
- #define MOUSE_SENSITIVITY_DIVISOR 5.0
- // Determines the number of elements in the passed array at compile time.
- #define NUM_ELEMENTS(a) (sizeof(a) / sizeof(a[0]) )
- ////////////////////////////////////////////////////////////////////////////////
- // Function prototypes
- ////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////
- // Menu callbacks.
- static short MainMenuInit( // Returns 0 on succes, non-zero to cancel menu.
- Menu* pmenuCurrent, // In: Menu being init'ed or killed.
- short sInit); // In: TRUE, if initializing; FALSE, if killing.
- static bool MainMenuChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem); // Item chosen.
- static bool VerifyExitMenuChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem); // Item chosen.
- static bool ClientGameMenuChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem); // Item chosen.
- static bool EditorMenuChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem); // Item chosen.
- static bool StartGameMenu( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem); // Item chosen.
- static short StartGameInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit); // TRUE, if initializing; FALSE, if killing.
- static bool StartSingleMenu( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem); // Item chosen.
- static short ChallengeInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit); // TRUE, if initializing; FALSE, if killing.
- static bool ChallengeChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem); // Item chosen.
- static short StartSingleInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit); // TRUE, if initializing; FALSE, if killing.
- static bool StartMultiMenu( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem); // Item chosen.
- static short StartMultiInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit); // TRUE, if initializing; FALSE, if killing.
- static bool JoinMultiMenu( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem); // Item chosen.
- static short JoinMultiInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit); // TRUE, if initializing; FALSE, if killing.
- static bool HostMultiMenu( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem); // Item chosen.
- static short HostMultiInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit); // TRUE, if initializing; FALSE, if killing.
- static bool StartDemoMenu( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem); // Item chosen.
- static short StartDemoInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit); // TRUE, if initializing; FALSE, if killing.
- static short OptionsInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit); // TRUE, if initializing; FALSE, if killing.
- static bool OptionsChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem); // Item chosen.
- static short PlayOptionsInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit); // TRUE, if initializing; FALSE, if killing.
- static bool PlayOptionsChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem); // Item chosen.
- static short VideoOptionsInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit); // TRUE, if initializing; FALSE, if killing.
- static bool VideoOptionsChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem); // Item chosen.
- static short AudioOptionsInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit); // TRUE, if initializing; FALSE, if killing.
- static bool AudioOptionsChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem); // Item chosen.
- static short VolumesInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit); // TRUE, if initializing; FALSE, if killing.
- static bool VolumesChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem); // Item chosen.
- static short ControlsInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit); // TRUE, if initializing; FALSE, if killing.
- static bool ControlsChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem); // Item chosen.
- static short RotationInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit); // TRUE, if initializing; FALSE, if killing.
- static bool RotationChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem); // Item chosen.
- static short MouseInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit); // TRUE, if initializing; FALSE, if killing.
- static bool MouseChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem); // Item chosen.
- static short KeyInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit); // TRUE, if initializing; FALSE, if killing.
- static bool KeyChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem); // Item chosen.
- static short JoyInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit); // TRUE, if initializing; FALSE, if killing.
- static bool JoyChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem); // Item chosen.
- static short MultiOptionsInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit); // TRUE, if initializing; FALSE, if killing.
- static bool MultiOptionsChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCur, // Current menu.
- short sMenuItem); // Item chosen.
- static short FeaturesInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit); // TRUE, if initializing; FALSE, if killing.
- static bool FeaturesChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCur, // Current menu.
- short sMenuItem); // Item chosen.
- ////////////////////////////////////////////////////////////////////////////////
- // GUI callbacks.
- static void GammaScrollUpdate( // Returns nothing.
- RScrollBar* psb); // Scrollbar that got updated.
- static void DifficultyScrollUpdate( // Returns nothing.
- RScrollBar* psb); // Scrollbar that got updated.
- static void VolumesScrollUpdate( // Returns nothing.
- RScrollBar* psb); // Scrollbar that got updated.
- static void MouseSensitivityScrollUpdate( // Returns nothing.
- RScrollBar* psb); // Scrollbar that got updated.
- static void RotationScrollUpdateDouble( // Returns nothing.
- RScrollBar* psb); // Scrollbar that got updated.
- static void RotationScrollUpdateShort( // Returns nothing.
- RScrollBar* psb); // Scrollbar that got updated.
- ////////////////////////////////////////////////////////////////////////////////
- // Variables/data
- ////////////////////////////////////////////////////////////////////////////////
- CMenuSettings g_MenuSettings;
- // Controls.
- static RScrollBar* ms_psbGamma = NULL;
- static REdit* ms_peditConnect = NULL;
- static REdit* ms_peditHostName = NULL;
- static REdit* ms_peditName = NULL;
- static RTxt* ms_ptxtColor = NULL;
- static RTxt* ms_ptxtProto = NULL;
- static RMultiBtn* ms_pmbCheckBox = NULL;
- static RScrollBar* ms_psbDifficulty = NULL;
- static RScrollBar* ms_psbMouseSensitivityX = NULL;
- static RScrollBar* ms_psbMouseSensitivityY = NULL;
- static RTxt* ms_ptxtBandwidth = NULL;
- static SampleMaster::SoundInstance ms_siLastSamplePlayed = 0; // Last sample played.
- static SampleMasterID* ms_apsmidVolumeTesters[SampleMaster::MAX_NUM_SOUND_CATEGORIES] =
- {
- &g_smidEmptyWeapon, // Unspecified
- &g_smidMusicTester, // BackgroundMusic
- &g_smidShotgun, // Weapon
- &g_smidLoadedWeapon, // UserFeedBack
- &g_smidRocketExplode, // Destruction
- &g_smidAmbientTester, // Ambient
- &g_smidDemonBleed, // Demon.
- &g_smidSteveScumbag, // Voices.
- &g_smidMikeAhh, // Pain
- &g_smidWrithing2, // Suffering
- };
- static char* ms_apszDifficultyDescriptions[] =
- {
- "Easy",
- "Easy",
- "Easy",
- "Medium",
- "Medium",
- "Medium",
- "Hard",
- "Hard",
- "Hard",
- "Hard",
- "Masochist",
- };
- // Main menu
- extern Menu menuMain =
- {
- MAIN_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_SM, // menu x, y, w, h
- -60, // menu header x offset
- MENU_HEAD_Y_SM, // menu header y offset
- MENU_ITEM_X_SM, // menu items x offset
- MENU_ITEM_Y_SM, // menu items y offset
- MENU_ITEM_SPACE_Y_SM, // vertical space between menu items
- MENU_ITEM_IND_SPACE_X_SM, // horizontal space between indicator and menu items
- },
- // Background info.
- { // pszFile, u32BackColor, sStartIndex, sNumEntries
- MENU_BG_SM,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- g_pszMainMenu_Title,
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- MainMenuInit, // Called before menu is initialized.
- MainMenuChoice // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- -1, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- #if defined(SPAWN)
- { // pszText, sEnabled, pmenu, pgui
- { g_pszStartMultiplayerMenu_Join,TRUE, &menuJoinMulti, NULL, },
- { g_pszMainMenu_Options, TRUE, &menuOptions, NULL, },
- { g_pszMainMenu_Exit, TRUE, &menuVerifyExit, NULL, },
- NULL // Terminates list.
- },
- #else
- { // pszText, sEnabled, pmenu, pgui
- { g_pszMainMenu_Start, TRUE, &menuStartSingle/*menuStart*/, NULL, },
- { g_pszMainMenu_Options, TRUE, &menuOptions, NULL, },
- #ifndef EDITOR_REMOVED
- { g_pszMainMenu_Editor, TRUE, NULL, NULL, },
- #endif
- #if defined(DEMO)
- { g_pszMainMenu_Buy, TRUE, NULL, NULL, },
- #endif
- { g_pszMainMenu_Exit, TRUE, &menuVerifyExit, NULL, },
- NULL // Terminates list.
- },
- #endif
- };
- // Verify exit menu
- extern Menu menuVerifyExit =
- {
- VERIFY_EXIT_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_SM, // menu x, y, w, h
- -120, // menu header x offset
- MENU_HEAD_Y_SM, // menu header y offset
- MENU_ITEM_X_SM, // menu items x offset
- MENU_ITEM_Y_SM, // menu items y offset
- MENU_ITEM_SPACE_Y_SM, // vertical space between menu items
- MENU_ITEM_IND_SPACE_X_SM, // horizontal space between indicator and menu items
- },
- // Background info.
- { // pszFile, u32BackColor
- MENU_BG_SM,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE, // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- g_pszVerifyExitMenu_Title,
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8,
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- NULL, // Called before menu is initialized.
- VerifyExitMenuChoice, // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- -1, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- { // pszText, sEnabled, pmenu, pgui
- { g_pszVerifyExitMenu_Yes, TRUE, NULL, NULL, },
- { g_pszVerifyExitMenu_No, TRUE, &menuMain, NULL, },
- NULL // Terminates list.
- },
- };
- // Verify exit menu
- extern Menu g_menuVerifyQuitGame =
- {
- VERIFY_QUIT_GAME_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_MD, // menu x, y, w, h
- -120, // menu header x offset
- MENU_HEAD_Y_MD, // menu header y offset
- MENU_ITEM_X_MD, // menu items x offset
- MENU_ITEM_Y_MD, // menu items y offset
- MENU_ITEM_SPACE_Y_MD, // vertical space between menu items
- MENU_ITEM_IND_SPACE_X_MD, // horizontal space between indicator and menu items
- },
- // Background info.
- { // pszFile, u32BackColor
- MENU_BG_MD,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE, // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- g_pszVerifyQuitMenu_Title,
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8,
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- NULL, // Called before menu is initialized.
- Play_VerifyQuitMenuChoice, // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- -1, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- { // pszText, sEnabled, pmenu, pgui
- { g_pszVerifyQuitMenu_Yes, TRUE, NULL, NULL, },
- { g_pszVerifyQuitMenu_No, TRUE, NULL, NULL, },
- NULL // Terminates list.
- },
- };
- // Client game menu
- extern Menu menuClientGame =
- {
- CLIENT_GAME_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_SM, // menu x, y, w, h
- -60, // menu header x offset
- MENU_HEAD_Y_SM, // menu header y offset
- MENU_ITEM_X_SM, // menu items x offset
- MENU_ITEM_Y_SM, // menu items y offset
- MENU_ITEM_SPACE_Y_SM, // vertical space between menu items
- MENU_ITEM_IND_SPACE_X_SM, // horizontal space between indicator and menu items
- },
- // Background info.
- { // pszFile, u32BackColor
- MENU_BG_SM,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE, // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- g_pszGameMenu_Title,
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8,
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- NULL, // Called before menu is initialized.
- Play_VerifyQuitMenuChoice, // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- 0, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- { // pszText, sEnabled, pmenu, pgui
- { g_pszGameMenu_Continue, TRUE, NULL, NULL, },
- { g_pszGameMenu_Save, TRUE, NULL, NULL, },
- { g_pszGameMenu_Options, TRUE, &menuOptions, NULL, },
- { g_pszGameMenu_Quit, TRUE, NULL, NULL, },
- NULL // Terminates list.
- },
- };
- // Editor menu
- extern Menu menuEditor =
- {
- EDITOR_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_SM, // menu x, y, w, h
- -60, // menu header x offset
- MENU_HEAD_Y_SM, // menu header y offset
- MENU_ITEM_X_SM, // menu items x offset
- MENU_ITEM_Y_SM, // menu items y offset
- MENU_ITEM_SPACE_Y_SM, // vertical space between menu items
- MENU_ITEM_IND_SPACE_X_SM, // horizontal space between indicator and menu items
- },
- // Background info.
- { // pszFile, u32BackColor
- MENU_BG_SM,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE, // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- g_pszEditorMenu_Title,
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8,
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- NULL, // Called before menu is initialized.
- EditorMenuChoice, // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- 0, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- { // pszText, sEnabled, pmenu, pgui
- { g_pszEditorMenu_Continue, TRUE, NULL, NULL, },
- { g_pszEditorMenu_Options, TRUE, &menuOptions, NULL, },
- { g_pszEditorMenu_Quit, TRUE, NULL, NULL, },
- NULL // Terminates list.
- },
- };
- // Options menu.
- extern Menu menuOptions =
- {
- OPTIONS_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_MD, // menu x, y, w, h
- -60, // menu header x offset
- MENU_HEAD_Y_MD, // menu header y offset
- MENU_ITEM_X_MD, // menu items x offset
- MENU_ITEM_Y_MD, // menu items y offset
- MENU_ITEM_SPACE_Y_MD, // vertical space between menu items
- MENU_ITEM_IND_SPACE_X_MD, // horizontal space between indicator and menu items
- },
- // Background info.
- { // pszFile, u32BackColor
- MENU_BG_MD,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE, // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- g_pszOptionsMenu_Title,
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8,
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- OptionsInit, // Called before menu is initialized.
- OptionsChoice, // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- -1, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- { // pszText, sEnabled, pmenu, pgui
- #if 0
- { g_pszOptionsMenu_Video, TRUE, &menuVideoOptions, NULL, },
- #endif
- { g_pszOptionsMenu_Audio, TRUE, &menuAudioOptions, NULL, },
- { g_pszOptionsMenu_Controls, TRUE, &menuControls, NULL, },
- #ifndef MULTIPLAYER_REMOVED
- { g_pszOptionsMenu_Multiplayer, TRUE, &menuMultiOptions, NULL, },
- #endif
- { g_pszOptionsMenu_Performance, TRUE, &menuFeatures, NULL, },
- { g_pszOptionsMenu_Difficulty, TRUE, &menuPlayOptions, NULL, },
- { g_pszOptionsMenu_Crosshair, TRUE, NULL, NULL, },
- { "", FALSE, NULL, NULL, },
- NULL // Terminates list.
- },
- };
- // Options menu.
- extern Menu menuPlayOptions =
- {
- PLAYOPTIONS_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_MD, // menu x, y, w, h
- -60, // menu header x offset
- MENU_HEAD_Y_MD, // menu header y offset
- MENU_ITEM_X_MD, // menu items x offset
- MENU_ITEM_Y_MD, // menu items y offset
- MENU_ITEM_SPACE_Y_MD, // vertical space between menu items
- MENU_ITEM_IND_SPACE_X_MD, // horizontal space between indicator and menu items
- },
- // Background info.
- { // pszFile, u32BackColor
- MENU_BG_MD,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE, // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- g_pszDifficultyMenu_Title,
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8,
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- PlayOptionsInit, // Called before menu is initialized.
- PlayOptionsChoice, // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- -1, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- { // pszText, sEnabled, pmenu, pgui
- { g_pszDifficultyMenu_SetDifficulty, TRUE, NULL, NULL, },
- { "", FALSE, NULL, NULL, },
- NULL // Terminates list.
- },
- };
- // Postal music organ:
- extern Menu menuOrgan =
- {
- ORGAN_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_MD, // menu x, y, w, h
- -60, // menu header x offset
- MENU_HEAD_Y_MD, // menu header y offset
- MENU_ITEM_X_MD, // menu items x offset
- MENU_ITEM_Y_MD, // menu items y offset
- MENU_ITEM_SPACE_Y_MD, // vertical space between menu items
- MENU_ITEM_IND_SPACE_X_MD, // horizontal space between indicator and menu items
- },
- // Background info.
- { // pszFile, u32BackColor
- MENU_BG_MD,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE, // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- g_pszOrganMenu_Title,
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8,
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- NULL, // Called before menu is initialized.
- Organ_MenuChoice, // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- -1, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- { // pszText, sEnabled, pmenu, pgui
- { "", FALSE, NULL, NULL, },
- { g_pszOrganMenu_SpecialKeysHeading, FALSE, NULL, NULL, },
- { g_pszOrganMenu_NumericKeysFunction, FALSE, NULL, NULL, },
- { g_pszOrganMenu_AlphaKeysFunction, FALSE, NULL, NULL, },
- { g_pszOrganMenu_TabKeyFunction, FALSE, NULL, NULL, },
- { "", FALSE, NULL, NULL, },
- { g_pszOrganMenu_Exit, TRUE, NULL, NULL, },
- NULL // Terminates list.
- },
- };
- // Audio Options menu.
- extern Menu menuAudioOptions =
- {
- AUDIO_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_SM, // menu x, y, w, h
- -60, // menu header x offset
- MENU_HEAD_Y_SM, // menu header y offset
- MENU_ITEM_X_SM, // menu items x offset
- MENU_ITEM_Y_SM, // menu items y offset
- MENU_ITEM_SPACE_Y_SM, // vertical space between menu items
- MENU_ITEM_IND_SPACE_X_SM, // horizontal space between indicator and menu items
- },
- // Background info.
- { // pszFile, u32BackColor
- MENU_BG_SM,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE, // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- g_pszAudioMenu_Title,
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8,
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- AudioOptionsInit, // Called before menu is initialized.
- AudioOptionsChoice, // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- -1, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- { // pszText, sEnabled, pmenu, pgui
- { g_pszAudioMenu_Mixer, TRUE, &menuVolumes, NULL, },
- { g_pszAudioMenu_SoundTest, TRUE, &menuOrgan, NULL, },
- { "", FALSE, NULL, NULL, },
- NULL // Terminates list.
- },
- };
- // Video Options menu.
- extern Menu menuVideoOptions =
- {
- VIDEO_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_SM, // menu x, y, w, h
- -60, // menu header x offset
- MENU_HEAD_Y_SM, // menu header y offset
- MENU_ITEM_X_SM, // menu items x offset
- MENU_ITEM_Y_SM, // menu items y offset
- MENU_ITEM_SPACE_Y_SM, // vertical space between menu items
- MENU_ITEM_IND_SPACE_X_SM, // horizontal space between indicator and menu items
- },
- // Background info.
- { // pszFile, u32BackColor
- MENU_BG_SM,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE, // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter | MenuColumnizeGuis),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- g_pszVideoMenu_Title,
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8,
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- VideoOptionsInit, // Called before menu is initialized.
- VideoOptionsChoice, // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- -1, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- { // pszText, sEnabled, pmenu, pgui
- { g_pszVideoMenu_Gamma, TRUE, NULL, NULL, },
- { "", FALSE, NULL, NULL, },
- NULL // Terminates list.
- },
- };
- // Controls menu.
- extern Menu menuControls =
- {
- CONTROLS_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_LG, // menu x, y, w, h
- -60, // menu header x offset
- MENU_HEAD_Y_LG, // menu header y offset
- MENU_ITEM_X_LG, // menu items x offset
- MENU_ITEM_Y_LG, // menu items y offset
- MENU_ITEM_SPACE_Y_LG, // vertical space between menu items
- MENU_ITEM_IND_SPACE_X_LG, // horizontal space between indicator and menu items
- },
- // Background info.
- { // pszFile, u32BackColor
- MENU_BG_LG,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE, // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter | MenuColumnizeGuis),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- g_pszControlsMenu_Title,
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8,
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- ControlsInit, // Called before menu is initialized.
- ControlsChoice, // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- -1, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- { // pszText, sEnabled, pmenu, pgui
- { g_pszControlsMenu_KeyboardSetup, TRUE, &menuKeyboard, NULL, },
- { g_pszControlsMenu_MouseSetup, TRUE, &menuMouse, NULL, },
- #if defined(ALLOW_JOYSTICK)
- { g_pszControlsMenu_JoystickSetup, TRUE, &menuJoystick, NULL, },
- #endif // defined(ALLOW_JOYSTICK)
- { g_pszControlsMenu_TurningSpeeds, TRUE, &menuRotation, NULL, },
- #if defined(ALLOW_JOYSTICK)
- { g_pszControlsMenu_UseJoystick, TRUE, NULL, NULL, },
- #endif // defined(ALLOW_JOYSTICK)
- { g_pszControlsMenu_UseMouse, TRUE, NULL, NULL, },
- { g_pszControlsMenu_HorizMouseSensitivity, TRUE, NULL, NULL, },
- { g_pszControlsMenu_VertMouseSensitivity, TRUE, NULL, NULL, },
- { "", FALSE, NULL, NULL, },
- NULL // Terminates list.
- },
- };
- // Keyboard menu.
- extern Menu menuKeyboard =
- {
- KEYBOARD_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_LG, // Pos and dimensions.
- 15, // Offset from left edge for menu header.
- // Negative indicates offset from center.
- 12, // Offset from top edge for menu header.
- // Negative indicates offset from center.
- 72, // Offset from left edge for menu items.
- // Negative indicates offset from center.
- 40, // Offset from top edge for menu items.
- // Negative indicates offset from center.
- -5, // Space between menu items.
- 5, // Space between indicator and menu items horizontally.
- -10, // X position menu items should not pass w/i Menu.
- // Less than 1, indicates offset from right edge.
- -20, // Y position menu items should not pass w/i Menu.
- // Less than 1, indicates offset from right edge.
- },
- // Background info.
- { // pszFile, u32BackColor
- MENU_BG_LG,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE, // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter | MenuColumnizeGuis),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- g_pszKeyboardSetupMenu_Title,
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT_SMALLER, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8,
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- KeyInit, // Called before menu is initialized.
- KeyChoice, // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- -1, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- // Note that in the old ways we had to reserve as many of these
- // as there were items to be in this menu, but now, since this array
- // is not open ended, we don't. But, if it ever ends up open ended
- // again, this will have to be updated. I included enough for the
- // current settings, but more will have to be added, if we ever change
- // back and add more input functions.
- { // pszText, sEnabled, pmenu, pgui
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- NULL // Terminates list.
- },
- };
- // Mouse menu.
- extern Menu menuMouse =
- {
- MOUSE_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_LG, // Pos and dimensions.
- 15, // Offset from left edge for menu header.
- // Negative indicates offset from center.
- 12, // Offset from top edge for menu header.
- // Negative indicates offset from center.
- 72, // Offset from left edge for menu items.
- // Negative indicates offset from center.
- 40, // Offset from top edge for menu items.
- // Negative indicates offset from center.
- -5, // Space between menu items.
- 5, // Space between indicator and menu items horizontally.
- -10, // X position menu items should not pass w/i Menu.
- // Less than 1, indicates offset from right edge.
- -20, // Y position menu items should not pass w/i Menu.
- // Less than 1, indicates offset from right edge.
- },
- // Background info.
- { // pszFile, u32BackColor
- MENU_BG_LG,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE, // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter | MenuColumnizeGuis),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- g_pszMouseSetupMenu_Title,
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT_SMALLER, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8,
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- MouseInit, // Called before menu is initialized.
- MouseChoice, // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- -1, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- // Note that in the old ways we had to reserve as many of these
- // as there were items to be in this menu, but now, since this array
- // is not open ended, we don't. But, if it ever ends up open ended
- // again, this will have to be updated. I included enough for the
- // current settings, but more will have to be added, if we ever change
- // back and add more input functions.
- { // pszText, sEnabled, pmenu, pgui
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- NULL // Terminates list.
- },
- };
- // Joystick menu.
- extern Menu menuJoystick =
- {
- JOYSTICK_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_LG, // Pos and dimensions.
- 15, // Offset from left edge for menu header.
- // Negative indicates offset from center.
- 12, // Offset from top edge for menu header.
- // Negative indicates offset from center.
- 72, // Offset from left edge for menu items.
- // Negative indicates offset from center.
- 40, // Offset from top edge for menu items.
- // Negative indicates offset from center.
- -5, // Space between menu items.
- 5, // Space between indicator and menu items horizontally.
- -10, // X position menu items should not pass w/i Menu.
- // Less than 1, indicates offset from right edge.
- -20, // Y position menu items should not pass w/i Menu.
- // Less than 1, indicates offset from right edge.
- },
- // Background info.
- { // pszFile, u32BackColor
- MENU_BG_LG,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE, // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter | MenuColumnizeGuis),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- g_pszJoystickSetupMenu_Title,
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT_SMALLER, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8,
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- JoyInit, // Called before menu is initialized.
- JoyChoice, // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- -1, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- // Note that in the old ways we had to reserve as many of these
- // as there were items to be in this menu, but now, since this array
- // is not open ended, we don't. But, if it ever ends up open ended
- // again, this will have to be updated. I included enough for the
- // current settings, but more will have to be added, if we ever change
- // back and add more input functions.
- { // pszText, sEnabled, pmenu, pgui
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- NULL // Terminates list.
- },
- };
- // Features menu.
- extern Menu menuFeatures =
- {
- FEATURES_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_MD, // menu x, y, w, h
- -80, // menu header x offset
- MENU_HEAD_Y_MD, // menu header y offset
- MENU_ITEM_X_MD, // menu items x offset
- MENU_ITEM_Y_MD, // menu items y offset
- MENU_ITEM_SPACE_Y_MD, // vertical space between menu items
- MENU_ITEM_IND_SPACE_X_MD, // horizontal space between indicator and menu items
- },
- // Background info.
- { // pszFile, u32BackColor
- MENU_BG_MD,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE, // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter | MenuColumnizeGuis),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- g_pszPerformanceMenu_Title,
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8,
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- FeaturesInit, // Called before menu is initialized.
- FeaturesChoice, // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- -1, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- { // pszText, sEnabled, pmenu, pgui
- { g_pszPerformanceMenu_Transparency, TRUE, NULL, NULL, },
- { g_pszPerformanceMenu_3dLighting, TRUE, NULL, NULL, },
- { g_pszPerformanceMenu_Particles, TRUE, NULL, NULL, },
- { g_pszPerformanceMenu_DynamicVolume, TRUE, NULL, NULL, },
- { g_pszPerformanceMenu_AmbientSounds, TRUE, NULL, NULL, },
- { "", FALSE, NULL, NULL, },
- NULL // Terminates list.
- },
- };
- // Rotation menu.
- extern Menu menuRotation =
- {
- ROTATION_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_LG, // menu x, y, w, h
- -60, // menu header x offset
- MENU_HEAD_Y_LG, // menu header y offset
- MENU_ITEM_X_LG, // menu items x offset
- MENU_ITEM_Y_LG, // menu items y offset
- MENU_ITEM_SPACE_Y_LG, // vertical space between menu items
- MENU_ITEM_IND_SPACE_X_LG, // horizontal space between indicator and menu items
- },
- // Background info.
- { // pszFile, u32BackColor
- MENU_BG_LG,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE, // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter | MenuColumnizeGuis),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- g_pszRotationSetupMenu_Title,
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8,
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- RotationInit, // Called before menu is initialized.
- RotationChoice, // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- -1, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- { // pszText, sEnabled, pmenu, pgui
- { g_pszRotationSetupMenu_RunningSlow, TRUE, NULL, NULL, },
- { g_pszRotationSetupMenu_RunningFast, TRUE, NULL, NULL, },
- { g_pszRotationSetupMenu_StandingSlow, TRUE, NULL, NULL, },
- { g_pszRotationSetupMenu_StandingFast, TRUE, NULL, NULL, },
- { g_pszRotationSetupMenu_TapDegrees, TRUE, NULL, NULL, },
- { g_pszRotationSetupMenu_RestoreDefaults, TRUE, NULL, NULL, },
- { "", FALSE, NULL, NULL, },
- NULL // Terminates list.
- },
- };
- // Volumes menu.
- extern Menu menuVolumes =
- {
- VOLUME_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_MD, // menu x, y, w, h
- -60, // menu header x offset
- MENU_HEAD_Y_MD, // menu header y offset
- MENU_ITEM_X_MD, // menu items x offset
- MENU_ITEM_Y_MD, // menu items y offset
- 1, //MENU_ITEM_SPACE_Y_MD, // vertical space between menu items
- MENU_ITEM_IND_SPACE_X_MD, // horizontal space between indicator and menu items
- },
- // Background info.
- { // pszFile, u32BackColor
- MENU_BG_MD,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE, // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter | MenuColumnizeGuis),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- g_pszVolumesMenu_Title,
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT_SMALLER, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8,
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- VolumesInit, // Called before menu is initialized.
- VolumesChoice, // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- -1, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- // Note that in the old ways we had to reserve as many of these
- // as there were items to be in this menu, but now, since this array
- // is not open ended, we don't. But, if it ever ends up open ended
- // again, this will have to be updated. I included enough for the
- // current settings, but more will have to be added, if we ever change
- // back and add more volume categories.
- { // pszText, sEnabled, pmenu, pgui
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- { NULL, TRUE, NULL, NULL, },
- NULL // Terminates list.
- },
- };
- // Start menu.
- extern Menu menuStart =
- {
- START_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_MD, // menu x, y, w, h
- -120, // menu header x offset
- MENU_HEAD_Y_MD, // menu header y offset
- MENU_ITEM_X_MD, // menu items x offset
- MENU_ITEM_Y_MD, // menu items y offset
- MENU_ITEM_SPACE_Y_MD, // vertical space between menu items
- MENU_ITEM_IND_SPACE_X_MD, // horizontal space between indicator and menu items
- },
- // Background info.
- { // pszFile, u32BackColor
- MENU_BG_MD,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE, // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- g_pszStartGameMenu_Title,
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8,
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- StartGameInit, // Called before menu is initialized.
- StartGameMenu, // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- -1, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- { // pszText, sEnabled, pmenu, pgui
- { g_pszStartGameMenu_SinglePlayer, TRUE, &menuStartSingle, NULL, },
- #ifndef MULTIPLAYER_REMOVED
- { g_pszStartGameMenu_Multiplayer, TRUE, &menuStartMulti, NULL, },
- #endif
- { g_pszStartGameMenu_Demo, TRUE, &menuStartDemo, NULL, },
- { "", FALSE, NULL, NULL, },
- NULL // Terminates list.
- },
- };
- // Single player start menu.
- extern Menu menuStartSingle =
- {
- START_SINGLE_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_MD, // menu x, y, w, h
- -120, // menu header x offset
- MENU_HEAD_Y_MD, // menu header y offset
- MENU_ITEM_X_MD, // menu items x offset
- MENU_ITEM_Y_MD, // menu items y offset
- MENU_ITEM_SPACE_Y_MD, // vertical space between menu items
- MENU_ITEM_IND_SPACE_X_MD, // horizontal space between indicator and menu items
- },
- // Background info.
- { // pszFile, u32BackColor
- MENU_BG_MD,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE, // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- g_pszStartSinglePlayerMenu_Title,
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8,
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- StartSingleInit, // Called before menu is initialized.
- StartSingleMenu, // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- -1, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- { // pszText, sEnabled, pmenu, pgui
- { g_pszStartSinglePlayerMenu_New, TRUE, NULL, NULL, },
- #if defined(START_MENU_ADDON_ITEM)
- { g_pszStartSinglePlayerMenu_AddOn, TRUE, NULL, NULL, },
- #endif
- #ifndef LOADLEVEL_REMOVED
- { g_pszStartSinglePlayerMenu_LoadLevel, TRUE, NULL, NULL, },
- #endif
- { g_pszStartSinglePlayerMenu_LoadGame, TRUE, NULL, NULL, },
- { g_pszStartSinglePlayerMenu_Challenge, TRUE, /*&menuChallenge,*/NULL, NULL, },
- { "", FALSE, NULL, NULL, },
- NULL // Terminates list.
- },
- };
- // Single player start menu.
- extern Menu menuChallenge =
- {
- CHALLENGE_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_MD, // menu x, y, w, h
- -120, // menu header x offset
- MENU_HEAD_Y_MD, // menu header y offset
- MENU_ITEM_X_MD, // menu items x offset
- MENU_ITEM_Y_MD, // menu items y offset
- MENU_ITEM_SPACE_Y_MD, // vertical space between menu items
- MENU_ITEM_IND_SPACE_X_MD, // horizontal space between indicator and menu items
- },
- // Background info.
- { // pszFile, u32BackColor
- MENU_BG_MD,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE, // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- g_pszStartChallengeMenu_Title,
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8,
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- ChallengeInit, // Called before menu is initialized.
- ChallengeChoice, // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- -1, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- { // pszText, sEnabled, pmenu, pgui
- { g_pszStartChallengeMenu_Gauntlet, TRUE, NULL, NULL, },
- { g_pszStartChallengeMenu_Timed, TRUE, NULL, NULL, },
- { g_pszStartChallengeMenu_Goal, TRUE, NULL, NULL, },
- { g_pszStartChallengeMenu_Flag, TRUE, NULL, NULL, },
- { g_pszStartChallengeMenu_CheckPoint, TRUE, NULL, NULL, },
- { "", FALSE, NULL, NULL, },
- NULL // Terminates list.
- },
- };
- // Multiplayer start menu.
- extern Menu menuStartMulti =
- {
- START_MULTI_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_MD, // menu x, y, w, h
- -120, // menu header x offset
- MENU_HEAD_Y_MD, // menu header y offset
- MENU_ITEM_X_MD, // menu items x offset
- MENU_ITEM_Y_MD, // menu items y offset
- MENU_ITEM_SPACE_Y_MD, // vertical space between menu items
- MENU_ITEM_IND_SPACE_X_MD, // horizontal space between indicator and menu items
- },
- // Background info.
- { // pszFile, u32BackColor
- MENU_BG_MD,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE, // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- g_pszStartMultiplayerMenu_Title,
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8,
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- StartMultiInit, // Called before menu is initialized.
- StartMultiMenu, // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- -1, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- { // pszText, sEnabled, pmenu, pgui
- { g_pszStartMultiplayerMenu_Join, TRUE, &menuJoinMulti, NULL, },
- { g_pszStartMultiplayerMenu_Host, TRUE, &menuHostMulti, NULL, },
- { g_pszStartMultiplayerMenu_Options, TRUE, &menuMultiOptions, NULL, },
- { "", FALSE, NULL, NULL, },
- NULL // Terminates list.
- },
- };
- // Join Multiplayer menu.
- extern Menu menuJoinMulti =
- {
- JOIN_MULTI_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_LG, // menu x, y, w, h
- -60, // menu header x offset
- MENU_HEAD_Y_LG, // menu header y offset
- MENU_ITEM_X_LG, // menu items x offset
- MENU_ITEM_Y_LG, // menu items y offset
- MENU_ITEM_SPACE_Y_LG, // vertical space between menu items
- MENU_ITEM_IND_SPACE_X_LG, // horizontal space between indicator and menu items
- },
- // Background info.
- { // pszFile, u32BackColor
- MENU_BG_LG,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE, // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- g_pszJoinGameMenu_Title,
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8,
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- JoinMultiInit, // Called before menu is initialized.
- JoinMultiMenu, // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- -1, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- { // pszText, sEnabled, pmenu, pgui
- { g_pszJoinGameMenu_Browse, TRUE, NULL, NULL, },
- { g_pszJoinGameMenu_ConnectTo, TRUE, NULL, NULL, },
- { "", FALSE, NULL, NULL, },
- NULL // Terminates list.
- },
- };
- // Join Multiplayer menu.
- extern Menu menuHostMulti =
- {
- HOST_MULTI_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_MD, // menu x, y, w, h
- -60, // menu header x offset
- MENU_HEAD_Y_MD, // menu header y offset
- MENU_ITEM_X_MD, // menu items x offset
- MENU_ITEM_Y_MD, // menu items y offset
- MENU_ITEM_SPACE_Y_MD, // vertical space between menu items
- MENU_ITEM_IND_SPACE_X_MD, // horizontal space between indicator and menu items
- },
- // Background info.
- { // pszFile, u32BackColor
- MENU_BG_MD,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE, // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- g_pszHostGameMenu_Title,
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8,
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- HostMultiInit, // Called before menu is initialized.
- HostMultiMenu, // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- -1, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- { // pszText, sEnabled, pmenu, pgui
- { g_pszHostGameMenu_Start, TRUE, NULL, NULL, },
- { "", FALSE, NULL, NULL, },
- NULL // Terminates list.
- },
- };
- // Single player start menu.
- extern Menu menuStartDemo =
- {
- START_DEMO_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_SM, // menu x, y, w, h
- -120, // menu header x offset
- MENU_HEAD_Y_SM, // menu header y offset
- MENU_ITEM_X_SM, // menu items x offset
- MENU_ITEM_Y_SM, // menu items y offset
- MENU_ITEM_SPACE_Y_SM, // vertical space between menu items
- MENU_ITEM_IND_SPACE_X_SM, // horizontal space between indicator and menu items
- },
- // Background info.
- { // pszFile, u32BackColor
- MENU_BG_SM,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE, // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- g_pszStartDemoMenu_Title,
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8,
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- StartDemoInit, // Called before menu is initialized.
- StartDemoMenu, // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- -1, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- { // pszText, sEnabled, pmenu, pgui
- // { g_pszStartDemoMenu_Browse, TRUE, NULL, NULL, },
- { g_pszStartDemoMenu_Play, TRUE, NULL, NULL, },
- { g_pszStartDemoMenu_Record, TRUE, NULL, NULL, },
- { "", FALSE, NULL, NULL, },
- NULL // Terminates list.
- },
- };
- // Multiplayer options menu.
- extern Menu menuMultiOptions =
- {
- MULTIPLAYER_OPTIONS_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_MD, // menu x, y, w, h
- -60, // menu header x offset
- MENU_HEAD_Y_MD, // menu header y offset
- MENU_ITEM_X_MD, // menu items x offset
- MENU_ITEM_Y_MD, // menu items y offset
- MENU_ITEM_SPACE_Y_MD, // vertical space between menu items
- MENU_ITEM_IND_SPACE_X_MD, // horizontal space between indicator and menu items
- },
- // Background info.
- { // pszFile, u32BackColor
- MENU_BG_MD,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE, // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter | MenuColumnizeGuis),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- g_pszMultiplayerSetupMenu_Title,
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8,
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- MultiOptionsInit, // Called before menu is initialized.
- MultiOptionsChoice, // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- -1, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- { // pszText, sEnabled, pmenu, pgui
- { g_pszMultiplayerSetupMenu_Name, TRUE, NULL, NULL, },
- { g_pszMultiplayerSetupMenu_Color, TRUE, NULL, NULL, },
- { g_pszMultiplayerSetupMenu_Protocol, TRUE, NULL, NULL, },
- { g_pszMultiplayerSetupMenu_Connection, TRUE, NULL, NULL, },
- { "", FALSE, NULL, NULL, },
- NULL // Terminates list.
- },
- };
- ////////////////////////////////////////////////////////////////////////////////
- // Menu callbacks.
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called when main menu is initialized or killed.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static short MainMenuInit( // Returns 0 on succes, non-zero to cancel menu.
- Menu* pmenuCurrent, // In: Menu being init'ed or killed.
- short sInit) // In: TRUE, if initializing; FALSE, if killing.
- {
- short sRes = 0; // Assume success.
- Game_InitMainMenu(sInit);
- return sRes;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called when item is chosen from main menu
- //
- ////////////////////////////////////////////////////////////////////////////////
- static bool MainMenuChoice( // Returns true to accept, false to deny choice.
- Menu* /*pmenuCurrent*/, // Current menu.
- short sMenuItem) // Item chosen.
- {
- bool bAcceptChoice = true; // Assume accepting.
- // Audible Feedback.
- if (sMenuItem == -1)
- PlaySample(g_smidMenuItemChange, SampleMaster::UserFeedBack);
- else
- PlaySample(g_smidMenuItemSelect, SampleMaster::UserFeedBack);
- switch (sMenuItem)
- {
- case 2:
- #if defined(SPAWN) || defined(EDITOR_REMOVED)
- // Exit
- #else
- // Editor
- Game_StartEditor();
- #endif
- break;
- case 3:
- #if defined(DEMO)
- // Buy
- Game_Buy();
- #else
- // (some other choice we don't care about)
- #endif
- break;
- }
- return bAcceptChoice;
- }
- static bool VerifyExitMenuChoice( // Returns true to accept, false to deny choice.
- Menu* /*pmenuCurrent*/, // Current menu.
- short sMenuItem) // Item chosen.
- {
- bool bAcceptChoice = true; // Assume accepting.
- // Audible Feedback.
- if (sMenuItem == -1)
- PlaySample(g_smidMenuItemChange, SampleMaster::UserFeedBack);
- else
- PlaySample(g_smidMenuItemSelect, SampleMaster::UserFeedBack);
- switch (sMenuItem)
- {
- case 0: // Yes
- // Set quit status to something other than 1 (which is what RSPiX Blue sets it to
- // if a system-specific quit is used) so we can later detect wether we should immediately
- // quit the app or put up the credits first.
- rspSetQuitStatus(10);
- break;
- case 1: // No
- break;
- }
- return bAcceptChoice;
- }
- static bool ClientGameMenuChoice( // Returns true to accept, false to deny choice.
- Menu* /*pmenuCurrent*/, // Current menu.
- short sMenuItem) // Item chosen.
- {
- bool bAcceptChoice = true; // Assume accepting.
- // Audible Feedback.
- if (sMenuItem == -1)
- PlaySample(g_smidMenuItemChange, SampleMaster::UserFeedBack);
- else
- PlaySample(g_smidMenuItemSelect, SampleMaster::UserFeedBack);
- switch (sMenuItem)
- {
- case 0: // Continue.
- StopMenu();
- break;
- case 1: // Options.
- break;
- case 2: // Quit.
- break;
- }
- return bAcceptChoice;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called to init or kill the Start Game menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static short StartGameInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit) // TRUE, if initializing; FALSE, if killing.
- {
- short sRes = 0; // Assume success.
- // Be sure the demo option reflects INI setting.
- if (g_GameSettings.m_sCanRecordDemos == FALSE)
- {
- menuStart.ami[2].pmenu = NULL;
- }
- return sRes;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called by the menu API when an item is chosen in menuStart.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static bool StartGameMenu( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem) // Item chosen.
- {
- bool bAcceptChoice = true; // Assume accepting.
- switch (sMenuItem)
- {
- #ifndef MULTIPLAYER_REMOVED
- case 1:
- // This is necessary to give the game a chance to inform the
- // player in case multiplayer mode is disabled. The return
- // value determines whether we accept this choice.
- bAcceptChoice = Game_StartMultiPlayerGame(sMenuItem);
- break;
- case 2:
- #else
- case 1:
- #endif
- // If we can't record...
- if (g_GameSettings.m_sCanRecordDemos == FALSE)
- {
- // Start a demo in playback mode by simulating the menu choice "Play"
- // from the demo menu.
- Game_StartDemoGame(1);
- }
- break;
- }
- // Audible Feedback.
- if (sMenuItem == -1)
- PlaySample(g_smidMenuItemChange, SampleMaster::UserFeedBack);
- else
- PlaySample(g_smidMenuItemSelect, SampleMaster::UserFeedBack);
- return bAcceptChoice;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called to init or kill the Challenge menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static short ChallengeInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit) // TRUE, if initializing; FALSE, if killing.
- {
- short sRes = 0; // Assume success.
- return sRes;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called by the menu API when an item is chosen in menuChallenge.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static bool ChallengeChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem) // Item chosen.
- {
- bool bAcceptChoice = true; // Assume accepting.
- // Audible Feedback.
- if (sMenuItem == -1)
- PlaySample(g_smidMenuItemChange, SampleMaster::UserFeedBack);
- else
- PlaySample(g_smidMenuItemSelect, SampleMaster::UserFeedBack);
- // Let game module handle it
- Game_StartChallengeGame(sMenuItem);
- return bAcceptChoice;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called to init or kill the Start Single Player Game menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static short StartSingleInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit) // TRUE, if initializing; FALSE, if killing.
- {
- return 0;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called by the menu API when an item is chosen in menuStartSingle.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static bool StartSingleMenu( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem) // Item chosen.
- {
- bool bAcceptChoice = true; // Assume accepting.
- // Audible Feedback.
- if (sMenuItem == -1)
- PlaySample(g_smidMenuItemChange, SampleMaster::UserFeedBack);
- else
- PlaySample(g_smidMenuItemSelect, SampleMaster::UserFeedBack);
- // Let game module handle it
- Game_StartSinglePlayerGame(sMenuItem);
- return bAcceptChoice;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called to init or kill the Start Multiplayer Game menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static short StartMultiInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit) // TRUE, if initializing; FALSE, if killing.
- {
- short sRes = 0; // Assume success.
- if (sInit != FALSE)
- RGuiItem::ms_print.SetFont(DEFAULT_GUI_FONT_HEIGHT, &g_fontPostal);
- return sRes;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called by the menu API when an item is chosen in menuStartMulti.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static bool StartMultiMenu( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem) // Item chosen.
- {
- bool bAcceptChoice = true; // Assume accepting.
- // Audible Feedback.
- if (sMenuItem == -1)
- PlaySample(g_smidMenuItemChange, SampleMaster::UserFeedBack);
- else
- PlaySample(g_smidMenuItemSelect, SampleMaster::UserFeedBack);
- return bAcceptChoice;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called to init or kill menuJoinMulti.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static short JoinMultiInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit) // TRUE, if initializing; FALSE, if killing.
- {
- short sRes = 0; // Assume success.
- if (sInit != FALSE)
- {
- RGuiItem::ms_print.SetFont(DEFAULT_GUI_FONT_HEIGHT, &g_fontPostal);
- if (rspGetResource(&g_resmgrShell, GUI_CONNECT_IP_FILE, &ms_peditConnect) == 0)
- {
- // Set the text from the INI setting. Note that we are changing a resource!
- ms_peditConnect->m_sMaxText = sizeof(g_GameSettings.m_szServerName) - 1;
- ms_peditConnect->SetText("%s", g_GameSettings.m_szServerName);
- ms_peditConnect->Compose();
- // Let menu know about it.
- pmenuCur->ami[1].pgui = ms_peditConnect;
- }
- else
- {
- TRACE("JoinMultiInit(): ms_presmgr->Get() failed.\n");
- sRes = 1;
- }
- }
- else
- {
- // Release resources
- rspReleaseResource(&g_resmgrShell, &ms_peditConnect);
- // Clear menu's pointer.
- pmenuCur->ami[1].pgui = NULL;
- }
- return sRes;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called by the menu API when an item is chosen in menuJoinMulti.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static bool JoinMultiMenu( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem) // Item chosen.
- {
- bool bAcceptChoice = true; // Assume accepting.
- // Audible Feedback.
- if (sMenuItem == -1)
- PlaySample(g_smidMenuItemChange, SampleMaster::UserFeedBack);
- else
- PlaySample(g_smidMenuItemSelect, SampleMaster::UserFeedBack);
- // If specified, get server name (BEFORE calling the game module!)
- if (ms_peditConnect != NULL)
- ms_peditConnect->GetText(g_GameSettings.m_szServerName, sizeof(g_GameSettings.m_szServerName) );
- // Let game module handle it
- Game_JoinMultiPlayerGame(sMenuItem);
- return bAcceptChoice;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called to init or kill menuHostMulti.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static short HostMultiInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit) // TRUE, if initializing; FALSE, if killing.
- {
- short sRes = 0; // Assume success.
- if (sInit != FALSE)
- {
- RGuiItem::ms_print.SetFont(DEFAULT_GUI_FONT_HEIGHT, &g_fontPostal);
- if (rspGetResource(&g_resmgrShell, GUI_HOST_NAME_FILE, &ms_peditHostName) == 0)
- {
- // Set the text from the INI setting. Note that we are changing a resource!
- ms_peditHostName->m_sMaxText = Net::MaxHostNameSize - 1;
- ms_peditHostName->SetText("%s", g_GameSettings.m_szHostName);
- ms_peditHostName->Compose();
- // Let menu know about it.
- pmenuCur->ami[0].pgui = ms_peditHostName;
- }
- else
- {
- TRACE("HostMultiInit(): ms_presmgr->Get() failed.\n");
- sRes = 1;
- }
- }
- else
- {
- // Release resources
- rspReleaseResource(&g_resmgrShell, &ms_peditHostName);
- // Clear menu's pointer.
- pmenuCur->ami[0].pgui = NULL;
- }
- return sRes;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called by the menu API when an item is chosen in menuHostMulti.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static bool HostMultiMenu( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem) // Item chosen.
- {
- bool bAcceptChoice = true; // Assume accepting.
- // Audible Feedback.
- if (sMenuItem == -1)
- PlaySample(g_smidMenuItemChange, SampleMaster::UserFeedBack);
- else
- PlaySample(g_smidMenuItemSelect, SampleMaster::UserFeedBack);
- // If specified, get host name (BEFORE calling the game module!)
- if (ms_peditHostName != NULL)
- ms_peditHostName->GetText(g_GameSettings.m_szHostName, sizeof(g_GameSettings.m_szHostName) );
- // Let game module handle it
- Game_HostMultiPlayerGame(sMenuItem);
- return bAcceptChoice;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called to init or kill the Start Demo Game menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static short StartDemoInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit) // TRUE, if initializing; FALSE, if killing.
- {
- short sRes = 0; // Assume success.
- return sRes;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called by the menu API when an item is chosen in menuStartDemo.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static bool StartDemoMenu( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem) // Item chosen.
- {
- bool bAcceptChoice = true; // Assume accepting.
- bool bPlay = false;
- // Audible Feedback.
- if (sMenuItem == -1)
- PlaySample(g_smidMenuItemChange, SampleMaster::UserFeedBack);
- else
- PlaySample(g_smidMenuItemSelect, SampleMaster::UserFeedBack);
- // Let game module handle it
- switch (sMenuItem)
- {
- case 0:
- Game_StartDemoGame(0);
- break;
- case 1:
- Game_StartDemoGame(2);
- break;
- }
- return bAcceptChoice;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called to init or kill the options menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static short OptionsInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit) // TRUE, if initializing; FALSE, if killing.
- {
- short sRes = 0; // Assume success.
- if (sInit != FALSE)
- {
- #ifndef MULTIPLAYER_REMOVED
- short sMenuItem = 5;
- #else
- short sMenuItem = 4;
- #endif
- RMultiBtn** ppmb = (RMultiBtn**)&(pmenuCur->ami[sMenuItem++].pgui);
- // Get check box for 'Crosshair'.
- if (rspGetResourceInstance(&g_resmgrShell, GUI_CHECKBOX_FILE, ppmb) == 0)
- {
- // Set the initial state.
- (*ppmb)->m_sState = (g_GameSettings.m_sCrossHair != FALSE) ? 1 : 2;
- (*ppmb)->Compose();
- }
- else
- {
- TRACE("ControlsInit(): rspGetResource() failed.\n");
- sRes = 1;
- }
- }
- else
- {
- #ifndef MULTIPLAYER_REMOVED
- short sMenuItem = 6;
- #else
- short sMenuItem = 5;
- #endif
- RMultiBtn** ppmb = (RMultiBtn**)&(pmenuCur->ami[sMenuItem++].pgui);
- if (*ppmb)
- {
- // Store new mouse usage setting.
- g_GameSettings.m_sCrossHair = ((*ppmb)->m_sState == 1) ? TRUE : FALSE;
- // Release resource.
- rspReleaseResourceInstance(&g_resmgrShell, ppmb);
- }
- }
- return sRes;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called when a choice is made or changed on the options menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static bool OptionsChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem) // Item chosen or -1 for change of focus.
- {
- bool bAcceptChoice = true; // Assume accepting.
- switch (sMenuItem)
- {
- #ifndef MULTIPLAYER_REMOVED
- case 5:
- #else
- case 4:
- #endif
- {
- // Toggle 'Use Joystick'.
- RMultiBtn* pmb = (RMultiBtn*)pmenuCurrent->ami[sMenuItem].pgui;
- ASSERT(pmb->m_type == RGuiItem::MultiBtn);
- pmb->NextState();
- pmb->Compose();
- break;
- }
- }
- // Audible Feedback.
- if (sMenuItem == -1)
- PlaySample(g_smidMenuItemChange, SampleMaster::UserFeedBack);
- else
- PlaySample(g_smidMenuItemSelect, SampleMaster::UserFeedBack);
- return bAcceptChoice;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called to init or kill the play options menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static short PlayOptionsInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit) // TRUE, if initializing; FALSE, if killing.
- {
- short sRes = 0; // Assume success.
- if (sInit != FALSE)
- {
- RGuiItem::ms_print.SetFont(DEFAULT_GUI_FONT_HEIGHT, &g_fontPostal);
- RGuiItem* pgui;
- // Get difficulty slider . . .
- if (rspGetResource(&g_resmgrShell, GUI_DIFFICULTY_FILE, &pgui) == 0)
- {
- // Get the scrollbar . . .
- ms_psbDifficulty = (RScrollBar*)pgui->GetItemFromId(GUI_ID_DIFFICULTY_SLIDER);
- if (ms_psbDifficulty)
- {
- // Set the update call.
- ms_psbDifficulty->m_upcUser = DifficultyScrollUpdate;
- // This is weird but it allows artie to finer tune the scroll thumb size.
- // We use the ID of the parent as the divisor for the scrollbar value.
- // Set the initial position.
- ms_psbDifficulty->SetPos(g_GameSettings.m_sDifficulty * pgui->m_lId);
- }
- // Let menu know about it.
- pmenuCur->ami[0].pgui = pgui;
- }
- else
- {
- TRACE("PlayOptionsInit(): rspGetResource() failed.\n");
- sRes = 1;
- }
- }
- else
- {
- if (pmenuCur->ami[0].pgui)
- {
- // Release the resource.
- rspReleaseResource(&g_resmgrShell, &pmenuCur->ami[0].pgui);
- }
- }
- return sRes;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called when a choice is made or changed on the play options menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static bool PlayOptionsChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem) // Item chosen or -1 for change of focus.
- {
- bool bAcceptChoice = true; // Assume accepting.
- // Audible Feedback.
- if (sMenuItem == -1)
- PlaySample(g_smidMenuItemChange, SampleMaster::UserFeedBack);
- else
- PlaySample(g_smidMenuItemSelect, SampleMaster::UserFeedBack);
- return bAcceptChoice;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called to init or kill the video options menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static short VideoOptionsInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit) // TRUE, if initializing; FALSE, if killing.
- {
- short sRes = 0; // Assume success.
- if (sInit != FALSE)
- {
- RGuiItem::ms_print.SetFont(DEFAULT_GUI_FONT_HEIGHT, &g_fontPostal);
- if (rspGetResource(&g_resmgrShell, GUI_GAMMA_FILE, &ms_psbGamma) == 0)
- {
- // Set the update call.
- ms_psbGamma->m_upcUser = GammaScrollUpdate;
- // Get range.
- long lMin, lMax;
- ms_psbGamma->GetRange(&lMin, &lMax);
- // Determine range of values.
- long lRange = lMax - lMin;
- // Set the initial position. Gamma value indicator will get set via callback.
- // Convert to gamma value by ratio.
- long lVal = long(float(lRange) / GAMMA_RANGE * (GetGammaLevel() - MIN_GAMMA_VAL) + 0.5) + lMin;
- ms_psbGamma->SetPos(lVal);
- // Let menu know about it.
- pmenuCur->ami[0].pgui = ms_psbGamma;
- }
- else
- {
- TRACE("VideoOptionsInit(): rspGetResource() failed.\n");
- sRes = 1;
- }
- }
- else
- {
- if (ms_psbGamma != NULL)
- {
- // Release resource.
- rspReleaseResource(&g_resmgrShell, &ms_psbGamma);
- }
- // Clear menu's pointer.
- pmenuCur->ami[0].pgui = NULL;
- }
- return sRes;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called when a choice is made or changed on the video options menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static bool VideoOptionsChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem) // Item chosen or -1 for change of focus.
- {
- bool bAcceptChoice = true; // Assume accepting.
- // Audible Feedback.
- if (sMenuItem == -1)
- PlaySample(g_smidMenuItemChange, SampleMaster::UserFeedBack);
- else
- PlaySample(g_smidMenuItemSelect, SampleMaster::UserFeedBack);
- return bAcceptChoice;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called to init or kill the audio options menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static short AudioOptionsInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit) // TRUE, if initializing; FALSE, if killing.
- {
- short sRes = 0; // Assume success.
- if (sInit != FALSE)
- {
- }
- else
- {
- }
- return sRes;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called when a choice is made or changed on the audio options menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static bool AudioOptionsChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem) // Item chosen or -1 for change of focus.
- {
- bool bAcceptChoice = true; // Assume accepting.
- Game_AudioOptionsChoice(sMenuItem);
- // Audible Feedback.
- if (sMenuItem == -1)
- PlaySample(g_smidMenuItemChange, SampleMaster::UserFeedBack);
- else
- PlaySample(g_smidMenuItemSelect, SampleMaster::UserFeedBack);
- return bAcceptChoice;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called to init or kill the volumes menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static short VolumesInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit) // TRUE, if initializing; FALSE, if killing.
- {
- short sRes = 0; // Assume success.
- if (sInit != FALSE)
- {
- RGuiItem::ms_print.SetFont(DEFAULT_GUI_FONT_HEIGHT, &g_fontPostal);
- short i;
- for (i = 0; i < SampleMaster::MAX_NUM_SOUND_CATEGORIES && sRes == 0 && i < (NUM_ELEMENTS(pmenuCur->ami) - 2); i++)
- {
- if (rspGetResourceInstance(&g_resmgrShell, GUI_VOLUME_FILE, (RScrollBar**)&(pmenuCur->ami[i].pgui)) == 0)
- {
- RScrollBar* psb = (RScrollBar*)(pmenuCur->ami[i].pgui);
- ASSERT(psb->m_type == RGuiItem::ScrollBar);
- // Let the callback know which item this is.
- psb->m_ulUserData = i;
- long lMin, lMax, lRange;
- psb->GetRange(&lMin, &lMax);
- lRange = lMax - lMin;
- // Set the initial position.
- psb->SetPos(g_GameSettings.m_asCategoryVolumes[i] * lRange / SampleMaster::UserMaxVolume);
- // Set the rate so based on the range.
- psb->m_lButtonIncDec = lRange / SampleMaster::UserMaxVolume;
- psb->m_lTrayIncDec = psb->m_lButtonIncDec;
- // Set the update call. Note that we set the callback after setting the
- // initial position so we don't get a callback for that.
- psb->m_upcUser = VolumesScrollUpdate;
- // Note that we have to update the GUI val here b/c we don't allow the callback
- // until after we set the initial position of the scrollbar to avoid it playing
- // the example sample during that position change.
- // Get val indicator.
- RGuiItem* pguiVal = psb->GetItemFromId(GUI_ID_VOLUME_VAL);
- if (pguiVal)
- {
- pguiVal->SetText("%d", g_GameSettings.m_asCategoryVolumes[i]);
- pguiVal->Compose();
- }
- // Text.
- pmenuCur->ami[i].pszText = SampleMaster::ms_apszSoundCategories[i];
- }
- else
- {
- TRACE("VolumesInit(): Failed to get resource.\n");
- sRes = 1;
- }
- }
- // Make the second to last one defaults.
- pmenuCur->ami[i].sEnabled = TRUE;
- pmenuCur->ami[i++].pszText = g_pszRotationSetupMenu_RestoreDefaults;
- // Make the last one back.
- #if 0
- static char szBack[] = "";
- pmenuCur->ami[i].pszText = szBack;
- pmenuCur->ami[i].sEnabled = FALSE;
- #endif
- pmenuCur->menuautoitems.sCancelItem = i;
- }
- else
- {
- short i;
- for (i = 0; i < SampleMaster::MAX_NUM_SOUND_CATEGORIES && sRes == 0 && pmenuCur->ami[i].pszText; i++)
- {
- // If this resource was allocated . . .
- if (pmenuCur->ami[i].pgui)
- {
- // Release resource.
- rspReleaseResourceInstance(&g_resmgrShell, &(pmenuCur->ami[i].pgui));
- }
- }
- }
- return sRes;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called when a choice is made or changed on the volumes menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static bool VolumesChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem) // Item chosen or -1 for change of focus.
- {
- bool bAcceptChoice = true; // Assume accepting.
- // Audible Feedback.
- switch (sMenuItem)
- {
- case -1: // Selection change.
- break;
- case SampleMaster::MAX_NUM_SOUND_CATEGORIES + 1: // Back.
- break;
-
- case SampleMaster::MAX_NUM_SOUND_CATEGORIES: // Restore defaults.
- {
- short i;
- for (i = 0; i < SampleMaster::MAX_NUM_SOUND_CATEGORIES && i < NUM_ELEMENTS(pmenuCurrent->ami); i++)
- {
- if (pmenuCurrent->ami[i].pgui)
- {
- long lMin, lMax, lRange;
- ( (RScrollBar*)(pmenuCurrent->ami[i].pgui) )->GetRange(&lMin, &lMax);
- lRange = lMax - lMin;
- ((RScrollBar*)(pmenuCurrent->ami[i].pgui) )->SetPos(SampleMaster::UserDefaultVolume * lRange / SampleMaster::UserMaxVolume);
- // This'll keep the next sample from aborting the current so we can let the user
- // hear all the sounds when 'defaults' is chosen.
- ms_siLastSamplePlayed = 0;
- }
- }
- break;
- }
- default: // Play all.
- {
- // Play all samples simultaneously so user can hear the mixage.
- short i;
- for (i = 0; i < SampleMaster::MAX_NUM_SOUND_CATEGORIES; i++)
- {
- // Play a sample in that category.
- PlaySample( // Returns RSnd used to play the sample.
- // Does not fail.
- *(ms_apsmidVolumeTesters[i]), // In: Identifier of sample you want played.
- (SampleMaster::SoundCategory)i, // In: Sound Volume Category for user adjustment
- 255, // In: Initial Sound Instance Volume (0 - 255)
- &ms_siLastSamplePlayed); // Out: Handle for adjusting sound volume
- ms_siLastSamplePlayed = 0;
- }
- break;
- }
- }
- if (sMenuItem == -1)
- PlaySample(g_smidMenuItemChange, SampleMaster::UserFeedBack);
- else
- PlaySample(g_smidMenuItemSelect, SampleMaster::UserFeedBack);
- return bAcceptChoice;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called when the controls menu is initialized.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static short ControlsInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit) // TRUE, if initializing; FALSE, if killing.
- {
- short sRes = 0; // Assume success.
- if (sInit != FALSE)
- {
- RGuiItem::ms_print.SetFont(DEFAULT_GUI_FONT_HEIGHT, &g_fontPostal);
- #if defined(ALLOW_JOYSTICK)
- short sMenuItem = 4;
- RMultiBtn** ppmb = (RMultiBtn**)&(pmenuCur->ami[sMenuItem++].pgui);
- // Get check box for 'Use Joystick'.
- if (rspGetResourceInstance(&g_resmgrShell, GUI_CHECKBOX_FILE, ppmb) == 0)
- {
- // Set the initial state.
- (*ppmb)->m_sState = (g_InputSettings.m_sUseJoy != FALSE) ? 1 : 2;
- (*ppmb)->Compose();
- }
- else
- {
- TRACE("ControlsInit(): rspGetResource() failed.\n");
- sRes = 1;
- }
- #else
- short sMenuItem = 3;
- #endif // defined(ALLOW_JOYSTICK)
- // Get check box for 'Use Mouse'.
- if (rspGetResourceInstance(&g_resmgrShell, GUI_CHECKBOX_FILE, &ms_pmbCheckBox) == 0)
- {
- // Set the initial state.
- ms_pmbCheckBox->m_sState = (g_InputSettings.m_sUseMouse != FALSE) ? 1 : 2;
- ms_pmbCheckBox->Compose();
- // Let menu know about it.
- pmenuCur->ami[sMenuItem++].pgui = ms_pmbCheckBox;
- }
- else
- {
- TRACE("ControlsInit(): rspGetResource() failed.\n");
- sRes = 1;
- }
- // Get scrollbar for 'Mouse Sensitivity'.
- if (rspGetResourceInstance(&g_resmgrShell, GUI_MOUSE_SENSITIVITY_FILE, &ms_psbMouseSensitivityX) == 0)
- {
- // Set the initial state.
- // Set the callback.
- ms_psbMouseSensitivityX->m_upcUser = MouseSensitivityScrollUpdate;
- // Set the value to change.
- ms_psbMouseSensitivityX->m_ulUserInstance = (ULONG)&g_InputSettings.m_dMouseSensitivityX;
- // Set the initial position. ms_psbGammaVal will get set via callback.
- ms_psbMouseSensitivityX->SetPos(g_InputSettings.m_dMouseSensitivityX * MOUSE_SENSITIVITY_DIVISOR);
- // Let menu know about it.
- pmenuCur->ami[sMenuItem++].pgui = ms_psbMouseSensitivityX;
- }
- else
- {
- TRACE("ControlsInit(): rspGetResource() failed.\n");
- sRes = 2;
- }
- // Get scrollbar for 'Mouse Sensitivity'.
- if (rspGetResourceInstance(&g_resmgrShell, GUI_MOUSE_SENSITIVITY_FILE, &ms_psbMouseSensitivityY) == 0)
- {
- // Set the initial state.
- // Set the callback.
- ms_psbMouseSensitivityY->m_upcUser = MouseSensitivityScrollUpdate;
- // Set the value to change.
- ms_psbMouseSensitivityY->m_ulUserInstance = (ULONG)&g_InputSettings.m_dMouseSensitivityY;
- // Set the initial position. ms_psbGammaVal will get set via callback.
- ms_psbMouseSensitivityY->SetPos(g_InputSettings.m_dMouseSensitivityY * MOUSE_SENSITIVITY_DIVISOR);
- // Let menu know about it.
- pmenuCur->ami[sMenuItem++].pgui = ms_psbMouseSensitivityY;
- }
- else
- {
- TRACE("ControlsInit(): rspGetResource() failed.\n");
- sRes = 3;
- }
- }
- else
- {
- #if defined(ALLOW_JOYSTICK)
- short sMenuItem = 4;
- RMultiBtn** ppmb = (RMultiBtn**)&(pmenuCur->ami[sMenuItem++].pgui);
- if (*ppmb)
- {
- // Store new mouse usage setting.
- g_InputSettings.m_sUseJoy = ((*ppmb)->m_sState == 1) ? TRUE : FALSE;
- // Release resource.
- rspReleaseResourceInstance(&g_resmgrShell, ppmb);
- }
- #else
- short sMenuItem = 3;
- #endif // defined(ALLOW_JOYSTICK)
- if (ms_pmbCheckBox)
- {
- // Store new mouse usage setting.
- g_InputSettings.m_sUseMouse = (ms_pmbCheckBox->m_sState == 1) ? TRUE : FALSE;
- // Release resource.
- rspReleaseResourceInstance(&g_resmgrShell, &ms_pmbCheckBox);
- }
- // Clear menu's pointer.
- pmenuCur->ami[sMenuItem++].pgui = NULL;
- if (ms_psbMouseSensitivityX != NULL)
- {
- // Release resource.
- rspReleaseResourceInstance(&g_resmgrShell, &ms_psbMouseSensitivityX);
- }
- // Clear menu's pointer.
- pmenuCur->ami[sMenuItem++].pgui = NULL;
- if (ms_psbMouseSensitivityY != NULL)
- {
- // Release resource.
- rspReleaseResourceInstance(&g_resmgrShell, &ms_psbMouseSensitivityY);
- }
- // Clear menu's pointer.
- pmenuCur->ami[sMenuItem++].pgui = NULL;
- }
- return sRes;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Call when a selection is changed or made on the controls menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static bool ControlsChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem) // Item chosen.
- {
- bool bAcceptChoice = true; // Assume accepting.
- switch (sMenuItem)
- {
- #if defined(ALLOW_JOYSTICK)
- case 4:
- {
- // Toggle 'Use Joystick'.
- RMultiBtn* pmb = (RMultiBtn*)pmenuCurrent->ami[sMenuItem].pgui;
- ASSERT(pmb->m_type == RGuiItem::MultiBtn);
- pmb->NextState();
- pmb->Compose();
- break;
- }
- case 5:
- #else
- case 3:
- #endif // defined(ALLOW_JOYSTICK)
- // Toggle 'Use Mouse'.
- ms_pmbCheckBox->NextState();
- ms_pmbCheckBox->Compose();
- break;
- }
- // Audible Feedback.
- if (sMenuItem == -1)
- PlaySample(g_smidMenuItemChange, SampleMaster::UserFeedBack);
- else
- PlaySample(g_smidMenuItemSelect, SampleMaster::UserFeedBack);
-
- // Call game.
- Game_ControlsMenu(sMenuItem);
- return bAcceptChoice;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Macro for RotationInit().
- //
- ////////////////////////////////////////////////////////////////////////////////
- template <class ValType>
- short SetUpRotationScrollBar( // Returns 0 on success.
- ValType* pvtRotationVal, // In: Rotation value to tune via scrollbar.
- Menu* pmenu, // In: Menu.
- short sChoiceIndex, // In: Index of choice.
- char* pszResName) // In: Resource name.
- {
- short sRes = 0; // Assume success.
- RScrollBar* psb = NULL;
- if (rspGetResourceInstance(&g_resmgrShell, pszResName, &psb) == 0)
- {
- // Set the initial state.
- // Set the callback.
- switch (sizeof(ValType))
- {
- case 2:
- psb->m_upcUser = RotationScrollUpdateShort;
- break;
- case 8:
- psb->m_upcUser = RotationScrollUpdateDouble;
- break;
- default:
- TRACE("SetUpRotationScrollBar(): Unsupported value size.\n");
- break;
- }
- // Set the value to change.
- psb->m_ulUserInstance = (ULONG)pvtRotationVal;
- // Set the initial position. psb will get set via callback.
- psb->SetPos(*pvtRotationVal);
- }
- else
- {
- TRACE("SetUpRotationScrollBar(): rspGetResource() failed for \"%s\".\n", pszResName);
- sRes = 1;
- }
- // Let menu know about it.
- pmenu->ami[sChoiceIndex].pgui = psb;
- return sRes;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called when the Rotation menu is initialized.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static short RotationInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit) // TRUE, if initializing; FALSE, if killing.
- {
- short sRes = 0; // Assume success.
- if (sInit != FALSE)
- {
- RGuiItem::ms_print.SetFont(DEFAULT_GUI_FONT_HEIGHT, &g_fontPostal);
- // Get scrollbars for rotation parameters.
- sRes |= SetUpRotationScrollBar(&g_InputSettings.m_dMovingSlowDegreesPerSec, pmenuCur, 0, GUI_ROTATION_FILE);
- sRes |= SetUpRotationScrollBar(&g_InputSettings.m_dMovingFastDegreesPerSec, pmenuCur, 1, GUI_ROTATION_FILE);
- sRes |= SetUpRotationScrollBar(&g_InputSettings.m_dStillSlowDegreesPerSec, pmenuCur, 2, GUI_ROTATION_FILE);
- sRes |= SetUpRotationScrollBar(&g_InputSettings.m_dStillFastDegreesPerSec, pmenuCur, 3, GUI_ROTATION_FILE);
- sRes |= SetUpRotationScrollBar(&g_InputSettings.m_sTapRotationDegrees, pmenuCur, 4, GUI_TAP_ROTATION_FILE);
- }
- else
- {
- short i;
- for (i = 0; pmenuCur->ami[i].pszText; i++)
- {
- if (pmenuCur->ami[i].pgui)
- {
- rspReleaseResourceInstance(&g_resmgrShell, (RScrollBar**)&(pmenuCur->ami[i].pgui) );
- }
- }
- }
- return sRes;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Call when a selection is changed or made on the Rotation menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static bool RotationChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem) // Item chosen.
- {
- bool bAcceptChoice = true; // Assume accepting.
- switch (sMenuItem)
- {
- // Restore defaults.
- case 5:
- g_InputSettings.DefaultRotations();
- // Update sliders.
- ( (RScrollBar*)(pmenuCurrent->ami[0].pgui) )->SetPos(g_InputSettings.m_dMovingSlowDegreesPerSec);
- ( (RScrollBar*)(pmenuCurrent->ami[1].pgui) )->SetPos(g_InputSettings.m_dMovingFastDegreesPerSec);
- ( (RScrollBar*)(pmenuCurrent->ami[2].pgui) )->SetPos(g_InputSettings.m_dStillSlowDegreesPerSec);
- ( (RScrollBar*)(pmenuCurrent->ami[3].pgui) )->SetPos(g_InputSettings.m_dStillFastDegreesPerSec);
- ( (RScrollBar*)(pmenuCurrent->ami[4].pgui) )->SetPos(g_InputSettings.m_sTapRotationDegrees);
- break;
- }
- // Audible Feedback.
- if (sMenuItem == -1)
- PlaySample(g_smidMenuItemChange, SampleMaster::UserFeedBack);
- else
- PlaySample(g_smidMenuItemSelect, SampleMaster::UserFeedBack);
- return bAcceptChoice;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called to init or kill the multiplyaer options menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static short MultiOptionsInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit) // TRUE, if initializing; FALSE, if killing.
- {
- short sRes = 0; // Assume success.
- if (sInit != FALSE)
- {
- RGuiItem::ms_print.SetFont(DEFAULT_GUI_FONT_HEIGHT, &g_fontPostal);
- if (rspGetResource(&g_resmgrShell, PLAYER_NAME_GUI_FILE, &ms_peditName) == 0)
- {
- // Set the text from the INI setting. Note that we are changing a resource!
- ms_peditName->m_sMaxText = Net::MaxPlayerNameSize - 1;
- ms_peditName->SetText("%s", g_GameSettings.m_szPlayerName);
- ms_peditName->Compose();
- // Let menu know about it.
- pmenuCur->ami[0].pgui = ms_peditName;
- // If any errors occurred after getting resource, this function will be
- // called with sInit == FALSE.
- }
- else
- {
- TRACE("MultiOptionsInit(): rspGetResource() failed.\n");
- sRes = 1;
- }
- if (rspGetResource(&g_resmgrShell, PLAYER_COLOR_GUI_FILE, &ms_ptxtColor) == 0)
- {
- // Keep in bounds just in case (anyone could type any number into the INI) . . .
- if ( g_GameSettings.m_sPlayerColorIndex >= CGameSettings::ms_sNumPlayerColorDescriptions
- || g_GameSettings.m_sPlayerColorIndex >= CDude::MaxTextures
- || g_GameSettings.m_sPlayerColorIndex < 0)
- {
- g_GameSettings.m_sPlayerColorIndex = 0;
- }
- // Set the text from the INI setting. Note that we are changing a
- // resource!
- ms_ptxtColor->SetText("%s", CGameSettings::ms_apszPlayerColorDescriptions[g_GameSettings.m_sPlayerColorIndex]);
- ms_ptxtColor->Compose();
- pmenuCur->ami[1].pgui = ms_ptxtColor;
- }
- else
- {
- TRACE("MultiOptionsInit(): rspGetResource() failed.\n");
- sRes = 2;
- }
- if (rspGetResource(&g_resmgrShell, NET_PROTO_GUI_FILE, &ms_ptxtProto) == 0)
- {
- // Set the text from the INI setting. Note that we are changing a
- // resource!
- ms_ptxtProto->SetText("%s", RSocket::GetProtoName((RSocket::ProtoType)g_GameSettings.m_usProtocol));
- ms_ptxtProto->Compose();
- pmenuCur->ami[2].pgui = ms_ptxtProto;
- }
- else
- {
- TRACE("MultiOptionsIni(): rspGetResource() failed.\n");
- sRes = 4;
- }
- if (rspGetResource(&g_resmgrShell, NET_CONNECTION_GUI_FILE, &ms_ptxtBandwidth) == 0)
- {
- // Set the text from the INI setting. Note that we are changing a
- // resource!
- if (g_GameSettings.m_sNetBandwidth >= Net::NumBandwidths)
- g_GameSettings.m_sNetBandwidth = Net::FirstBandwidth;
- ms_ptxtBandwidth->SetText("%s", Net::BandwidthText[g_GameSettings.m_sNetBandwidth]);
- ms_ptxtBandwidth->Compose();
- pmenuCur->ami[3].pgui = ms_ptxtBandwidth;
- }
- else
- {
- TRACE("MultiOptionsInit(): rspGetResource() failed.\n");
- sRes = 5;
- }
- }
- else
- {
- if (ms_peditName != NULL)
- {
- // Get the player name for storage purposes.
- ms_peditName->GetText(g_GameSettings.m_szPlayerName, sizeof(g_GameSettings.m_szPlayerName) );
- // Release resource.
- rspReleaseResource(&g_resmgrShell, &ms_peditName);
- // Clear menu's pointer.
- pmenuCur->ami[0].pgui = NULL;
- }
- if (ms_ptxtColor != NULL)
- {
- // Release resource.
- rspReleaseResource(&g_resmgrShell, &ms_ptxtColor);
- // Clear menu's pointer.
- pmenuCur->ami[1].pgui = NULL;
- }
- if (ms_ptxtProto)
- {
- // Release resource.
- rspReleaseResource(&g_resmgrShell, &ms_ptxtProto);
- // Clear menu's pointer.
- pmenuCur->ami[2].pgui = NULL;
- }
- if (ms_ptxtBandwidth)
- {
- // Release resource.
- rspReleaseResource(&g_resmgrShell, &ms_ptxtBandwidth);
- // Clear menu's pointer.
- pmenuCur->ami[3].pgui = NULL;
- }
- }
- return sRes;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called when a choice is made or changed on the multiplayer options menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static bool MultiOptionsChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCur, // Current menu.
- short sMenuItem) // Item chosen.
- {
- bool bAcceptChoice = true; // Assume accepting.
- // Toggle the protocol to the next one in the list
- switch (sMenuItem)
- {
- case 1:
- // Increment and check to make sure we have a description and we have such a color . . .
- g_GameSettings.m_sPlayerColorIndex++;
- if ( g_GameSettings.m_sPlayerColorIndex >= CGameSettings::ms_sNumPlayerColorDescriptions
- || g_GameSettings.m_sPlayerColorIndex >= CDude::MaxTextures)
- {
- g_GameSettings.m_sPlayerColorIndex = 0;
- }
- // Set the text from the INI setting. Note that we are changing a
- // resource!
- ms_ptxtColor->SetText("%s", CGameSettings::ms_apszPlayerColorDescriptions[g_GameSettings.m_sPlayerColorIndex]);
- ms_ptxtColor->Compose();
- break;
- case 2:
- if (ms_ptxtProto != NULL)
- {
- g_GameSettings.m_usProtocol++;
- if (g_GameSettings.m_usProtocol >= RSocket::NumProtocols)
- g_GameSettings.m_usProtocol = RSocket::FirstProtocol;
- ms_ptxtProto->SetText("%s", RSocket::GetProtoName((RSocket::ProtoType)g_GameSettings.m_usProtocol));
- ms_ptxtProto->Compose();
- }
- break;
- case 3:
- if (ms_ptxtBandwidth)
- {
- g_GameSettings.m_sNetBandwidth = (Net::Bandwidth)(g_GameSettings.m_sNetBandwidth + 1);
- if (g_GameSettings.m_sNetBandwidth >= Net::NumBandwidths)
- g_GameSettings.m_sNetBandwidth = Net::FirstBandwidth;
- // Set new text and realize.
- ms_ptxtBandwidth->SetText("%s", Net::BandwidthText[g_GameSettings.m_sNetBandwidth]);
- ms_ptxtBandwidth->Compose();
- }
- break;
- }
- // Audible Feedback.
- if (sMenuItem == -1)
- PlaySample(g_smidMenuItemChange, SampleMaster::UserFeedBack);
- else
- PlaySample(g_smidMenuItemSelect, SampleMaster::UserFeedBack);
- return bAcceptChoice;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called when a choice is made or changed on the Editor menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static bool EditorMenuChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem) // Item chosen.
- {
- bool bAcceptChoice = true; // Assume accepting.
- switch (sMenuItem)
- {
- case 0:
- Edit_Menu_Continue();
- break;
- case 1:
- break;
- case 2:
- Edit_Menu_ExitEditor();
- break;
- }
- // Audible Feedback.
- if (sMenuItem == -1)
- PlaySample(g_smidMenuItemChange, SampleMaster::UserFeedBack);
- else
- PlaySample(g_smidMenuItemSelect, SampleMaster::UserFeedBack);
- return bAcceptChoice;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called to init or kill the Mouse menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static short MouseInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit) // TRUE, if initializing; FALSE, if killing.
- {
- short sRes = 0; // Assume success.
- if (sInit == TRUE)
- {
- sRes = InputSettingsDlg_InitMenu(pmenuCur);
- }
- else
- {
- sRes = InputSettingsDlg_KillMenu(pmenuCur);
- }
- return sRes;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called when a choice is made or changed on the Mouse menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static bool MouseChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem) // Item chosen or -1 for change of focus.
- {
- bool bAcceptChoice = true; // Assume accepting.
- // Audible Feedback.
- if (sMenuItem == -1)
- PlaySample(g_smidMenuItemChange, SampleMaster::UserFeedBack);
- else
- PlaySample(g_smidMenuItemSelect, SampleMaster::UserFeedBack);
- InputSettingsDlg_Choice(pmenuCurrent, sMenuItem);
- return bAcceptChoice;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called to init or kill the Key menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static short KeyInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit) // TRUE, if initializing; FALSE, if killing.
- {
- short sRes = 0; // Assume success.
- if (sInit == TRUE)
- {
- sRes = InputSettingsDlg_InitMenu(pmenuCur);
- }
- else
- {
- sRes = InputSettingsDlg_KillMenu(pmenuCur);
- }
- return sRes;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called when a choice is made or changed on the Key menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static bool KeyChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem) // Item chosen or -1 for change of focus.
- {
- bool bAcceptChoice = true; // Assume accepting.
- // Audible Feedback.
- if (sMenuItem == -1)
- PlaySample(g_smidMenuItemChange, SampleMaster::UserFeedBack);
- else
- PlaySample(g_smidMenuItemSelect, SampleMaster::UserFeedBack);
- InputSettingsDlg_Choice(pmenuCurrent, sMenuItem);
- return bAcceptChoice;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called to init or kill the Joy menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static short JoyInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit) // TRUE, if initializing; FALSE, if killing.
- {
- short sRes = 0; // Assume success.
- if (sInit == TRUE)
- {
- sRes = InputSettingsDlg_InitMenu(pmenuCur);
- }
- else
- {
- sRes = InputSettingsDlg_KillMenu(pmenuCur);
- }
- return sRes;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called when a choice is made or changed on the Joy menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static bool JoyChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem) // Item chosen or -1 for change of focus.
- {
- bool bAcceptChoice = true; // Assume accepting.
- // Audible Feedback.
- if (sMenuItem == -1)
- PlaySample(g_smidMenuItemChange, SampleMaster::UserFeedBack);
- else
- PlaySample(g_smidMenuItemSelect, SampleMaster::UserFeedBack);
- InputSettingsDlg_Choice(pmenuCurrent, sMenuItem);
- return bAcceptChoice;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called to init or kill the Features menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static short FeaturesInit( // Returns 0 on success, non-zero to cancel menu.
- Menu* pmenuCur, // Current menu.
- short sInit) // TRUE, if initializing; FALSE, if killing.
- {
- short sRes = 0; // Assume success.
- if (sInit != FALSE)
- {
- RGuiItem::ms_print.SetFont(DEFAULT_GUI_FONT_HEIGHT, &g_fontPostal);
- short sItem;
- short sMaxFeatureItems = NUM_ELEMENTS(pmenuCur->ami) - 1;
- for (sItem = 0; sItem < sMaxFeatureItems && pmenuCur->ami[sItem + 1].pszText && sRes == 0; sItem++)
- {
- RMultiBtn** ppmb = (RMultiBtn**)&(pmenuCur->ami[sItem].pgui);
- if (rspGetResourceInstance(&g_resmgrShell, GUI_CHECKBOX_FILE, ppmb) == 0)
- {
- // Set the initial state.
- short sState = 1;
- switch (sItem)
- {
- case 0:
- sState = (g_GameSettings.m_sAlphaBlend != FALSE) ? 1 : 2;
- break;
- case 1:
- sState = (g_GameSettings.m_s3dFog != FALSE) ? 1 : 2;
- break;
- case 2:
- sState = (g_GameSettings.m_sParticleEffects != FALSE) ? 1 : 2;
- break;
- case 3:
- sState = (g_GameSettings.m_sVolumeDistance != FALSE) ? 1 : 2;
- break;
- case 4:
- sState = (g_GameSettings.m_sPlayAmbientSounds != FALSE) ? 1 : 2;
- break;
- }
-
- (*ppmb)->m_sState = sState;
- (*ppmb)->Compose();
- }
- else
- {
- TRACE("FeaturesInit(): rspGetResource() failed.\n");
- sRes = 1;
- }
- }
- }
- else
- {
- short sMaxFeatureItems = NUM_ELEMENTS(pmenuCur->ami) - 1;
- short sItem;
- for (sItem = 0; sItem < sMaxFeatureItems; sItem++)
- {
- RMultiBtn** ppmb = (RMultiBtn**)&(pmenuCur->ami[sItem].pgui);
- if (*ppmb)
- {
- // Get the final state.
- short sOn = ( (*ppmb)->m_sState == 1) ? TRUE : FALSE;
- // Release the resource.
- rspReleaseResourceInstance(&g_resmgrShell, ppmb);
- // Update the feature.
- switch (sItem)
- {
- case 0:
- g_GameSettings.m_sAlphaBlend = sOn;
- break;
- case 1:
- g_GameSettings.m_s3dFog = sOn;
- break;
- case 2:
- g_GameSettings.m_sParticleEffects = sOn;
- break;
- case 3:
- g_GameSettings.m_sVolumeDistance = sOn;
- break;
- case 4:
- g_GameSettings.m_sPlayAmbientSounds = sOn;
- break;
- }
- }
- }
- }
- return sRes;
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Called when a choice is made or changed on the Features menu.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static bool FeaturesChoice( // Returns true to accept, false to deny choice.
- Menu* pmenuCurrent, // Current menu.
- short sMenuItem) // Item chosen or -1 for change of focus.
- {
- bool bAcceptChoice = true; // Assume accepting.
- // Audible Feedback.
- if (sMenuItem == -1)
- PlaySample(g_smidMenuItemChange, SampleMaster::UserFeedBack);
- else
- {
- // If there's an associated GUI . . .
- if (pmenuCurrent->ami[sMenuItem].pgui)
- {
- // If it's a multistate btn . . .
- if (pmenuCurrent->ami[sMenuItem].pgui->m_type == RGuiItem::MultiBtn)
- {
- // Move to the next state and update visual components.
- RMultiBtn* pmb = (RMultiBtn*)pmenuCurrent->ami[sMenuItem].pgui;
- pmb->NextState();
- pmb->Compose();
- }
- }
- PlaySample(g_smidMenuItemSelect, SampleMaster::UserFeedBack);
- }
- return bAcceptChoice;
- }
- ////////////////////////////////////////////////////////////////////////////////
- // GUI callbacks.
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Callback from ms_psbGamma to update 'gamma' adjustment.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static void GammaScrollUpdate( // Returns nothing.
- RScrollBar* psb) // Scrollbar that got updated.
- {
- ASSERT(psb != NULL);
- // Get range.
- long lMin, lMax;
- psb->GetRange(&lMin, &lMax);
- // Determine range of values.
- long lRange = lMax - lMin;
- // Set via scroll position.
- long lVal = psb->GetPos();
- // Convert to gamma value by ratio.
- short sVal = short(GAMMA_RANGE / float(lRange) * (lVal - lMin) + 0.5) + MIN_GAMMA_VAL;
- SetGammaLevel(sVal);
- RGuiItem* pguiGammaVal = psb->GetItemFromId(GUI_ID_GAMMA_VAL);
- if (pguiGammaVal)
- {
- pguiGammaVal->SetText("%+02ld", lVal);
- pguiGammaVal->Compose();
- }
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Callback from ms_psbDifficulty to update difficulty adjustment.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static void DifficultyScrollUpdate( // Returns nothing.
- RScrollBar* psb) // Scrollbar that got updated.
- {
- ASSERT(psb != NULL);
- // Get the parent.
- RGuiItem* pguiParent = psb->GetParent();
- // This is weird but it allows artie to finer tune the scroll thumb size.
- // We use the ID of the parent as the divisor for the scrollbar value.
- short sDivisor = (short)pguiParent->m_lId;
- g_GameSettings.m_sDifficulty = (short)psb->GetPos() / sDivisor;
- RGuiItem* pguiVal = psb->GetItemFromId(GUI_ID_DIFFICULTY_VAL);
- if (pguiVal)
- {
- pguiVal->SetText("%d", g_GameSettings.m_sDifficulty);
- pguiVal->Compose();
- }
- if (pguiParent)
- {
- RGuiItem* pguiText = psb->GetParent()->GetItemFromId(GUI_ID_DIFFICULTY_TEXT);
- if (pguiText)
- {
- // Add shadow.
- pguiText->m_sTextEffects |= RGuiItem::Shadow;
- pguiText->m_u32TextShadowColor = GetCurrentMenuBox()->m_u32TextShadowColor;
- pguiText->SetText("%s", ms_apszDifficultyDescriptions[g_GameSettings.m_sDifficulty - 1] );
- pguiText->Compose();
- }
- }
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Callback from volume sliders to update corresponding volume adjustment.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static void VolumesScrollUpdate( // Returns nothing.
- RScrollBar* psb) // Scrollbar that got updated.
- {
- ASSERT(psb != NULL);
- SampleMaster::SoundCategory sc = (SampleMaster::SoundCategory)psb->m_ulUserData;
- long lMin, lMax, lRange;
- psb->GetRange(&lMin, &lMax);
- lRange = lMax - lMin;
- // Get volume and scale to user volume.
- g_GameSettings.m_asCategoryVolumes[sc] = (short)(psb->GetPos() * SampleMaster::UserMaxVolume / lRange);
- SetCategoryVolume(sc, g_GameSettings.m_asCategoryVolumes[sc]);
- SampleMasterID* psmid = ms_apsmidVolumeTesters[sc];
- if (psmid == NULL)
- {
- psmid = ms_apsmidVolumeTesters[0];
- }
- if (ms_siLastSamplePlayed)
- {
- // Abort last one.
- AbortSample(ms_siLastSamplePlayed);
- }
- // Play a sample in that category.
- PlaySample( // Returns RSnd used to play the sample.
- // Does not fail.
- *psmid, // In: Identifier of sample you want played.
- sc, // In: Sound Volume Category for user adjustment
- 255, // In: Initial Sound Instance Volume (0 - 255)
- &ms_siLastSamplePlayed); // Out: Handle for adjusting sound volume
- // Get val indicator.
- RGuiItem* pguiVal = psb->GetItemFromId(GUI_ID_VOLUME_VAL);
- if (pguiVal)
- {
- pguiVal->SetText("%d", g_GameSettings.m_asCategoryVolumes[sc]);
- pguiVal->Compose();
- }
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Callback from mouse sensitivity sliders to update corresponding
- // mouse sensitivity adjsutment.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static void MouseSensitivityScrollUpdate( // Returns nothing.
- RScrollBar* psb) // Scrollbar that got updated.
- {
- // Update value.
- double* pdSensitivity = (double*)psb->m_ulUserInstance;
- *pdSensitivity = double(psb->GetPos() ) / MOUSE_SENSITIVITY_DIVISOR;
- RGuiItem* pguiVal = psb->GetItemFromId(GUI_ID_SENSITIVITY_VAL);
- if (pguiVal)
- {
- pguiVal->SetText("%f", *pdSensitivity);
- pguiVal->Compose();
- }
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Callback from rotation scrollbars.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static void RotationScrollUpdateDouble( // Returns nothing.
- RScrollBar* psb) // Scrollbar that got updated.
- {
- double* pdRotVal = (double*)psb->m_ulUserInstance;
- *pdRotVal = double(psb->GetPos() );
- RGuiItem* pguiVal = psb->GetItemFromId(GUI_ID_ROTATION_VAL);
- if (pguiVal)
- {
- pguiVal->SetText("%d", (short)(*pdRotVal) );
- pguiVal->Compose();
- }
- }
- ////////////////////////////////////////////////////////////////////////////////
- //
- // Callback from rotation scrollbars.
- //
- ////////////////////////////////////////////////////////////////////////////////
- static void RotationScrollUpdateShort( // Returns nothing.
- RScrollBar* psb) // Scrollbar that got updated.
- {
- short* psRotVal = (short*)psb->m_ulUserInstance;
- *psRotVal = short(psb->GetPos() );
- RGuiItem* pguiVal = psb->GetItemFromId(GUI_ID_ROTATION_VAL);
- if (pguiVal)
- {
- pguiVal->SetText("%d", *psRotVal);
- pguiVal->Compose();
- }
- }
- // Workaround the need for a platform-specific file selector, since this
- // requires external dependencies like GTK+ on Linux, and may not play well
- // with a fullscreen display mode on any platform. Better to just render
- // into the existing framebuffer. --ryan.
- #if 1 //PLATFORM_UNIX
- static bool PickFileMenuChoice(Menu *pmenuCurrent, short sMenuItem);
- extern Menu g_menuPickFile =
- {
- PICK_FILE_MENU_ID,
- // Position info.
- { // x, y, w, h, sPosX, sPosY, sItemSpacingY, sIndicatorSpacingX,
- MENU_RECT_MD, // menu x, y, w, h
- -120, // menu header x offset
- MENU_HEAD_Y_MD, // menu header y offset
- MENU_ITEM_X_MD, // menu items x offset
- MENU_ITEM_Y_MD, // menu items y offset
- MENU_ITEM_SPACE_Y_MD, // vertical space between menu items
- MENU_ITEM_IND_SPACE_X_MD, // horizontal space between indicator and menu items
- },
- // Background info.
- { // pszFile, u32BackColor
- MENU_BG_MD,
- MENU_BG_COLOR, // Background color.
- PAL_SET_START, // Starting palette index to set.
- PAL_SET_NUM, // Number of entries to set.
- PAL_MAP_START, // Starting index of palette entries that can be mapped to.
- PAL_MAP_NUM, // Number of palette entries that can be mapped to.
- },
- // GUI settings.
- { // sTransparent.
- TRUE, // TRUE if GUI is to be BLiT with transparency.
- },
- // Flags.
- (MenuFlags)(MenuPosCenter | MenuBackTiled | MenuItemTextShadow | MenuHeaderTextShadow | MenuHeaderTextCenter),
- // Header and its font info.
- { // pszHeaderText, pszFontFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor.
- NULL, // filled in by PickFile().
- SMASH_FONT,
- HEAD_FONT_HEIGHT, // Height of font.
- HEAD_COLOR, // Text RGBA.
- HEAD_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Font info.
- { // pszFile, sHeight, u32ForeColor, u32BackColor, u32ShadowColor
- SMASH_FONT,
- ITEM_FONT_HEIGHT, // Height of font.
- ITEM_COLOR, // Text RGBA.
- ITEM_SHADOW_COLOR // Text Shadow RGBA.
- },
- // Menu indicator.
- { // pszFile, type
- MENU_INDICATOR,
- RImage::FSPR8,
- },
- // Menu callbacks.
- { // fnInit, fnChoice,
- NULL, // Called before menu is initialized.
- PickFileMenuChoice, // Called when item is chosen.
- },
- // Menu auto items.
- { // sDefaultItem, sCancelItem,
- 0, // Menu item (index in ami[]) selected initially.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- -1, // Menu item (index in ami[]) chosen on cancel.
- // Negative indicates distance from number of items
- // (e.g., -1 is the last item).
- },
-
- // Menu items.
- // Filled in by PickFile().
- { // pszText, sEnabled, pmenu, pgui
- NULL // Terminates list.
- },
- };
- static volatile bool g_PickFileMenuDone = false;
- static volatile const char *g_PickFileMenuChoice = NULL;
- static bool PickFileMenuChoice(Menu *pmenuCurrent, short sMenuItem)
- {
- ASSERT(pmenuCurrent == &g_menuPickFile);
- if (sMenuItem == -1) // focus change.
- {
- PlaySample(g_smidMenuItemChange, SampleMaster::UserFeedBack);
- return true;
- }
- PlaySample(g_smidMenuItemSelect, SampleMaster::UserFeedBack);
- g_PickFileMenuChoice = (const char *) pmenuCurrent->ami[sMenuItem].pszText;
- g_PickFileMenuDone = true; // break loop in PickFile().
- return true; // accept choice.
- }
- short PickFile(const char *title, void (*enumer)(Menu *), char *buf, size_t bufsize)
- {
- *buf = '\0';
- Menu *currentMenu = GetCurrentMenu();
- int Max = (sizeof(g_menuPickFile.ami) / sizeof(g_menuPickFile.ami[0])) - 1;
- g_menuPickFile.menuheader.pszHeaderText = (char *) title;
- memset(&g_menuPickFile.ami, '\0', sizeof (g_menuPickFile.ami));
- enumer(&g_menuPickFile);
- g_menuPickFile.menuautoitems.sCancelItem = Max; // the null index
- g_PickFileMenuChoice = NULL;
- g_PickFileMenuDone = false;
-
- short sResult = StartMenu(&g_menuPickFile, &g_resmgrShell, g_pimScreenBuf);
- if (sResult != 0)
- {
- TRACE("StartMenu failed! Can't pick file!\n");
- return -1;
- }
- while (!g_PickFileMenuDone)
- {
- if (rspGetQuitStatus())
- break;
- // Update the system, drive the audio, blah blah blah.
- UpdateSystem();
- RInputEvent ie;
- ie.type = RInputEvent::None;
- rspGetNextInputEvent(&ie);
- DoMenuInput(&ie, g_InputSettings.m_sUseJoy);
- DoMenuOutput(g_pimScreenBuf);
- rspUpdateDisplay();
- }
- if (g_PickFileMenuChoice != NULL)
- {
- strncpy(buf, (const char *) g_PickFileMenuChoice, bufsize);
- buf[bufsize-1] = '\0'; // just in case.
- }
- TRACE("PickFile: Going with %s.\n", buf);
- for (int i = 0; (i < Max) && (g_menuPickFile.ami[i].pszText); i++)
- free(g_menuPickFile.ami[i].pszText);
- // put the old menu back.
- StartMenu(currentMenu, &g_resmgrShell, g_pimScreenBuf);
- return ((g_PickFileMenuChoice == NULL) ? -1 : 0);
- }
- #endif // PLATFORM_UNIX
- ////////////////////////////////////////////////////////////////////////////////
- // EOF
- ////////////////////////////////////////////////////////////////////////////////
|