Changeset 588

Show
Ignore:
Timestamp:
05/30/08 15:14:49 (7 months ago)
Author:
LeoD
Message:

debugging units' targets

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/defend/Main.d

    r583 r588  
    323323     
    324324    gameState.shutdown; 
     325     
     326    delete renderer; 
     327    delete soundSystem; 
    325328 
    326329    logger.info("program execution finished normally"); 
  • trunk/src/defend/game/hud/Mouse.d

    r583 r588  
    2525import engine.image.Devil; 
    2626import engine.gui.Controller; 
     27import engine.sound.SoundSystem; 
    2728 
    2829import defend.Config; 
     
    254255                           (!selectionBuffer.length || selectionBuffer[0].owner == obj.owner)) 
    255256                        { 
     257                            if(obj.typeInfo.selectSound) 
     258                                soundSystem.play(obj.typeInfo.selectSound); 
     259                         
    256260                            selectionBuffer.append(obj); 
    257261                             
     
    825829            const int BORDER_SIZE = 1; 
    826830 
    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 || 
    828832               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; 
    832836            start.x -= 15; 
    833837            start.y -= 30; 
    834838 
    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; 
    839843             
    840844            //end.y -= (end.y - start.y) * 0.9; 
     
    842846 
    843847            // white border 
    844             /+glColor4f(1, 1, 1, 0.5); 
     848            glColor4f(1, 1, 1, 0.5); 
    845849 
    846850            glVertex2f(start.x, start.y); 
    847851            glVertex2f(start.x, end.y); 
    848852            glVertex2f(end.x, end.y); 
    849             glVertex2f(end.x, start.y);+/ 
    850  
    851             /+// green bar 
     853            glVertex2f(end.x, start.y); 
     854 
     855            // green bar 
    852856            glColor3f(1, 0, 0); 
    853857             
     
    869873                glVertex2f(endX - BORDER_SIZE, end.y - BORDER_SIZE); 
    870874                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); 
    874878             
    875879            foreach(x; obj.screenPos_) 
     
    879883                glVertex2f(x.x + 3, x.y + 3); 
    880884                glVertex2f(x.x + 3, x.y); 
    881             } 
     885            }*/ 
    882886 
    883887            glColor3f(1, 1, 1); 
  • trunk/src/defend/sim/Core.d

    r585 r588  
    306306    vec3 posOffset; 
    307307    vec3 scale; 
     308 
     309    // Sound which gets played when the object gets selected by the user 
     310    char[] selectSound; 
    308311 
    309312    // Mini picture 
  • trunk/src/defend/sim/obj/Citizen.d

    r585 r588  
    2727            // TODO: change citizen model and mini pic 
    2828            moveSound = "data/sounds/sheep.ogg"; 
     29            selectSound = "data/sounds/sheep.ogg"; 
    2930            model = "sheep/low.obj"; 
    3031            miniPic = "minipics/sheep.png"; 
  • trunk/src/defend/sim/obj/Unit.d

    r585 r588  
    649649    { 
    650650        // 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)); 
    662670            } 
    663671        } 
  • trunk/src/defend/terrain/Terrain.d

    r583 r588  
    456456                        { 
    457457                            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)); 
    459459                        } 
    460460                    } 
  • trunk/src/engine/sound/openal/SoundSystem.d

    r586 r588  
    8080    ~this() 
    8181    { 
     82        foreach(source; sources) 
     83            sourcePool.free(source); 
     84     
    8285        sourcePool.release(); 
    8386        sources.release();