Jump to content

2 40 and framewerk


DarthRaff
 Share

Recommended Posts

In my case yes ... so I'd like to see the solution to this if this is indeed the case. I'm using my own modified version of the framewerk which was retained (if not maintained) so we could do just this! I'm still working with 2.31

 

When you say 'Framewerk it's not working in 2 40' what problems are you experiencing ?

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

Well, when i compile the program it can't find any framewerk asociated word and can't find the include. I know that framework is similar but, for example, in framewerk you can do as easy as:

    leadwerks::Framewerk fw;
fw.Create();
// Setup Global Objects
SetGlobalObject ("world_main", fw.GetMain ().GetWorld ());
SetGlobalObject ("world_transparency", fw.GetTransparency ().GetWorld ());
SetGlobalObject ("world_background", fw.GetBackground ().GetWorld ());
SetGlobalObject ("camera_main", fw.GetMain ().GetCamera ());
SetGlobalObject ("camera_transparency", fw.GetTransparency ().GetCamera ());
SetGlobalObject ("camera_background", fw.GetBackground ().GetCamera ());
TListener listener= CreateListener(fw.GetMain ().GetCamera ());
SetGlobalObject("listener", listener);
// Setup Initial Post Processing FX 
fw.GetRenderer().SetGodRays(1);
fw.GetRenderer().SetHDR(0);
fw.GetRenderer().SetSSAO(1);
fw.GetRenderer().SetBloom(0);
fw.GetRenderer().SetAntialias(1);
fw.GetRenderer().SetReflectionRenderComponents(ENTITY_RENDERABLE);

 

and in framework it's similar but i can't find, for example, how to set up the post processing fx, and so

Link to comment
Share on other sites

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Have you copied the framewerk.cpp and framewerk.h files from your previous version. These are now fixed (not being maintained) and I don't think they are distributed with new builds any more.

 

If you have no need to modify the framewerk then there is nothing to stop you from using the embedded framework syntax but you will never be able to alter this in any way should you want to. I don't know off hand what the syntax is but isn't there a page in the Wiki on both the framewerk and the framework.

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

Thank you very much for your answers.

 

Not tryed copy the files because i thought that if it's a new version framewerk.cpp and framewerk.h don't will work. but i will try.

 

Yes i found the page and i'm try the appropriate changes but i have an error.

 

Here is the code:

//#include "framewerk.h"
#include "engine.h"
#include <math.h>
#include <string>
#include <vector>
#include "monsterfuncs.h"
//#include <iostream>
#include <sstream>

using namespace std;
string nametext;
string picname;
int countimage=0;

#pragma warning(disable:4996)

int state;
float fb;
float fe;

int animtex;

TController player;
TMesh mirillasprite;
TMaterial mirillamat[2];
TTexture mirillatex;
TMesh telaranya1;

TTexture electrictex[5];
TTexture electrictexdot[5];
TMaterial electricmat;
//TTexture electrictex;
//TTexture electrictexdot;

string StringToInt(int number)
{
stringstream ss;//create a stringstream
ss << number;//add number to the stream
return ss.str();//return a string with the contents of the stream
//return (str)ss.c_str();
}


class Monster
{
public:
TController monstercont;
TMesh monsterent;
TVec3 monsterpos;
TVec3 monsterrot;
int monsterstate;
float mstartframe;
float mendframe;
//TMaterial monstermat;
};
vector<Monster> monsterarray;
vector<Monster>::iterator monsteriter;

void LoadTextureSeq(string name,int num)
{
string tn;
string tndot;
int n=0;
for(n=0;n!=num;n++)
{
	tn="objs/monsters/DK1/";
	tn+=name;
	tn+=StringToInt(n+1);
	tn+=".dds";
	electrictex[n]=LoadTexture((str)tn.c_str());
	tndot="objs/monsters/DK1/";
	tndot+=name;
	tndot+=StringToInt(n+1);
	tndot+="dot3";
	tndot+=".dds";
	electrictexdot[n]=LoadTexture((str)tndot.c_str());
}
}

void UpdateTexture(int num)
{
animtex++;
if(animtex > num-1)
{
	animtex=0;
}
SetMaterialTexture(electricmat,electrictex[animtex],0);
SetMaterialTexture(electricmat,electrictexdot[animtex],1);
}

