编译nterrain需theoralib,但这个lib的theora_encode_init找不到dsp_static_init

0 views
Skip to first unread message

wakelong

unread,
Oct 23, 2006, 10:18:47 PM10/23/06
to 用nebula2 sdk来做游戏
编译nterrain需theoralib,但这个lib的theora_encode_init找不到dsp_static_init,这个函数是在哪里定义的哦

wakelong

unread,
Oct 23, 2006, 10:25:49 PM10/23/06
to 用nebula2 sdk来做游戏
虽然可以把这个引用注掉编过,但theora_decode_init就会没decode的功能了
虽然编过了,但contrib下的模块都没资源吗?运行了都提示缺文件什么的

kaikai

unread,
Oct 23, 2006, 10:46:05 PM10/23/06
to 用nebula2 sdk来做游戏
有些是长期没维护,底层更新了或者资源改了路径而它没更改。

wakelong

unread,
Oct 23, 2006, 10:47:53 PM10/23/06
to 用nebula2 sdk来做游戏
n2的文件管理有点麻烦,好像几个问题是跟目录有关
运行nct2viewer.exe弹出nKernelServer:Couldn't create object
'/sys/servers/script' of class ''.
physdemo.exe也出错,跟了下在D3D9Shader::LoadResource()里打开文件时,传入的文件名为空出错(这里感觉应能容错,而不是assert),而文件名为空是因为ManglePath找不到对应的shaders:shape.fx的路径

kaikai

unread,
Oct 23, 2006, 10:56:06 PM10/23/06
to 用nebula2 sdk来做游戏
这是没给类型名
class必须给出,否则kernel不知道该生成什么对象了。
修改到可以运行,但不知道它还能做什么。生成个patch,看看你有没有用:


Index: bldfiles/ncterrain2-tools.bld

===================================================================

--- bldfiles/ncterrain2-tools.bld (revision 2962)

+++ bldfiles/ncterrain2-tools.bld (working copy)

@@ -141,6 +141,8 @@

ngui
ncterrain2
nnetwork
+ ntoollib
+ ndsound
}
endtarget

Index: bldfiles/ncterrain2.bld

===================================================================

--- bldfiles/ncterrain2.bld (revision 2962)

+++ bldfiles/ncterrain2.bld (working copy)

@@ -59,5 +59,7 @@

ndshow
ngui
nnetwork
+ ntoollib
+ ndsound
}
endworkspace
Index: inc/ncterrain2/nchunklodmesh.h

===================================================================

--- inc/ncterrain2/nchunklodmesh.h (revision 2962)

+++ inc/ncterrain2/nchunklodmesh.h (working copy)

@@ -86,7 +86,7 @@

{
renderParams.shader->SetFloat4(nShaderState::MatDiffuse,
this->matDiffuse);
}
-
+/*
if (this->refMesh->GetRefillBuffersMode() == nMesh2::NeededNow)
{
// initiate loading process
@@ -99,10 +99,10 @@

n_sleep(0.001f);
}
}
-
+*/
nMesh2* mesh = this->refMesh.get();
n_assert(mesh->IsValid());
- renderParams.gfxServer->SetMesh(mesh);
+ renderParams.gfxServer->SetMesh(mesh, mesh);
renderParams.gfxServer->SetVertexRange(0, mesh->GetNumVertices());
renderParams.gfxServer->SetIndexRange(0, mesh->GetNumIndices());
renderParams.gfxServer->DrawIndexedNS(nGfxServer2::TriangleStrip);

Index: src/nct2tools/nbttotga.cc

===================================================================

--- src/nct2tools/nbttotga.cc (revision 2962)

+++ src/nct2tools/nbttotga.cc (working copy)

@@ -18,8 +18,8 @@


// get cmd line args
bool helpArg = args.GetBoolArg("-help");
- const char* inArg = args.GetStringArg("-in", 0);
- const char* outArg = args.GetStringArg("-out", 0);
+ nString inArg = args.GetStringArg("-in", 0);
+ nString outArg = args.GetStringArg("-out", 0);
int sizeArg = args.GetIntArg("-size", 256);
bool normalMapArg = args.GetBoolArg("-nmap");
float vscaleArg = args.GetFloatArg("-vscale", 10000.0f);
@@ -39,12 +39,12 @@

}

