├── SM3D ├── ogres │ ├── d │ ├── i0.png │ ├── i2.png │ ├── p0.png │ ├── p1.png │ ├── w0.png │ ├── w1.png │ ├── w2.png │ ├── w3.png │ ├── wm.png │ ├── dmgL.png │ ├── i10.png │ ├── i11.png │ ├── i12.png │ ├── icon.png │ ├── lock.png │ ├── null.png │ ├── objects │ ├── p2-2.png │ ├── pers.m3g │ ├── Lights.m3g │ ├── antirad.png │ ├── blood.png │ ├── sfire1.png │ ├── sglare1.png │ ├── texgr2.png │ ├── texgr3.png │ ├── texobj1.png │ ├── texobj2.png │ ├── texsky1.png │ ├── texsky2.png │ ├── texsky3.png │ ├── text0.png │ ├── text1.png │ ├── texw1.png │ ├── texw2.png │ ├── texw3.png │ ├── texw4.png │ ├── textree1.png │ ├── textree2.png │ ├── textree3.png │ ├── ForestDecors.m3g │ ├── sredglare1.png │ └── texforest1.png ├── res │ ├── d │ ├── icon.png │ ├── objects │ └── gamedata │ │ ├── levels │ │ ├── l0 │ │ ├── l1 │ │ ├── l2 │ │ ├── l3 │ │ ├── l4 │ │ ├── l5 │ │ ├── l6 │ │ ├── l7 │ │ ├── l8 │ │ ├── l9 │ │ ├── l10 │ │ ├── l11 │ │ ├── l12 │ │ ├── l13 │ │ ├── l14 │ │ ├── l15 │ │ └── l16 │ │ ├── sounds │ │ ├── 0.mid │ │ ├── 1.amr │ │ ├── 2.amr │ │ ├── 3.amr │ │ ├── 4.amr │ │ ├── 5.amr │ │ └── 6.amr │ │ ├── textures │ │ ├── i0.png │ │ ├── i10.png │ │ ├── i11.png │ │ ├── i12.png │ │ ├── i2.png │ │ ├── p0.png │ │ ├── p1.png │ │ ├── p2.png │ │ ├── w0.png │ │ ├── w1.png │ │ ├── w2.png │ │ ├── w3.png │ │ ├── wm.png │ │ ├── blood.png │ │ ├── dmgL.png │ │ ├── icon.png │ │ ├── lock.png │ │ ├── sfire1.png │ │ ├── texgr2.png │ │ ├── texgr3.png │ │ ├── text0.png │ │ ├── text1.png │ │ ├── texw1.png │ │ ├── texw2.png │ │ ├── texw3.png │ │ ├── texw4.png │ │ ├── antirad.png │ │ ├── pbandit.png │ │ ├── pkiller.png │ │ ├── psoldier.png │ │ ├── pstalker.png │ │ ├── sglare1.png │ │ ├── texobj1.data │ │ ├── texobj2.data │ │ ├── texsky1.png │ │ ├── texsky2.png │ │ ├── texsky3.png │ │ ├── textree1.png │ │ ├── textree2.png │ │ ├── textree3.png │ │ ├── sredglare1.png │ │ ├── texforest1.png │ │ ├── texobj1.data.pal │ │ └── texobj2.data.pal │ │ └── meshes │ │ ├── Box1_00.z1 │ │ ├── Box2_00.z1 │ │ ├── Door1_00.z1 │ │ ├── Door2_00.z1 │ │ ├── Lamp1_00.z1 │ │ ├── Lamp2_00.z1 │ │ ├── Lamp3_00.z1 │ │ ├── Room1_00.z1 │ │ ├── Room2_00.z1 │ │ ├── Sky1_00.z1 │ │ ├── Sky2_00.z1 │ │ ├── Sky3_00.z1 │ │ ├── Stone1_00.z1 │ │ ├── Stone2_00.z1 │ │ ├── UAZ1_00.z1 │ │ ├── m3g │ │ ├── null.png │ │ ├── pers.m3g │ │ ├── Lights.m3g │ │ ├── texobj2.png │ │ ├── texforest1.png │ │ └── ForestDecors.m3g │ │ ├── Asphalt1_00.z1 │ │ ├── Asphalt2_00.z1 │ │ ├── Barrel1_00.z1 │ │ ├── Barrel2_00.z1 │ │ ├── CBlock1_00.z1 │ │ ├── CFence1_00.z1 │ │ ├── CFence2_00.z1 │ │ ├── Forest1_00.z1 │ │ ├── Rubbish1_00.z1 │ │ ├── Storage1_00.z1 │ │ ├── Storage2_00.z1 │ │ ├── TreeOld1_00.z1 │ │ ├── WFence1_00.z1 │ │ ├── WFence2_00.z1 │ │ ├── Window1_00.z1 │ │ ├── Corridor1_00.z1 │ │ ├── DoorStud1_00.z1 │ │ ├── DoorStud2_00.z1 │ │ ├── GrassPlot1_00.z1 │ │ ├── GrassPlot2_00.z1 │ │ ├── GreenAcid1_00.z1 │ │ ├── MetalCase1_00.z1 │ │ ├── MetalGate1_00.z1 │ │ ├── MetalRVent1_00.z1 │ │ ├── RailRoad1_00.z1 │ │ ├── SelskiyDom1_00.z1 │ │ ├── WindowSill1_00.z1 │ │ ├── WoodPanel1_00.z1 │ │ ├── WoodReel1_00.z1 │ │ ├── WoodTable1_00.z1 │ │ ├── ConcreteTube1_00.z1 │ │ ├── IndustryTube1_00.z1 │ │ ├── SewerSectionC_00.z1 │ │ ├── SewerSectionI_00.z1 │ │ ├── SewerSectionT_00.z1 │ │ ├── ConcreteSlabs1_00.z1 │ │ ├── IndustryBuild1_00.z1 │ │ ├── IndustryBuild2_00.z1 │ │ ├── IndustryBuild3_00.z1 │ │ ├── IndustryBuild4_00.z1 │ │ ├── IndustryBuild5_00.z1 │ │ ├── IndustryBuild6_00.z1 │ │ ├── IndustryBuildA1_00.z1 │ │ ├── IndustryBuildA2_00.z1 │ │ ├── IndustryBuildA3_00.z1 │ │ ├── IndustryBuildB1_00.z1 │ │ ├── IndustryBuildB2_00.z1 │ │ └── SewerWallBlind1_00.z1 ├── src │ └── code │ │ ├── Screen.java │ │ ├── EmptySceneScreen.java │ │ ├── Timer.java │ │ ├── GameScreen.java │ │ ├── SettingsScreen.java │ │ ├── PlayersRecords.java │ │ ├── AllScreens.java │ │ ├── MasterCanvas.java │ │ ├── SoundAndVibro.java │ │ ├── MenuScreen.java │ │ ├── Keys.java │ │ ├── MathUtils.java │ │ ├── CentralText.java │ │ ├── MasterInventoryScreen.java │ │ ├── KeyboardScreen.java │ │ ├── Main.java │ │ ├── HelpAboutScreen.java │ │ ├── InventoryScreen.java │ │ ├── LoadingScreen.java │ │ ├── Bot.java │ │ ├── OldDebugger.java │ │ ├── StashScreen.java │ │ ├── TradeScreen.java │ │ ├── ItemDescriptionScreen.java │ │ ├── MainMenuScreen.java │ │ ├── PlayerStatsScreen.java │ │ ├── ResourceLoader.java │ │ └── ItemsInteraction.java ├── nbproject │ ├── project.xml │ ├── genfiles.properties │ └── project.properties └── build.xml ├── .gitignore ├── README.md └── Converters └── objects_parser.py /SM3D/ogres/d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/d -------------------------------------------------------------------------------- /SM3D/res/d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/d -------------------------------------------------------------------------------- /SM3D/ogres/i0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/i0.png -------------------------------------------------------------------------------- /SM3D/ogres/i2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/i2.png -------------------------------------------------------------------------------- /SM3D/ogres/p0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/p0.png -------------------------------------------------------------------------------- /SM3D/ogres/p1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/p1.png -------------------------------------------------------------------------------- /SM3D/ogres/w0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/w0.png -------------------------------------------------------------------------------- /SM3D/ogres/w1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/w1.png -------------------------------------------------------------------------------- /SM3D/ogres/w2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/w2.png -------------------------------------------------------------------------------- /SM3D/ogres/w3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/w3.png -------------------------------------------------------------------------------- /SM3D/ogres/wm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/wm.png -------------------------------------------------------------------------------- /SM3D/res/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/icon.png -------------------------------------------------------------------------------- /SM3D/res/objects: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/objects -------------------------------------------------------------------------------- /SM3D/ogres/dmgL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/dmgL.png -------------------------------------------------------------------------------- /SM3D/ogres/i10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/i10.png -------------------------------------------------------------------------------- /SM3D/ogres/i11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/i11.png -------------------------------------------------------------------------------- /SM3D/ogres/i12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/i12.png -------------------------------------------------------------------------------- /SM3D/ogres/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/icon.png -------------------------------------------------------------------------------- /SM3D/ogres/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/lock.png -------------------------------------------------------------------------------- /SM3D/ogres/null.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/null.png -------------------------------------------------------------------------------- /SM3D/ogres/objects: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/objects -------------------------------------------------------------------------------- /SM3D/ogres/p2-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/p2-2.png -------------------------------------------------------------------------------- /SM3D/ogres/pers.m3g: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/pers.m3g -------------------------------------------------------------------------------- /SM3D/ogres/Lights.m3g: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/Lights.m3g -------------------------------------------------------------------------------- /SM3D/ogres/antirad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/antirad.png -------------------------------------------------------------------------------- /SM3D/ogres/blood.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/blood.png -------------------------------------------------------------------------------- /SM3D/ogres/sfire1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/sfire1.png -------------------------------------------------------------------------------- /SM3D/ogres/sglare1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/sglare1.png -------------------------------------------------------------------------------- /SM3D/ogres/texgr2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/texgr2.png -------------------------------------------------------------------------------- /SM3D/ogres/texgr3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/texgr3.png -------------------------------------------------------------------------------- /SM3D/ogres/texobj1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/texobj1.png -------------------------------------------------------------------------------- /SM3D/ogres/texobj2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/texobj2.png -------------------------------------------------------------------------------- /SM3D/ogres/texsky1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/texsky1.png -------------------------------------------------------------------------------- /SM3D/ogres/texsky2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/texsky2.png -------------------------------------------------------------------------------- /SM3D/ogres/texsky3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/texsky3.png -------------------------------------------------------------------------------- /SM3D/ogres/text0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/text0.png -------------------------------------------------------------------------------- /SM3D/ogres/text1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/text1.png -------------------------------------------------------------------------------- /SM3D/ogres/texw1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/texw1.png -------------------------------------------------------------------------------- /SM3D/ogres/texw2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/texw2.png -------------------------------------------------------------------------------- /SM3D/ogres/texw3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/texw3.png -------------------------------------------------------------------------------- /SM3D/ogres/texw4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/texw4.png -------------------------------------------------------------------------------- /SM3D/ogres/textree1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/textree1.png -------------------------------------------------------------------------------- /SM3D/ogres/textree2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/textree2.png -------------------------------------------------------------------------------- /SM3D/ogres/textree3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/textree3.png -------------------------------------------------------------------------------- /SM3D/ogres/ForestDecors.m3g: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/ForestDecors.m3g -------------------------------------------------------------------------------- /SM3D/ogres/sredglare1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/sredglare1.png -------------------------------------------------------------------------------- /SM3D/ogres/texforest1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/ogres/texforest1.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/levels/l0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/levels/l0 -------------------------------------------------------------------------------- /SM3D/res/gamedata/levels/l1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/levels/l1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/levels/l2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/levels/l2 -------------------------------------------------------------------------------- /SM3D/res/gamedata/levels/l3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/levels/l3 -------------------------------------------------------------------------------- /SM3D/res/gamedata/levels/l4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/levels/l4 -------------------------------------------------------------------------------- /SM3D/res/gamedata/levels/l5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/levels/l5 -------------------------------------------------------------------------------- /SM3D/res/gamedata/levels/l6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/levels/l6 -------------------------------------------------------------------------------- /SM3D/res/gamedata/levels/l7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/levels/l7 -------------------------------------------------------------------------------- /SM3D/res/gamedata/levels/l8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/levels/l8 -------------------------------------------------------------------------------- /SM3D/res/gamedata/levels/l9: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/levels/l9 -------------------------------------------------------------------------------- /SM3D/res/gamedata/levels/l10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/levels/l10 -------------------------------------------------------------------------------- /SM3D/res/gamedata/levels/l11: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/levels/l11 -------------------------------------------------------------------------------- /SM3D/res/gamedata/levels/l12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/levels/l12 -------------------------------------------------------------------------------- /SM3D/res/gamedata/levels/l13: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/levels/l13 -------------------------------------------------------------------------------- /SM3D/res/gamedata/levels/l14: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/levels/l14 -------------------------------------------------------------------------------- /SM3D/res/gamedata/levels/l15: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/levels/l15 -------------------------------------------------------------------------------- /SM3D/res/gamedata/levels/l16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/levels/l16 -------------------------------------------------------------------------------- /SM3D/res/gamedata/sounds/0.mid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/sounds/0.mid -------------------------------------------------------------------------------- /SM3D/res/gamedata/sounds/1.amr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/sounds/1.amr -------------------------------------------------------------------------------- /SM3D/res/gamedata/sounds/2.amr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/sounds/2.amr -------------------------------------------------------------------------------- /SM3D/res/gamedata/sounds/3.amr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/sounds/3.amr -------------------------------------------------------------------------------- /SM3D/res/gamedata/sounds/4.amr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/sounds/4.amr -------------------------------------------------------------------------------- /SM3D/res/gamedata/sounds/5.amr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/sounds/5.amr -------------------------------------------------------------------------------- /SM3D/res/gamedata/sounds/6.amr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/sounds/6.amr -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/i0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/i0.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/i10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/i10.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/i11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/i11.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/i12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/i12.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/i2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/i2.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/p0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/p0.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/p1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/p1.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/p2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/p2.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/w0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/w0.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/w1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/w1.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/w2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/w2.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/w3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/w3.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/wm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/wm.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/Box1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/Box1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/Box2_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/Box2_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/Door1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/Door1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/Door2_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/Door2_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/Lamp1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/Lamp1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/Lamp2_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/Lamp2_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/Lamp3_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/Lamp3_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/Room1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/Room1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/Room2_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/Room2_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/Sky1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/Sky1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/Sky2_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/Sky2_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/Sky3_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/Sky3_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/Stone1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/Stone1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/Stone2_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/Stone2_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/UAZ1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/UAZ1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/m3g/null.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/m3g/null.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/m3g/pers.m3g: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/m3g/pers.m3g -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/blood.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/blood.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/dmgL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/dmgL.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/icon.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/lock.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/sfire1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/sfire1.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/texgr2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/texgr2.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/texgr3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/texgr3.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/text0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/text0.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/text1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/text1.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/texw1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/texw1.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/texw2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/texw2.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/texw3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/texw3.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/texw4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/texw4.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/Asphalt1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/Asphalt1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/Asphalt2_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/Asphalt2_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/Barrel1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/Barrel1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/Barrel2_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/Barrel2_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/CBlock1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/CBlock1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/CFence1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/CFence1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/CFence2_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/CFence2_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/Forest1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/Forest1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/Rubbish1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/Rubbish1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/Storage1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/Storage1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/Storage2_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/Storage2_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/TreeOld1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/TreeOld1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/WFence1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/WFence1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/WFence2_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/WFence2_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/Window1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/Window1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/m3g/Lights.m3g: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/m3g/Lights.m3g -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/antirad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/antirad.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/pbandit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/pbandit.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/pkiller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/pkiller.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/psoldier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/psoldier.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/pstalker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/pstalker.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/sglare1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/sglare1.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/texobj1.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/texobj1.data -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/texobj2.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/texobj2.data -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/texsky1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/texsky1.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/texsky2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/texsky2.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/texsky3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/texsky3.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/textree1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/textree1.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/textree2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/textree2.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/textree3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/textree3.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/Corridor1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/Corridor1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/DoorStud1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/DoorStud1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/DoorStud2_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/DoorStud2_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/GrassPlot1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/GrassPlot1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/GrassPlot2_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/GrassPlot2_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/GreenAcid1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/GreenAcid1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/MetalCase1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/MetalCase1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/MetalGate1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/MetalGate1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/MetalRVent1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/MetalRVent1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/RailRoad1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/RailRoad1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/SelskiyDom1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/SelskiyDom1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/WindowSill1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/WindowSill1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/WoodPanel1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/WoodPanel1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/WoodReel1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/WoodReel1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/WoodTable1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/WoodTable1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/m3g/texobj2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/m3g/texobj2.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/sredglare1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/sredglare1.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/texforest1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/texforest1.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/ConcreteTube1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/ConcreteTube1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/IndustryTube1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/IndustryTube1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/SewerSectionC_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/SewerSectionC_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/SewerSectionI_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/SewerSectionI_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/SewerSectionT_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/SewerSectionT_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/m3g/texforest1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/m3g/texforest1.png -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/texobj1.data.pal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/texobj1.data.pal -------------------------------------------------------------------------------- /SM3D/res/gamedata/textures/texobj2.data.pal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/textures/texobj2.data.pal -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/ConcreteSlabs1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/ConcreteSlabs1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/IndustryBuild1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/IndustryBuild1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/IndustryBuild2_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/IndustryBuild2_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/IndustryBuild3_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/IndustryBuild3_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/IndustryBuild4_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/IndustryBuild4_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/IndustryBuild5_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/IndustryBuild5_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/IndustryBuild6_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/IndustryBuild6_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/IndustryBuildA1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/IndustryBuildA1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/IndustryBuildA2_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/IndustryBuildA2_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/IndustryBuildA3_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/IndustryBuildA3_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/IndustryBuildB1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/IndustryBuildB1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/IndustryBuildB2_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/IndustryBuildB2_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/SewerWallBlind1_00.z1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/SewerWallBlind1_00.z1 -------------------------------------------------------------------------------- /SM3D/res/gamedata/meshes/m3g/ForestDecors.m3g: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldekotan/OpenSM3D/HEAD/SM3D/res/gamedata/meshes/m3g/ForestDecors.m3g -------------------------------------------------------------------------------- /SM3D/src/code/Screen.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import javax.microedition.lcdui.Graphics; 4 | 5 | //Игровой экран 6 | public interface Screen { 7 | 8 | void resetVariables(); 9 | 10 | void paint(Graphics graphics); 11 | void keyPressed(int key); 12 | 13 | //19.03.2021. Понятия не имею, что это, но скоро узнаю! 14 | boolean onShow(byte screenId); 15 | //22.06.2024. Не прошло и года. 16 | } 17 | -------------------------------------------------------------------------------- /SM3D/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.kjava.j2meproject 4 | 5 | 6 | SM3D 7 | 1.6 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /SM3D/nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 2 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 3 | build.xml.data.CRC32=b01334bd 4 | build.xml.script.CRC32=85c86658 5 | build.xml.stylesheet.CRC32=9c6a911d 6 | nbproject/build-impl.xml.data.CRC32=b01334bd 7 | nbproject/build-impl.xml.script.CRC32=4c9bb7a3 8 | nbproject/build-impl.xml.stylesheet.CRC32=e46c2d22 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | <<<<<<< HEAD 2 | /SM3D/nbproject/private/ 3 | /SM3D/build/ 4 | /SM3D/dist/ 5 | ======= 6 | # Compiled class file 7 | *.class 8 | 9 | # Log file 10 | *.log 11 | 12 | # BlueJ files 13 | *.ctxt 14 | 15 | # Mobile Tools for Java (J2ME) 16 | .mtj.tmp/ 17 | 18 | # Package Files # 19 | *.jar 20 | *.war 21 | *.nar 22 | *.ear 23 | *.zip 24 | *.tar.gz 25 | *.rar 26 | 27 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 28 | hs_err_pid* 29 | replay_pid* 30 | >>>>>>> b68b6ee7a00600dd415bd6e1f6e0cd07c5dc8d0b 31 | -------------------------------------------------------------------------------- /SM3D/src/code/EmptySceneScreen.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import javax.microedition.lcdui.Graphics; 4 | 5 | public final class EmptySceneScreen implements Screen 6 | { 7 | //Понития не имею, зачем этот класс используется. (aldo 24) 8 | //Класс игровых меню 9 | public EmptySceneScreen(MasterInventoryScreen directLink) {} 10 | 11 | public final void resetVariables() {} 12 | 13 | public final void paint(Graphics graphics) 14 | { 15 | ResourceManager.drawUserInterfaceItems(graphics, 50, 0, 0); 16 | graphics.setClip(0, 0, MainMenuScreen.scrWidth, MainMenuScreen.scrHeight); 17 | graphics.setColor(0xffffff); 18 | graphics.drawString("Empty scene", 19 | MainMenuScreen.scrWidth / 2, 20 | MainMenuScreen.scrHeight / 2, 17); 21 | } 22 | 23 | public final void keyPressed(int key) 24 | { 25 | switch(key) 26 | { 27 | case 3: 28 | Main.main.setScreen(AllScreens.pauseScreen, (byte)2); 29 | default: 30 | Main.main.repaint(); 31 | } 32 | } 33 | 34 | public final boolean onShow(byte screenId) 35 | { 36 | return true; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OpenSM3D 2 | *Inspired by the true lovers of three-dimensional mobile games* 3 | 4 | Open Stalker Mobile 3D a.k.a. OpenSM3D представляет собой частично деобфусцированный код, который можно свободно изменять, отлаживать и компилировать для запуска на эмуляторах и телефонах. 5 | 6 | Цели на текущий момент: 7 | * доработка порядка отрисовки 8 | * переход от атласов к отдельным текстурам 9 | 10 | Толчком к началу разработки проекта послужила моя любовь к двум вещам: мобильным играм и сталкеру. Следствием этой любви стало желание разобраться в том, как работает Stalker Mobile 3D, а также модифицировать его. 11 | 12 | Первая попытка декомпилировать игру произошла в мае 2014 года. Спустя два года был получен первый рабочий билд. Тогда же у меня появилась идея открыть доступ к проекту всем желающим, но сделать это, по ряду причин, удалось только в 2024 году. 13 | 14 | Важным событием в истории SM3D является выход HD модификации 31 декабря 2019 года, в отладке которой я принял участие: http://ae-mods.ru/load/mob/mods_by_users/s_t_a_l_k_e_r_mobile_hd/9-1-0-3244 15 | Кодовая база у проектов отличалась, но в дальнейшем разработчик присоединился к работе над OpenSM3D. 16 | 17 | Отличия от оригинала: 18 | * реорганизация загрузки и хранения текстур 19 | * изменения в порядке рендера 20 | * поддержка 256-цветных индексированных текстур 21 | * восстановление звуков 22 | * восстановление прежнего вида интерфейса ПДА 23 | * возможность менять внутриигровой текст в отдельном файле 24 | * исправление мелких багов 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /SM3D/src/code/Timer.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | public final class Timer { 4 | 5 | private boolean timerJustStarted; 6 | private boolean countEachLoop; 7 | private boolean returnLoopCount; 8 | private boolean timeHasRunOut; 9 | private int loopsCount; 10 | private long timeoutTime; 11 | private long timeToWait; 12 | 13 | //активация подсчёта 14 | //длительность кругов 15 | public Timer(boolean counterEnabled, long duration) { 16 | this(counterEnabled, true, duration); 17 | } 18 | 19 | //активация подсчёта 20 | //возврат количества 21 | //длительность кругов 22 | public Timer(boolean counterEnabled, boolean returnLoops, long duration) { 23 | this.timerJustStarted = true; 24 | this.countEachLoop = counterEnabled; 25 | this.timeToWait = duration; 26 | this.returnLoopCount = returnLoops; 27 | } 28 | 29 | public final int getTimerState() { 30 | if (this.timeHasRunOut) { 31 | return -2; 32 | } else { 33 | if (this.timerJustStarted) { 34 | this.timeoutTime = System.currentTimeMillis() + this.timeToWait; 35 | this.timerJustStarted = false; 36 | } else if (System.currentTimeMillis() > this.timeoutTime) { 37 | if (this.countEachLoop) { 38 | this.timeoutTime = System.currentTimeMillis() + this.timeToWait; 39 | return ++this.loopsCount; 40 | } 41 | 42 | this.timeHasRunOut = true; 43 | return 0;//время истекло 44 | } 45 | 46 | return this.countEachLoop && this.returnLoopCount ? this.loopsCount : -1; 47 | } 48 | } 49 | 50 | public final void resetTimer() { 51 | this.loopsCount = 0; 52 | this.timerJustStarted = true; 53 | this.timeHasRunOut = false; 54 | this.getTimerState(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /SM3D/src/code/GameScreen.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import java.util.Random; 4 | import javax.microedition.lcdui.Graphics; 5 | 6 | //Сам класс ледит за ходом времени в игре, обновляя интерфейс и сам мир 7 | public final class GameScreen implements Screen { 8 | 9 | //Нигде не используется 10 | //public byte var_16; 11 | 12 | //На каком-то этапе разработки игровая логика связанная со временем 13 | //отрабатывалась через GameScreen 14 | public GameScreen() { 15 | //Что-то с шансом попасть по игроку 16 | new Random(); 17 | //Таймер со счётчиком и проверкой, что-то в худе, что было анимировано 18 | new Timer(true, 10L); 19 | //Таймер с проверкой, но без счётчика - отрисовка попаданий на худе, мб? 20 | new Timer(true, false, 100L); 21 | //Таймер без проверки - идей нет 22 | new Timer(false, 100L); 23 | //this.var_16 = 8; 24 | OldDebugger.restartDebuggers("timers"); 25 | } 26 | 27 | public final void resetVariables() { 28 | } 29 | 30 | //Здесь происходит переход от состояния игрового мира к просмотру UI 31 | public static void clearMemoryAndLoadUIImages() { 32 | GameScene.SetToNullAllWorldnMeshMassives(); 33 | ResourceManager.loadAllInterfaceImages(); 34 | Main.main.setScreen(AllScreens.menu, (byte) 1); 35 | Main.main.repaint(); 36 | } 37 | 38 | public final void paint(Graphics g) { 39 | if (!MasterCanvas.paused) { 40 | try { 41 | Scripts.checkPlayerAndSaveGame();//воспроизвести звук и не только 42 | //Если мы в окне игры-исследования, обновить время 43 | if (GameScene.currentGameState == 2 44 | || GameScene.currentGameState == 1 45 | || GameScene.currentGameState == 0 46 | || GameScene.currentGameState == -2 47 | || GameScene.currentGameState == 13 48 | || GameScene.currentGameState == 11 49 | || GameScene.currentGameState == 4) { 50 | GameScene.updateGameTime(); 51 | GameScene.renderWorld(MasterCanvas.graphics); 52 | } 53 | 54 | PlayerHUD.updatePlayerHUDState(); 55 | } catch (Exception exc) { 56 | exc.printStackTrace(); 57 | } 58 | } 59 | 60 | Main.main.repaint(); 61 | } 62 | 63 | public final void keyPressed(int key) { 64 | } 65 | 66 | public final boolean onShow(byte ScreenId) { 67 | return true; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /SM3D/src/code/SettingsScreen.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import javax.microedition.lcdui.Canvas; 4 | import javax.microedition.lcdui.Command; 5 | import javax.microedition.rms.RecordStore; 6 | import javax.microedition.rms.RecordStoreException; 7 | 8 | public final class SettingsScreen extends ListScreen 9 | { 10 | 11 | public byte[] settings = new byte[]{(byte)1, (byte)1}; 12 | 13 | 14 | public final void loadSettings() 15 | { 16 | this.settings[0] = (byte) (SoundAndVibro.soundsEnabled ? 1 : 0); 17 | this.settings[1] = (byte) (SoundAndVibro.vibroEnabled ? 1 : 0); 18 | } 19 | 20 | public final void keyPressed(int key) 21 | { 22 | if((key == Command.CANCEL || key == Canvas.FIRE) && settings[super.selectedIndex] != -1) 23 | { 24 | this.settings[super.selectedIndex] = (byte)(this.settings[super.selectedIndex] == 0?1:0); 25 | 26 | SoundAndVibro.soundsEnabled = settings[0] == 1; 27 | SoundAndVibro.vibroEnabled = settings[1] == 1; 28 | 29 | if(!SoundAndVibro.soundsEnabled) 30 | { 31 | SoundAndVibro.stopPlayingSound(); 32 | } 33 | 34 | super.redrawAnimOnly = 4;//можно рисовать интерфейс, если 5 - то анимку 35 | } 36 | //Хардресет сейва с прогрессом игры 37 | else if((key == 3 || key == 8) && this.settings[super.selectedIndex] == -1) 38 | { 39 | try 40 | { 41 | RecordStore.deleteRecordStore("qpmrsp"); 42 | } 43 | catch (RecordStoreException error) 44 | { 45 | error.printStackTrace(); 46 | } 47 | 48 | ((PlayersRecords)AllScreens.recordsScreen).deletePlayerRecord(Main.main.currentPlayerRecordId); 49 | Main.main.setScreen(AllScreens.loadingScreen, (byte)6); 50 | } 51 | else if(key == 4) 52 | { 53 | Main.main.setScreen(AllScreens.loadingScreen, (byte)3); 54 | } 55 | else 56 | { 57 | super.keyPressed(key); 58 | } 59 | 60 | Main.main.repaint(); 61 | } 62 | 63 | //надписи "вкл выкл" справа от опций настроек 64 | public final void drawItem(int settingsId) 65 | { 66 | super.drawItem(settingsId); 67 | if(this.settings[settingsId] != -1) 68 | { 69 | //textId: 61 on; 62 off; 70 | TextCreator.drawLineByAnchor(1, 71 | this.settings[settingsId] == 0?62:61, 72 | MenuScreen.textClipX + MenuScreen.textClipWidth, 73 | MenuScreen.textClipY + 20 + 74 | AllScreens.SINGLE_TEXT_LINE_HEIGHT * settingsId + 3, 2); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /SM3D/src/code/PlayersRecords.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import javax.microedition.lcdui.Canvas; 4 | import javax.microedition.lcdui.Command; 5 | 6 | 7 | public final class PlayersRecords extends ListScreen 8 | { 9 | 10 | public byte[][] records = new byte[3][]; 11 | 12 | 13 | public PlayersRecords() 14 | { 15 | super.optionsTextId = new int[3]; 16 | } 17 | 18 | public final boolean onShow(byte screenId) 19 | { 20 | super.onShow(screenId); 21 | super.numberOfOptions = Main.main.numberOfPlayers; 22 | return true; 23 | } 24 | 25 | public final void drawItem(int item) 26 | { 27 | TextCreator.drawTextByAnchor(0, this.records[item], 0, this.records[item].length, AllScreens.listDefaultXoffset + 2, MenuScreen.textClipY + AllScreens.SINGLE_TEXT_LINE_HEIGHT * item + 3, 0); 28 | } 29 | 30 | public final void addNewPlayerRecord(byte[] recordData) 31 | { 32 | this.records[Main.main.numberOfPlayers] = recordData; 33 | if(++Main.main.numberOfPlayers > 3) 34 | { 35 | Main.main.numberOfPlayers = 3; 36 | } 37 | 38 | super.numberOfOptions = Main.main.numberOfPlayers; 39 | super.screenOptionsCapacity = (byte)Math.min(MenuScreen.textClipHeight / AllScreens.SINGLE_TEXT_LINE_HEIGHT, super.numberOfOptions); 40 | } 41 | 42 | public final void deletePlayerRecord(byte id) 43 | { 44 | if(id < Main.main.numberOfPlayers - 1) 45 | { 46 | System.arraycopy(this.records, id + 1, this.records, id, Main.main.numberOfPlayers - id - 1); 47 | } 48 | 49 | --Main.main.numberOfPlayers; 50 | super.numberOfOptions = Main.main.numberOfPlayers; 51 | super.screenOptionsCapacity = (byte)Math.min(MenuScreen.textClipHeight / AllScreens.SINGLE_TEXT_LINE_HEIGHT, super.numberOfOptions); 52 | Main.main.currentPlayerRecordId = -1; 53 | } 54 | 55 | public final void keyPressed(int key_pressed) 56 | { 57 | switch(key_pressed) 58 | { 59 | case Command.CANCEL: //Right soft 60 | case Canvas.FIRE: 61 | Main.main.currentPlayerRecordId = (byte)super.selectedIndex; 62 | synchronized(this) 63 | { 64 | ; 65 | } 66 | 67 | Main.main.setScreen(AllScreens.menu, (byte)14); //Load new game?? 68 | return; 69 | case Command.OK: //Left soft 70 | synchronized(this) 71 | { 72 | ; 73 | } 74 | 75 | Main.main.setScreen(AllScreens.menu, (byte)1); //Return to menu? 76 | Main.main.repaint(); 77 | return; 78 | default: 79 | super.keyPressed(key_pressed); 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /SM3D/src/code/AllScreens.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import javax.microedition.lcdui.Font; 4 | 5 | public final class AllScreens { 6 | 7 | public static short[] mainMenuTextIds; 8 | //массив с репликами, куда копируются значения из переменных ниже 9 | public static final short[] menuTextIdEmptySave = new short[]{(short)20, (short)21, (short)23, (short)24, (short)25, (short)26, (short)27}; 10 | //id реплик меню, если сейвов нет 11 | //id|реплика 12 | //20 продолжить 13 | //21 новая игра 14 | //23 настройки 15 | //24 помощь 16 | //25 об игре 17 | //26 ещё игры 18 | //27 выход 19 | public static final short[] menuTextIdSaveCreated = new short[]{(short)20, (short)21, (short)22, (short)23, (short)24, (short)25, (short)26, (short)27}; 20 | //id реплик меню, если сохранения уже были 21 | //textId|реплика | screenId 22 | //20 продолжить 4 23 | //21 новая игра 9 24 | //22 загрузка игры 10 25 | //23 настройки 1 26 | //24 помощь 1 27 | //25 об игре 2 28 | //26 ещё игры 15 29 | //27 выход 3 30 | 31 | public static final String MORE_GAMES_URL = Main.main.getAppProperty("SiteURL"); 32 | public static final int TEXT_LINE_HEIGHT_NOINDENT; 33 | public static int SymbolHeight; 34 | public static int SymbolWidth; 35 | public static final int textLineHeightPlusFour; 36 | public static final int screenClipHeight; 37 | public static final int screenClipYstart; 38 | public static final int halfScrWidth; 39 | public static final int textY; 40 | public static int menuNameXCoord; 41 | public static int menuNameYCoord; 42 | public static int rightSoftTextXCoord; 43 | public static int rightsoftTextYCoord; 44 | public static int leftSoftTextXCoord; 45 | public static int leftSoftTextYCoord; 46 | public static int listDefaultXoffset; 47 | public static final int SINGLE_TEXT_LINE_HEIGHT; 48 | //Main screens duplicate? 49 | public static Screen confirmScreen; 50 | public static Screen helpAboutScreen; 51 | public static Screen pauseScreen; 52 | public static Screen settingsScreen; 53 | public static Screen recordsScreen; 54 | public static Screen masterInventory; 55 | public static Screen loadingScreen; 56 | public static Screen menu; 57 | public static Screen menu2; //why?? useless. todo remove 58 | 59 | 60 | static 61 | { 62 | Font.getFont(0, 1, 8); 63 | TEXT_LINE_HEIGHT_NOINDENT = 15; 64 | 65 | //no use 66 | textLineHeightPlusFour = TEXT_LINE_HEIGHT_NOINDENT + -1 + 3;// (17) 67 | 68 | screenClipHeight = TEXT_LINE_HEIGHT_NOINDENT + 1 + 3;//18 69 | screenClipYstart = MainMenuScreen.scrHeight - screenClipHeight;//320-18=302 70 | halfScrWidth = MainMenuScreen.scrWidth >> 1; 71 | textY = MainMenuScreen.scrHeight - 3; 72 | listDefaultXoffset = 60;//перезаписывается 73 | SINGLE_TEXT_LINE_HEIGHT = TEXT_LINE_HEIGHT_NOINDENT + 6; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /SM3D/src/code/MasterCanvas.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import javax.microedition.lcdui.Canvas; 4 | import javax.microedition.lcdui.Command; 5 | import javax.microedition.lcdui.Graphics; 6 | import javax.microedition.m3g.Graphics3D; 7 | 8 | public final class MasterCanvas extends Canvas { //Общий канвас для обработки экранов игры 9 | 10 | public static MasterCanvas instance; 11 | public Screen currentScreen; 12 | public static Graphics graphics; 13 | 14 | public static boolean paused; 15 | public static boolean paused2; //useless?? todo remove? 16 | 17 | public MasterCanvas() { 18 | instance = this; 19 | setFullScreenMode(true); 20 | GameScene.graphics3D = Graphics3D.getInstance(); 21 | SoundAndVibro.prefetchSounds(); 22 | } 23 | 24 | public final void keyPressed(int key) //Клавиша нажата 25 | { 26 | if(currentScreen instanceof GameScreen) { 27 | Keys.updateKey(key, true); 28 | } else if( 29 | !(currentScreen instanceof MainMenuScreen) && 30 | !(currentScreen instanceof KeyboardScreen) && 31 | !(currentScreen instanceof OldDebugger)) { 32 | currentScreen.keyPressed(getGameAction(key)); 33 | } else { 34 | currentScreen.keyPressed(key); 35 | } 36 | } 37 | 38 | public final void keyReleased(int key) //Клавиша отжата 39 | { 40 | if(currentScreen instanceof GameScreen) { 41 | getGameAction(key); //why? useless 42 | } 43 | 44 | Keys.updateKey(key, false); 45 | } 46 | 47 | public final void paint(Graphics g) { 48 | PlayerHUD.graphics = graphics = g; 49 | if(currentScreen != null) currentScreen.paint(g); 50 | 51 | Thread.yield(); //Дать остальным потокам процессорное 52 | } 53 | 54 | public final int getGameAction(int key) { 55 | switch(key) { 56 | case -7: //Nokia soft right 57 | return Command.CANCEL; 58 | case -6: //Nokia soft left 59 | return Command.OK; 60 | case -5: //Nokia ok 61 | return Canvas.FIRE; 62 | default: 63 | return super.getGameAction(key); 64 | } 65 | } 66 | 67 | //USELESS??? duplicate of Main.pauseApp todo remove? 68 | //Canvas was removed from display 69 | public final void hideNotify() { 70 | if(!paused2) { 71 | paused = true; 72 | GameScene.gamePaused = true; 73 | 74 | //Если звук влючён - остановить воспроизведение 75 | if(SoundAndVibro.soundsEnabled) SoundAndVibro.stopPlayingSound(); 76 | 77 | paused2 = true; 78 | Keys.reset(); 79 | System.gc(); 80 | super.hideNotify(); 81 | } 82 | 83 | } 84 | 85 | //USELESS??? duplicate of Main.startApp todo remove? 86 | //Canvas shown on display 87 | public final void showNotify() { 88 | paused2 = false; 89 | GameScene.gamePaused = false; 90 | paused = false; 91 | System.gc(); 92 | super.showNotify(); 93 | Main.main.repaint(); 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /SM3D/src/code/SoundAndVibro.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import javax.microedition.media.Manager; 4 | import javax.microedition.media.Player; 5 | import javax.microedition.media.control.VolumeControl; 6 | 7 | public final class SoundAndVibro { 8 | 9 | public static boolean soundsEnabled = true, vibroEnabled = true; 10 | 11 | private static final Player[] players = new Player[7]; 12 | private static int lastPlayedSound = -1; //Текущий воспроизводимый звук 13 | private static long lastVibrationTime; 14 | 15 | static { 16 | //int[] var10000 = new int[]{0, 0, 0, 250, 0}; Чтение из массива не выполняется, скрыл за ненадобностью 17 | } 18 | 19 | //Последовательная загрузка звуковых файлов 20 | public static final void prefetchSounds() { 21 | 22 | for(int i = 0; i < 7; i++) { 23 | try { 24 | String path, format; 25 | 26 | //Музыка в midi 27 | if(i == 0) { 28 | path = "/gamedata/sounds/" + i + ".mid"; 29 | format = "audio/midi"; 30 | } else { 31 | path = "/gamedata/sounds/" + i + ".amr"; 32 | format = "audio/amr"; 33 | } 34 | 35 | players[i] = Manager.createPlayer(MathUtils.getFileStream(path), format); 36 | 37 | //Подготовка звука для загрузки и воспроизведения 38 | players[i].realize(); 39 | if(i != 0) players[i].prefetch(); 40 | 41 | //Установить громкость в 80% (зачем лол) 42 | VolumeControl volumeControl = (VolumeControl) players[i].getControl("VolumeControl"); 43 | volumeControl.setLevel(80); 44 | 45 | } catch (Exception e) { 46 | players[i] = null; 47 | System.out.print("Sound load error:"+i); 48 | e.printStackTrace(); 49 | } 50 | } 51 | } 52 | 53 | //Воспроизвести выбранный звук 54 | public static final void playSound(int sound) { 55 | if(sound >= 0 && soundsEnabled) { 56 | //Остановить воспроизведение активного звука 57 | stopPlayingSound(); 58 | 59 | try { 60 | players[sound].start(); 61 | } catch (Exception e) { 62 | e.printStackTrace(); 63 | } 64 | 65 | //Запись в переменную текущего проигрываемого звука 66 | lastPlayedSound = sound; 67 | } 68 | } 69 | 70 | public static void stopTooLongVibro() { 71 | if(lastVibrationTime != 0 && GameScene.gameTimeUnpaused - lastVibrationTime >= 200L) { 72 | Main.main.vibrate(0); //Остановить вибрацию телефона 73 | lastVibrationTime = 0; 74 | } 75 | } 76 | 77 | public static void vibrate(int duration) { 78 | if(vibroEnabled && duration != 0) { 79 | lastVibrationTime = GameScene.gameTimeUnpaused; 80 | Main.main.vibrate(duration); 81 | } 82 | } 83 | 84 | public static final void stopPlayingSound() { 85 | if(lastPlayedSound == -1) return; 86 | 87 | try { 88 | players[lastPlayedSound].stop(); 89 | //Переводит время воспроизведения звука на его начало 90 | players[lastPlayedSound].setMediaTime(0); 91 | } catch (Exception e) { 92 | e.printStackTrace(); 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /SM3D/src/code/MenuScreen.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import javax.microedition.lcdui.Graphics; 4 | 5 | public class MenuScreen implements Screen 6 | { 7 | //Отвечает за отображение интерфейса и надписей над правым и 8 | //левым софткеем, а также в верхней части экрана. 9 | public byte interfaceNumber; 10 | public short[][] replicsMassive; 11 | //Ссылки на объекты Screen после перехода и их ID, по левой и правой 12 | //софт клавишам 13 | public Screen[] screenTransitionRightOption; 14 | public byte[] screenIdTransitionRightOption; 15 | public Screen[] screensTransitionLeftOption; 16 | public byte[] screenIdTransitionLeftOption; 17 | 18 | //id текста 19 | public short menuNameTextId; 20 | public short leftSoftTextId; 21 | public short rightSoftTextId; 22 | public byte drawingScreenId; 23 | 24 | //текстовая зона, центральный блок 25 | public static int textClipX; //55; 26 | public static int textClipY; //70; 27 | public static int textClipWidth; //125 28 | public static int textClipHeight; //180 29 | //зона заливки, как правило весь экран 30 | public static int menuClipX; 31 | public static int menuClipY; 32 | public static int menuClipWidth; 33 | public static int menuClipHight; 34 | 35 | public MenuScreen() 36 | { 37 | setTextClipVariables(); 38 | } 39 | 40 | public boolean onShow(byte screenId) 41 | { 42 | this.menuNameTextId = this.replicsMassive[0][screenId]; 43 | this.leftSoftTextId = this.replicsMassive[1][screenId]; 44 | this.rightSoftTextId = this.replicsMassive[2][screenId]; 45 | this.drawingScreenId = screenId; 46 | return true; 47 | } 48 | 49 | public void resetVariables() {} 50 | 51 | public void paint(Graphics graphics) 52 | { 53 | //Заливаем всё чёрным фоном 54 | graphics.setClip(menuClipX, menuClipY, menuClipWidth, menuClipHight); 55 | graphics.setColor(0); 56 | graphics.fillRect(0, 0, 57 | MainMenuScreen.scrWidth, 58 | MainMenuScreen.scrHeight); 59 | //ResourceManager.drawUserInterfaceItems(graphics, 60 | // this.interfaceNumber, 0, 0); 61 | //Adaptive interface 62 | ModChanges.drawAdaptiveUI(graphics, this.interfaceNumber, 0, 0); 63 | // 64 | 65 | //Жёлтый цвет (цвет надписей по дефолту) 66 | graphics.setColor(15637809); 67 | 68 | //Надписи "Настройки", "Помощь", "Об игре", "Меню" слева вверху 69 | TextCreator.drawLineByAnchor(0, this.menuNameTextId, 70 | AllScreens.menuNameXCoord, AllScreens.menuNameYCoord, 9); 71 | 72 | //"Нет" в меню звука, слева. 73 | TextCreator.drawLineByAnchor(0, this.leftSoftTextId, 74 | AllScreens.leftSoftTextXCoord, AllScreens.leftSoftTextYCoord, 5); 75 | 76 | //"Да" в меню звука, справа. "Выбор", "Меню" 77 | TextCreator.drawLineByAnchor(0, this.rightSoftTextId, 78 | AllScreens.rightSoftTextXCoord, AllScreens.rightsoftTextYCoord, 5); 79 | } 80 | 81 | public void keyPressed(int key) {} //заглушка 82 | 83 | private static void setTextClipVariables() 84 | { 85 | textClipX = 55; 86 | textClipY = 70; 87 | textClipWidth = 125; 88 | textClipHeight = 180; 89 | textClipX = ModChanges.getTextClipVars(textClipX); 90 | textClipY = ModChanges.getTextClipVars(textClipY); 91 | textClipWidth = ModChanges.getTextClipVars(textClipWidth); 92 | textClipHeight = ModChanges.getTextClipVars(textClipHeight); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /SM3D/src/code/Keys.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import javax.microedition.lcdui.Canvas; 4 | 5 | public final class Keys { 6 | 7 | public static boolean wasPressed; //Unused. todo remove? 8 | 9 | public static boolean up, down, left, right, fire; 10 | public static boolean leftSoft, rightSoft; 11 | 12 | public static boolean num1, num2, num3; 13 | public static boolean num4, num5, num6; 14 | public static boolean num8; 15 | public static boolean star, num0, pound; 16 | 17 | public static boolean leftAccelerate, rightAccelerate, upAccelerate, downAccelerate; 18 | 19 | public static long leftOr4PressTime = -1L; 20 | public static long righOr6PressTime = -1L; 21 | public static long upOr2PressTime = -1L; 22 | public static long downOr8PressTime = -1L; 23 | 24 | public static final void reset() { 25 | wasPressed = false; 26 | 27 | leftSoft = rightSoft = false; 28 | up = down = left = right = fire = false; 29 | num1 = num2 = num3 = false; 30 | num4 = num5 = num6 = false; 31 | num8 = false; 32 | star = num0 = pound = false; 33 | } 34 | 35 | public static final void updateKey(int key, boolean pressed) { 36 | wasPressed |= pressed; 37 | 38 | switch(key) { 39 | case -7: //nokia right soft 40 | rightSoft = pressed; 41 | break; 42 | case -6: //nokia left soft 43 | leftSoft = pressed; 44 | break; 45 | case -5: //Nokia ok 46 | fire = pressed; 47 | break; 48 | case -4: //Nokia right 49 | righOr6PressTime = pressed ? System.currentTimeMillis() : -1L; 50 | right = pressed; 51 | break; 52 | case -3: //Nokia left 53 | leftOr4PressTime = pressed ? System.currentTimeMillis() : -1L; 54 | left = pressed; 55 | break; 56 | case -2: //Nokia down 57 | downOr8PressTime = pressed ? System.currentTimeMillis() : -1L; 58 | down = pressed; 59 | break; 60 | case -1: //Nokia up 61 | upOr2PressTime = pressed ? System.currentTimeMillis() : -1L; 62 | up = pressed; 63 | break; 64 | case Canvas.KEY_POUND: 65 | pound = pressed; 66 | break; 67 | case Canvas.KEY_STAR: 68 | star = pressed; 69 | break; 70 | case Canvas.KEY_NUM0: 71 | num0 = pressed; 72 | break; 73 | case Canvas.KEY_NUM1: 74 | num1 = pressed; 75 | break; 76 | case Canvas.KEY_NUM2: 77 | upOr2PressTime = pressed ? System.currentTimeMillis() : -1L; 78 | num2 = pressed; 79 | break; 80 | case Canvas.KEY_NUM3: 81 | num3 = pressed; 82 | break; 83 | case Canvas.KEY_NUM4: 84 | leftOr4PressTime = pressed ? System.currentTimeMillis() : -1L; 85 | num4 = pressed; 86 | break; 87 | case Canvas.KEY_NUM5: 88 | num5 = pressed; 89 | break; 90 | case Canvas.KEY_NUM6: 91 | righOr6PressTime = pressed ? System.currentTimeMillis() : -1L; 92 | num6 = pressed; 93 | break; 94 | case Canvas.KEY_NUM8: 95 | downOr8PressTime = pressed ? System.currentTimeMillis() : -1L; 96 | num8 = pressed; 97 | break; 98 | } 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /SM3D/src/code/MathUtils.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import java.io.DataInputStream; 4 | import java.util.Random; 5 | 6 | public final class MathUtils { 7 | 8 | private static final Random random = new Random(System.currentTimeMillis()); 9 | public static int framesCount = 0; 10 | public static long previousTime = System.currentTimeMillis(); 11 | public static int fps = 30; 12 | 13 | public static final int getRandomNumber(int max) //Случайное число в пределах [0, max) 14 | { 15 | return (random.nextInt() & Integer.MAX_VALUE) % max; 16 | } 17 | 18 | //https://developer.download.nvidia.com/cg/acos.html 19 | public static double acos(float x) { 20 | boolean negate = x < 0; 21 | 22 | x = Math.abs(x); 23 | double ret = -0.0187293; 24 | ret = ret * x; 25 | ret = ret + 0.0742610; 26 | ret = ret * x; 27 | ret = ret - 0.2121144; 28 | ret = ret * x; 29 | ret = ret + 1.5707288; 30 | ret = ret * Math.sqrt(1.0 - x); 31 | 32 | if(negate) ret = Math.PI - ret; 33 | 34 | return ret / Math.PI * 180; 35 | } 36 | 37 | public static float distance2D(float x1, float y1, float x2, float y2) { 38 | return (float) Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); 39 | } 40 | 41 | public static float distance3D(float x1, float y1, float z1, float x2, float y2, float z2) { 42 | return (float) Math.sqrt( 43 | (x2 - x1) * (x2 - x1) 44 | + (y2 - y1) * (y2 - y1) 45 | + (z2 - z1) * (z2 - z1) 46 | ); 47 | } 48 | 49 | public static final int isPositiveOrNegative(int x) //Число больше нуля? 50 | { 51 | return x > 0 ? 1 : (x < 0 ? -1 : 0); //1 если больше. -1 если меньше. 0 если равно нулю ^^ 52 | } 53 | 54 | public static final int calcFps() { 55 | long time = System.currentTimeMillis(); 56 | long measureTime = time - previousTime; 57 | 58 | if(measureTime > 1000L) { 59 | //todo зачем здесь * measureTime / 1000 60 | fps = Math.max(1, (int) (framesCount * measureTime / 1000)); 61 | //"fps: " + fps; В оригинале вывода не было 62 | //System.out.println("fps: " + fps); 63 | 64 | framesCount = 0; 65 | previousTime = time; 66 | } else { 67 | framesCount++; 68 | } 69 | 70 | return fps; 71 | } 72 | 73 | public static final DataInputStream getFileStream(String file) //Загрузить в память конкретный объект 74 | { 75 | return new DataInputStream(Main.main.getClass().getResourceAsStream(file)); 76 | } 77 | 78 | public static short[] removeItemFromList(short[] items, int index) { 79 | short[] newItems; 80 | 81 | if(index == items.length - 1) //Если предмет в конце списка 82 | { 83 | newItems = new short[index]; 84 | System.arraycopy(items, 0, newItems, 0, index); 85 | } else { 86 | //todo можно упростить ? 87 | for(int i = index; i < items.length - 1; i++) { 88 | items[i] = items[i + 1]; 89 | items[i + 1] = -1; 90 | } 91 | 92 | int newLength = 0; 93 | for(int i = 0; i < items.length; i++) { 94 | if(items[i] == -1) { 95 | newLength = i; 96 | break; 97 | } 98 | } 99 | 100 | newItems = new short[newLength]; 101 | System.arraycopy(items, 0, newItems, 0, newLength); 102 | } 103 | 104 | return newItems; 105 | } 106 | 107 | public static int clamp(int value, int min, int max) 108 | { 109 | Math.min(Math.max(value, min), max); 110 | return value; 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /SM3D/src/code/CentralText.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import javax.microedition.lcdui.Graphics; 4 | 5 | public class CentralText extends MenuScreen { 6 | //отрисовывает текст по центру в нескольких местах по игре 7 | 8 | public CentralText() { 9 | super.replicsMassive = new short[][]{{(short) 0, (short) 21, (short) 18, 10 | (short) 27, (short) 19, (short) 16}, {(short) 0, (short) 7, (short) 4, 11 | (short) 4, (short) 4, (short) 7}, {(short) 0, (short) 2, (short) 3, 12 | (short) 3, (short) 3, (short) 2}, {(short) 0, (short) 28, 13 | (short) 33, (short) 32, (short) 34, (short) 16}}; 14 | //id текстовых фраз, выводимых на экран в главном меню 15 | //0 16 | //21 новая игра 17 | //18 18 | //27 выход 19 | //19 20 | //16 Переписать? 21 | //7 Отмена 22 | //4 Нет 23 | //3 Да 24 | //2 Ок 25 | //28 Начать новую игру? 26 | //33 Покинуть игру? 27 | //32 Покинуть приложение? 28 | //34 Включить звук? 29 | //16 Переписать 30 | super.screenIdTransitionRightOption = new byte[]{ 31 | (byte) 0, (byte) 1, 32 | (byte) 1, (byte) 10, 33 | (byte) 1, (byte) 2}; 34 | //На какой экран переключается игра при нажатии правой софт-клавиши 35 | super.screenIdTransitionLeftOption = new byte[]{ 36 | (byte) 0, (byte) 1, 37 | (byte) 14, (byte) 1, 38 | (byte) 16, (byte) 2}; 39 | //То же - для левой 40 | } 41 | 42 | //Задаёт экраны, к которым будет переход после нажатия софтовых клавиш 43 | public final void resetVariables() { 44 | super.screenTransitionRightOption = new Screen[]{ 45 | AllScreens.menu2, 46 | AllScreens.loadingScreen, 47 | AllScreens.menu, 48 | AllScreens.menu2, 49 | AllScreens.menu, 50 | AllScreens.loadingScreen}; 51 | super.screensTransitionLeftOption = new Screen[]{ 52 | AllScreens.menu2, 53 | AllScreens.menu, 54 | AllScreens.menu2, 55 | AllScreens.menu, 56 | AllScreens.menu, 57 | AllScreens.pauseScreen}; 58 | } 59 | 60 | public boolean onShow(byte screenId) { 61 | super.onShow(screenId); 62 | super.interfaceNumber = 50; 63 | return true; 64 | } 65 | 66 | public void paint(Graphics graphics) { 67 | MenuScreen.menuClipX = 0; 68 | MenuScreen.menuClipY = 0; 69 | MenuScreen.menuClipWidth = MainMenuScreen.scrWidth; 70 | MenuScreen.menuClipHight = MainMenuScreen.scrHeight; 71 | super.paint(graphics); 72 | graphics.setColor(0); 73 | graphics.fillRect(MainMenuScreen.scrWidth / 5, 74 | MainMenuScreen.scrHeight / 5, 75 | 3 * MainMenuScreen.scrWidth / 5, 76 | 3 * MainMenuScreen.scrHeight / 5); 77 | if (!(this instanceof KeyboardScreen)) {// надпись по центру 78 | //TextCreator.drawLineByAnchor(0, super.replicsMassive[3][super.drawingScreenId], MenuScreen.textClipX + (MenuScreen.textClipWidth >> 1), MenuScreen.textClipY + (MenuScreen.textClipHeight >> 1), 9) 79 | TextCreator.drawLineByAnchor(0, super.replicsMassive[3][super.drawingScreenId], MenuScreen.textClipX + (MenuScreen.textClipWidth >> 1), MenuScreen.textClipY + (MenuScreen.textClipHeight >> 1), 9); 80 | }//55+(125>>1=62)=117 70+(180>>1=90)=160 81 | } 82 | 83 | public void keyPressed(int key) //Да нет? 84 | { 85 | //Левая софт-клавиша 86 | if (key == 4) 87 | { 88 | Main.main.setScreen(super.screensTransitionLeftOption[super.drawingScreenId], super.screenIdTransitionLeftOption[super.drawingScreenId]); 89 | } else if (key == 3) { //Правая софт-клавиша 90 | Main.main.setScreen(super.screenTransitionRightOption[super.drawingScreenId], super.screenIdTransitionRightOption[super.drawingScreenId]); 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /SM3D/src/code/MasterInventoryScreen.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import javax.microedition.lcdui.Graphics; 4 | 5 | public final class MasterInventoryScreen implements Screen 6 | { 7 | 8 | public Screen screen; 9 | public Screen[] screens = new Screen[8]; 10 | public ItemsInteraction playerItemsZone; 11 | public ItemsInteraction topAreaItemsZone; 12 | public ItemDescriptionScreen itemDscrScreen; 13 | 14 | private void setItemsZones() 15 | { 16 | //Текст ниже использовался, вероятно, для дебаг-меню и отрисовки 17 | //свойств снаряжения, пока не был заменён на графическую часть 18 | //точность: 19 | //DAMAGE: 20 | //RATE OF DUERCGARGE: 21 | //BULLET FAKA: 22 | //RADIATION FAKA: 23 | //ANOMALY FAKA: 24 | //ЗДОРОВЬЕ: 25 | //СИЛА: 26 | //%%%%%%%%%%% 27 | 28 | //Окно предметов игрока 29 | int xStart = ResourceManager.getUIElementXcoord(49, 14); 30 | int yStart = ResourceManager.getUIElementYcoord(49, 14); 31 | int xEnd = ResourceManager.getUIElementXcoord(49, 15); 32 | int yEnd = ResourceManager.getUIElementYcoord(49, 15); 33 | this.playerItemsZone = new ItemsInteraction(xStart, yStart + 2, xEnd - xStart, yEnd - yStart); 34 | //Окно торгаша/тайника 35 | xStart = ResourceManager.getUIElementXcoord(49, 0); 36 | yStart = ResourceManager.getUIElementYcoord(49, 0); 37 | xEnd = ResourceManager.getUIElementXcoord(49, 1); 38 | yEnd = ResourceManager.getUIElementYcoord(49, 1); 39 | this.topAreaItemsZone = new ItemsInteraction(xStart, yStart, xEnd - xStart, yEnd - yStart); 40 | //Окно описания предметов 41 | this.itemDscrScreen = new ItemDescriptionScreen(); 42 | //Окно характеристик игрока 43 | this.itemDscrScreen.statsTextAndValues = new byte[][]{TextCreator.createTextFromLine(68), TextCreator.createTextFromLine(69), TextCreator.createTextFromLine(70), TextCreator.createTextFromLine(71), TextCreator.createTextFromLine(72), TextCreator.createTextFromLine(73), TextCreator.createTextFromLine(74), TextCreator.createTextFromLine(75)}; 44 | //id text: Пауза? 45 | short textStartId = TextCreator.textLinesAdress[60]; 46 | //id text: Меню? 47 | byte[] var6 = new byte[]{TextCreator.textLinesSymbols[textStartId + 18]}; 48 | //76 id: "%"; 63 id: " " 49 | this.itemDscrScreen.statsClosingCharacters = new byte[][]{TextCreator.createTextFromLine(76), 50 | TextCreator.createTextFromLine(76), var6, 51 | TextCreator.createTextFromLine(76), 52 | TextCreator.createTextFromLine(76), 53 | TextCreator.createTextFromLine(76), 54 | TextCreator.createTextFromLine(63), 55 | TextCreator.createTextFromLine(63)}; 56 | } 57 | 58 | //В каждом есть графический отдел и контроль над клавишами 59 | public MasterInventoryScreen() 60 | { 61 | this.screens[0] = new EmptySceneScreen(this); 62 | this.screens[1] = new EmptySceneScreen(this); 63 | this.screens[2] = new EmptySceneScreen(this); 64 | this.screens[3] = new InventoryScreen(this); 65 | this.screens[4] = new EmptySceneScreen(this); 66 | this.screens[5] = new PlayerStatsScreen(this); 67 | this.screens[6] = new StashScreen(this); 68 | this.screens[7] = new TradeScreen(this); 69 | this.setItemsZones(); 70 | } 71 | 72 | public final void resetVariables() 73 | { 74 | for(int screenNumber = 0; screenNumber < this.screens.length; ++screenNumber) 75 | { 76 | this.screens[screenNumber].resetVariables(); 77 | } 78 | 79 | } 80 | 81 | public final void paint(Graphics graphics) 82 | { 83 | graphics.setColor(0); 84 | graphics.fillRect(0, 0, MainMenuScreen.scrWidth, MainMenuScreen.scrHeight); 85 | this.screen.paint(graphics); 86 | } 87 | 88 | public final void keyPressed(int key) 89 | { 90 | this.screen.keyPressed(key); 91 | } 92 | 93 | public final boolean onShow(byte screenId) 94 | { 95 | this.screen = this.screens[screenId]; 96 | this.screen.onShow(screenId); 97 | return true; 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /SM3D/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Builds, tests, and runs the project . 7 | 8 | 83 | 84 | -------------------------------------------------------------------------------- /SM3D/src/code/KeyboardScreen.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import javax.microedition.lcdui.Graphics; 4 | import javax.microedition.rms.RecordStore; 5 | import javax.microedition.rms.RecordStoreException; 6 | 7 | public final class KeyboardScreen extends CentralText { 8 | 9 | public static final int nameHeight = AllScreens.TEXT_LINE_HEIGHT_NOINDENT + 4; 10 | public byte[] nameText = new byte[8]; 11 | public int nameLength; 12 | public byte currentSelectedSymbol; 13 | 14 | public final boolean onShow(byte screenId) { 15 | if (Main.main.numberOfPlayers == 3) { 16 | try { 17 | RecordStore.deleteRecordStore("qpmrsp"); 18 | } catch (RecordStoreException exc) { 19 | exc.printStackTrace(); 20 | } 21 | 22 | ((PlayersRecords) AllScreens.recordsScreen).deletePlayerRecord((byte) 0); 23 | ResourceManager.savePlayersRecords(); 24 | } 25 | 26 | super.onShow(screenId); 27 | this.nameLength = 0; 28 | return true; 29 | } 30 | 31 | public final void paint(Graphics graphics) { 32 | super.paint(graphics); 33 | TextCreator.drawTextByAnchor(0, this.nameText, 0, this.nameLength, MenuScreen.textClipX + (MenuScreen.textClipWidth >> 1), MenuScreen.textClipY, 9); 34 | graphics.setColor(0); 35 | graphics.fillRect(MainMenuScreen.scrWidth / 4, MainMenuScreen.scrHeight / 4 - 5, 2 * MainMenuScreen.scrWidth / 4, 2 * MainMenuScreen.scrHeight / 4 + 5); 36 | short firstSymbolAdress = TextCreator.textLinesAdress[60]; 37 | 38 | for (int currentSymbol = 0; currentSymbol < TextCreator.getLineLength(60); ++currentSymbol) { 39 | int x = MenuScreen.textClipX + currentSymbol % 5 * (MenuScreen.textClipWidth / 5) + 3; 40 | int y = MenuScreen.textClipY + currentSymbol / 5 * nameHeight + 3; 41 | TextCreator.drawTextByAnchor(0, TextCreator.textLinesSymbols, firstSymbolAdress + currentSymbol, firstSymbolAdress + currentSymbol + 1, x, y, 0); 42 | } 43 | 44 | graphics.setColor(8421504); 45 | graphics.drawRect(MenuScreen.textClipX + this.currentSelectedSymbol % 5 * (MenuScreen.textClipWidth / 5), MenuScreen.textClipY + this.currentSelectedSymbol / 5 * nameHeight, AllScreens.SymbolWidth + 6, AllScreens.SymbolHeight + 6); 46 | } 47 | 48 | public final void keyPressed(int key) { 49 | switch (key) { 50 | case -7: 51 | Main.main.addPlayerRecord(this.nameText, (byte) this.nameLength); 52 | Main.main.currentPlayerRecordId = (byte) (Main.main.numberOfPlayers - 1); 53 | Main.main.setScreen(AllScreens.loadingScreen, (byte) 5); 54 | break; 55 | case -6: 56 | if (this.nameLength > 0) { 57 | this.nameLength = Math.max(0, this.nameLength - 1); 58 | } else { 59 | Main.main.setScreen(AllScreens.menu, (byte) 1); 60 | } 61 | break; 62 | case -5: 63 | case 53: 64 | if (this.nameLength >= 8) { 65 | return; 66 | } 67 | 68 | short var2 = TextCreator.textLinesAdress[60]; 69 | byte symbolId = TextCreator.textLinesSymbols[var2 + this.currentSelectedSymbol]; 70 | this.nameText[this.nameLength++] = symbolId; 71 | break; 72 | case -4: 73 | if (this.currentSelectedSymbol < TextCreator.getLineLength(60) - 1) { 74 | ++this.currentSelectedSymbol; 75 | } 76 | break; 77 | case -3: 78 | if (this.currentSelectedSymbol > 0) { 79 | --this.currentSelectedSymbol; 80 | } 81 | break; 82 | case -2: 83 | if (this.currentSelectedSymbol / 5 < TextCreator.getLineLength(60) / 5) { 84 | this.currentSelectedSymbol = (byte) (this.currentSelectedSymbol + 5); 85 | } 86 | 87 | if (this.currentSelectedSymbol >= TextCreator.getLineLength(60)) { 88 | this.currentSelectedSymbol = (byte) (this.currentSelectedSymbol - 5); 89 | } 90 | break; 91 | case -1: 92 | if (this.currentSelectedSymbol / 5 > 0) { 93 | this.currentSelectedSymbol = (byte) (this.currentSelectedSymbol - 5); 94 | } 95 | } 96 | 97 | Main.main.repaint(); 98 | } 99 | 100 | } 101 | -------------------------------------------------------------------------------- /SM3D/src/code/Main.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import javax.microedition.lcdui.Display; 4 | import javax.microedition.midlet.MIDlet; 5 | 6 | public class Main extends MIDlet 7 | { //крик души 8 | 9 | public static Main main; 10 | 11 | private static Display display; 12 | private MasterCanvas canvas; 13 | 14 | private Screen menu; 15 | private Screen loadingScreen; 16 | private Screen gameScreen; 17 | private Screen masterInventory; 18 | 19 | private MenuScreen confirmScreen; 20 | MenuScreen keyboardScreen; 21 | private MenuScreen helpScreen; 22 | private MenuScreen pauseScreen; 23 | private MenuScreen settingsScreen; 24 | private MenuScreen recordsScreen; 25 | 26 | public byte currentPlayerRecordId = -1; 27 | public byte numberOfPlayers; 28 | public static Screen currentScreen; 29 | public static byte currentScreenId; 30 | 31 | 32 | public Main() 33 | { 34 | main = this; 35 | OldDebugger.restartDebuggers("players"); 36 | display = Display.getDisplay(main); 37 | canvas = new MasterCanvas(); 38 | AllScreens.loadingScreen = loadingScreen = new LoadingScreen(ResourceManager.interfaceImages[0]); 39 | AllScreens.recordsScreen = recordsScreen = new PlayersRecords(); 40 | AllScreens.settingsScreen = settingsScreen = new SettingsScreen(); 41 | gameScreen = new GameScreen(); 42 | display.setCurrent(canvas); 43 | setScreen(loadingScreen, (byte)0); 44 | repaint(); 45 | } 46 | 47 | public final void initializeScreens() 48 | { 49 | AllScreens.confirmScreen = confirmScreen = new CentralText(); 50 | keyboardScreen = new KeyboardScreen(); 51 | AllScreens.helpAboutScreen = helpScreen = new HelpAboutScreen(); 52 | AllScreens.pauseScreen = pauseScreen = new ListScreen(); 53 | AllScreens.masterInventory = masterInventory = new MasterInventoryScreen(); 54 | AllScreens.menu = menu = new MainMenuScreen(); 55 | AllScreens.menu2 = AllScreens.menu; //why?? useless. todo remove 56 | 57 | loadingScreen.resetVariables(); 58 | confirmScreen.resetVariables(); 59 | keyboardScreen.resetVariables(); 60 | helpScreen.resetVariables(); 61 | pauseScreen.resetVariables(); 62 | settingsScreen.resetVariables(); 63 | masterInventory.resetVariables(); 64 | menu.resetVariables(); 65 | } 66 | 67 | public final void startApp() 68 | { 69 | if(MasterCanvas.paused) 70 | { 71 | MasterCanvas.paused2 = false; 72 | MasterCanvas.paused = false; 73 | GameScene.gamePaused = false; 74 | System.gc(); 75 | main.repaint(); 76 | } 77 | 78 | } 79 | 80 | public final void pauseApp() 81 | { 82 | if(!MasterCanvas.paused2) 83 | { 84 | MasterCanvas.paused = true; 85 | GameScene.gamePaused = true; 86 | SoundAndVibro.stopPlayingSound(); 87 | MasterCanvas.paused2 = true; 88 | System.gc(); 89 | Keys.reset(); 90 | } 91 | } 92 | 93 | public final void destroyApp(boolean var1) 94 | { 95 | ResourceManager.saveSettings(); 96 | this.notifyDestroyed(); 97 | } 98 | 99 | public final void setScreen(Screen scr, byte screenId) 100 | { 101 | currentScreen = scr; 102 | currentScreenId = screenId; 103 | 104 | if(scr.onShow(screenId)) 105 | { 106 | canvas.currentScreen = scr; 107 | canvas.repaint(); 108 | System.gc(); 109 | } 110 | } 111 | 112 | public final void reloadCurrentScreen() 113 | { 114 | this.setScreen(currentScreen, currentScreenId); 115 | } 116 | 117 | public final void showGameScreen() 118 | { 119 | canvas.currentScreen = this.gameScreen; 120 | } 121 | 122 | public final void setDebugScreen(Screen scr, byte screenId) 123 | { 124 | scr.onShow(screenId); 125 | canvas.currentScreen = scr; 126 | canvas.repaint(); 127 | System.gc(); 128 | } 129 | 130 | /**В данный момент отсылается на KeyboardScreen, 131 | * но там не используется */ 132 | public final void addPlayerRecord(byte[] nameText, byte length) { 133 | byte[] recordData = new byte[length]; 134 | System.arraycopy(nameText, 0, recordData, 0, length); 135 | ((PlayersRecords)this.recordsScreen).addNewPlayerRecord(recordData); 136 | } 137 | 138 | public final byte[][] getPlayersRecords() 139 | { 140 | return ((PlayersRecords)recordsScreen).records; 141 | } 142 | 143 | public final void repaint() 144 | { 145 | this.canvas.repaint(); 146 | } 147 | 148 | public void vibrate(int duration) { 149 | display.vibrate(duration); 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /Converters/objects_parser.py: -------------------------------------------------------------------------------- 1 | import json 2 | import struct 3 | 4 | def write_binary(data, output_file): 5 | """Writes objects data to file""" 6 | 7 | with open(output_file, 'wb') as f: 8 | # Header (2 bytes) 9 | f.write(struct.pack('>B', 0x0A)) 10 | f.write(struct.pack('>B', 0xB1)) 11 | 12 | # Objects count (1 byte) 13 | f.write(struct.pack('>B', len(data))) 14 | 15 | for idx, obj in enumerate(data): 16 | # Check object_id 17 | if obj['object_id'] != idx: 18 | raise ValueError(f"object_id mismatch: expected {idx}, got {obj['object_id']}") 19 | 20 | # Main object fields 21 | f.write(struct.pack('>B', obj['model_source'])) 22 | f.write(struct.pack('>B', obj['unused_field'])) 23 | 24 | # Write model and texture name 25 | for field in ['model_name', 'texture_name']: 26 | value = obj[field].encode('utf-8') 27 | if len(value) > 255: 28 | raise ValueError(f"{field} can't take more than 255 bytes (object {idx})") 29 | 30 | f.write(struct.pack('>B', len(value))) 31 | f.write(value) 32 | 33 | # Write additional fields 34 | if obj['model_source'] == 4: 35 | # Bot data 36 | static_data = obj['static_bot_data'] 37 | f.write(struct.pack('>B', static_data['weapon_id'])) 38 | f.write(struct.pack('>B', static_data['anim_time'])) 39 | else: 40 | # M3G / Sprite data 41 | lights_data = obj['m3g_data'] 42 | f.write(struct.pack('>B', lights_data['sprite_blend_mode'])) 43 | f.write(struct.pack('>B', lights_data['m3g_id'])) 44 | 45 | # Model scale 46 | scale = int(round(obj['scale'] * 100)) 47 | f.write(struct.pack('>i', scale)) 48 | 49 | def read_str(f): 50 | return f.read(struct.unpack('>B', f.read(1))[0]).decode('utf-8') 51 | 52 | def read_binary(filename): 53 | """Reads objects data from file""" 54 | 55 | with open(filename, 'rb') as f: 56 | f.read(2) # Skip header 57 | 58 | objs_count = struct.unpack('>B', f.read(1))[0] 59 | objects = [] 60 | 61 | for obj_id in range(objs_count): 62 | obj = {} 63 | objects.append(obj) 64 | 65 | # Store object id to help keep original objects order 66 | obj['object_id'] = obj_id 67 | 68 | # Main object fields 69 | obj['model_source'] = struct.unpack('>B', f.read(1))[0] 70 | obj['unused_field'] = struct.unpack('>B', f.read(1))[0] 71 | 72 | # Read model and texture name 73 | obj['model_name'] = read_str(f) 74 | obj['texture_name'] = read_str(f) 75 | 76 | if obj['model_source'] == 4: 77 | # Bot data 78 | obj['static_bot_data'] = { 79 | 'weapon_id': struct.unpack('>B', f.read(1))[0], 80 | 'anim_time': struct.unpack('>B', f.read(1))[0] 81 | } 82 | else: 83 | # M3G / Sprite data 84 | obj['m3g_data'] = { 85 | 'sprite_blend_mode': struct.unpack('>B', f.read(1))[0], 86 | 'm3g_id': struct.unpack('>B', f.read(1))[0] 87 | } 88 | 89 | # Scale 90 | obj['scale'] = struct.unpack('>i', f.read(4))[0] / 100.0 91 | 92 | return objects 93 | 94 | if __name__ == "__main__": 95 | import argparse 96 | 97 | parser = argparse.ArgumentParser(description='Converts objects file from binary data to json and back') 98 | parser.add_argument('input', help='Input file') 99 | parser.add_argument('output', help='Output file') 100 | 101 | args = parser.parse_args() 102 | 103 | try: 104 | if args.input.lower().endswith('.json'): 105 | # Read json 106 | with open(args.input, 'r', encoding='utf-8') as f: 107 | data = json.load(f)['objects'] 108 | 109 | write_binary(data, args.output) 110 | else: 111 | # Read binary objects data 112 | output = args.input + '.json' 113 | data = read_binary(args.input) 114 | 115 | with open(args.output, 'w', encoding='utf-8') as f: 116 | json.dump( 117 | { 118 | "_comment": "Object IDs correspond to their original position in binary file (0-based index)", 119 | "objects": data 120 | }, 121 | f, 122 | ensure_ascii=False, 123 | indent=4 124 | ) 125 | 126 | print(f"Succesfully converted {args.input}") 127 | except Exception as e: 128 | print(f"Convertation error: {str(e)}") -------------------------------------------------------------------------------- /SM3D/src/code/HelpAboutScreen.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import java.util.Vector; 4 | import javax.microedition.lcdui.Graphics; 5 | 6 | public final class HelpAboutScreen extends MenuScreen { 7 | 8 | public short textId; 9 | private static final short[] ABOUT_TEXT_IDS = new short[]{(short)392, (short)393, (short)379, (short)380, (short)381, (short)382, (short)383, (short)384, (short)395, (short)396, (short)397}; 10 | //id text 11 | //392 S.T.A.L.K.E.R. 12 | //393 Version 1.1.0 13 | //379 (C) Developer: 14 | //380 Qplaze 15 | //381 www.qplaze.com 16 | //382 (C) Publisher: 17 | //383 Nomoc 18 | //384 www.nomoc.com 19 | public int yStart; 20 | public int textLinesCount; 21 | public Vector textLinesStartsEnds; 22 | 23 | 24 | public HelpAboutScreen() 25 | { 26 | super.replicsMassive = new short[][]{{(short)0, (short)24, (short)25, (short)17}, {(short)0, (short)0, (short)0, (short)0}, {(short)0, (short)1, (short)1, (short)1}, {(short)0, (short)30, (short)31, (short)35}}; 27 | //id text 28 | //0 29 | //24 help 30 | //25 about 31 | //17 message 32 | //0 33 | //0 34 | //0 35 | //0 36 | //0 37 | //1 menu 38 | //1 menu 39 | //1 menu 40 | //0 41 | //30 42 | /*Help.Control: 43 | Soft key1 - exit to menu. 44 | Soft key2 - change weapon. 45 | 1 - reload weapon. 46 | 2,up - move the sight up. 47 | 3 - fast first-aid kit. 48 | 4,left - move the sight to the left. 49 | 5,select - fire, confirm action. 50 | 6,right - move the sight to the right. 51 | 8,down - move the sight down. 52 | o - go back. 53 | # - telescopic sight (if available).*/ 54 | //31 here we are 55 | //35 Too many players. Delete some record 56 | this.yStart = MenuScreen.textClipY; 57 | this.textLinesCount = 0; 58 | this.textLinesStartsEnds = new Vector(); 59 | } 60 | 61 | public final void resetVariables() { 62 | super.screensTransitionLeftOption = new Screen[]{ 63 | AllScreens.menu2, AllScreens.menu, 64 | AllScreens.menu, AllScreens.menu}; 65 | } 66 | 67 | public final boolean onShow(byte screenId) { 68 | super.onShow(screenId); 69 | this.textId = super.replicsMassive[3][screenId]; 70 | super.interfaceNumber = 44; 71 | this.textLinesCount = 0; 72 | this.yStart = MenuScreen.textClipY; 73 | return true; 74 | } 75 | 76 | private static void drawAboutText() 77 | { 78 | for(byte id = 0; id < 11; ++id) 79 | { 80 | int x = MainMenuScreen.scrWidth / 81 | 2 - TextCreator.getWideLineWidth(1, ABOUT_TEXT_IDS[id]) / 2; 82 | TextCreator.drawLineByAnchor(1, ABOUT_TEXT_IDS[id], 83 | x, MenuScreen.textClipY + 84 | AllScreens.TEXT_LINE_HEIGHT_NOINDENT * id + 20, 0); 85 | } 86 | } 87 | 88 | public final void paint(Graphics graphics) 89 | { 90 | MenuScreen.menuClipX = 0; 91 | MenuScreen.menuClipY = 0; 92 | MenuScreen.menuClipWidth = MainMenuScreen.scrWidth; 93 | MenuScreen.menuClipHight = MainMenuScreen.scrHeight; 94 | super.paint(graphics); 95 | //если окно "Об игре" 96 | if(this.textId == 31) 97 | { 98 | drawAboutText(); 99 | } 100 | //если окно "Помощь" 101 | else 102 | { 103 | this.textLinesStartsEnds = TextCreator.splitOnLines(this.textId, MenuScreen.textClipWidth + 15, 1); 104 | this.textLinesCount = 0; 105 | graphics.setClip(MenuScreen.textClipX, MenuScreen.textClipY, MenuScreen.textClipWidth + 15, MenuScreen.textClipHeight); 106 | //Серый цвет текста(рамки) 107 | graphics.setColor(8421504); 108 | this.textLinesCount = this.textLinesStartsEnds.size(); 109 | TextCreator.drawReplicInsideFrame(this.textId, 110 | MenuScreen.textClipX + 5, this.yStart, 0, 1, 111 | MasterCanvas.graphics, 0, -1, this.textLinesStartsEnds); 112 | graphics.setClip(0, 0, MainMenuScreen.scrWidth, MainMenuScreen.scrHeight); 113 | this.drawScrollbar(); 114 | } 115 | } 116 | 117 | private void drawScrollbar() 118 | { 119 | int splitVertical = (this.textLinesCount + 1) * 120 | TextCreator.getSymbolHeight(1) 121 | - MenuScreen.textClipHeight; 122 | int currentYpos = Math.abs(this.yStart - MenuScreen.textClipY); 123 | int x = MenuScreen.textClipX + MenuScreen.textClipWidth + 20; 124 | int yOuter = ResourceManager.getRectangleParams(44, 4, 0)[1] + 5; 125 | int heightOuter = MenuScreen.textClipHeight + 25; 126 | //Серый цвет 127 | MasterCanvas.graphics.setColor(8421504); 128 | //Колба снаружи 129 | MasterCanvas.graphics.drawRect(x, yOuter, 5, heightOuter); 130 | int height = heightOuter * TextCreator.getSymbolHeight(1) 131 | / splitVertical; 132 | int yInner = yOuter + heightOuter * currentYpos / splitVertical; 133 | //Водка внутри 134 | MasterCanvas.graphics.fillRect(x, yInner, 5, height); 135 | } 136 | 137 | public final void keyPressed(int key) { 138 | switch (key) { 139 | //Промотка текста вниз 140 | case 1: 141 | if (this.yStart < MenuScreen.textClipY) { 142 | this.yStart += TextCreator.getSymbolHeight(1); 143 | } 144 | Main.main.repaint(); 145 | return; 146 | //Возврат в главное меню 147 | case 3: 148 | Main.main.setScreen(super.screensTransitionLeftOption[super.drawingScreenId], (byte) 1); 149 | //Промотка текста вверх 150 | case 6: 151 | if (this.yStart + this.textLinesCount 152 | * TextCreator.getSymbolHeight(1) > MenuScreen.textClipY 153 | + MenuScreen.textClipHeight) { 154 | this.yStart -= TextCreator.getSymbolHeight(1); 155 | } 156 | Main.main.repaint(); 157 | default: 158 | } 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /SM3D/src/code/InventoryScreen.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import java.io.IOException; 4 | import javax.microedition.lcdui.Graphics; 5 | 6 | public final class InventoryScreen implements Screen 7 | { 8 | 9 | public ItemDescriptionScreen itemDscrScreen; 10 | public ItemsInteraction itemsInteraction; 11 | public MasterInventoryScreen masterInvScreen; 12 | 13 | 14 | public InventoryScreen(MasterInventoryScreen directLink) 15 | { 16 | this.masterInvScreen = directLink; 17 | } 18 | 19 | public final void resetVariables() {} 20 | 21 | public static short getItemDescrTextId(short itemId) 22 | { 23 | return (short)(311 + (itemId - 101)); 24 | } 25 | 26 | public final void paint(Graphics graphics) 27 | { 28 | //Отрисовка основы UI и задание рабочей области 29 | ResourceManager.drawUserInterfaceItems(graphics, 38, 0, 0); 30 | graphics.setClip(0, 0, MainMenuScreen.scrWidth, MainMenuScreen.scrHeight); 31 | 32 | //Рисуем кнопки. id 6: Назад 33 | PlayerHUD.drawSoftButtonNames(0, 1, 6, true); 34 | ResourceManager.drawUserInterfaceItems(MasterCanvas.graphics, 78, 0, 0); 35 | ResourceManager.drawUserInterfaceItems(MasterCanvas.graphics, 80, 0, 0); 36 | 37 | //Рисуем поле с текущим/максимальным переносимым весом 38 | byte[] currentPlayerWeight = TextCreator.createTextFromNumberSeparated(Scripts.playerWeight); 39 | //"кг/" 40 | byte[] kgSlash = TextCreator.createTextFromLine(65); 41 | byte[] leftPartText = TextCreator.combineText(currentPlayerWeight, kgSlash); 42 | byte[] maxPlayerWeight = TextCreator.createTextFromNumber(Scripts.playerMaxWeight / 10); 43 | //"кг" 44 | byte[] kg = TextCreator.createTextFromLine(64); 45 | byte[] rightPartText = TextCreator.combineText(maxPlayerWeight, kg); 46 | byte[] finalText = TextCreator.combineText(leftPartText, rightPartText); 47 | int x_dest = ResourceManager.getUIElementXcoord(39, 20); 48 | int y_dest = ResourceManager.getUIElementYcoord(39, 20); 49 | TextCreator.drawWeightTextByAnchor(1, finalText, 50 | 0, finalText.length, x_dest, y_dest, 5); 51 | 52 | //Поле с весом выбранного предмета (дописываем КГ в конце) 53 | finalText = TextCreator.combineText(TextCreator.createTextFromNumberSeparated(Scripts.getItemWeight(Scripts.inventoryItems[ItemsInteraction.selectedInventoryItem])), TextCreator.createTextFromLine(64)); 54 | x_dest = ResourceManager.getUIElementXcoord(39, 19); 55 | y_dest = ResourceManager.getUIElementYcoord(39, 19); 56 | TextCreator.drawWeightTextByAnchor(1, finalText, 57 | 0, finalText.length, x_dest, y_dest, 5); 58 | 59 | 60 | short[] moneyText; 61 | //106 - символ доллара 62 | (moneyText = TextCreator.makeColoredTextFromNumber(Scripts.playerMoney, 63 | false))[moneyText.length - 1] = 106; 64 | x_dest = ResourceManager.getUIElementXcoord(39, 21); 65 | y_dest = ResourceManager.getUIElementYcoord(39, 21); 66 | TextCreator.drawColoredText(moneyText, x_dest, y_dest, 3); 67 | 68 | PlayerHUD.drawDamageIndicatorAndHealthBar(true); 69 | 70 | //Если выбран экипированный предмет, но это не Форт-12 71 | if(Scripts.isItemEquipped(Scripts.inventoryItems[ItemsInteraction.selectedInventoryItem]) && 72 | Scripts.inventoryItems[ItemsInteraction.selectedInventoryItem] != 116) 73 | { 74 | //текст: take off/снять 75 | PlayerHUD.drawSoftButtonNames(1, 0, 374, true); 76 | } 77 | else 78 | { 79 | //текст id: take/взять 80 | PlayerHUD.drawSoftButtonNames(1, 0, 373, true); 81 | } 82 | 83 | //Заполняем описание предмета в инвентаре и подсвечиваем его 84 | this.masterInvScreen.itemDscrScreen.descrText = 85 | getItemDescrTextId(Scripts.inventoryItems[ItemsInteraction.selectedInventoryItem]); 86 | this.masterInvScreen.itemDscrScreen.paint(graphics); 87 | ItemsInteraction.drawOrder = 1; 88 | this.masterInvScreen.playerItemsZone.paint(graphics); 89 | this.masterInvScreen.playerItemsZone.highlightSelectedItem(graphics); 90 | } 91 | 92 | public final void keyPressed(int key) 93 | { 94 | switch(key) 95 | { 96 | case 1: 97 | case 6: 98 | case 7: 99 | default: 100 | break; 101 | case 2: 102 | this.itemsInteraction.keyPressed(2); 103 | break; 104 | //Вернуться в меню игровой паузы 105 | case 3: 106 | Main.main.setScreen(AllScreens.pauseScreen, (byte)2); 107 | break; 108 | case 4: 109 | //Использовать предмет 110 | case 8: 111 | if(Scripts.isItemEquipped(Scripts.inventoryItems[ItemsInteraction.selectedInventoryItem])) 112 | { 113 | Scripts.unequipItem(Scripts.inventoryItems[ItemsInteraction.selectedInventoryItem]); 114 | } 115 | else 116 | { 117 | Scripts.useItem(Scripts.inventoryItems[ItemsInteraction.selectedInventoryItem]); 118 | } 119 | 120 | this.masterInvScreen.playerItemsZone.onShow((byte)1); 121 | break; 122 | case 5: 123 | this.itemsInteraction.keyPressed(5); 124 | } 125 | 126 | Main.main.repaint(); 127 | } 128 | 129 | public final boolean onShow(byte screenId) 130 | { 131 | this.itemDscrScreen = this.masterInvScreen.itemDscrScreen; 132 | this.itemDscrScreen.resetVariables(); 133 | 134 | //Задаём фреймворк для окна с названием предмета 135 | int xStart = ResourceManager.getUIElementXcoord(39, 15);//Левый край 142 136 | int xEnd = ResourceManager.getUIElementXcoord(39, 16);//Правый край 216 137 | int yStart = ResourceManager.getUIElementYcoord(39, 15);//Верхний край 54 138 | int yEnd = ResourceManager.getUIElementYcoord(39, 18);//Нижний край 206 139 | this.itemDscrScreen.setNameFrameLocation(xStart, xEnd, yStart); 140 | 141 | //Задаём фреймворк для окна описания 142 | xStart = ResourceManager.getUIElementXcoord(39, 17);//137 143 | xEnd = ResourceManager.getUIElementXcoord(39, 18);//215 144 | this.itemDscrScreen.setDescriptionFrameLocation(xStart, yStart, xEnd - xStart, yEnd - yStart);//137,54,78,152 145 | this.itemsInteraction = this.masterInvScreen.playerItemsZone; 146 | this.itemsInteraction.onShow((byte)1); 147 | return true; 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /SM3D/src/code/LoadingScreen.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import javax.microedition.lcdui.Graphics; 4 | import javax.microedition.lcdui.Image; 5 | 6 | public final class LoadingScreen implements Screen { 7 | 8 | public static final byte[] statesList = new byte[]{1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}; 9 | public static final byte[] thingsToLoad = new byte[]{0, 3, 6, 4, 7, 5, 5, 9, 10, 11, 12}; 10 | 11 | public static Screen[] screens; 12 | public static final byte[] screenIds = new byte[]{(byte) 1, (byte) 2, (byte) 2, (byte) 1, (byte) 14, (byte) 14, (byte) 1, (byte) 14, (byte) 14, (byte) 14, (byte) 14}; 13 | private Screen screen; 14 | private byte screenId; 15 | private Timer timer = new Timer(false, 3000L); 16 | 17 | private Image logo; 18 | private int state = 1; 19 | private int toLoad; 20 | private int framesDrawn; 21 | 22 | public LoadingScreen(Image logo) { 23 | this.logo = logo; 24 | } 25 | 26 | public final boolean onShow(byte screenId) { 27 | this.state = statesList[screenId]; 28 | this.toLoad = thingsToLoad[screenId]; 29 | 30 | if(screenId != 0) { 31 | this.screen = screens[screenId]; 32 | this.screenId = screenIds[screenId]; 33 | } 34 | 35 | return true; 36 | } 37 | 38 | public final void resetVariables() { 39 | screens = new Screen[]{AllScreens.menu2, AllScreens.pauseScreen, AllScreens.pauseScreen, AllScreens.menu, AllScreens.menu2, AllScreens.menu, AllScreens.settingsScreen, AllScreens.menu, AllScreens.menu, AllScreens.menu, AllScreens.menu}; 40 | } 41 | 42 | public static void RunGarbageCollector() { 43 | //System.gc(); 44 | ++PlayerHUD.garbageCollected; 45 | } 46 | 47 | public final void paint(Graphics g) { 48 | switch(state) { 49 | case 1: 50 | g.drawImage(logo, 0, 0, 0); 51 | 52 | framesDrawn++; 53 | if(framesDrawn > 2) { 54 | nextState(); 55 | framesDrawn = 0; 56 | return; 57 | } 58 | 59 | Main.main.repaint(); 60 | MasterCanvas.instance.serviceRepaints(); 61 | break; 62 | case 2: 63 | g.setColor(0); //0 64 | g.fillRect(0, 0, 65 | MainMenuScreen.scrWidth, 66 | MainMenuScreen.scrHeight 67 | ); 68 | 69 | TextCreator.drawLineByAnchor(0, 41, MainMenuScreen.scrWidth / 2 - 20, MainMenuScreen.scrHeight / 2 - TextCreator.getSymbolHeight(0) / 2, 0); 70 | 71 | framesDrawn++; 72 | if(framesDrawn > 2) { 73 | nextState(); 74 | framesDrawn = 0; 75 | } 76 | 77 | Main.main.repaint(); 78 | MasterCanvas.instance.serviceRepaints(); 79 | break; 80 | default: 81 | System.out.println("wtf??? 699"); 82 | } 83 | } 84 | 85 | public final void keyPressed(int var1) { 86 | } 87 | 88 | private void nextState() { 89 | switch(state) //на стартовой заставке 1// 90 | { 91 | case 1: 92 | loadGameStuff(); 93 | 94 | //Unload logo 95 | ResourceManager.interfaceImages[0] = null; 96 | System.gc(); 97 | 98 | if(SoundAndVibro.soundsEnabled) { 99 | Main.main.setScreen(AllScreens.confirmScreen, (byte) 4); 100 | return; 101 | } 102 | 103 | Main.main.setScreen(AllScreens.menu, (byte) 1); 104 | return; 105 | case 2: 106 | this.gamePreload(); 107 | Main.main.setScreen(this.screen, this.screenId); 108 | default: 109 | } 110 | } 111 | 112 | private void gamePreload() //загрузка и начало новой игры, сохранение настроек 113 | { 114 | switch(this.toLoad) { 115 | case 4: //сохранение игровых настроек 116 | ResourceManager.saveSettings(); 117 | break; 118 | case 5: 119 | ResourceManager.savePlayersRecords(); 120 | case 6: 121 | case 7: 122 | case 9: 123 | case 10: 124 | default: 125 | break; 126 | case 8: 127 | ResourceManager.removeLogoImageFromMemory(); 128 | break; 129 | case 11: //начало новой игры 130 | GameScene.setDialogWindowState((short) -2); 131 | GameScene.init(); 132 | break; 133 | case 12: //загрузка сохранённой игры 134 | ResourceManager.loadGameSave(); 135 | PlayerHUD.loadLocationsCoordinates(); 136 | Scripts.openPDA(); 137 | } 138 | 139 | ResourceManager.loadingState = 0; 140 | } 141 | 142 | private void loadGameStuff() { 143 | ResourceManager.loadingState = 1; 144 | if(ResourceManager.loadingState == 1) { 145 | try { 146 | TextCreator.loadTextSymbols(ResourceManager.data, 0); //загрузка параметров 147 | TextCreator.loadTextSymbols(ResourceManager.data, 1); //загрузка параметров 148 | TextCreator.loadTextLines(ResourceManager.data); //загрузка текста и его параметров 149 | ResourceManager.getInterfaceData(ResourceManager.data); //загрузка параметров изображений интерфейса 150 | AllScreens.SymbolHeight = TextCreator.getSymbolHeight(1); 151 | AllScreens.SymbolWidth = TextCreator.getSymbolWidth(1, 10); 152 | } catch (Exception var2) { 153 | var2.printStackTrace(); 154 | } 155 | 156 | TextCreator.setColoredDigitsId(); 157 | Main.main.initializeScreens(); 158 | ResourceManager.loadAllInterfaceImages(); 159 | ResourceManager.loadSettings(); 160 | } 161 | 162 | Main.main.repaint(); 163 | 164 | while(this.timer.getTimerState() != 0) { 165 | Thread.yield(); 166 | } 167 | 168 | this.logo = null; 169 | ResourceManager.logoImageLoaded = true; 170 | ResourceManager.loadingState = 8; 171 | } 172 | 173 | } 174 | -------------------------------------------------------------------------------- /SM3D/src/code/Bot.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import java.io.DataInputStream; 4 | import java.io.IOException; 5 | import javax.microedition.m3g.Appearance; 6 | import javax.microedition.m3g.CompositingMode; 7 | import javax.microedition.m3g.Group; 8 | import javax.microedition.m3g.Light; 9 | import javax.microedition.m3g.Loader; 10 | import javax.microedition.m3g.Material; 11 | import javax.microedition.m3g.Mesh; 12 | import javax.microedition.m3g.Object3D; 13 | import javax.microedition.m3g.World; 14 | 15 | public final class Bot //Персонажи, модели, освещение, спрайты... 16 | { 17 | //Вид оружия для каждого врага, от 0 до 3. 18 | //Сами вероятности см. в NPCShootPlayer 19 | public static byte[] enemyWeaponType = new byte[10]; 20 | //Тип каждого добавленного на уровень противника (от 0 до 12) 21 | //По нему вычисляется количество получаемого опыта за убийство 22 | private static final byte[] botTypes = new byte[10]; 23 | 24 | public static void loadBot(int botType, int botId) { 25 | if(GameScene.persWorld == null) { 26 | try { 27 | String path = "/gamedata/meshes/m3g/pers.m3g"; 28 | 29 | Object3D[] objs = Loader.load(path); 30 | ModChanges.updateM3DModels(objs, path); 31 | 32 | for(int i = 0; i < objs.length; i++) { 33 | if(objs[i] instanceof World) { 34 | GameScene.persWorld = (World) objs[i]; 35 | break; 36 | } 37 | } 38 | 39 | } catch(IOException e) { 40 | System.out.println("Error at loading model pers.m3g"); 41 | e.printStackTrace(); 42 | } 43 | } 44 | 45 | botTypes[botId] = (byte) botType; 46 | 47 | if(GameScene.roomBotGroups[botId] == null) { 48 | if(GameScene.roomBotGroups[0] == null) { 49 | GameScene.roomBotGroups[0] = new Group(); 50 | 51 | for(int i = 0; i < 12; ++i) { 52 | Mesh bodyPart = (Mesh) GameScene.persWorld.find(i + 1); 53 | Mesh meshCopy = (Mesh) bodyPart.duplicate(); 54 | 55 | GameScene.roomBotGroups[0].addChild(meshCopy); 56 | } 57 | 58 | for(int i = 30; i < 34; ++i) { 59 | Mesh bloodSpawnMesh = (Mesh) GameScene.persWorld.find(i); 60 | Mesh meshCopy = (Mesh) bloodSpawnMesh.duplicate(); 61 | 62 | meshCopy.setRenderingEnable(false); 63 | GameScene.roomBotGroups[0].addChild(meshCopy); 64 | } 65 | 66 | Light flash = (Light) GameScene.persWorld.find(50); 67 | Light lightCopy = (Light) flash.duplicate(); 68 | 69 | lightCopy.setRenderingEnable(false); 70 | GameScene.roomBotGroups[0].addChild(lightCopy); 71 | } else { 72 | GameScene.roomBotGroups[botId] = (Group) GameScene.roomBotGroups[0].duplicate(); 73 | } 74 | 75 | GameScene.roomBotGroups[botId].setRenderingEnable(false); 76 | GameScene.gameWorld.addChild(GameScene.roomBotGroups[botId]); 77 | } 78 | 79 | setBotType(botType, botId); 80 | setBotAppearance(botType, botId); 81 | } 82 | 83 | private static void setBotType(int botType, int botId) { 84 | int weaponId; 85 | 86 | //0 is minimal 12 is max 87 | if(botType == 0) { 88 | //tutorial bandits 89 | weaponId = 22; 90 | enemyWeaponType[botId] = (byte) (botType - 0); 91 | } else if(botType >= 1 && botType < 4) { 92 | //bandit 93 | weaponId = botType + 22 - 1; 94 | enemyWeaponType[botId] = (byte) (botType - 0); 95 | } else if(botType >= 4 && botType < 7) { 96 | //killer 97 | weaponId = botType + 22 - 4; 98 | enemyWeaponType[botId] = (byte) (botType - 3); 99 | } else if(botType >= 7 && botType < 10) { 100 | //stalker 101 | weaponId = botType + 22 - 7; 102 | enemyWeaponType[botId] = (byte) (botType - 6); 103 | } else { 104 | //soldier 105 | weaponId = botType + 22 - 10; 106 | enemyWeaponType[botId] = (byte) (botType - 9); 107 | } 108 | 109 | Mesh weaponMesh = (Mesh) GameScene.persWorld.find(weaponId); 110 | Mesh weaponCopy = (Mesh) weaponMesh.duplicate(); 111 | GameScene.roomBotGroups[botId].addChild(weaponCopy); 112 | } 113 | 114 | private static void setBotAppearance(int botType, int botId) { 115 | String textureName; 116 | 117 | if(botType >= 0 && botType < 4) { 118 | textureName = "pbandit.png"; //бандит 119 | } else if(botType >= 4 && botType < 7) { 120 | textureName = "pkiller.png"; //наёмник 121 | } else if(botType >= 7 && botType < 10) { 122 | textureName = "pstalker.png"; //сталкер 123 | } else { 124 | textureName = "psoldier.png"; //солдат 125 | } 126 | 127 | Appearance ap = new Appearance(); 128 | ap.setTexture(0, ResourceLoader.getTexture(textureName)); 129 | 130 | CompositingMode cm = new CompositingMode(); 131 | cm.setBlending(CompositingMode.REPLACE); 132 | ap.setCompositingMode(cm); 133 | 134 | Material mat = new Material(); 135 | ap.setMaterial(mat); 136 | 137 | for(int i = 0; i < 12; i++) { 138 | Mesh bodyPart = (Mesh) GameScene.roomBotGroups[botId].find(i + 1); 139 | bodyPart.setAppearance(0, ap); 140 | } 141 | 142 | } 143 | 144 | public static byte getBotType(int botId) { 145 | return botTypes[botId]; 146 | } 147 | 148 | public static void loadStaticBot(int botId, int persId) { 149 | if(GameScene.roomBotGroups[0] != null) { 150 | Group botMdlCopy = (Group) GameScene.roomBotGroups[0].duplicate(); 151 | GameScene.staticBotMdlGroup[botId] = botMdlCopy; 152 | } 153 | 154 | GameScene.staticBotMdlGroup[botId].setRenderingEnable(true); 155 | GameScene.gameWorld.addChild(GameScene.staticBotMdlGroup[botId]); 156 | 157 | byte weaponId = GameScene.objectStaticBotWeaponId[persId]; 158 | if(weaponId != 0) { 159 | Mesh weaponMesh = (Mesh) GameScene.persWorld.find(weaponId); 160 | Mesh weaponCopy = (Mesh) weaponMesh.duplicate(); 161 | GameScene.staticBotMdlGroup[botId].addChild(weaponCopy); 162 | } 163 | 164 | setStaticBotAppearance(botId, persId); 165 | 166 | int time = GameScene.objectStaticBotAnimTime[persId] * 100; 167 | GameScene.staticBotMdlGroup[botId].animate(time); 168 | } 169 | 170 | private static void setStaticBotAppearance(int botId, int textureId) { 171 | Appearance ap = new Appearance(); 172 | 173 | String textureName = GameScene.objectTextureName[textureId]; 174 | ap.setTexture(0, ResourceLoader.getTexture(textureName)); 175 | 176 | CompositingMode cm = new CompositingMode(); 177 | cm.setBlending(CompositingMode.REPLACE); 178 | ap.setCompositingMode(cm); 179 | 180 | Material mat = new Material(); 181 | ap.setMaterial(mat); 182 | 183 | for(int i = 0; i < 12; i++) { 184 | Mesh bodyPart = (Mesh) GameScene.staticBotMdlGroup[botId].find(i + 1); 185 | bodyPart.setAppearance(0, ap); 186 | } 187 | } 188 | } 189 | -------------------------------------------------------------------------------- /SM3D/nbproject/project.properties: -------------------------------------------------------------------------------- 1 | abilities=ColorScreen,MIDP=2.1,ScreenHeight=320,JSR229=1.1,JSR226=1.0,JSR184=1.1,JSR82=1.1,JSR180=1.1.0,JSR280=1.0,OBEX=1.0,SATSA=1.0,WMA=2.0,ScreenColorDepth=16,JSR238=1.0,JSR239=1.0,JSR234=1.0,JSR179=1.0,JSR256=1.0,JSR177=1.0,JSR211=1.0,CLDC=1.1,J2MEWS=1.0,ScreenWidth=240,MMAPI=1.1,JSR172=1.0,JSR75=1.0, 2 | all.configurations=\ ,SDK_34,WTK_PreciseRender 3 | application.args= 4 | application.description= 5 | application.description.detail= 6 | application.name= 7 | application.vendor=Vendor 8 | build.classes.dir=${build.dir}/compiled 9 | build.classes.excludes=**/*.java,**/*.form,**/*.class,**/.nbintdb,**/*.mvd,**/*.wsclient,**/*.vmd 10 | build.dir=build/${config.active} 11 | build.root.dir=build 12 | configs.SDK_34.javac.source=1.3 13 | configs.SDK_34.javac.target=1.3 14 | configs.SDK_34.platform.active=Oracle_Java_TM__Platform_Micro_Edition_SDK_3_4 15 | configs.SDK_34.platform.active.description=Oracle Java(TM) Platform Micro Edition SDK 3.4 16 | configs.SDK_34.platform.apis=WMA-2.0,MMAPI-1.2,JSR211-1.0,JSR82-1.1,JSR177-1.0,JSR179-1.0,JSR234-1.0,JSR257-1.0,J2ME-WS-1.0,JSR239-1.0,JSR256-1.2,JSR226-1.0,JSR280-1.0,JSR75-1.0,JSR184-1.1 17 | configs.SDK_34.platform.bootclasspath=${platform.home}/lib/jsr172_1.0.jar:${platform.home}/lib/jsr234_1.0.jar:${platform.home}/lib/jsr135_1.2.jar:${platform.home}/lib/jsr239_1.0.jar:${platform.home}/lib/jsr75_1.0.jar:${platform.home}/lib/jsr211_1.0.jar:${platform.home}/lib/jsr177_1.0.jar:${platform.home}/lib/jsr257_1.0.jar:${platform.home}/lib/jsr184_1.1.jar:${platform.home}/lib/jsr226_1.0.jar:${platform.home}/lib/jsr205_2.0.jar:${platform.home}/lib/jsr082_1.1.jar:${platform.home}/lib/jsr179_1.0.jar:${platform.home}/lib/jsr256_1.2.jar:${platform.home}/lib/jsr280_1.0.jar:${platform.home}/lib/midp_2.1.jar:${platform.home}/lib/cldc_1.1.jar 18 | configs.SDK_34.platform.configuration=CLDC-1.1 19 | configs.SDK_34.platform.device=JavaMEPhone1 20 | configs.SDK_34.platform.fat.jar=true 21 | configs.SDK_34.platform.profile=MIDP-2.1 22 | configs.SDK_34.platform.trigger=CLDC 23 | configs.SDK_34.platform.type=UEI-1.0.1 24 | configs.WTK_PreciseRender.javac.source=1.3 25 | configs.WTK_PreciseRender.javac.target=1.3 26 | configs.WTK_PreciseRender.platform.active=Sun_Java_TM__Wireless_Toolkit_2_5_2_01_for_CLDC 27 | configs.WTK_PreciseRender.platform.active.description=Sun Java(TM) Wireless Toolkit 2.5.2_01 for CLDC 28 | configs.WTK_PreciseRender.platform.apis=WMA-2.0,MMAPI-1.1,JSR238-1.0,JSR211-1.0,JSR82-1.1,JSR177-1.0,JSR234-1.0,J2ME-WS-1.0,JSR226-1.0,JSR75-1.0,JSR184-1.1 29 | configs.WTK_PreciseRender.platform.bootclasspath=${platform.home}/lib/jsr226.jar:${platform.home}/lib/jsr75.jar:${platform.home}/lib/jsr238.jar:${platform.home}/lib/jsr211.jar:${platform.home}/lib/mmapi.jar:${platform.home}/lib/satsa-jcrmi.jar:${platform.home}/lib/jsr082.jar:${platform.home}/lib/satsa-apdu.jar:${platform.home}/lib/jsr184.jar:${platform.home}/lib/j2me-ws.jar:${platform.home}/lib/wma20.jar:${platform.home}/lib/jsr234.jar:${platform.home}/lib/cldcapi11.jar:${platform.home}/lib/midpapi21.jar 30 | configs.WTK_PreciseRender.platform.configuration=CLDC-1.1 31 | configs.WTK_PreciseRender.platform.device=DefaultColorPhone 32 | configs.WTK_PreciseRender.platform.fat.jar=true 33 | configs.WTK_PreciseRender.platform.profile=MIDP-2.1 34 | configs.WTK_PreciseRender.platform.trigger=CLDC 35 | configs.WTK_PreciseRender.platform.type=UEI-1.0.1 36 | debug.level=debug 37 | debugger.timeout= 38 | deployment.copy.target=${file.reference.Documents-Stalker_Mobile_Deploy} 39 | deployment.instance=default 40 | deployment.jarurl=${dist.jar} 41 | deployment.method=Copy 42 | deployment.override.jarurl=false 43 | dist.dir=dist/${config.active} 44 | dist.jad=SM3D.jad 45 | dist.jar=SM3D.jar 46 | dist.javadoc.dir=${dist.dir}/doc 47 | dist.root.dir=dist 48 | extra.classpath= 49 | file.reference.builtin.ks=${netbeans.user}/config/j2me/builtin.ks 50 | file.reference.Documents-Stalker_Mobile_Deploy=../../../../../../Documents/Stalker Mobile Deploy 51 | file.reference.SM3D-res=res 52 | filter.exclude.tests=false 53 | filter.excludes= 54 | filter.more.excludes=**/overview.html,**/package.html 55 | filter.use.standard=true 56 | jar.compress=true 57 | javac.debug=true 58 | javac.deprecation=false 59 | javac.encoding=UTF-8 60 | javac.optimize=true 61 | javac.source=1.3 62 | javac.target=1.3 63 | javadoc.author=false 64 | javadoc.encoding= 65 | javadoc.noindex=false 66 | javadoc.nonavbar=false 67 | javadoc.notree=false 68 | javadoc.private=false 69 | javadoc.splitindex=true 70 | javadoc.use=true 71 | javadoc.version=false 72 | javadoc.windowtitle= 73 | libs.classpath=${file.reference.SM3D-res} 74 | main.class= 75 | main.class.class=applet 76 | manifest.apipermissions= 77 | manifest.file=manifest.mf 78 | manifest.is.liblet=false 79 | manifest.jad= 80 | manifest.manifest= 81 | manifest.midlets=MIDlet-1: Stalker Mobile 3D,/icon.png,code.Main\n 82 | manifest.others=ShowFPS: 0\nMIDlet-Vendor: Freeware\nMIDlet-Name: Stalker Mobile 3D\nSiteURL: http://ae-mods.ru/load/mob/mods_by_users/s_t_a_l_k_e_r_mobile_hd/9-1-0-3244\nMIDlet-Icon: /icon.png\nMIDlet-Version: 1.2.4\n 83 | manifest.pushregistry= 84 | name=SM3D_Origin 85 | no.dependencies=true 86 | nokiaS80.application.icon= 87 | obfuscated.classes.dir=${build.dir}/obfuscated 88 | obfuscation.custom= 89 | obfuscation.level=0 90 | obfuscator.destjar=${build.dir}/obfuscated.jar 91 | obfuscator.srcjar=${build.dir}/before-obfuscation.jar 92 | platform.active=Sun_Java_TM__Wireless_Toolkit_2_5_2_01_for_CLDC 93 | platform.active.description=Sun Java(TM) Wireless Toolkit 2.5.2_01 for CLDC 94 | platform.apis=WMA-2.0,JSR211-1.0,JSR82-1.1,JSR177-1.0,JSR234-1.0,J2ME-WS-1.0,JSR226-1.0,JSR75-1.0,JSR184-1.1 95 | platform.bootclasspath=${platform.home}/lib/jsr226.jar:${platform.home}/lib/jsr75.jar:${platform.home}/lib/jsr211.jar:${platform.home}/lib/satsa-jcrmi.jar:${platform.home}/lib/jsr082.jar:${platform.home}/lib/satsa-apdu.jar:${platform.home}/lib/jsr184.jar:${platform.home}/lib/j2me-ws.jar:${platform.home}/lib/wma20.jar:${platform.home}/lib/jsr234.jar:${platform.home}/lib/cldcapi11.jar:${platform.home}/lib/midpapi21.jar 96 | platform.configuration=CLDC-1.1 97 | platform.device=DefaultColorPhone 98 | platform.fat.jar=true 99 | platform.profile=MIDP-2.1 100 | platform.trigger=CLDC 101 | platform.type=UEI-1.0.1 102 | preprocessed.dir=${build.dir}/preprocessed 103 | preverify.classes.dir=${build.dir}/preverified 104 | preverify.sources.dir=${build.dir}/preverifysrc 105 | resources.dir=resources 106 | run.cmd.options= 107 | run.jvmargs= 108 | run.method=STANDARD 109 | run.security.domain=minimum 110 | run.use.security.domain=false 111 | savaje.application.icon= 112 | savaje.application.icon.focused= 113 | savaje.application.icon.small= 114 | savaje.application.uid=TBD 115 | savaje.bundle.base= 116 | savaje.bundle.debug=false 117 | savaje.bundle.debug.port= 118 | semc.application.caps= 119 | semc.application.icon= 120 | semc.application.icon.count= 121 | semc.application.icon.splash= 122 | semc.application.icon.splash.installonly=false 123 | semc.application.uid=E9382236 124 | semc.certificate.path= 125 | semc.private.key.password= 126 | semc.private.key.path= 127 | sign.alias=minimal 128 | sign.enabled=false 129 | sign.keystore=${file.reference.builtin.ks} 130 | src.dir=src 131 | use.emptyapis=true 132 | use.preprocessor=true 133 | -------------------------------------------------------------------------------- /SM3D/src/code/OldDebugger.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import javax.microedition.lcdui.Font; 4 | import javax.microedition.lcdui.Graphics; 5 | import javax.microedition.rms.RecordStore; 6 | import javax.microedition.rms.RecordStoreException; 7 | import javax.microedition.rms.RecordStoreNotOpenException; 8 | 9 | //дебаггер, мать вашу 10 | public final class OldDebugger implements Screen 11 | { 12 | private static final Font FONT = Font.getFont(0, 1, 8); 13 | private static final int FONT_SMALL_HEIGHT = FONT.getHeight(); 14 | public static final byte FONT_MEDIUM_HEIGHT = (byte)(FONT_SMALL_HEIGHT + 6); 15 | private static int debuggersTotal; 16 | private static int keyDebuggerId; 17 | private static OldDebugger[] debuggers = new OldDebugger[10]; 18 | private String debuggerName; 19 | private String[] debuggerNames = new String[10]; 20 | private static boolean noIndent; 21 | 22 | private OldDebugger(String name) 23 | { 24 | this.debuggerName = name; 25 | if(debuggersTotal == 10) 26 | { 27 | OldDebugger[] newDebuggers = new OldDebugger[debuggersTotal + 10]; 28 | System.arraycopy(debuggers, 0, newDebuggers, 0, debuggers.length); 29 | debuggers = newDebuggers; 30 | } 31 | 32 | debuggers[debuggersTotal++] = this; 33 | this.setDebuggerInfo("Empty debugger", 0); 34 | } 35 | 36 | public final void resetVariables() {} 37 | 38 | public final void paint(Graphics graphics) 39 | { 40 | graphics.setClip(0, 0, MainMenuScreen.scrWidth, MainMenuScreen.scrHeight); 41 | //Заливаем весь экран белым 42 | graphics.setColor(16777215); 43 | graphics.fillRect(0, 0, MainMenuScreen.scrWidth, MainMenuScreen.scrHeight); 44 | //Текст делаем чёрно-серым 45 | graphics.setColor(2105376); 46 | int debId; 47 | int textHeight; 48 | //Отображаем на экране все счётчики и показатели 49 | if(noIndent) { 50 | for(debId = 0; debId < debuggersTotal; ++debId) 51 | { 52 | textHeight = debId * (FONT_MEDIUM_HEIGHT + 4) + 10; 53 | if(debId == keyDebuggerId) 54 | { 55 | graphics.drawRect(10, textHeight, MainMenuScreen.scrWidth - 20, FONT_MEDIUM_HEIGHT); 56 | } 57 | 58 | graphics.drawString(debuggers[debId].debuggerName, 15, textHeight + 3, 0); 59 | } 60 | } 61 | else 62 | { 63 | graphics.drawString(this.debuggerName, MainMenuScreen.scrWidth >> 1, 13, 17); 64 | 65 | for(debId = 0; debId < this.debuggerNames.length; ++debId) { 66 | if(this.debuggerNames[debId] != null) { 67 | textHeight = (debId + 1) * (FONT_MEDIUM_HEIGHT + 4) + 10; 68 | graphics.drawRect(10, textHeight, MainMenuScreen.scrWidth - 20, FONT_MEDIUM_HEIGHT); 69 | graphics.drawString(this.debuggerNames[debId], 15, textHeight + 3, 0); 70 | } 71 | } 72 | } 73 | 74 | graphics.drawString("free:" + Runtime.getRuntime().freeMemory() / 1000L, 80, 30, 0); 75 | } 76 | 77 | public final void keyPressed(int key) 78 | { 79 | //Банальная проверка кодов клавиш, для настройки под разные телефоны 80 | System.out.println("Debugger.keyPressed code = " + key); 81 | int debugActionNumber = MasterCanvas.instance.getGameAction(key); 82 | if(noIndent) { 83 | System.out.println(" isChoise == true"); 84 | //Не уверен, что этот дебагер отвечает за клавиши, но в других местах 85 | //с ним связанную логику я не встретил 86 | switch(debugActionNumber) { 87 | case 1: 88 | if(keyDebuggerId != 0) { 89 | --keyDebuggerId; 90 | } else { 91 | keyDebuggerId = debuggersTotal - 1; 92 | } 93 | 94 | Main.main.repaint(); 95 | break; 96 | case 6: 97 | if(keyDebuggerId != debuggersTotal - 1) { 98 | ++keyDebuggerId; 99 | } else { 100 | keyDebuggerId = 0; 101 | } 102 | 103 | Main.main.repaint(); 104 | break; 105 | case 8: 106 | Main.main.setDebugScreen(debuggers[keyDebuggerId], (byte)0); 107 | noIndent = false; 108 | } 109 | //Включаем отступы между строками текста, для большей читаемости 110 | } else if(debugActionNumber == 4) { 111 | noIndent = true; 112 | Main.main.repaint(); 113 | //Обнуляем всё к чертям собачьим 114 | } else if(debugActionNumber == 42) { 115 | for(int id = 0; id < this.debuggerNames.length; ++id) { 116 | this.debuggerNames[id] = null; 117 | } 118 | } 119 | 120 | if(key == 48) { 121 | System.out.println("Deleting all RS in Debugger"); 122 | String[] recordStoreNames = RecordStore.listRecordStores(); 123 | 124 | try { 125 | int i = 0; 126 | 127 | while(i < recordStoreNames.length) { 128 | System.out.println("Deleting of " + recordStoreNames[i] + " recordstore"); 129 | RecordStore recStore = RecordStore.openRecordStore(recordStoreNames[i], false); 130 | 131 | try { 132 | while(true) { 133 | recStore.closeRecordStore(); 134 | } 135 | } catch (RecordStoreNotOpenException err) { 136 | err.printStackTrace(); 137 | RecordStore.deleteRecordStore(recordStoreNames[i]); 138 | ++i; 139 | } 140 | } 141 | } catch (RecordStoreException var8) { 142 | ; 143 | } 144 | 145 | Main.main.numberOfPlayers = 0; 146 | Main.main.currentPlayerRecordId = -1; 147 | } 148 | 149 | } 150 | 151 | //При открытии окна - сворачиваем размер текста 152 | public final boolean onShow(byte screenId) { 153 | noIndent = true; 154 | return true; 155 | } 156 | 157 | private void setDebuggerInfo(String info, int debuggerId) 158 | { 159 | if(debuggerId < 10) 160 | { 161 | this.debuggerNames[debuggerId] = info; 162 | } 163 | 164 | } 165 | 166 | //Пересоздаём дебагеры 167 | //Похоже на счётчики производительности, которые отрабатывали 168 | //с определёнными интервалами 169 | public static OldDebugger restartDebuggers(String name) 170 | { 171 | OldDebugger debugger = null; 172 | if(debuggersTotal == 0) 173 | { 174 | return new OldDebugger(name); 175 | } 176 | else 177 | { 178 | try 179 | { 180 | int count = 0; 181 | 182 | while(true) 183 | { 184 | if(count >= debuggersTotal) 185 | { 186 | debugger = new OldDebugger(name); 187 | break; 188 | } 189 | 190 | if(debuggers[count].debuggerName.equals(name)) 191 | { 192 | debugger = debuggers[count]; 193 | break; 194 | } 195 | 196 | ++count; 197 | } 198 | } 199 | catch (Exception exc) 200 | { 201 | debugger = new OldDebugger(name); 202 | } 203 | 204 | return debugger; 205 | } 206 | } 207 | 208 | } 209 | -------------------------------------------------------------------------------- /SM3D/src/code/StashScreen.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import javax.microedition.lcdui.Graphics; 4 | 5 | public final class StashScreen implements Screen 6 | { 7 | 8 | public MasterInventoryScreen masterInvScreen; 9 | public Screen screen; 10 | 11 | 12 | public StashScreen(MasterInventoryScreen directLink) 13 | { 14 | this.masterInvScreen = directLink; 15 | } 16 | 17 | public final void resetVariables() {} 18 | 19 | public final void paint(Graphics graphics) 20 | { 21 | short[] items; 22 | int selectedItem; 23 | if(this.screen == this.masterInvScreen.topAreaItemsZone) 24 | { 25 | items = Scripts.stashItems; 26 | selectedItem = ItemsInteraction.selectedTopAreaItem; 27 | } 28 | else 29 | { 30 | items = Scripts.inventoryItems; 31 | selectedItem = ItemsInteraction.selectedInventoryItem; 32 | } 33 | 34 | ResourceManager.drawUserInterfaceItems(graphics, 46, 0, 0); //отрисовка UI 35 | graphics.setClip(0, 0, MainMenuScreen.scrWidth, MainMenuScreen.scrHeight); 36 | if(this.screen instanceof ItemsInteraction) 37 | { 38 | this.masterInvScreen.itemDscrScreen.descrText = InventoryScreen.getItemDescrTextId(items[selectedItem]); 39 | this.masterInvScreen.itemDscrScreen.paint(graphics); 40 | } 41 | else if(this.screen instanceof ItemDescriptionScreen) 42 | { 43 | this.masterInvScreen.itemDscrScreen.paint(graphics); 44 | } 45 | 46 | boolean var4 = false; 47 | boolean var5 = false; 48 | graphics.setClip(0, 0, MainMenuScreen.scrWidth, MainMenuScreen.scrHeight); 49 | ResourceManager.drawUserInterfaceItems(graphics, 91, 0, 0);//? 50 | ResourceManager.drawUserInterfaceItems(graphics, 82, 0, 0);//? 51 | if(this.screen == this.masterInvScreen.playerItemsZone) 52 | { 53 | PlayerHUD.drawSoftButtonNames(1, 0, 372, true);//убрать 54 | } 55 | else 56 | { 57 | PlayerHUD.drawSoftButtonNames(1, 0, 10, true);//выбрать 58 | } 59 | 60 | PlayerHUD.drawSoftButtonNames(0, 1, 6, true); 61 | int x_dest = ResourceManager.getUIElementXcoord(47, 6); 62 | int y_dest = ResourceManager.getUIElementYcoord(47, 6); 63 | TextCreator.drawLineByAnchor(1, 309, x_dest, y_dest, 5); 64 | 65 | byte[] currWeight = TextCreator.createTextFromNumberSeparated(Scripts.playerWeight); 66 | byte[] kgSlash = TextCreator.createTextFromLine(65); 67 | byte[] playerWeightText = TextCreator.combineText(currWeight, kgSlash); 68 | 69 | byte[] maxWeight = TextCreator.createTextFromNumber(Scripts.playerMaxWeight / 10); 70 | byte[] kg = TextCreator.createTextFromLine(64); 71 | byte[] playerMaxWeightText = TextCreator.combineText(maxWeight, kg); 72 | byte[] text = TextCreator.combineText(playerWeightText, playerMaxWeightText); 73 | int x_coord = ResourceManager.getUIElementXcoord(47, 10); 74 | int y_coord = ResourceManager.getUIElementYcoord(47, 10); 75 | TextCreator.drawWeightTextByAnchor(1, text, 0, text.length, x_coord, y_coord, 5); 76 | 77 | text = TextCreator.combineText(TextCreator.createTextFromNumberSeparated(Scripts.getItemWeight(items[selectedItem])), TextCreator.createTextFromLine(64)); 78 | x_coord = ResourceManager.getUIElementXcoord(47, 7); 79 | y_coord = ResourceManager.getUIElementYcoord(47, 7); 80 | TextCreator.drawWeightTextByAnchor(1, text, 0, text.length, x_coord, y_coord, 5); 81 | 82 | ItemsInteraction.drawOrder = 3; 83 | this.masterInvScreen.playerItemsZone.paint(graphics); 84 | if(this.screen == this.masterInvScreen.playerItemsZone) 85 | { 86 | this.masterInvScreen.playerItemsZone.highlightSelectedItem(graphics); 87 | } 88 | 89 | ItemsInteraction.drawOrder = 4; 90 | this.masterInvScreen.topAreaItemsZone.paint(graphics); 91 | if(this.screen == this.masterInvScreen.topAreaItemsZone) 92 | { 93 | this.masterInvScreen.topAreaItemsZone.highlightSelectedItem(graphics); 94 | } 95 | 96 | } 97 | 98 | private void restartMovingDescr() 99 | { 100 | this.screen = ((ItemsInteraction)this.screen).itemsInteraction; 101 | ItemDescriptionScreen.resetTextOffset(); 102 | } 103 | 104 | public final void keyPressed(int key) 105 | { 106 | switch(key) 107 | { 108 | case 1: 109 | if(this.screen instanceof ItemsInteraction) 110 | { 111 | this.restartMovingDescr(); 112 | } 113 | else 114 | { 115 | this.screen.keyPressed(key); 116 | } 117 | break; 118 | case 2: 119 | case 5: 120 | if(this.screen == this.masterInvScreen.playerItemsZone) 121 | { 122 | ItemsInteraction.drawOrder = 3; 123 | } 124 | 125 | if(this.screen == this.masterInvScreen.topAreaItemsZone) 126 | { 127 | ItemsInteraction.drawOrder = 4; 128 | } 129 | 130 | this.screen.keyPressed(key); 131 | break; 132 | case 3: 133 | ResourceManager.runGarbageCollector(); 134 | Main.main.setScreen(AllScreens.menu, (byte)14); 135 | GameScene.setActiveObjState(Scripts.openedActivableObjId, (short)0); 136 | break; 137 | case 4: 138 | case 8://взять предмет себе/дропнуть из инвентаря 139 | if(this.screen == this.masterInvScreen.topAreaItemsZone && Scripts.stashItems[ItemsInteraction.selectedTopAreaItem] != -1) 140 | { 141 | Scripts.addItemToInventory(Scripts.stashItems[ItemsInteraction.selectedTopAreaItem]); 142 | Scripts.stashItems = MathUtils.removeItemFromList(Scripts.stashItems, ItemsInteraction.selectedTopAreaItem); 143 | this.masterInvScreen.topAreaItemsZone.onShow((byte)4); 144 | this.masterInvScreen.playerItemsZone.onShow((byte)3); 145 | if(Scripts.stashItems.length == 0) { 146 | GameScene.setActiveObjState(Scripts.openedActivableObjId, (short)0); 147 | ResourceManager.runGarbageCollector(); 148 | Main.main.setScreen(AllScreens.menu, (byte)14); 149 | break; 150 | } 151 | } 152 | 153 | if(this.screen == this.masterInvScreen.playerItemsZone) 154 | { 155 | if(Scripts.isItemEquipped(Scripts.inventoryItems[ItemsInteraction.selectedInventoryItem])) 156 | { 157 | Scripts.unequipItem(Scripts.inventoryItems[ItemsInteraction.selectedInventoryItem]); 158 | } 159 | 160 | Scripts.dropItem(Scripts.inventoryItems[ItemsInteraction.selectedInventoryItem]); 161 | this.masterInvScreen.playerItemsZone.onShow((byte)3); 162 | this.masterInvScreen.topAreaItemsZone.onShow((byte)4); 163 | } 164 | break; 165 | case 6: 166 | if(this.screen instanceof ItemsInteraction) { 167 | this.restartMovingDescr(); 168 | } else { 169 | this.screen.keyPressed(key); 170 | } 171 | case 7: 172 | } 173 | 174 | Main.main.repaint(); 175 | } 176 | 177 | public final boolean onShow(byte screenId) 178 | { 179 | this.masterInvScreen.itemDscrScreen.resetVariables(); 180 | int xCoord2 = ResourceManager.getUIElementXcoord(47, 2); 181 | int xCoord3 = ResourceManager.getUIElementXcoord(47, 3); 182 | int yCoord2 = ResourceManager.getUIElementYcoord(47, 2); 183 | int yCoord5 = ResourceManager.getUIElementYcoord(47, 5); 184 | this.masterInvScreen.itemDscrScreen.setNameFrameLocation(xCoord2, xCoord3, yCoord2); 185 | xCoord2 = ResourceManager.getUIElementXcoord(47, 4); 186 | xCoord3 = ResourceManager.getUIElementXcoord(47, 5); 187 | this.masterInvScreen.itemDscrScreen.setDescriptionFrameLocation(xCoord2, yCoord2, xCoord3 - xCoord2, yCoord5 - yCoord2); 188 | this.masterInvScreen.playerItemsZone.onShow((byte)3); 189 | this.masterInvScreen.playerItemsZone.itemsInteraction = this.masterInvScreen.topAreaItemsZone; 190 | this.masterInvScreen.topAreaItemsZone.onShow((byte)4); 191 | this.masterInvScreen.topAreaItemsZone.itemsInteraction = this.masterInvScreen.playerItemsZone; 192 | this.screen = this.masterInvScreen.playerItemsZone; 193 | return true; 194 | } 195 | } 196 | -------------------------------------------------------------------------------- /SM3D/src/code/TradeScreen.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import javax.microedition.lcdui.Graphics; 4 | 5 | public final class TradeScreen implements Screen 6 | { 7 | 8 | public MasterInventoryScreen masterInvScreen; 9 | public Screen screen; 10 | 11 | 12 | public TradeScreen(MasterInventoryScreen directLink) 13 | { 14 | this.masterInvScreen = directLink; 15 | } 16 | 17 | public final void resetVariables() {} 18 | 19 | public final void paint(Graphics graphics) 20 | { 21 | short[] items; 22 | int selectedItem; 23 | //поле торговца (верхнее) 24 | //выбирается та строка, где находится подсвеченный предмет 25 | //у игрока или у торговца соотв. 26 | if(this.screen == this.masterInvScreen.topAreaItemsZone) 27 | { 28 | items = Scripts.traderItems; 29 | selectedItem = ItemsInteraction.selectedTopAreaItem; 30 | } 31 | //поле наших вещей (нижнее) 32 | else 33 | { 34 | items = Scripts.inventoryItems; 35 | selectedItem = ItemsInteraction.selectedInventoryItem; 36 | } 37 | 38 | //МЕНЮ ТОРГОВЛИ. ОСНОВА 39 | ResourceManager.drawUserInterfaceItems(graphics, 48, 0, 0); 40 | //надпись ТОРГОВЛЯ 41 | ResourceManager.drawUserInterfaceItems(graphics, 92, 0, 0); 42 | 43 | graphics.setClip(0, 0, MainMenuScreen.scrWidth, MainMenuScreen.scrHeight); 44 | //предмет вне окна предпрсмотра 45 | if(this.screen instanceof ItemsInteraction) 46 | { 47 | this.masterInvScreen.itemDscrScreen.descrText = InventoryScreen.getItemDescrTextId(items[selectedItem]); 48 | this.masterInvScreen.itemDscrScreen.paint(graphics); 49 | } 50 | //предмет в окне предпросмотра 51 | else if(this.screen instanceof ItemDescriptionScreen) 52 | { 53 | this.masterInvScreen.itemDscrScreen.paint(graphics); 54 | } 55 | 56 | boolean var4 = false; 57 | boolean var5 = false; 58 | graphics.setClip(0, 0, MainMenuScreen.scrWidth, MainMenuScreen.scrHeight); 59 | ResourceManager.drawUserInterfaceItems(graphics, 82, 0, 0); //надпись ИНФО 60 | if(this.screen == this.masterInvScreen.playerItemsZone) 61 | { 62 | PlayerHUD.drawSoftButtonNames(1, 0, 375, true);//продать 63 | } 64 | else 65 | { 66 | PlayerHUD.drawSoftButtonNames(1, 0, 376, true);//купить 67 | } 68 | 69 | PlayerHUD.drawSoftButtonNames(0, 1, 6, true);//назад 70 | int x1 = ResourceManager.getUIElementXcoord(49, 6); 71 | int y2 = ResourceManager.getUIElementYcoord(49, 6); 72 | TextCreator.drawLineByAnchor(1, 309, x1, y2, 5); 73 | 74 | x1 = ResourceManager.getUIElementXcoord(49, 10); 75 | y2 = ResourceManager.getUIElementYcoord(49, 10); 76 | TextCreator.drawLineByAnchor(1, 310, x1, y2, 5); 77 | 78 | byte[] currWeight = TextCreator.createTextFromNumberSeparated(Scripts.playerWeight); 79 | byte[] kgSlash = TextCreator.createTextFromLine(65); 80 | byte[] playerWeightText = TextCreator.combineText(currWeight, kgSlash); 81 | 82 | byte[] maxWeight = TextCreator.createTextFromNumber(Scripts.playerMaxWeight / 10); 83 | byte[] kg = TextCreator.createTextFromLine(64); 84 | byte[] playerMaxWeightText = TextCreator.combineText(maxWeight, kg); 85 | byte[] text = TextCreator.combineText(playerWeightText, playerMaxWeightText); 86 | int x = ResourceManager.getUIElementXcoord(49, 12); 87 | int y = ResourceManager.getUIElementYcoord(49, 12); 88 | TextCreator.drawWeightTextByAnchor(1, text, 0, text.length, x, y, 5); 89 | 90 | text = TextCreator.combineText(TextCreator.createTextFromNumberSeparated(Scripts.getItemWeight(items[selectedItem])), TextCreator.createTextFromLine(64)); 91 | x = ResourceManager.getUIElementXcoord(49, 7); 92 | y = ResourceManager.getUIElementYcoord(49, 7); 93 | TextCreator.drawWeightTextByAnchor(1, text, 0, text.length, x, y, 5); 94 | 95 | int price; 96 | if(this.screen == this.masterInvScreen.playerItemsZone) { 97 | price = Scripts.getItemPrice(items[selectedItem]) / 2; 98 | } 99 | else 100 | { 101 | price = Scripts.getItemPrice(items[selectedItem]); 102 | } 103 | 104 | text = TextCreator.combineText(TextCreator.createTextFromNumber(price), TextCreator.createTextFromLine(66)); 105 | x = ResourceManager.getUIElementXcoord(49, 11); 106 | y = ResourceManager.getUIElementYcoord(49, 11); 107 | TextCreator.drawTextByAnchor(1, text, 0, text.length, x, y, 5); 108 | 109 | short[] playerMoneyText; 110 | (playerMoneyText = TextCreator.makeColoredTextFromNumber(Scripts.playerMoney, false))[playerMoneyText.length - 1] = 106; 111 | x = ResourceManager.getUIElementXcoord(49, 13); 112 | y = ResourceManager.getUIElementYcoord(49, 13); 113 | TextCreator.drawColoredText(playerMoneyText, x, y, 3); 114 | 115 | ItemsInteraction.drawOrder = 5; 116 | this.masterInvScreen.playerItemsZone.paint(graphics); 117 | if(this.screen == this.masterInvScreen.playerItemsZone) { 118 | this.masterInvScreen.playerItemsZone.highlightSelectedItem(graphics); 119 | } 120 | 121 | ItemsInteraction.drawOrder = 6; 122 | this.masterInvScreen.topAreaItemsZone.paint(graphics); 123 | if(this.screen == this.masterInvScreen.topAreaItemsZone) { 124 | this.masterInvScreen.topAreaItemsZone.highlightSelectedItem(graphics); 125 | } 126 | 127 | } 128 | 129 | private void restartMovingDescr() { 130 | this.screen = ((ItemsInteraction)this.screen).itemsInteraction; 131 | ItemDescriptionScreen.resetTextOffset(); 132 | } 133 | 134 | public final void keyPressed(int key) 135 | { 136 | switch(key) { 137 | case 1: 138 | if(this.screen instanceof ItemsInteraction) { 139 | this.restartMovingDescr(); 140 | } else { 141 | this.screen.keyPressed(key); 142 | } 143 | break; 144 | case 2: 145 | case 5: 146 | if(this.screen == this.masterInvScreen.playerItemsZone) { 147 | ItemsInteraction.drawOrder = 5; 148 | } 149 | 150 | if(this.screen == this.masterInvScreen.topAreaItemsZone) { 151 | ItemsInteraction.drawOrder = 6; 152 | } 153 | 154 | this.screen.keyPressed(key); 155 | break; 156 | case 3: 157 | ResourceManager.runGarbageCollector(); 158 | Main.main.setScreen(AllScreens.menu, (byte)14); 159 | break; 160 | case 4: 161 | case 8://покупка/продажа 162 | if(this.screen == this.masterInvScreen.topAreaItemsZone && 163 | Scripts.traderItems[ItemsInteraction.selectedTopAreaItem] != -1) 164 | { 165 | Scripts.buyItem(Scripts.traderItems[ItemsInteraction.selectedTopAreaItem]); 166 | this.masterInvScreen.topAreaItemsZone.onShow((byte)6); 167 | this.masterInvScreen.playerItemsZone.onShow((byte)5); 168 | if(Scripts.traderItems.length == 0) //Если у торговца предметов нет 169 | { 170 | ResourceManager.runGarbageCollector(); 171 | Main.main.setScreen(AllScreens.menu, (byte)14); 172 | break; 173 | } 174 | } 175 | 176 | if(this.screen == this.masterInvScreen.playerItemsZone) 177 | { 178 | Scripts.sellItem(Scripts.inventoryItems[ItemsInteraction.selectedInventoryItem]); 179 | this.masterInvScreen.playerItemsZone.onShow((byte)5); 180 | this.masterInvScreen.topAreaItemsZone.onShow((byte)6); 181 | } 182 | break; 183 | case 6: 184 | if(this.screen instanceof ItemsInteraction) { 185 | this.restartMovingDescr(); 186 | } else { 187 | this.screen.keyPressed(key); 188 | } 189 | case 7: 190 | } 191 | 192 | Main.main.repaint(); 193 | } 194 | 195 | public final boolean onShow(byte var1) { 196 | this.masterInvScreen.itemDscrScreen.resetVariables(); 197 | int xCoord2 = ResourceManager.getUIElementXcoord(49, 2); 198 | int xCoord3 = ResourceManager.getUIElementXcoord(49, 3); 199 | int yCoord2 = ResourceManager.getUIElementYcoord(49, 2); 200 | int yCoord5 = ResourceManager.getUIElementYcoord(49, 5); 201 | this.masterInvScreen.itemDscrScreen.setNameFrameLocation(xCoord2, 202 | xCoord3, yCoord2); 203 | xCoord2 = ResourceManager.getUIElementXcoord(49, 4); 204 | xCoord3 = ResourceManager.getUIElementXcoord(49, 5); 205 | this.masterInvScreen.itemDscrScreen.setDescriptionFrameLocation(xCoord2, 206 | yCoord2, xCoord3 - xCoord2, yCoord5 - yCoord2); 207 | this.masterInvScreen.playerItemsZone.onShow((byte)5); 208 | this.masterInvScreen.playerItemsZone.itemsInteraction = 209 | this.masterInvScreen.topAreaItemsZone; 210 | this.masterInvScreen.topAreaItemsZone.onShow((byte)6); 211 | this.masterInvScreen.topAreaItemsZone.itemsInteraction = 212 | this.masterInvScreen.playerItemsZone; 213 | this.screen = this.masterInvScreen.playerItemsZone; 214 | return true; 215 | } 216 | } 217 | -------------------------------------------------------------------------------- /SM3D/src/code/ItemDescriptionScreen.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import java.util.Vector; 4 | import javax.microedition.lcdui.Graphics; 5 | 6 | public final class ItemDescriptionScreen implements Screen { 7 | 8 | public int nameFrameXstart; 9 | public int nameFrameXend; 10 | public int nameFrameYstart; 11 | 12 | public int xStart; 13 | public int yStart; 14 | public int frameWidth; 15 | public int frameHeight; 16 | 17 | public int maxTextWindowCapacity; 18 | 19 | public int oldYoffset; //работает странно. Отключает прокрутку текста, дублируя yOffset 20 | 21 | public int linesCounter; 22 | public int textDescrHeight; 23 | public int singleLineHeight; 24 | 25 | public int nameText; //рабочее, но не используется 26 | public byte[] itemStatsText; //рабочее, но не используется 27 | public int descrText; 28 | 29 | private static int yOffset; 30 | private static int currTimeMillis; 31 | public static int previousTime; 32 | public byte[][] statsTextAndValues;//см. ниже 33 | //точность: 34 | //DAMAGE: 35 | //RATE OF DUERCGARGE: 36 | //BULLET FAKA: 37 | //RADIATION FAKA: 38 | //ANOMALY FAKA: 39 | //ЗДОРОВЬЕ: 40 | //СИЛА: 41 | public byte[][] statsClosingCharacters;//%%%%%%%%%__ 42 | public static Vector textLinesStartsEnds = new Vector(); 43 | 44 | public final void resetVariables() { 45 | this.nameText = -1; 46 | this.itemStatsText = null;//new byte[]{15, -1, -1, -1, -1, -1, -1, -1} 47 | this.descrText = -1; 48 | } 49 | 50 | public static void resetTextOffset() { 51 | yOffset = 0; 52 | currTimeMillis = (int) System.currentTimeMillis(); 53 | previousTime = 0; 54 | } 55 | 56 | public final void paint(Graphics graphics) { 57 | boolean var4 = false; 58 | this.yStart = this.nameFrameYstart + this.drawNameText(0, this.nameText);//Если заменить 59 | this.maxTextWindowCapacity = this.frameHeight - this.yStart; 60 | int totalTextHeight = this.drawStatsText(this.itemStatsText); 61 | this.textDescrHeight = this.drawDescriptionText(1, this.descrText, totalTextHeight, true)[0]; 62 | int currTime; 63 | //Если текст выходит за пределы окошка 64 | if (this.textDescrHeight >= this.maxTextWindowCapacity && (currTime = (int) (System.currentTimeMillis() - (long) currTimeMillis)) >= 3000 && currTime - previousTime >= 200) { 65 | previousTime = currTime; 66 | yOffset += this.singleLineHeight / 4;//скорость промотки текста 67 | if (totalTextHeight - yOffset + this.textDescrHeight < totalTextHeight + this.maxTextWindowCapacity / 2) { 68 | resetTextOffset(); 69 | } 70 | } 71 | 72 | Main.main.repaint(); 73 | } 74 | 75 | public final void keyPressed(int key) { 76 | } 77 | 78 | public final boolean onShow(byte screenId) { 79 | return true; 80 | } 81 | 82 | public final void setNameFrameLocation(int xStart, int xEnd, int yStart) { 83 | this.nameFrameXstart = xStart; 84 | this.nameFrameXend = xEnd; 85 | this.nameFrameYstart = yStart; 86 | } 87 | 88 | public final void setDescriptionFrameLocation(int xStart, int yStart, int width, int height) { 89 | this.xStart = xStart; 90 | this.yStart = yStart; 91 | this.frameWidth = width; 92 | this.maxTextWindowCapacity = height; 93 | this.frameHeight = height + yStart; 94 | } 95 | 96 | private int drawStatsText(byte[] text) { 97 | if (text == null) { 98 | return 0; 99 | } else { 100 | int textHeight = TextCreator.getSymbolHeight(1) + 0; 101 | int totalTextBlockHeight = 0; 102 | 103 | for (int i = 0; i < text.length; ++i) { 104 | if (text[i] != -1) { 105 | int[] var5 = this.getTotalTextHeight(1, this.statsTextAndValues[i], totalTextBlockHeight, true); 106 | totalTextBlockHeight += var5[0]; 107 | byte[] textArray = TextCreator.combineText(TextCreator.createTextFromNumber(text[i]), this.statsClosingCharacters[i]); 108 | int var7 = TextCreator.getTextWidth(1, textArray, 0, textArray.length); 109 | if (this.frameWidth - var5[1] <= var7) { 110 | totalTextBlockHeight += textHeight; 111 | } 112 | 113 | this.getTotalTextHeight(1, textArray, totalTextBlockHeight, false); 114 | totalTextBlockHeight += textHeight; 115 | } 116 | } 117 | 118 | return totalTextBlockHeight + textHeight; 119 | } 120 | } 121 | 122 | private int[] getTotalTextHeight(int color, byte[] textArray, int yOffset, boolean fromLeftToRight) { 123 | if (textArray == null) { 124 | return new int[]{0, 0}; 125 | } else { 126 | this.singleLineHeight = TextCreator.getSymbolHeight(color) + 0; 127 | MasterCanvas.graphics.setClip(this.xStart, this.yStart, this.frameWidth, this.maxTextWindowCapacity); 128 | int numberOfMassive_start = 0; 129 | boolean var6 = false; 130 | this.linesCounter = 0; 131 | byte emptySpaceSymbolId = TextCreator.getSymbolFromLine(63, 0); 132 | int[] linesHeights = new int[2]; 133 | 134 | int textLength; 135 | do { 136 | textLength = TextCreator.getTextLength(color, textArray, numberOfMassive_start, this.frameWidth); 137 | if (textArray[textLength] != emptySpaceSymbolId && textLength < textArray.length - 1) { 138 | int var9; 139 | textLength = (var9 = TextCreator.getTextLengthWithoutSymbol(textArray, emptySpaceSymbolId, textLength)) != -1 && var9 != numberOfMassive_start ? var9 : textLength; 140 | } 141 | 142 | TextCreator.drawTextByAnchor(color, textArray, numberOfMassive_start, textLength + 1, fromLeftToRight ? this.xStart : this.xStart + this.frameWidth, this.yStart + yOffset + this.linesCounter * this.singleLineHeight + this.oldYoffset, fromLeftToRight ? 0 : 10); 143 | if (textLength == textArray.length - 1) { 144 | linesHeights[1] = TextCreator.getTextWidth(color, textArray, numberOfMassive_start, textLength); 145 | } 146 | 147 | ++this.linesCounter; 148 | numberOfMassive_start = textLength; 149 | } while (textLength < textArray.length - 1); 150 | 151 | linesHeights[0] = this.singleLineHeight * this.linesCounter; 152 | return linesHeights; 153 | } 154 | } 155 | //Отрисовка описания предмета 156 | private int[] drawDescriptionText(int color, int replicNumber, int yOffsetLocal, boolean fromLeftToRight) { 157 | if (replicNumber == -1) { 158 | return new int[]{0, 0}; 159 | } else { 160 | textLinesStartsEnds = TextCreator.splitOnLines(replicNumber, this.frameWidth, color); 161 | this.singleLineHeight = TextCreator.getSymbolHeight(color) + 0; 162 | MasterCanvas.graphics.setClip(this.xStart, this.yStart, this.frameWidth, this.maxTextWindowCapacity); 163 | int[] var5 = new int[2]; 164 | TextCreator.drawReplicInsideFrame(replicNumber, fromLeftToRight ? this.xStart : this.xStart + this.frameWidth, this.yStart + yOffsetLocal + this.linesCounter * this.singleLineHeight + this.oldYoffset - yOffset, 0, color, MasterCanvas.graphics, 0, -1, textLinesStartsEnds); 165 | var5[0] = TextCreator.getSymbolHeight(color) * textLinesStartsEnds.size(); 166 | return var5; 167 | } 168 | } 169 | //Имя предмета. Не используется 170 | private int drawNameText(int color, int replicNumber) { 171 | if (replicNumber == -1) { 172 | return 0; 173 | } else { 174 | byte[] symbolMassive = TextCreator.createTextFromLine(replicNumber); 175 | int firstSymbol = 0; 176 | boolean var5 = false; 177 | int HeightOfText = 0; 178 | byte emptySpaceSymbolId = TextCreator.getSymbolFromLine(63, 0); 179 | 180 | int lastSymbol; 181 | do //считать высоту текста 182 | { 183 | lastSymbol = TextCreator.getTextLength(color, symbolMassive, firstSymbol, this.nameFrameXend - this.nameFrameXstart); 184 | if (symbolMassive[lastSymbol] != emptySpaceSymbolId && lastSymbol < symbolMassive.length - 1) { 185 | int var8; 186 | lastSymbol = (var8 = TextCreator.getDistanceToFirstSymbolFromEnd(replicNumber, emptySpaceSymbolId, lastSymbol)) == -1 ? lastSymbol : var8; 187 | } 188 | 189 | TextCreator.drawTextByAnchor(color, symbolMassive, firstSymbol, lastSymbol + 1, this.nameFrameXstart, this.nameFrameYstart + HeightOfText * (TextCreator.getSymbolHeight(color) + 0), 0); 190 | ++HeightOfText; 191 | firstSymbol = lastSymbol; 192 | } while (lastSymbol < symbolMassive.length - 1); 193 | 194 | return HeightOfText * (TextCreator.getSymbolHeight(color) + 0); 195 | } 196 | } 197 | 198 | } 199 | -------------------------------------------------------------------------------- /SM3D/src/code/MainMenuScreen.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import javax.microedition.lcdui.Graphics; 4 | import javax.microedition.midlet.MIDletStateChangeException; 5 | 6 | public final class MainMenuScreen implements Screen 7 | { 8 | private int prevMenuOptionId; 9 | private int numberOfScreens; 10 | public int defaultMenuOption = 1; 11 | public int menuOptionId; 12 | private int movingDirection; 13 | private Screen[] screenByOptionId; 14 | private byte[] screenIdByOptionId; 15 | private int newTextX; 16 | private int prevTextX; 17 | public static int scrWidth = code.MasterCanvas.instance.getWidth(); 18 | public static int scrHeight = code.MasterCanvas.instance.getHeight(); 19 | 20 | private static final byte[] screenIdsIfSavedBefore = new byte[]{(byte)4, (byte)9, (byte)10, (byte)1, (byte)1, (byte)2, (byte)15, (byte)3}; 21 | private static Screen[] screensIfSavedBefore; 22 | 23 | private static final byte[] screenIdsNoSaves = new byte[]{(byte)4, (byte)9, (byte)1, (byte)1, (byte)2, (byte)15, (byte)3}; 24 | private static Screen[] screensNoSaves; 25 | 26 | //textId|реплика | screenId 27 | //20 продолжить 4 28 | //21 новая игра 9 29 | //22 загрузка игры 10 30 | //23 настройки 1 31 | //24 помощь 1 32 | //25 об игре 2 33 | //26 ещё игры 15 34 | //27 выход 3 35 | 36 | public MainMenuScreen() { 37 | this.menuOptionId = this.defaultMenuOption; 38 | this.movingDirection = -1; 39 | this.prevTextX = AllScreens.halfScrWidth; 40 | sleepForAWhile(50L); 41 | this.screenIdByOptionId = screenIdsIfSavedBefore; 42 | this.movingDirection = 4; 43 | } 44 | 45 | public final void resetVariables() { 46 | screensNoSaves = new Screen[]{ 47 | AllScreens.loadingScreen, 48 | AllScreens.loadingScreen, 49 | AllScreens.settingsScreen, 50 | AllScreens.helpAboutScreen, 51 | AllScreens.helpAboutScreen, 52 | this, 53 | AllScreens.confirmScreen}; 54 | screensIfSavedBefore = new Screen[]{ 55 | AllScreens.loadingScreen, 56 | AllScreens.loadingScreen, 57 | AllScreens.loadingScreen, 58 | AllScreens.settingsScreen, 59 | AllScreens.helpAboutScreen, 60 | AllScreens.helpAboutScreen, 61 | this, 62 | AllScreens.confirmScreen}; 63 | this.screenByOptionId = screensIfSavedBefore; 64 | } 65 | 66 | public final void paint(Graphics graphics) 67 | { 68 | switch(this.movingDirection) 69 | { 70 | case 2: 71 | this.moveTextLeft(graphics); 72 | return; 73 | case 3: 74 | this.moveTextRight(graphics); 75 | return; 76 | case 4: 77 | this.drawMainMenu(graphics); 78 | return; 79 | case 5: 80 | new LoadingScreen(ResourceManager.interfaceImages[0]); 81 | this.movingDirection = 4; 82 | default: 83 | } 84 | } 85 | 86 | //Обрабатывает переключение пунктов главного меню 87 | public final void keyPressed(int key) 88 | { 89 | MasterCanvas.instance.getGameAction(key); 90 | switch(key) 91 | { 92 | case -5: 93 | case 53: 94 | Main.main.setScreen(this.screenByOptionId[this.menuOptionId], this.screenIdByOptionId[this.menuOptionId]); 95 | break; 96 | case -4: 97 | case 54: 98 | this.nextOption();//следующий пункт меню, текст уезжает влево 99 | break; 100 | case -3: 101 | case 52: 102 | this.previousOption();//предыдущий пункт меню, текст едет вправо 103 | } 104 | 105 | Main.main.repaint(); 106 | } 107 | 108 | public final boolean onShow(byte screenId) 109 | { 110 | switch(screenId) 111 | { 112 | case 0: 113 | return false; 114 | case 1: 115 | SoundAndVibro.playSound(0); 116 | break; 117 | case 10: 118 | Main.main.destroyApp(false); 119 | 120 | Main.main.notifyDestroyed(); 121 | return false; 122 | case 14: 123 | Main.main.showGameScreen(); 124 | return false; 125 | case 15: 126 | try 127 | { 128 | Main.main.platformRequest(AllScreens.MORE_GAMES_URL); 129 | Main.main.destroyApp(true); 130 | } 131 | catch (Exception e) 132 | { 133 | e.printStackTrace(); 134 | } 135 | } 136 | 137 | this.checkSavedGame(Main.main.numberOfPlayers > 0); 138 | if(screenId == 16) 139 | { 140 | SoundAndVibro.soundsEnabled = false; 141 | ResourceManager.saveSettings(); 142 | ((SettingsScreen)AllScreens.settingsScreen).loadSettings(); 143 | } 144 | 145 | return true; 146 | } 147 | 148 | private void nextOption() 149 | { 150 | if(this.movingDirection != 2) //not left 151 | { 152 | this.prevMenuOptionId = this.menuOptionId; 153 | if(this.menuOptionId == this.numberOfScreens - 1) 154 | { 155 | this.menuOptionId = this.defaultMenuOption; 156 | } 157 | else 158 | { 159 | ++this.menuOptionId; 160 | } 161 | 162 | if(this.movingDirection == 3) //right 163 | { 164 | this.prevTextX += this.newTextX; 165 | this.newTextX = this.prevTextX - this.newTextX; 166 | this.prevTextX -= this.newTextX; 167 | } 168 | else 169 | { 170 | this.newTextX = scrWidth + this.prevTextX; 171 | } 172 | 173 | this.movingDirection = 2; //left 174 | } 175 | } 176 | 177 | private void previousOption() 178 | { 179 | if(this.movingDirection != 3) //not right 180 | { 181 | this.prevMenuOptionId = this.menuOptionId; 182 | //если мы не знаем, что было в прошлой опции 183 | if(this.menuOptionId == this.defaultMenuOption) 184 | { 185 | this.menuOptionId = this.numberOfScreens - 1; 186 | } 187 | else 188 | { 189 | --this.menuOptionId; 190 | } 191 | 192 | if(this.movingDirection == 2) // left 193 | { 194 | this.prevTextX += this.newTextX; 195 | this.newTextX = this.prevTextX - this.newTextX; 196 | this.prevTextX -= this.newTextX; 197 | } 198 | else 199 | { 200 | this.newTextX = -scrWidth + this.prevTextX; 201 | } 202 | 203 | this.movingDirection = 3;//moveTextRight 204 | } 205 | } 206 | 207 | private static void drawMainMenuLogo(Graphics graphics) 208 | { 209 | //цвет фона в главном меню игры 210 | graphics.setColor(0); 211 | graphics.fillRect(0, 0, scrWidth, scrHeight); 212 | int x_coord = scrWidth / 2 - ResourceManager.interfaceImages[2].getWidth() / 2; 213 | int y_coord = scrHeight / 2 - ResourceManager.interfaceImages[2].getHeight() / 2; 214 | graphics.drawImage(ResourceManager.interfaceImages[2], x_coord, y_coord, 0); 215 | } 216 | 217 | private void drawMainMenu(Graphics graphics) 218 | { 219 | drawMainMenuLogo(graphics); 220 | //жёлтый цвет текста. Когда-то использовался для отрисовки в меню? 221 | graphics.setColor(15637809); 222 | TextCreator.drawLineByAnchor(0, AllScreens.mainMenuTextIds[this.menuOptionId], AllScreens.halfScrWidth, AllScreens.textY, 9); 223 | } 224 | 225 | private void moveTextLeft(Graphics graphics) 226 | { 227 | this.newTextX -= 20; 228 | this.prevTextX -= 20; 229 | sleepForAWhile(1L); 230 | drawMainMenuLogo(graphics); 231 | graphics.setClip(0, AllScreens.screenClipYstart, scrWidth, AllScreens.screenClipHeight); 232 | graphics.setColor(15637809); 233 | TextCreator.drawLineByAnchor(0, AllScreens.mainMenuTextIds[this.menuOptionId], this.newTextX, AllScreens.textY, 9); 234 | TextCreator.drawLineByAnchor(0, AllScreens.mainMenuTextIds[this.prevMenuOptionId], this.prevTextX, AllScreens.textY, 9); 235 | graphics.setClip(0, 0, scrWidth, scrHeight); 236 | if(this.newTextX > AllScreens.halfScrWidth) 237 | { 238 | Main.main.repaint(); 239 | } 240 | else 241 | { 242 | this.prevTextX = AllScreens.halfScrWidth; 243 | this.movingDirection = 4;//stop 244 | Main.main.repaint(); 245 | } 246 | } 247 | 248 | private void moveTextRight(Graphics graphics) 249 | { 250 | this.newTextX += 20; 251 | this.prevTextX += 20; 252 | sleepForAWhile(1L); 253 | drawMainMenuLogo(graphics); 254 | graphics.setClip(0, AllScreens.screenClipYstart, scrWidth, AllScreens.screenClipHeight); 255 | //cнова задаём жёлтый цвет, который не используется для текста 256 | graphics.setColor(15637809); 257 | TextCreator.drawLineByAnchor(0, AllScreens.mainMenuTextIds[this.menuOptionId], this.newTextX, AllScreens.textY, 9); 258 | TextCreator.drawLineByAnchor(0, AllScreens.mainMenuTextIds[this.prevMenuOptionId], this.prevTextX, AllScreens.textY, 9); 259 | graphics.setClip(0, 0, scrWidth, scrHeight); 260 | if(this.newTextX < AllScreens.halfScrWidth) 261 | { 262 | Main.main.repaint(); 263 | } 264 | else 265 | { 266 | this.prevTextX = AllScreens.halfScrWidth; 267 | this.movingDirection = 4; 268 | Main.main.repaint(); 269 | } 270 | } 271 | 272 | private static void sleepForAWhile(long milliseconds) 273 | { 274 | //long awakenTime = System.currentTimeMillis() + milliseconds; 275 | 276 | //while (System.currentTimeMillis() < awakenTime) { 277 | //Починил плавную перемотку 10.11 278 | try { 279 | Thread.sleep(milliseconds); 280 | } catch (InterruptedException ex) { 281 | ex.printStackTrace(); 282 | } 283 | //} 284 | 285 | } 286 | 287 | private void checkSavedGame(boolean savedBefore) 288 | { 289 | if(savedBefore) 290 | { 291 | this.screenByOptionId = screensIfSavedBefore; 292 | this.screenIdByOptionId = screenIdsIfSavedBefore; 293 | AllScreens.mainMenuTextIds = AllScreens.menuTextIdSaveCreated; 294 | this.numberOfScreens = this.screenByOptionId.length; 295 | } 296 | else 297 | { 298 | this.screenByOptionId = screensNoSaves; 299 | this.screenIdByOptionId = screenIdsNoSaves; 300 | AllScreens.mainMenuTextIds = AllScreens.menuTextIdEmptySave; 301 | this.numberOfScreens = this.screenByOptionId.length; 302 | } 303 | } 304 | 305 | } 306 | -------------------------------------------------------------------------------- /SM3D/src/code/PlayerStatsScreen.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import javax.microedition.lcdui.Graphics; 4 | 5 | public final class PlayerStatsScreen implements Screen { 6 | 7 | public byte selectedStat; 8 | 9 | //Прямая ссылка в этот раз пуста, хотя в других классах она передавалась в 10 | //this. Возможно, в этом окне ранее была возможность поменять одежду 11 | //в инвентаре? 12 | public PlayerStatsScreen(MasterInventoryScreen directLink) { 13 | } 14 | 15 | public final void resetVariables() { 16 | } 17 | 18 | public final void paint(Graphics graphics) { 19 | //Рисуем рамку интерфейса и задаём рабочую область 20 | ResourceManager.drawUserInterfaceItems(graphics, 42, 0, 0); 21 | 22 | graphics.setClip(0, 0, MainMenuScreen.scrWidth, MainMenuScreen.scrHeight); 23 | 24 | ResourceManager.drawUserInterfaceItems(MasterCanvas.graphics, 87, 0, 0); 25 | ResourceManager.drawUserInterfaceItems(MasterCanvas.graphics, 86, 0, 0); 26 | 27 | //отрисовка текущего уровня игрока 28 | //id 39: УРОВЕНЬ:__ 29 | byte[] currentValueText = 30 | TextCreator.combineText(TextCreator.createTextFromLine(39), 31 | TextCreator.createTextFromNumber(Scripts.playerLevel)); 32 | int x_start = ResourceManager.getUIElementXcoord(43, 0); 33 | int y_start = ResourceManager.getUIElementYcoord(43, 0); 34 | TextCreator.drawTextByAnchor(0, currentValueText, 0, currentValueText.length, x_start, y_start, 4); 35 | 36 | //сохраняем характеристики персонажа и вкаченные уровни в массив 37 | byte[] statsLevels = getPlayerStatsLevel(); 38 | short[] statsValues = getPlayerStats(); 39 | boolean var7 = false; 40 | //0 color is highlighted, 1 is not 41 | int color; 42 | 43 | //Поле слева вверху. Отрисовка названия уровней для поднятия 44 | //id 68: ТОЧНОСТЬ: 45 | TextCreator.drawLineByAnchor(color = this.selectedStat == 0 ? 0 : 1, 46 | 68, ResourceManager.getUIElementXcoord(43, 2), 47 | ResourceManager.getUIElementYcoord(43, 2), 4); 48 | x_start = ResourceManager.getUIElementXcoord(43, 3); 49 | y_start = ResourceManager.getUIElementYcoord(43, 3); 50 | byte[] currentPlayerLevelText = TextCreator.createTextFromNumber(statsLevels[0]); 51 | TextCreator.drawTextByAnchor(color, 52 | currentPlayerLevelText, 0, currentPlayerLevelText.length, 53 | x_start, y_start, 6); 54 | 55 | //67 id text: "+" 56 | if (this.selectedStat == 0) { 57 | TextCreator.drawLineByAnchor(color, 67, 58 | x_start + 10, y_start, 5); 59 | } 60 | 61 | //id 74: ЗДОРОВЬЕ: 62 | TextCreator.drawLineByAnchor(color = this.selectedStat == 1 ? 0 : 1, 63 | 74, ResourceManager.getUIElementXcoord(43, 4), 64 | ResourceManager.getUIElementYcoord(43, 4), 4); 65 | x_start = ResourceManager.getUIElementXcoord(43, 5); 66 | y_start = ResourceManager.getUIElementYcoord(43, 5); 67 | currentPlayerLevelText = TextCreator.createTextFromNumber(statsLevels[1]); 68 | TextCreator.drawTextByAnchor(color, 69 | currentPlayerLevelText, 0, currentPlayerLevelText.length, 70 | x_start, y_start, 6); 71 | 72 | if (this.selectedStat == 1) { 73 | TextCreator.drawLineByAnchor(color, 67, 74 | x_start + 10, y_start, 5); 75 | } 76 | 77 | //id 75: СИЛА: 78 | TextCreator.drawLineByAnchor(color = this.selectedStat == 2 ? 0 : 1, 79 | 75, ResourceManager.getUIElementXcoord(43, 6), 80 | ResourceManager.getUIElementYcoord(43, 6), 4); 81 | x_start = ResourceManager.getUIElementXcoord(43, 7); 82 | y_start = ResourceManager.getUIElementYcoord(43, 7); 83 | currentPlayerLevelText = TextCreator.createTextFromNumber(statsLevels[2]); 84 | TextCreator.drawTextByAnchor(color, 85 | currentPlayerLevelText, 0, currentPlayerLevelText.length, 86 | x_start, y_start, 6); 87 | 88 | if (this.selectedStat == 2) { 89 | TextCreator.drawLineByAnchor(color, 67, 90 | x_start + 10, y_start, 5); 91 | } 92 | 93 | //Поле справа 94 | //Отрисовка характеристик игрока, цветным текстом 95 | short[] statValue; 96 | //здоровье 97 | (statValue = TextCreator.makeColoredTextFromNumber(statsValues[0], 98 | true))[statValue.length - 1] = 99 | (short) (statsValues[0] < 0 ? 157 : 105); 100 | TextCreator.drawColoredText(statValue, 101 | ResourceManager.getUIElementXcoord(43, 14), 102 | ResourceManager.getUIElementYcoord(43, 14), 10); 103 | 104 | //точность 105 | (statValue = TextCreator.makeColoredTextFromNumber(statsValues[1], 106 | true))[statValue.length - 1] = -2; 107 | TextCreator.drawColoredText(statValue, 108 | ResourceManager.getUIElementXcoord(43, 15), 109 | ResourceManager.getUIElementYcoord(43, 15), 10); 110 | 111 | //пулестойкость 112 | (statValue = TextCreator.makeColoredTextFromNumber(statsValues[2], 113 | true))[statValue.length - 1] = (short) (statsValues[2] < 0 ? 157 : 105); 114 | TextCreator.drawColoredText(statValue, 115 | ResourceManager.getUIElementXcoord(43, 16), 116 | ResourceManager.getUIElementYcoord(43, 16), 10); 117 | 118 | //устойчивость к радиации 119 | (statValue = TextCreator.makeColoredTextFromNumber(statsValues[3], 120 | true))[statValue.length - 1] = (short) (statsValues[3] < 0 ? 157 : 105); 121 | TextCreator.drawColoredText(statValue, 122 | ResourceManager.getUIElementXcoord(43, 17), 123 | ResourceManager.getUIElementYcoord(43, 17), 10); 124 | 125 | //защита от аномалий 126 | (statValue = TextCreator.makeColoredTextFromNumber(statsValues[4], 127 | true))[statValue.length - 1] = (short) (statsValues[4] < 0 ? 157 : 105); 128 | TextCreator.drawColoredText(statValue, 129 | ResourceManager.getUIElementXcoord(43, 18), 130 | ResourceManager.getUIElementYcoord(43, 18), 10); 131 | 132 | //Поле внизу, слева. Свободные очки прокачки 133 | //id text: ОЧКИ: 134 | byte[] sparePointsText = 135 | TextCreator.combineText(TextCreator.createTextFromLine(77), 136 | TextCreator.createTextFromNumber(statsLevels[4])); 137 | TextCreator.drawTextByAnchor(1, sparePointsText, 138 | 0, sparePointsText.length, 139 | ResourceManager.getUIElementXcoord(43, 12), 140 | ResourceManager.getUIElementYcoord(43, 12), 4); 141 | 142 | //Отрисовка веса, справа внизу 143 | currentValueText = 144 | TextCreator.combineText(TextCreator.createTextFromNumber(Scripts.playerMaxWeight / 10), 145 | TextCreator.createTextFromLine(64)); 146 | x_start = ResourceManager.getUIElementXcoord(43, 13); 147 | y_start = ResourceManager.getUIElementYcoord(43, 13); 148 | TextCreator.drawTextByAnchor(0, currentValueText, 149 | 0, currentValueText.length, x_start, y_start, 5); 150 | 151 | //Отрисовка полоски опыта 152 | int width = ResourceManager.getRectangleParams(42, 5, 10)[2] + ResourceManager.getRectangleParams(42, 5, 11)[2] + ResourceManager.getRectangleParams(42, 5, 13)[2] + ResourceManager.getRectangleParams(42, 5, 14)[2]; 153 | int height = ResourceManager.getRectangleParams(42, 5, 8)[3] / 3 - 1; 154 | x_start = ResourceManager.getRectangleParams(42, 5, 10)[0]; 155 | y_start = ResourceManager.getRectangleParams(42, 5, 10)[1] + height + 3; 156 | int outlineColor = 1594115; //тёмно-зелёный 157 | int inlineColor = 2670136; //светло-зелёный 158 | 159 | MasterCanvas.graphics.setColor(outlineColor); 160 | MasterCanvas.graphics.fillRect(x_start, y_start, 161 | width * Scripts.playerLevel / 10, height / 3); 162 | 163 | MasterCanvas.graphics.setColor(inlineColor); 164 | MasterCanvas.graphics.fillRect(x_start, y_start + height / 3, 165 | width * Scripts.playerLevel / 10, height / 3); 166 | 167 | MasterCanvas.graphics.setColor(outlineColor); 168 | MasterCanvas.graphics.fillRect(x_start, y_start + 2 * height / 3, 169 | width * Scripts.playerLevel / 10, height / 3); 170 | 171 | //Отрисовка кнопок меню 172 | PlayerHUD.drawSoftButtonNames(1, 0, 391, true); 173 | PlayerHUD.drawSoftButtonNames(0, 1, 6, true); 174 | } 175 | 176 | //Переключение пунктов меню при поднятии уровней 177 | public final void keyPressed(int key) 178 | { 179 | switch (key) { 180 | //вернуться назад на 1 пункт 181 | case 1: 182 | --this.selectedStat; 183 | if (this.selectedStat == -1) { 184 | this.selectedStat = 2; 185 | } 186 | case 2: 187 | case 5: 188 | default: 189 | break; 190 | case 3: 191 | //вернуться назад в меню Паузы 192 | Main.main.setScreen(AllScreens.pauseScreen, (byte) 2); 193 | break; 194 | case 4: 195 | Scripts.levelUpPlayerStat(this.selectedStat); 196 | break; 197 | case 6: 198 | ++this.selectedStat; 199 | if (this.selectedStat > 2) { 200 | this.selectedStat = 0; 201 | } 202 | } 203 | 204 | Main.main.repaint(); 205 | } 206 | 207 | public final boolean onShow(byte screenId) { 208 | return true; 209 | } 210 | 211 | private static byte[] getPlayerStatsLevel() { 212 | byte statsLevelSumm = 213 | (byte) (Scripts.playerStatLevel[0] 214 | + Scripts.playerStatLevel[1] 215 | + Scripts.playerStatLevel[2]); 216 | return new byte[]{ 217 | Scripts.playerStatLevel[0], 218 | Scripts.playerStatLevel[1], 219 | Scripts.playerStatLevel[2], 220 | (byte) 0, 221 | (byte) (Scripts.playerLevel - statsLevelSumm), 222 | (byte) Scripts.playerLevel}; 223 | } 224 | 225 | private static short[] getPlayerStats() { 226 | return new short[]{ 227 | (short) Scripts.playerAccuracy, 228 | Scripts.playerMaxHealth, 229 | (short) Scripts.playerBulletProtection, 230 | (short) Scripts.playerRadiationResistance, 231 | (short) Scripts.playerAnomalyResistance}; 232 | } 233 | } 234 | -------------------------------------------------------------------------------- /SM3D/src/code/ResourceLoader.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | 4 | import java.io.DataInputStream; 5 | import java.io.IOException; 6 | import java.util.Vector; 7 | import javax.microedition.lcdui.Image; 8 | import javax.microedition.m3g.*; 9 | 10 | public final class ResourceLoader { 11 | 12 | public static int texturesCount = 0; 13 | public static Texture2D[] textures; 14 | private static String[] texturesNames; 15 | public static boolean[] texturesUsedTwice; 16 | 17 | public static void clearTextures() { 18 | for(byte i = 0; i < 100; ++i) { 19 | if(!texturesUsedTwice[i]) { 20 | textures[i] = null; 21 | texturesNames[i] = ""; 22 | } 23 | } 24 | 25 | System.gc(); 26 | texturesCount = 0; 27 | } 28 | 29 | public static void initTexturesMassive() { 30 | texturesCount = 0; 31 | textures = new Texture2D[100]; 32 | texturesNames = new String[100]; 33 | texturesUsedTwice = new boolean[100]; 34 | System.gc(); 35 | } 36 | 37 | private static int findTextureId(String path) { 38 | for(byte i = 0; i < 100; i++) { 39 | if(path.equals(texturesNames[i]) && !path.equals("")) { 40 | return i; 41 | } 42 | } 43 | 44 | return -1; 45 | } 46 | 47 | public static Mesh loadZ1Model(String path) throws IOException { 48 | DataInputStream dis = new DataInputStream( 49 | Main.main.getClass().getResourceAsStream("/gamedata/meshes" + path) 50 | ); 51 | 52 | dis.readLong(); 53 | dis.readLong(); 54 | 55 | byte submeshesCount = dis.readByte(); 56 | String[] submeshTexture = new String[submeshesCount]; 57 | float[] submeshAlphaTest = new float[submeshesCount]; 58 | byte[] submeshBlendingMode = new byte[submeshesCount]; 59 | byte[] submeshDoublesided = new byte[submeshesCount]; 60 | 61 | for(int i = 0; i < submeshTexture.length; ++i) { 62 | char[] texNameChars = new char[dis.readByte()]; 63 | 64 | for(int i2 = 0; i2 < texNameChars.length; ++i2) { 65 | texNameChars[i2] = (char) dis.readByte(); 66 | } 67 | 68 | submeshTexture[i] = String.valueOf(texNameChars); 69 | submeshAlphaTest[i] = dis.readByte(); 70 | submeshBlendingMode[i] = dis.readByte(); 71 | submeshDoublesided[i] = dis.readByte(); 72 | } 73 | 74 | short[] allPositions = new short[dis.readShort() * 3]; 75 | 76 | for(int i = 0; i < allPositions.length; ++i) { 77 | allPositions[i] = (short) dis.readByte(); 78 | } 79 | 80 | short[] allNormals = new short[dis.readShort() * 3]; 81 | 82 | for(int i = 0; i < allNormals.length; ++i) { 83 | allNormals[i] = (short) dis.readByte(); 84 | } 85 | 86 | int uvXAdd = dis.readInt(); 87 | int uvYAdd = dis.readInt(); 88 | int uvScale = dis.readInt(); 89 | short[] allUVs = new short[dis.readShort() * 2]; 90 | 91 | for(int i = 0; i < allUVs.length; i+=2) { 92 | allUVs[i] = (short) (dis.readUnsignedByte() + uvXAdd); 93 | allUVs[i + 1] = (short) (dis.readUnsignedByte() + uvYAdd); 94 | } 95 | 96 | short polygonsCount = dis.readShort(); 97 | int[] positionsIds = new int[polygonsCount * 3]; 98 | int[] normalsIds = new int[polygonsCount * 3]; 99 | short[] vertexUVsID = new short[polygonsCount * 3]; 100 | short[] polygonsSubmeshIds = new short[polygonsCount]; 101 | byte[] stripMassive = new byte[polygonsCount]; 102 | 103 | for(int i = 0; i < polygonsCount; ++i) { 104 | polygonsSubmeshIds[i] = dis.readByte(); 105 | stripMassive[i] = dis.readByte(); 106 | } 107 | 108 | for(int i = 0; i < polygonsCount * 3; i++) { 109 | positionsIds[i] = dis.readShort(); 110 | } 111 | 112 | for(int i = 0; i < polygonsCount * 3; i++) { 113 | normalsIds[i] = dis.readShort(); 114 | } 115 | 116 | for(int i = 0; i < polygonsCount * 3; i++) { 117 | vertexUVsID[i] = dis.readShort(); 118 | } 119 | dis.close(); 120 | 121 | short[] positions = new short[polygonsCount * 3 * 3]; 122 | short[] normals = new short[polygonsCount * 3 * 3]; 123 | 124 | for(int i = 0; i < polygonsCount * 3; ++i) { 125 | int posId = positionsIds[i]; 126 | int normId = normalsIds[i]; 127 | 128 | for(int x = 0; x < 3; ++x) { 129 | positions[i * 3 + x] = allPositions[posId * 3 + x]; 130 | normals[i * 3 + x] = allNormals[normId * 3 + x]; 131 | } 132 | } 133 | 134 | Vector uvsVector = new Vector(); 135 | 136 | for(int i = 0; i < polygonsCount * 3; ++i) { 137 | short uvId = vertexUVsID[i]; 138 | 139 | Short u = new Short(allUVs[uvId * 2 + 0]); 140 | uvsVector.addElement(u); 141 | 142 | Short v = new Short(allUVs[uvId * 2 + 1]); 143 | uvsVector.addElement(v); 144 | } 145 | 146 | uvsVector.trimToSize(); 147 | short[] uvsMassive = new short[uvsVector.capacity()]; 148 | 149 | for(int i = 0; i < uvsMassive.length; ++i) { 150 | Short uv = (Short) uvsVector.elementAt(i); 151 | uvsMassive[i] = uv.shortValue(); 152 | } 153 | 154 | VertexArray vertexPositions = new VertexArray(positions.length / 3, 3, 2); 155 | vertexPositions.set(0, positions.length / 3, positions); 156 | 157 | VertexArray vertexUVS = new VertexArray(uvsMassive.length / 2, 2, 2); 158 | vertexUVS.set(0, uvsMassive.length / 2, uvsMassive); 159 | 160 | VertexArray vertexNormals = new VertexArray(positions.length / 3, 3, 2); 161 | vertexNormals.set(0, positions.length / 3, normals); 162 | 163 | VertexBuffer vb = new VertexBuffer(); 164 | vb.setPositions(vertexPositions, 1, null); 165 | vb.setNormals(vertexNormals); 166 | vb.setTexCoords(0, vertexUVS, uvScale / 1000000f, null); 167 | 168 | IndexBuffer[] indexBufferMassive = new IndexBuffer[submeshesCount]; 169 | Appearance[] appearanceMassive = new Appearance[submeshesCount]; 170 | 171 | for(int sbMesh = 0; sbMesh < submeshesCount; sbMesh++) { 172 | Vector triangleIndixesVector = new Vector(); 173 | Vector stripVector = new Vector(); 174 | 175 | for(short i = 0; i < polygonsCount; i++) { 176 | if(sbMesh == polygonsSubmeshIds[i]) { 177 | Short ind = new Short((short) (i * 3 + 0)); 178 | triangleIndixesVector.addElement(ind); 179 | ind = new Short((short) (i * 3 + 1)); 180 | triangleIndixesVector.addElement(ind); 181 | ind = new Short((short) (i * 3 + 2)); 182 | triangleIndixesVector.addElement(ind); 183 | 184 | ind = new Short(stripMassive[i]); 185 | stripVector.addElement(ind); 186 | } 187 | } 188 | 189 | triangleIndixesVector.trimToSize(); 190 | int[] triangleIndexes = new int[triangleIndixesVector.capacity()]; 191 | 192 | for(int i = 0; i < triangleIndexes.length; ++i) { 193 | Short ind = (Short) triangleIndixesVector.elementAt(i); 194 | triangleIndexes[i] = ind.shortValue(); 195 | } 196 | 197 | stripVector.trimToSize(); 198 | int[] submeshStripLengths = new int[stripVector.capacity()]; 199 | 200 | for(int i = 0; i < submeshStripLengths.length; ++i) { 201 | Short ind = (Short) stripVector.elementAt(i); 202 | submeshStripLengths[i] = ind.shortValue(); 203 | } 204 | 205 | appearanceMassive[sbMesh] = new Appearance(); 206 | CompositingMode cm = new CompositingMode(); 207 | cm.setAlphaWriteEnable(false); 208 | 209 | Material mat = new Material(); 210 | appearanceMassive[sbMesh].setMaterial(mat); 211 | 212 | if(submeshAlphaTest[sbMesh] == 0.0F) { 213 | mat.setColor(Material.EMISSIVE, 0xffffffff); 214 | /*} else if(submeshAlphaTest[sbMesh] < 0) { 215 | //Glass material (??) 216 | //From STALKER MOBILE HD 217 | mat.setShininess(48); 218 | mat.setColor(Material.SPECULAR, 0xffffffff); 219 | mat.setColor(Material.DIFFUSE, 0xff888888); 220 | */} else { 221 | cm.setAlphaThreshold(submeshAlphaTest[sbMesh] / 100.0F); 222 | } 223 | 224 | if(submeshBlendingMode[sbMesh] != 0) { 225 | cm.setBlending(submeshBlendingMode[sbMesh]); 226 | } 227 | 228 | appearanceMassive[sbMesh].setCompositingMode(cm); 229 | indexBufferMassive[sbMesh] = new TriangleStripArray(triangleIndexes, submeshStripLengths); 230 | } 231 | 232 | Mesh mesh = new Mesh(vb, indexBufferMassive, appearanceMassive); 233 | 234 | try { 235 | for(int i = 0; i < submeshesCount; ++i) { 236 | String textureName; 237 | if((textureName = submeshTexture[i]).length() != 0) { 238 | mesh.getAppearance(i).setTexture(0, getTexture(textureName)); 239 | System.gc(); 240 | } 241 | } 242 | } catch (Exception e) { 243 | e.printStackTrace(); 244 | } 245 | 246 | PolygonMode pm = new PolygonMode(); 247 | pm.setPerspectiveCorrectionEnable(true); 248 | pm.setCulling(submeshDoublesided[0] == 1 ? PolygonMode.CULL_NONE : PolygonMode.CULL_BACK); 249 | 250 | for(byte i = 0; i < submeshesCount; ++i) { 251 | if(submeshDoublesided[i] == 1) { 252 | pm.setTwoSidedLightingEnable(true); 253 | break; 254 | } 255 | } 256 | 257 | for(int i = 0; i < submeshesCount; ++i) { 258 | mesh.getAppearance(i).setPolygonMode(pm); 259 | } 260 | 261 | mesh.setScale(0.1F, 0.1F, 0.1F); 262 | 263 | ModChanges.updateZ1Models(mesh, path); 264 | 265 | return mesh; 266 | } 267 | 268 | public static Texture2D getTexture(String path) { 269 | Texture2D tex = null; 270 | 271 | try { 272 | int textureId = findTextureId(path); 273 | 274 | if(textureId != -1) { 275 | tex = textures[textureId]; 276 | texturesUsedTwice[textureId] = true; 277 | } else { 278 | String textureAdress = "/gamedata/textures/" + path; 279 | 280 | Image2D img2d; 281 | if(path.indexOf("texobj") != -1) { 282 | img2d = ModChanges.loadIndexedImage(textureAdress); 283 | } else { 284 | Image img = Image.createImage(textureAdress); 285 | //Todo не использовать RGBA, когда возможно 286 | img2d = new Image2D(Image2D.RGBA, img); 287 | } 288 | 289 | tex = new Texture2D(img2d); 290 | 291 | texturesNames[texturesCount] = path; 292 | textures[texturesCount] = tex; 293 | texturesCount++; 294 | } 295 | 296 | tex.setBlending(Texture2D.FUNC_MODULATE); 297 | tex.setBlendColor(0x000000); 298 | tex.setFiltering(Texture2D.FILTER_BASE_LEVEL, Texture2D.FILTER_NEAREST); 299 | 300 | } catch (Exception e) { 301 | e.printStackTrace(); 302 | } 303 | 304 | return tex; 305 | } 306 | 307 | public static Sprite3D getSprite(int spriteId) { 308 | Image img; 309 | Image2D img2D = null; 310 | Texture2D tex = null; 311 | String path = spriteId > -100 ? GameScene.objectTextureName[spriteId] : "blood.png"; 312 | if(spriteId == -101) path = ""; // -101 is weapon fire 313 | 314 | int textureId = findTextureId(path); 315 | 316 | try { 317 | if(textureId != -1) { 318 | tex = textures[textureId]; 319 | 320 | img2D = tex.getImage(); 321 | texturesUsedTwice[textureId] = true; 322 | } else if(spriteId == -101) { 323 | img = PlayerHUD.weaponFireImage; 324 | 325 | img2D = new Image2D(Image2D.RGBA, img); 326 | tex = new Texture2D(img2D); 327 | } else { 328 | img = Image.createImage("/gamedata/textures/" + path); 329 | img2D = new Image2D(Image2D.RGBA, img); 330 | tex = new Texture2D(img2D); 331 | 332 | texturesNames[texturesCount] = path; 333 | textures[texturesCount] = tex; 334 | texturesCount++; 335 | } 336 | } catch (Exception e) { 337 | e.printStackTrace(); 338 | } 339 | 340 | CompositingMode cm = new CompositingMode(); 341 | if(spriteId == -100) { 342 | cm.setBlending(CompositingMode.ALPHA); 343 | } else if(spriteId == -101) { 344 | cm.setBlending(CompositingMode.ALPHA_ADD); 345 | } else { 346 | cm.setBlending(GameScene.objectSpriteBlendMode[spriteId]); 347 | } 348 | 349 | if(spriteId != -101) { 350 | cm.setAlphaThreshold(1.0F); 351 | } else { 352 | cm.setAlphaThreshold(0.6F); 353 | } 354 | 355 | Appearance ap = new Appearance(); 356 | ap.setCompositingMode(cm); 357 | ap.setTexture(0, tex); 358 | ap.setLayer(63); //render sprites after all geometry 359 | 360 | //Set alpha threshold instead of alpha test 361 | if(path.indexOf("tree") != -1) { 362 | cm.setAlphaWriteEnable(false); 363 | cm.setBlending(CompositingMode.REPLACE); 364 | cm.setAlphaThreshold(0.5f); 365 | ap.setLayer(1); //render after geometry 366 | //probably z write can be disabled? 367 | } 368 | 369 | Sprite3D spr = new Sprite3D(true, img2D, ap); 370 | //STALKER MOBILE HD 371 | //if(path.indexOf("glare") > -1) spr.scale(1.3f, 1.3f, 1.3f); 372 | 373 | System.gc(); 374 | return spr; 375 | } 376 | } 377 | -------------------------------------------------------------------------------- /SM3D/src/code/ItemsInteraction.java: -------------------------------------------------------------------------------- 1 | package code; 2 | 3 | import javax.microedition.lcdui.Graphics; 4 | 5 | public final class ItemsInteraction implements Screen 6 | { 7 | //Задаём рабочую область, где будут нарисованы предметы инвентаря/экипировки 8 | private int xClipStart = 10; 9 | private int yClipStart = 10; 10 | private int clipWidth; 11 | private int clipHeight; 12 | 13 | //Используется для начальной координаты X 14 | //при отрисовке рамки выделенного предмета 15 | private int itemFrameXStart; 16 | 17 | //Определяет, на сколько пикселей за пределы экрана (влево) уходят 18 | //отображаемые иконки предметов 19 | private int offScreenItemsXOffset; 20 | 21 | public ItemsInteraction itemsInteraction; 22 | private int[] itemsXcoords; 23 | private int[] itemsYcoords; 24 | //Общее количество предметов в инвентаре игрока и у торговца/в тайнике 25 | public int itemsTotalInInventory; 26 | public static int itemsTotalInTopArea; 27 | //Выбранный предмет в инвентаре 28 | public static int selectedInventoryItem; 29 | //Выбранный предмет в окне обыска или окне предметов торговца 30 | public static int selectedTopAreaItem; 31 | //Суммарная ширина иконок всех предметов, с учётом выходящих за экран 32 | public int totalItemsFrameWidth; 33 | //Порядок отрисовки. Нужно ли рисовать только инвентарь и/или окно торговли 34 | //или окно обыска 35 | public static int drawOrder; 36 | 37 | 38 | public ItemsInteraction(int xClip, int yClip, 39 | int width, int height) 40 | { 41 | this.clipWidth = MainMenuScreen.scrWidth - 2 * this.xClipStart; 42 | this.clipHeight = 30; 43 | 44 | this.itemsXcoords = new int[14]; 45 | this.itemsYcoords = new int[14]; 46 | 47 | this.xClipStart = xClip; 48 | this.yClipStart = yClip; 49 | this.clipWidth = width; 50 | this.clipHeight = height; 51 | } 52 | 53 | private void setItemsXYcoords() 54 | { 55 | for(byte i = 0; i < 14; ++i) 56 | { 57 | this.itemsXcoords[i] = ResourceManager.getUIElementXcoord(39, i); 58 | this.itemsYcoords[i] = ResourceManager.getUIElementYcoord(39, i); 59 | } 60 | 61 | } 62 | 63 | private void drawCurrentEquipment(Graphics graphics) 64 | { 65 | graphics.setClip(0, 0, PlayerHUD.SCREEN_WIDTH, PlayerHUD.SCREEN_HEIGHT); 66 | 67 | //2 слота под оружие, 1 под броню, 4 под арты 68 | for(byte item = 0; item < 7; ++item) 69 | { 70 | if(Scripts.equipmentSlots[item] != -1) 71 | { 72 | ResourceManager.drawUserInterfaceItems(graphics, 73 | getItemImageUIid(Scripts.equipmentSlots[item]), 74 | this.itemsXcoords[item * 2], this.itemsYcoords[item * 2]); 75 | } 76 | } 77 | 78 | } 79 | 80 | //Подсветить предмет в экипировке 81 | private void highlightWornItem(Graphics graphics, int inventaryItem) 82 | { 83 | int color = 15637809; 84 | graphics.setClip(0, 0, PlayerHUD.SCREEN_WIDTH, PlayerHUD.SCREEN_HEIGHT); 85 | graphics.setColor(color); 86 | graphics.setStrokeStyle(0); 87 | 88 | for(byte equipItem = 0; equipItem < 7; ++equipItem) 89 | { 90 | if(Scripts.inventoryItems[inventaryItem] == Scripts.equipmentSlots[equipItem]) 91 | { 92 | int x_coord = this.itemsXcoords[equipItem * 2]; 93 | int y_coord = this.itemsYcoords[equipItem * 2]; 94 | int width = this.itemsXcoords[equipItem * 2 + 1] - x_coord; 95 | int height = this.itemsYcoords[equipItem * 2 + 1] - y_coord; 96 | graphics.drawRect(x_coord, y_coord, width, height); 97 | } 98 | } 99 | 100 | } 101 | 102 | //а в начале я был наивнее)//а сейчас хотя бы строки научился переносить (02.22) 103 | 104 | //Основной метод отрисовки 105 | private void drawEquipmentAndInventoryItems(Graphics graphics) 106 | { 107 | int itemIndex = 0; 108 | int itemOffset = 0; 109 | switch(drawOrder) 110 | { 111 | //Отрисовка экипированных вещей 112 | case 1: 113 | this.drawCurrentEquipment(graphics); 114 | graphics.setClip(this.xClipStart, 0, 115 | PlayerHUD.SCREEN_WIDTH, PlayerHUD.SCREEN_HEIGHT); 116 | case 2: 117 | //default: 118 | // break; 119 | case 3: 120 | //Отрисовка предметов в инвентаре игрока 121 | case 5: 122 | do 123 | { 124 | int x = this.xClipStart + itemOffset + this.offScreenItemsXOffset; 125 | ResourceManager.drawUserInterfaceItems(graphics, 126 | getItemImageUIid(Scripts.inventoryItems[itemIndex]), 127 | x, this.yClipStart); 128 | itemOffset += ResourceManager.getRectangleWidth(getItemImageUIid(Scripts.inventoryItems[itemIndex++])); 129 | if(itemIndex >= this.itemsTotalInInventory) 130 | { 131 | return; 132 | } 133 | 134 | } 135 | //Пока не упрёмся за пределы экрана, с учётом буфера слева 136 | while(itemOffset + this.offScreenItemsXOffset < this.clipWidth); 137 | return; 138 | //Отрисовка предметов в тайнике 139 | case 4: 140 | do 141 | { 142 | if(Scripts.stashItems.length == 0) { 143 | return; 144 | } 145 | 146 | ResourceManager.drawUserInterfaceItems(graphics, 147 | getItemImageUIid(Scripts.stashItems[itemIndex]), 148 | this.xClipStart + itemOffset + this.offScreenItemsXOffset, 149 | this.yClipStart); 150 | itemOffset += ResourceManager.getRectangleWidth(getItemImageUIid(Scripts.stashItems[itemIndex++])); 151 | if(itemIndex >= itemsTotalInTopArea) 152 | { 153 | return; 154 | } 155 | } 156 | while(itemOffset + this.offScreenItemsXOffset < this.clipWidth); 157 | return; 158 | //Отрисовка предметов у торгаша в окне 159 | case 6: 160 | do 161 | { 162 | if(Scripts.traderItems.length == 0) 163 | { 164 | return; 165 | } 166 | 167 | ResourceManager.drawUserInterfaceItems(graphics, 168 | getItemImageUIid(Scripts.traderItems[itemIndex]), 169 | this.xClipStart + itemOffset + this.offScreenItemsXOffset, this.yClipStart); 170 | itemOffset += ResourceManager.getRectangleWidth(getItemImageUIid(Scripts.traderItems[itemIndex++])); 171 | } 172 | while(itemIndex < itemsTotalInTopArea && itemOffset + this.offScreenItemsXOffset < this.clipWidth); 173 | } 174 | 175 | } 176 | 177 | //Подсветим выбранный в инвентаре или в верхней зоне предмет 178 | public final void highlightSelectedItem(Graphics graphics) 179 | { 180 | int selectedItem = selectedInventoryItem; 181 | short[] items = Scripts.inventoryItems; 182 | switch(drawOrder) 183 | { 184 | case 1: 185 | case 3: 186 | case 5: 187 | items = Scripts.inventoryItems; 188 | selectedItem = selectedInventoryItem; 189 | case 2: 190 | default: 191 | break; 192 | case 4: 193 | items = Scripts.stashItems; 194 | selectedItem = selectedTopAreaItem; 195 | break; 196 | case 6: 197 | items = Scripts.traderItems; 198 | selectedItem = selectedTopAreaItem; 199 | } 200 | 201 | int color = 1106120; 202 | //Если код работает с инвентарём 203 | if(drawOrder == 1 && Scripts.isItemEquipped(Scripts.inventoryItems[selectedItem])) 204 | { 205 | //Цвет желтовато-оранжевый 206 | color = 15637809; 207 | this.highlightWornItem(graphics, selectedItem); 208 | } 209 | 210 | if(drawOrder == 5 || drawOrder == 6 || drawOrder == 3 || drawOrder == 4) 211 | { 212 | color = 15637809; 213 | } 214 | 215 | graphics.setColor(color); 216 | graphics.setStrokeStyle(0); 217 | int width = ResourceManager.getRectangleWidth(getItemImageUIid(items[selectedItem])); 218 | int itemHeight = ResourceManager.getRectangleHeight(getItemImageUIid(items[selectedItem])); 219 | int refItemHeight = ResourceManager.getRectangleHeight(33) - 10; 220 | int height = Math.min(itemHeight, refItemHeight); 221 | graphics.setClip(this.xClipStart, 0, PlayerHUD.SCREEN_WIDTH, PlayerHUD.SCREEN_HEIGHT); 222 | graphics.drawRect(this.xClipStart + this.itemFrameXStart + this.offScreenItemsXOffset, this.yClipStart, width, height); 223 | } 224 | 225 | //У иконок предметов и UI - свои ID, отличные от ID предметов 226 | private static int getItemImageUIid(short itemId) 227 | { 228 | /* if(itemId>=900) 229 | * { 230 | * return ModChanges.NewItemsID(itemId); 231 | * } 232 | * else 233 | * {*/ 234 | switch(itemId) 235 | { 236 | case 101: 237 | return 64; 238 | case 102: 239 | return 65; 240 | case 103: 241 | return 66; 242 | case 104: 243 | return 75; 244 | case 105: 245 | default: 246 | return -2; 247 | case 106: 248 | return 67; 249 | case 107: 250 | return 55; 251 | case 108: 252 | return 56; 253 | case 109: 254 | return 57; 255 | case 110: 256 | return 58; 257 | case 111: 258 | return 59; 259 | case 112: 260 | return 60; 261 | case 113: 262 | return 62; 263 | case 114: 264 | return 61; 265 | case 115: 266 | return 63; 267 | case 116: 268 | return 51; 269 | case 117: 270 | return 52; 271 | case 118: 272 | return 53; 273 | case 119: 274 | return 54; 275 | case 120: 276 | return 68; 277 | case 121: 278 | return 69; 279 | case 122: 280 | return 70; 281 | case 123: 282 | return 71; 283 | case 124: 284 | return 72; 285 | case 125: 286 | return 73; 287 | case 126: 288 | return 74; 289 | //} 290 | } 291 | } 292 | 293 | public final void keyPressed(int key) 294 | { 295 | int selectedItem = 0; 296 | int itemsTotalNumber = 0; 297 | short[] items = Scripts.inventoryItems; 298 | ItemDescriptionScreen.resetTextOffset(); 299 | switch(drawOrder) 300 | { 301 | case 1: 302 | case 3: 303 | case 5: 304 | selectedItem = selectedInventoryItem; 305 | itemsTotalNumber = this.itemsTotalInInventory; 306 | items = Scripts.inventoryItems; 307 | case 2: 308 | default: 309 | break; 310 | case 4: 311 | selectedItem = selectedTopAreaItem; 312 | itemsTotalNumber = itemsTotalInTopArea; 313 | items = Scripts.stashItems; 314 | break; 315 | case 6: 316 | selectedItem = selectedTopAreaItem; 317 | itemsTotalNumber = itemsTotalInTopArea; 318 | items = Scripts.traderItems; 319 | } 320 | 321 | switch(key) 322 | { 323 | //выбрать предыдущий предмет 324 | case 2: 325 | --selectedItem; 326 | if(selectedItem < 0) 327 | { 328 | selectedItem = itemsTotalNumber - 1; 329 | if(itemsTotalNumber - 1 > 0) 330 | { 331 | this.itemFrameXStart = this.totalItemsFrameWidth - ResourceManager.getRectangleWidth(getItemImageUIid(items[itemsTotalNumber - 1])); 332 | this.offScreenItemsXOffset = this.totalItemsFrameWidth < this.clipWidth?0:this.clipWidth - this.totalItemsFrameWidth; 333 | } 334 | } 335 | else 336 | { 337 | this.itemFrameXStart -= ResourceManager.getRectangleWidth(getItemImageUIid(items[selectedItem])); 338 | if(-this.offScreenItemsXOffset > this.itemFrameXStart) 339 | { 340 | this.offScreenItemsXOffset = -this.itemFrameXStart; 341 | } 342 | } 343 | break; 344 | case 3: 345 | if(drawOrder == 1) { 346 | Main.main.reloadCurrentScreen(); 347 | } else { 348 | Main.main.setScreen(AllScreens.menu, (byte)14); 349 | GameScene.setActiveObjState(Scripts.openedActivableObjId, (short)0); 350 | } 351 | case 4: 352 | //выбрать следующий предмет 353 | case 5: 354 | if(selectedItem < items.length) 355 | { 356 | this.itemFrameXStart += ResourceManager.getRectangleWidth(getItemImageUIid(items[selectedItem])); 357 | } 358 | 359 | ++selectedItem; 360 | if(selectedItem >= itemsTotalNumber) 361 | { 362 | selectedItem = 0; 363 | this.itemFrameXStart = this.offScreenItemsXOffset = 0; 364 | } 365 | else if(selectedItem < items.length && -this.offScreenItemsXOffset + this.clipWidth < this.itemFrameXStart + ResourceManager.getRectangleWidth(getItemImageUIid(items[selectedItem]))) { 366 | this.offScreenItemsXOffset = -this.itemFrameXStart - ResourceManager.getRectangleWidth(getItemImageUIid(items[selectedItem])) + this.clipWidth; 367 | } 368 | default: 369 | break; 370 | } 371 | 372 | switch(drawOrder) 373 | { 374 | case 1: 375 | case 3: 376 | case 5: 377 | selectedInventoryItem = selectedItem; 378 | this.itemsTotalInInventory = itemsTotalNumber; 379 | case 2: 380 | default: 381 | break; 382 | case 4: 383 | case 6: 384 | selectedTopAreaItem = selectedItem; 385 | itemsTotalInTopArea = itemsTotalNumber; 386 | } 387 | 388 | Main.main.repaint(); 389 | } 390 | 391 | public final boolean onShow(byte screenId) 392 | { 393 | ItemDescriptionScreen.resetTextOffset(); 394 | System.gc(); 395 | this.itemFrameXStart = this.offScreenItemsXOffset = 0; 396 | this.totalItemsFrameWidth = 0; 397 | int itemIndex = 0; 398 | 399 | try 400 | { 401 | label36: 402 | switch(screenId) 403 | { 404 | case 1: 405 | this.setItemsXYcoords(); 406 | case 2: 407 | //default: здесь они в оригинале 408 | // break; 409 | case 3: 410 | case 5: 411 | selectedInventoryItem = 0; 412 | this.itemsTotalInInventory = 0; 413 | 414 | while(true) 415 | { 416 | if(itemIndex >= Scripts.inventoryItemsCount) 417 | { 418 | break label36; 419 | } 420 | 421 | ++this.itemsTotalInInventory; 422 | this.totalItemsFrameWidth += ResourceManager.getRectangleWidth(getItemImageUIid(Scripts.inventoryItems[itemIndex++])); 423 | } 424 | default: //а здесь их нет 425 | break; 426 | case 4: 427 | itemsTotalInTopArea = 0; 428 | selectedTopAreaItem = 0; 429 | 430 | while(true) 431 | { 432 | if(itemIndex >= Scripts.stashItems.length) 433 | { 434 | break label36; 435 | } 436 | 437 | ++itemsTotalInTopArea; 438 | this.totalItemsFrameWidth += ResourceManager.getRectangleWidth(getItemImageUIid(Scripts.stashItems[itemIndex++])); 439 | } 440 | case 6: 441 | itemsTotalInTopArea = 0; 442 | 443 | for(selectedTopAreaItem = 0; itemIndex < Scripts.traderItems.length; this.totalItemsFrameWidth += ResourceManager.getRectangleWidth(getItemImageUIid(Scripts.traderItems[itemIndex++]))) { 444 | ++itemsTotalInTopArea; 445 | } 446 | } 447 | } 448 | catch (Exception exc) 449 | { 450 | exc.printStackTrace(); 451 | } 452 | 453 | Main.main.repaint(); 454 | return true; 455 | } 456 | 457 | public final void resetVariables() {} 458 | 459 | public final void paint(Graphics graphics) 460 | { 461 | graphics.setClip(this.xClipStart, this.yClipStart, 462 | this.clipWidth, this.clipHeight); 463 | this.drawEquipmentAndInventoryItems(graphics); 464 | } 465 | 466 | } 467 | --------------------------------------------------------------------------------