void UpdateMonsters()
{
for(monsteriter=monsterarray.begin();monsteriter!=monsterarray.end();monsteriter++)
{
	SlowPointEnt((*monsteriter).monstercont,player,.5);
	//PointEntity((*monsteriter).monstercont,player,3,0.5f,.0f);
	(*monsteriter).monsterrot=EntityRotation((*monsteriter).monstercont);
	UpdateController((*monsteriter).monstercont,(*monsteriter).monsterrot.Y,0.0f,0.0f,0.0f,500);
	RotateEntity((*monsteriter).monsterent,(*monsteriter).monsterrot);
	PositionEntity((*monsteriter).monsterent,Vec3((*monsteriter).monsterpos.X,(*monsteriter).monsterpos.Y-1.02,(*monsteriter).monsterpos.Z));
	if(KeyHit(KEY_UP))
	{
		if((*monsteriter).monsterstate <3)
		{
			monsteriter->monsterstate++;
		}
		else
		{
			monsteriter->monsterstate=0;
		}
	}
	if(KeyHit(KEY_DOWN))
	{
		if((*monsteriter).monsterstate >0)
		{
			monsteriter->monsterstate--;
		}
		else
		{
			monsteriter->monsterstate=3;
		}
	}
	switch ((*monsteriter).monsterstate)
	{
		case 1:
			monsteriter->mstartframe=41.0f;
			monsteriter->mendframe=85.0f;
			break;
		case 2:
			monsteriter->mstartframe=90.0f;
			monsteriter->mendframe=117.0f;
			break;
		case 3:
			monsteriter->mstartframe=149.0f;
			monsteriter->mendframe=184.0f;
			break;
		default:
			monsteriter->mstartframe=1.0f;
			monsteriter->mendframe=40.0f;
			break;
	}
	AnimeEntitySeq((*monsteriter).monsterent,(*monsteriter).mstartframe,(*monsteriter).mendframe,3.0f,100.0f);
	//PaintEntity((*monsteriter).monsterent,electricmat);
}
}

float IntToFloat1(int n)
{
  return(float(float(n)/float(255.0)));
}

TVec4 StringToVec4(string s, int noconv=0)
{
  flt a[4], cf=0;
  int p=0, q=0, i=0, ci=0;
  string c;
  if(s.length()>0)
  {
     while(p<=(signed)s.length())
     {
        q=p+1;
        p=(s+" ").find(" ",q)+1;
        c=s.substr(q-1,p-q);
        if((c.find(".")!=-1)|(noconv))
        {
           sscanf(c.c_str(),"%f",&cf);
           a[i]=cf;
        }
        else
        {
           sscanf(c.c_str(),"%d",&ci);
           a[i]=IntToFloat1(ci);
        }
        i++;
     }
  }
  return(Vec4(a[0],a[1],a[2],a[3]));
}

void ProcessSceneObjects(TEntity scene)
{
TEntity ent;
TModel entmesh;
TVec3 entpos;
string s="";
string cname;
string cname2;
TVec4 color;
int intensity;
//TMaterial doormat;

for (int i = 1; i <= CountChildren(scene); i++)
{

	ent = GetChild(scene,i);
	cname=GetEntityKey(ent,"classname","");

	if(cname=="room")
	{
		EntityType(ent,2);
	}

	if(cname=="playerstart")
	{
		PositionEntity(player,EntityPosition(ent));
	}

}
}

