Changeset 588
- Timestamp:
- 05/30/08 15:14:49 (7 months ago)
- Files:
-
- trunk/src/defend/Main.d (modified) (1 diff)
- trunk/src/defend/game/hud/Mouse.d (modified) (6 diffs)
- trunk/src/defend/sim/Core.d (modified) (1 diff)
- trunk/src/defend/sim/obj/Citizen.d (modified) (1 diff)
- trunk/src/defend/sim/obj/Unit.d (modified) (1 diff)
- trunk/src/defend/terrain/Terrain.d (modified) (1 diff)
- trunk/src/engine/sound/openal/SoundSystem.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/defend/Main.d
r583 r588 323 323 324 324 gameState.shutdown; 325 326 delete renderer; 327 delete soundSystem; 325 328 326 329 logger.info("program execution finished normally"); trunk/src/defend/game/hud/Mouse.d
r583 r588 25 25 import engine.image.Devil; 26 26 import engine.gui.Controller; 27 import engine.sound.SoundSystem; 27 28 28 29 import defend.Config; … … 254 255 (!selectionBuffer.length || selectionBuffer[0].owner == obj.owner)) 255 256 { 257 if(obj.typeInfo.selectSound) 258 soundSystem.play(obj.typeInfo.selectSound); 259 256 260 selectionBuffer.append(obj); 257 261 … … 825 829 const int BORDER_SIZE = 1; 826 830 827 /+if(obj.screenPos.x < 0 || obj.screenPos.y < 0 || obj.screenPos.x > renderer.width ||831 if(obj.screenPos.x < 0 || obj.screenPos.y < 0 || obj.screenPos.x > renderer.width || 828 832 obj.screenPos.y - BAR_HEIGHT > renderer.height - HUD_HEIGHT) 829 continue; +/830 831 /+auto start = obj.screenPos;833 continue; 834 835 auto start = obj.screenPos; 832 836 start.x -= 15; 833 837 start.y -= 30; 834 838 835 auto end = vec2i(start.x + BAR_WIDTH, start.y + BAR_HEIGHT); +/836 837 auto start = obj.screenRect.begin;838 auto end = obj.screenRect.end;839 auto end = vec2i(start.x + BAR_WIDTH, start.y + BAR_HEIGHT); 840 841 //auto start = obj.screenRect.begin; 842 //auto end = obj.screenRect.end; 839 843 840 844 //end.y -= (end.y - start.y) * 0.9; … … 842 846 843 847 // white border 844 /+glColor4f(1, 1, 1, 0.5);848 glColor4f(1, 1, 1, 0.5); 845 849 846 850 glVertex2f(start.x, start.y); 847 851 glVertex2f(start.x, end.y); 848 852 glVertex2f(end.x, end.y); 849 glVertex2f(end.x, start.y); +/850 851 / +// green bar853 glVertex2f(end.x, start.y); 854 855 // green bar 852 856 glColor3f(1, 0, 0); 853 857 … … 869 873 glVertex2f(endX - BORDER_SIZE, end.y - BORDER_SIZE); 870 874 glVertex2f(endX - BORDER_SIZE, start.y + BORDER_SIZE); 871 } +/872 873 glColor4f(0, 0, 1, 0.8);875 } 876 877 /*glColor4f(0, 0, 1, 0.8); 874 878 875 879 foreach(x; obj.screenPos_) … … 879 883 glVertex2f(x.x + 3, x.y + 3); 880 884 glVertex2f(x.x + 3, x.y); 881 } 885 }*/ 882 886 883 887 glColor3f(1, 1, 1); trunk/src/defend/sim/Core.d
r585 r588 306 306 vec3 posOffset; 307 307 vec3 scale; 308 309 // Sound which gets played when the object gets selected by the user 310 char[] selectSound; 308 311 309 312 // Mini picture trunk/src/defend/sim/obj/Citizen.d
r585 r588 27 27 // TODO: change citizen model and mini pic 28 28 moveSound = "data/sounds/sheep.ogg"; 29 selectSound = "data/sounds/sheep.ogg"; 29 30 model = "sheep/low.obj"; 30 31 miniPic = "minipics/sheep.png"; trunk/src/defend/sim/obj/Unit.d
r585 r588 649 649 { 650 650 // Debug the path 651 debug(unit) if(selected && moving && path.length) 652 { 653 MapPos a = mapPos; 654 655 foreach(b; path) 656 { 657 renderer.drawLine(terrain.getWorldPos(a) + vec3(0, 0.1, 0), 658 terrain.getWorldPos(b) + vec3(0, 0.1, 0), 659 vec3(1, 0, 0)); 660 661 a = b; 651 /+debug(unit)+/ if(selected) 652 { 653 if(moving && path.length) 654 { 655 MapPos a = mapPos; 656 657 foreach(b; path) 658 { 659 renderer.drawLine(terrain.getWorldPos(a) + vec3(0, 1, 0), 660 terrain.getWorldPos(b) + vec3(0, 1, 0), 661 vec3(1, 0, 0)); 662 663 a = b; 664 } 665 } 666 667 if(followObject) 668 { 669 renderer.drawLine(center, followObject.center, vec3(1, 1, 0)); 662 670 } 663 671 } trunk/src/defend/terrain/Terrain.d
r583 r588 456 456 { 457 457 auto pos = getWorldPos(x, y); 458 renderer.drawLine(pos, pos + vec3(0, 1, 0), vec3(1, 0, 0));458 renderer.drawLine(pos, pos + vec3(0, 0.5, 0), vec3(1, 0, 0)); 459 459 } 460 460 } trunk/src/engine/sound/openal/SoundSystem.d
r586 r588 80 80 ~this() 81 81 { 82 foreach(source; sources) 83 sourcePool.free(source); 84 82 85 sourcePool.release(); 83 86 sources.release();