// check args
- if (!inArg)
+ if (!inArg.IsValid())
{
printf("-in arg expected!\n");
return 10;
}
- if (!outArg)
+ if (!outArg.IsValid())
{
printf("-out arg expected!\n");
return 10;
@@ -54,9 +54,9 @@


// open the bt file
nBtFile btFile(&kernelServer);
- if (!btFile.Open(inArg))
+ if (!btFile.Open(inArg.Get()))
{
- printf("Could not open bt file '%s' for reading.\n", inArg);
+ printf("Could not open bt file '%s' for reading.\n",
inArg.Get());
return 10;
}

@@ -64,9 +64,9 @@

nTgaFile tgaFile(&kernelServer);
tgaFile.SetWidth(sizeArg);
tgaFile.SetHeight(sizeArg);
- if (!tgaFile.OpenWrite(outArg))
+ if (!tgaFile.OpenWrite(outArg.Get()))
{
- printf("Could not open tga file for writing '%s'.\n", outArg);
+ printf("Could not open tga file for writing '%s'.\n",
outArg.Get());
return 10;
}

Index: src/nct2tools/nchopbtfile.cc

===================================================================

--- src/nct2tools/nchopbtfile.cc (revision 2962)

+++ src/nct2tools/nchopbtfile.cc (working copy)

@@ -16,8 +16,8 @@


// get cmd line args
bool helpArg = args.GetBoolArg("-help");
- const char* inArg = args.GetStringArg("-in", 0);
- const char* outArg = args.GetStringArg("-out", "out.bt");
+ nString inArg = args.GetStringArg("-in", 0);
+ nString outArg = args.GetStringArg("-out", "out.bt");
int xArg = args.GetIntArg("-x", 0);
int yArg = args.GetIntArg("-y", 0);
int wArg = args.GetIntArg("-w", 0);
@@ -41,7 +41,7 @@

}