int main( int argn, char* argv[] )
{
int screenx=1280, screeny=960, camx=screenx/2, camy=screeny/2;

Initialize() ;

//Create a graphics context
Graphics(screenx,screeny);

   TFramework framework=CreateFramework(); 
   TLayer layer = GetFrameworkLayer(0); 
   TCamera cam=GetLayerCamera(layer); 
   PositionEntity(cam,Vec3(0,0,0));
TListener listener=GetFrameworkListener();
EntityParent(listener,cam);

   //Set Lua variable 
   BP L=GetLuaState(); 
   lua_pushobject(L,framework); 
   lua_setglobal(L,"fw"); 
   lua_pop(L,1); 

   // Setup Initial Post Processing FX 
   SetGodRays(1); 
   SetHDR(0); 
   SetSSAO(1); 
   SetBloom(0); 
   SetAntialias(1); 
   SetStats(2);

// Setup Collisions
Collisions(1, 1, 1);
Collisions(1, 2, 1);
Collisions(1, 3, 1);
Collisions(2, 2, 1);
Collisions(2, 3, 1);
Collisions(3, 3, 1);

Monster m;
	m.monstercont=CreateController(2.7f,0.9f,0.25f,45);

	//GetFrameworkLayer(1);
	m.monsterent=LoadMesh("objs/monsters/DK1/Material4/dk1.gmf");
	//GetFrameworkLayer(0);

	m.monsterrot=Vec3(0.0f,0.0f,0.0f);
	m.monsterpos=Vec3(0.0f,1.5f,-2.0f);
	m.monsterstate=0;
	RotateEntity(m.monstercont,m.monsterrot);
	RotateEntity(m.monsterent,m.monsterrot);
	PositionEntity(m.monstercont,m.monsterpos);
	PositionEntity(m.monsterent,m.monsterpos);

	EntityType(m.monstercont,2);
	SetBodyMass(m.monstercont,80.0f);

	//electricmat=LoadMaterial("objs/monsters/DK1/electric1.mat");
	//PaintEntity(m.monsterent,electricmat);

	monsterarray.push_back(m);

int sequence=1;
float framebegin;
float frameend;
float frame;

////Load Texture Seq
//LoadTextureSeq("electric",5);

//Create a physics body
TBody body=CreateBodyBox();
SetBodyMass(body,10.0f);
TMesh mesh=CreateCube();
EntityParent(mesh,body);
PositionEntity(body,Vec3(-6,5,0));
EntityType(body,2);
TMaterial meshmat=LoadMaterial("objs/Pruebas/a1.mat");
PaintEntity(mesh,meshmat);

//Create another physics body
TModel oildrum=LoadModel("scene/oildrum.gmf");
PositionEntity(oildrum,Vec3(6,5,0));
EntityType(oildrum,2);
SetBodyMass(oildrum,10.0f);


player=CreateController(1.84f,0.50f,0.5f,45);
//player=CreateController(1.84f,0.50f,0.5f,45);
EntityType(player,1);
//SetBodyDamping(player,.5f,.5f);
SetBodyMass(player,60.0f);
//SetWorldGravity(Vec3(0,-9.8f,0));
float move=0.0;
float strafe=0.0;
bool crouch=0;
float cameraheight=1.74f;
TVec3 camrotation=Vec3(0);
TVec3 playerpos;
float mx=0;
float my=0;
HideMouse();
//MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2);
MoveMouse(camx,camy);

PositionEntity(player,Vec3(0.0f,3.0f,-3.0f));

GetFrameworkLayer(1);

mirillasprite=LoadMesh("Sprites/simplesprite1.gmf",GetLayerCamera(layer));
mirillamat[0]=LoadMaterial("Sprites/white.mat");
mirillamat[1]=LoadMaterial("Sprites/green.mat");
mirillatex=mirillamat[0];
PaintEntity(mirillasprite,mirillatex);
PositionEntity(mirillasprite,Vec3(0,0,0.15));
ScaleEntity(mirillasprite,Vec3(.08f,.08f,1.0f));

telaranya1=LoadMesh("Sprites/simplesprite2.gmf");
ScaleEntity(telaranya1,Vec3(2.0f,2.0f,1.0f));
PositionEntity(telaranya1,Vec3(3.0f,1.5f,.0f));
RotateEntity(telaranya1,Vec3(.0f,45.0f,.0f));

GetFrameworkLayer(0);

LoadScene("scene/prueba5.sbx");

int debphy=0;

//Main loop
// Game loop
while( !KeyHit(KEY_ESCAPE) && !AppTerminate() )
{
	if( !AppSuspended() ) // We are not in focus!
	{

		if(KeyHit(KEY_P)){debphy=1-debphy;DebugPhysics(debphy);}

		move=(KeyDown(KEY_W)-KeyDown(KEY_S));
		strafe=(KeyDown(KEY_D)-KeyDown(KEY_A));

		//Jumping
		float jump=0.0;
		if (KeyHit(KEY_SPACE)) {
			if (!ControllerAirborne(player)) {
				jump=4.0;
			}
		}
		//Run
		if (KeyDown(KEY_LSHIFT)||KeyDown(KEY_RSHIFT)) {
			if (!ControllerAirborne(player)) {
				move/=2.0;
				strafe/=2.0;
			}
		}
		//crouch
		if (KeyHit(KEY_C)){
			//if (ControllerCrouched(player)){
			if (crouch==1){
				crouch=0;                        
				cameraheight=1.74f;
			}
			else{
				crouch=1;                        
				cameraheight=0.80f;
			}
		}

		playerpos=EntityPosition(player);
		//Camera looking
		mx=Curve(MouseX()-GraphicsWidth()/2,mx,6);
		my=Curve(MouseY()-GraphicsHeight()/2,my,6);
		MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2);
		camrotation.X=camrotation.X+my/5.0;
		if (camrotation.X < -90){ camrotation.X = -90;}
		if (camrotation.X > 90){ camrotation.X = 90;}
		camrotation.Y=camrotation.Y-mx/5.0;
		RotateEntity(cam,camrotation);

		////Set controller input
		UpdateController(player,camrotation.Y,move*3.0,strafe*3.0,jump,500,1,crouch);
		PositionEntity(cam,Vec3(playerpos.X,playerpos.Y+cameraheight,playerpos.Z));
		TVec3 camerapos=EntityPosition(cam);
		TVec3 poscont=EntityPosition(player);


		if(MouseDown(2))
		{
			mirillatex=mirillamat[1];
		}
		else
		{
			mirillatex=mirillamat[0];
		}

		GetFrameworkLayer(1);			

		PaintEntity(mirillasprite,mirillatex);

		GetFrameworkLayer(0);

		UpdateAppTime();
		UpdateWorld(AppSpeed()) ;

		PositionEntity(cam,camerapos);

		//UpdateTexture(5);
		UpdateMonsters();


		UpdateFramework();
		RenderFramework();

		if(KeyHit(KEY_F1)) // Press F1 to save a screenshot
		{
			countimage+=1;
			picname="Pics/ScreenShoot_";
			picname+=StringToInt(countimage);
			picname+=".jpg";
			char fn[32] = {0};
			_snprintf(fn, 31, (str)picname.c_str(), GetTickCount());
			SaveBuffer(BackBuffer(), fn, 100);
		}

		// Send to screen
		Flip(0) ;
	}
}

