Changeset 3501

Show
Ignore:
Timestamp:
03/15/10 06:23:12 (5 months ago)
Author:
trichards
Message:

More work on getting Tutorial 4 scene creation in script. See #199

Location:
tutorials/branches/0185_GEN_PHYSICS_REFACTOR_2/Tutorial4
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • tutorials/branches/0185_GEN_PHYSICS_REFACTOR_2/Tutorial4/Tutorial4/src/GameClient.cpp

    r3480 r3501  
    3838#include <Zen/Core/Math/Quaternion4.hpp> 
    3939 
    40 #include <Zen/Core/Scripting/I_ScriptEngine.hpp> 
    41 #include <Zen/Core/Scripting/I_ScriptModule.hpp> 
    42 #include <Zen/Core/Scripting/I_ScriptType.hpp> 
    43 #include <Zen/Core/Scripting/ObjectReference.hpp> 
     40#include <Zen/Core/Scripting.hpp> 
     41//#include <Zen/Core/Scripting/I_ScriptEngine.hpp> 
     42//#include <Zen/Core/Scripting/I_ScriptModule.hpp> 
     43//#include <Zen/Core/Scripting/I_ScriptType.hpp> 
     44//#include <Zen/Core/Scripting/ObjectReference.hpp> 
    4445 
    4546#include <Zen/Engine/Core/I_GameGroup.hpp> 
     
    225226GameClient::initPhysics() 
    226227{ 
    227     m_baseGame.initPhysicsService("ZNewton"); 
     228    m_baseGame.initPhysicsService("ZODE"); 
    228229    setupPhysicsMaterials(); 
    229     m_baseGame.initPhysicsResourceService("ZNewton"); 
     230    m_baseGame.initPhysicsResourceService("ZODE"); 
    230231} 
    231232 
     
    305306{ 
    306307    // TODO Register additional script types here 
     308 
     309    Zen::Scripting::script_type<GameClient>(base().getGameClientScriptType()) 
     310            .addMethod("init", &GameClient::init) 
     311    ; 
    307312 
    308313    // Tell m_base we're done.  After the modules are activated then you cannot 
  • tutorials/branches/0185_GEN_PHYSICS_REFACTOR_2/Tutorial4/scripts/client/GameClient.lua

    r3495 r3501  
     1print("=============\nLoading GameClient scripts...\n============") 
    12 
    23 
     
    2425-- ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- 
    2526function GameClient:initialize() 
     27    self:init(); 
     28     
    2629        rootGroup = self:getRootGroup() 
    2730 
     
    4245function GameClient:getActionMap(actionMapName) 
    4346    -- This is in Game now, not GameClient 
    44     return self:getActionMap(actionMapName) 
     47    return self:getGame():getActionMap(actionMapName) 
    4548end 
    4649 
  • tutorials/branches/0185_GEN_PHYSICS_REFACTOR_2/Tutorial4/scripts/client/init.lua

    r3480 r3501  
    1 package.path=package.path..";scripts\\?.lua" 
     1package.path=package.path..";scripts/?.lua" 
    22 
    3 require "core.Environment" 
    4 require "client.GameClient" 
     3print("=============\nLoading Tutorial4 initialization scripts...\n============"); 
     4 
     5print("Loading core.Environment"); 
     6require("core.Environment"); 
     7 
     8print("Loading client.GameClient"); 
     9require("client.GameClient"); 
    510 
    611-- Debug 
    7 -- require "core.debugHelp"; 
    8                                       
     12require "core.debugHelp"; 
     13 
     14-- Turn on tracing 
     15DebugInfo.trace = true; 
     16 
    917-- ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- 
    1018-- Create a game client of the specified type 
     
    1523-- ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- 
    1624-- Initialize the main taBBall Game 
    17 print("=============\nInitializing taBBall Client...\n============") 
     25print("=============\nInitializing Tutorial 4 Client...\n============") 
    1826gameClient:initialize() 
  • tutorials/branches/0185_GEN_PHYSICS_REFACTOR_2/Tutorial4/scripts/core/Environment.lua

    r989 r3501  
     1print("Loaded Environment.lua"); 
    12--[[ 
    23 
     
    78 
    89]] 
     10 
     11print("=============\nLoading Environment scripts...\n============") 
    912                         
    1013-- Get the environment 
  • tutorials/branches/0185_GEN_PHYSICS_REFACTOR_2/Tutorial4/scripts/core/debugHelp.lua

    r3480 r3501  
    11 
    2 local DebugInfo =  
     2print("=============\nLoading Debug scripts...\n============") 
     3 
     4DebugInfo =  
    35{ 
    46    nextIndex = 1; 
     7    trace = false; 
    58} 
    69 
     
    2124        DebugInfo.nextIndex = DebugInfo.nextIndex + 1; 
    2225 
    23         --local s = info.short_src 
    24         --print(s .. ":" .. line) 
     26        if (DebugInfo.trace) then 
     27            local s = info.short_src 
     28            print(s .. ":" .. line) 
     29        end 
    2530    end 
    2631