// check args
- if (!inArg)
+ if (!inArg.IsValid())
{
printf("-in arg expected!");
return 10;
@@ -54,9 +54,9 @@


nKernelServer kernelServer;
nBtFile btFile(&kernelServer);
- if (!btFile.Open(inArg))
+ if (!btFile.Open(inArg.Get()))
{
- printf("Could not open -in file '%s'\n", inArg);
+ printf("Could not open -in file '%s'\n", inArg.Get());
return 10;
}

Index: src/nct2tools/nmaketerraintexture.cc

===================================================================

--- src/nct2tools/nmaketerraintexture.cc (revision 2962)

+++ src/nct2tools/nmaketerraintexture.cc (working copy)

@@ -17,7 +17,7 @@


// get cmd line args
bool helpArg = args.GetBoolArg("-help");
- const char* confArg = args.GetStringArg("-conf", 0);
+ nString confArg = args.GetStringArg("-conf", 0);

if (helpArg)
{
@@ -30,7 +30,7 @@

}

// check args
- if (!confArg)
+ if (!confArg.IsValid())
{
n_printf("-conf arg expected!\n");
return 10;
@@ -38,7 +38,7 @@


// create and configure a GenTerrainTexture object
nGenTerrainTexture genTexture(&kernelServer);
- genTexture.SetConfigFilename(confArg);
+ genTexture.SetConfigFilename(confArg.Get());
if (!genTexture.Run())
{
n_printf("Generating texture failed with: %s\n",
genTexture.GetError());
Index: src/nct2tools/nmaketqt2.cc

===================================================================

--- src/nct2tools/nmaketqt2.cc (revision 2962)

+++ src/nct2tools/nmaketqt2.cc (working copy)

@@ -20,9 +20,9 @@


// get cmd line args
bool helpArg = args.GetBoolArg("-help");
- const char* inFile = args.GetStringArg("-in", 0);
- const char* outFile = args.GetStringArg("-out", 0);
- const char* tmpFile = args.GetStringArg("-tmp", "home:tmp.tqt2");
+ nString inFile = args.GetStringArg("-in", 0);
+ nString outFile = args.GetStringArg("-out", 0);
+ nString tmpFile = args.GetStringArg("-tmp", "home:tmp.tqt2");
int depth = args.GetIntArg("-depth", 4);
int tileSize = args.GetIntArg("-tilesize", 256);
bool dxt1 = args.GetBoolArg("-dxt1");
@@ -43,12 +43,12 @@

return 5;
}

- if (!inFile)
+ if (!inFile.IsValid())
{
n_printf("Input filename required [-in]!\n");
return 10;
}
- if (!outFile)
+ if (!outFile.IsValid())
{
n_printf("Output filename required [-out]!\n");
return 10;
@@ -59,8 +59,8 @@

if (!compress)
{
nTqt2FileMaker fileMaker(&kernelServer);
- fileMaker.SetSourceFile(inFile);
- fileMaker.SetTargetFile(outFile);
+ fileMaker.SetSourceFile(inFile.Get());
+ fileMaker.SetTargetFile(outFile.Get());
fileMaker.SetTileSize(tileSize);
fileMaker.SetTreeDepth(depth);
if (!fileMaker.Run())
@@ -75,7 +75,7 @@

{
n_printf("-> compressing generated texture tiles...\n");
nTqt2Compressor compressor(&kernelServer);
- compressor.SetSourceFile(inFile);
+ compressor.SetSourceFile(inFile.Get());
if (dxt1)
{
compressor.SetMode(nTqt2Compressor::DXT1);
@@ -84,7 +84,7 @@

{
compressor.SetMode(nTqt2Compressor::DXT5);
}
- compressor.SetTargetFile(outFile);
+ compressor.SetTargetFile(outFile.Get());
if (!compressor.Run())
{
n_printf("TQT2 Compressor failed with: %s\n",
compressor.GetError());
Index: src/nct2viewer/nct2viewer.cc

===================================================================

--- src/nct2viewer/nct2viewer.cc (revision 2962)

+++ src/nct2viewer/nct2viewer.cc (working copy)

@@ -57,6 +57,7 @@

nNebulaUsePackage(ngui);
nNebulaUsePackage(nnetwork);
nNebulaUsePackage(ncterrain2);
+nNebulaUsePackage(ndsound);


//------------------------------------------------------------------------------
/*
@@ -103,11 +104,11 @@

nCmdLineArgs args(argc, argv);
#endif

- const char* scriptserverArg = args.GetStringArg("-scriptserver",
"ntclserver");
- const char* sceneserverArg = args.GetStringArg("-sceneserver", 0);
- const char* startupArg = args.GetStringArg("-startup",
"home:bin/startup.tcl");
- const char* viewArg = args.GetStringArg("-view", 0);
- const char* stageArg = args.GetStringArg("-stage",
"home:export/gfxlib/stdlight.n2");
+ nString scriptserverArg = args.GetStringArg("-scriptserver",
"ntclserver");
+ nString sceneserverArg = args.GetStringArg("-sceneserver", 0);
+ nString startupArg = args.GetStringArg("-startup",
"home:data/scripts/startup.tcl");
+ nString viewArg = args.GetStringArg("-view", 0);
+ nString stageArg = args.GetStringArg("-stage",
"home:export/gfxlib/stdlight.n2");
bool fullscreenArg = args.GetBoolArg("-fullscreen");
bool alwaysOnTopArg = args.GetBoolArg("-alwaysontop");
bool helpArg = args.GetBoolArg("-help");
@@ -115,10 +116,10 @@

int yPosArg = args.GetIntArg("-y", 0);
int widthArg = args.GetIntArg("-w", 640);
int heightArg = args.GetIntArg("-h", 480);
- const char* projDir = args.GetStringArg("-projdir", 0);
+ nString projDir = args.GetStringArg("-projdir", 0);

- const char* gfxServerClass = args.GetStringArg("-gfxserver", 0);
- const char* featureSetArg = args.GetStringArg("-featureset", 0);
+ nString gfxServerClass = args.GetStringArg("-gfxserver", 0);
+ nString featureSetArg = args.GetStringArg("-featureset", 0);

// If the user needs an explanation, just provide one, and don't
do anything else this execution
if (helpArg)
@@ -158,10 +159,11 @@

kernelServer.AddPackage(ngui);
kernelServer.AddPackage(nnetwork);
kernelServer.AddPackage(ncterrain2);
+ kernelServer.AddPackage(ndsound);

// initialize a display mode object
nString title;
- if (viewArg)
+ if (viewArg.IsValid())
{
title.Append(viewArg);
title.Append(" - ");
@@ -172,15 +174,15 @@

displayMode.SetDialogBoxMode(true);
if (fullscreenArg)
{
- displayMode.Set(title.Get(), nDisplayMode2::Fullscreen,
xPosArg, yPosArg, widthArg, heightArg, false);
+ displayMode.Set(title.Get(), nDisplayMode2::Fullscreen,
xPosArg, yPosArg, widthArg, heightArg, false, false, 0);
}
else if (alwaysOnTopArg)
{
- displayMode.Set(title.Get(), nDisplayMode2::AlwaysOnTop,
xPosArg, yPosArg, widthArg, heightArg, false);
+ displayMode.Set(title.Get(), nDisplayMode2::AlwaysOnTop,
xPosArg, yPosArg, widthArg, heightArg, false, false, 0);
}
else
{
- displayMode.Set(title.Get(), nDisplayMode2::Windowed, xPosArg,
yPosArg, widthArg, heightArg, false);
+ displayMode.Set(title.Get(), nDisplayMode2::Windowed, xPosArg,
yPosArg, widthArg, heightArg, false, false, 0);
}

// under Win32 check if we should read the project directory from
the registry
@@ -199,17 +201,17 @@

// initialize a viewer app object
nViewerApp viewerApp;
viewerApp.SetDisplayMode(displayMode);
- if (gfxServerClass) viewerApp.SetGfxServerClass(gfxServerClass);
- if (viewArg) viewerApp.SetSceneFile(viewArg);
- if (projDir) viewerApp.SetProjDir(projDir);
- if (featureSetArg)
+ if (gfxServerClass.IsValid())
viewerApp.SetGfxServerClass(gfxServerClass);
+ if (viewArg.IsValid()) viewerApp.SetSceneFile(viewArg);
+ if (projDir.IsValid()) viewerApp.SetProjDir(projDir);
+ if (featureSetArg.IsValid())
{
- nGfxServer2::FeatureSet featureSet =
nGfxServer2::StringToFeatureSet(featureSetArg);
+ nGfxServer2::FeatureSet featureSet =
nGfxServer2::StringToFeatureSet(featureSetArg.Get());
viewerApp.SetFeatureSetOverride(featureSet);
}

viewerApp.SetScriptServerClass(scriptserverArg);
- if (sceneserverArg)
viewerApp.SetSceneServerClass(sceneserverArg);
+ if (sceneserverArg.IsValid())
viewerApp.SetSceneServerClass(sceneserverArg);
viewerApp.SetStartupScript(startupArg);
viewerApp.SetStageScript(stageArg);

Index: src/ncterrain2/nchunklodmesh_main.cc

===================================================================

--- src/ncterrain2/nchunklodmesh_main.cc (revision 2962)

+++ src/ncterrain2/nchunklodmesh_main.cc (working copy)

@@ -26,7 +26,7 @@

// do NOT create the mesh object inside LoadResource(),
// because NewMesh() may not be multithreading safe
this->refMesh = nGfxServer2::Instance()->NewMesh(0);
- this->refMesh->SetRefillBuffersMode(nMesh2::DisabledOnce);
+// this->refMesh->SetRefillBuffersMode(nMesh2::DisabledOnce);
}


//------------------------------------------------------------------------------
@@ -150,7 +150,7 @@

this->matDiffuse.z = 0.5f + n_rand() * 0.5f;
this->matDiffuse.w = 1.0f;

- this->SetValid(true);
+ this->SetState(nResource::Valid);
return true;
}

@@ -169,5 +169,5 @@


// n_printf("nChunkLodMesh %s: unloading\n");

- this->SetValid(false);
+ this->SetState(nResource::Valid);
}
Index: src/ncterrain2/nchunklodtree_main.cc

===================================================================

--- src/ncterrain2/nchunklodtree_main.cc (revision 2962)

+++ src/ncterrain2/nchunklodtree_main.cc (working copy)

@@ -217,7 +217,7 @@

// update the root bounding box
this->UpdateBoundingBox();

- this->SetValid(true);
+ this->SetState(nResource::Valid);
return true;
}

@@ -259,7 +259,7 @@

this->texQuadTree = 0;
}

- this->SetValid(false);
+ this->SetState(nResource::Valid);
}


//------------------------------------------------------------------------------
Index: src/ncterrain2/nterraingrassnode_main.cc

===================================================================

--- src/ncterrain2/nterraingrassnode_main.cc (revision 2962)

+++ src/ncterrain2/nterraingrassnode_main.cc (working copy)

@@ -86,9 +86,9 @@

}

// render the mesh
- gfxServer->SetMesh(attrs->mesh);
+ gfxServer->SetMesh(attrs->mesh, attrs->mesh);
gfxServer->SetVertexRange(0, attrs->mesh->GetNumVertices());
gfxServer->DrawNS(nGfxServer2::PointList);
- gfxServer->SetMesh(0);
+ gfxServer->SetMesh(0, 0);
return true;
}

wakelong

unread,
Oct 24, 2006, 12:01:31 AM10/24/06
to 用nebula2 sdk来做游戏
谢谢kaikai
,patch已打入(之前我也能编译过也类似的改了,只是方式略有不同,比如const

char* scriptserverArg = args.GetStringArg("-scriptserver",
"ntclserver"),我之前是改为了const char* scriptserverArg =
args.GetStringArg("-scriptserver",
"ntclserver").Get();,而你的是改为nString scriptserverArg =
args.GetStringArg("-scriptserver",
"ntclserver");你的方式应该更好)
现在能运行,nct2viewer.exe可以了(把startup.tcl放到trunk\nebula2\bin下);physdemo运行的时候出错Unexpected
error, D3DERR_INVALIDCALL,调试ing.....

wakelong

unread,
Oct 24, 2006, 3:26:59 AM10/24/06
to 用nebula2 sdk来做游戏
nebula\trunk\nebula2\code\nebula2\src\gfx2\nd3d9server_render.cc(898):
DrawIndexedPrimitive() failed! hr=D3DERR_INVALIDCALL (0x8876086c)

是怎么回事啊

Reply all
Reply to author
Forward
0 new messages