//// Done
////exitapp:
FreeFramework(framework);
return Terminate() ;
}

 

and the error (it's not an error but it appears in the engine text):

 

Leadwerks Engine 2.40

Initializing Renderer...

OpenGL Version: 3.0.0

GLSL Version: 1.30 NVIDIA via Cg compiler

Render device: GeForce 9800 GT/PCI/SSE2

Vendor: NVIDIA Corporation

DrawBuffers2 supported: 1

32 texture units supported.

GPU instancing supported: 1

Max batch size: 64

Shader model 4.0 supported: 1

Conditional render supported: 0

Error: Shader file "abstract::query.vert" not found.

 

i don't know what is that file because i never had that error before. Thank you

Link to comment
Share on other sites

Error: Shader file "abstract::query.vert" not found.

 

 

Normally means you don't have the shader.pak in the Apps path...

AMD Bulldozer FX-4 Quad Core 4100 Black Edition

2 x 4GB DDR3 1333Mhz Memory

Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5

Windows 7 Home 64 bit

 

BlitzMax 1.50 • Lua 5.1 MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro

3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET

 

LE 2.5/3.4 • Skyline UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0

 

Marleys Ghost's YouTube Channel Marleys Ghost's Blog

 

"I used to be alive like you .... then I took an arrow to the head"

Link to comment
Share on other sites

Sorry, i'm feeling so stupid. I copied the shaders.pak the first time but then i forgot it the following time. Now working all except the transparency. I need to set it correctly but i don't know how to set the layer or whatever by now. Thank you very much and sorry :) .

Link to comment
Share on other sites

I updated my game engine code to 2.40 with no issues other than a parameter change to one command (see below). The framewerk worked perfectly so I suspect you have your files a bit mixed up. I'd go back to your original version that previously worked with framewerk and whatever version of Leadwerks and copy the project as a backup. Then update the original to 2.4 and copy over your framewerk files (confirmed they are not in the 2.4 release) and try again. It should work ok.

 

The syntax of the following function appears to have changed between 2.31 and 2.4 with no reference to it, that I can see, in the version file:

 

2.31

typedef void (_stdcall *TEntityViewRange) (TEntity entity, flt nearrange, flt farrange, int recursive);

 

 

2.40

typedef void (_stdcall *TEntityViewRange) (TEntity entity, int range, int recursive);

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

Yes feeling stupid more and more. You are right now Framewerk working. I hate when i forget things thinking i have all correctly copied. I make other users, who kindly helps me, waste theire time. Sorry thousand times. Very angry with myself. Sorry again and thank you very much.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...