Jump to content

SpiderPig

Members
  • Posts

    2,348
  • Joined

  • Last visited

Posts posted by SpiderPig

  1. I found it in the top-left corner of the console window, thanks. But is there any way to do it globally from a tab or button in the Visual C++ Properties so that any project that compiles with a console will have that large buffer size?

     

    @Brent Taylor : Thanks, I was also after code to do this a while back. :)

  2. I've recently updated to 2.43 and now when I run my projects from C++ the terrains texture is rendered as a 2D image in the top right hand corner of the screen and the terrain is no longer visible as a 3D object. Even when I load a previously created .sbx file into the editor it does the same - as well as when I create a new terrain in the editor then texture it.

    Anybody else had the same problem?

  3. A terrain system with more flexibility would be nice, like;

     

    An increased number of LOD levels,

    Being able to control what the maximum / minimum LOD level is,

    A map which will set certain quads to not update past a certain LOD level, or to stay a certain LOD level (useful for buildings in the distance, so when you zoom in the building isn't floating or buried),

    Being able to set which areas are visible by a command, instead of just by the editor,

    Cave maps, River maps, Road maps,

    Increased amount of textures....which I think is already planned,

     

     

    Do I dream too big? :)

  4. SetTerrainHeight

    C: void SetTerrainHeight( TEntity terrain, long x, long y, flt height )

    C++: void Terrain::SetHeight( int x, int y, flt height )

    BlitzMax: SetTerrainHeight( terrain:TTerrain, x, y, height# )

    Pascal: procedure SetTerrainHeight ( terrain:THandle; x:Integer; y:Integer; height:Single );

    Sets the terrain height at the specified grid point. Height should be a number between 0 and 1.

     

    How is a height between 0 and 1 of any use? Are all vertex heights in a terrain decimals are they?

  5. The description says it!

     

    I've made a function in a dll and I want to write text to the screen through it (on the leadwerks buffer), but printf only prints to the console.

    I could make do with that but it keeps adding to it every loop and it's not pretty...

    Does any one know how to print to the screen using C++ commands?

    Or - printing to the console and erasing text from the previous loop?

     

    Thanks!

  6. Haha, Just figured it out once I posted it...

     

    I had to do;

     

    TPick pick

     

    instead of;

     

    TPick* pick

     

    and call on it like so;

     

    if(MouseHit(1))
    		{
    		if(CameraPick(&pick,camera,Vec3(MouseX(),MouseY(),100),2,0,0))
    		{
    				EntityColor(pick.entity,Vec4(0,1,0,0));
    		};
    		};
    

     

    Well, hope this helps someone else :)

     

    Though how do I check which entity I'm picking in order to change the color of only that entity? The following code didn't work for me;

     

    		if(MouseHit(1))
    		{
    		if(CameraPick(&pick,camera,Vec3(MouseX(),MouseY(),100),2,0,0))
    		{
    			if(pick.entity==cube)
    			{
    				EntityColor(pick.entity,Vec4(0,1,0,0));
    			};
    		};
    		};
    

  7. Hi,

     

    CameraPick() is givening me the following error;

     

    "Unhandled exception at 0x752c9b60 in game-Release.exe: 0xC0000005: Access violation writing location 0x00000000."

     

    and then it goes to this line in "Disassembly";

     

    "752C9B60 rep movs dword ptr es:[edi],dword ptr [esi] "

     

    This is my code;

     

    TPick* pick
    
    while( !KeyHit() && !AppTerminate() )
    {
    	if( !AppSuspended() ) // We are not in focus!
    	{
    
    		if(MouseHit(1))
    		{
    		if(CameraPick(pick,camera,Vec3(MouseX(),MouseY(),100),2,0,0))
    		{
    			EntityColor(pick->entity,Vec4(0,1,0,0));
    		};
    		};
    
    
    		UpdatePlayer();
    
    	                UpdateAppTime();
    		UpdateWorld(AppSpeed()) ;
    
    		// Render
    		SetBuffer(gbuffer);
    		RenderWorld();
    
    		SetBuffer(BackBuffer());
    		RenderLights(gbuffer);//ComputerTexture=GetColorBuffer(BackBuffer(),1);
    
    		Flip(1) ;
    	}
    }
    

     

    I tried it without setting the color of the picked entity or a mouse check but it still crashed.

    What am I missing?

  8. I think this still comes under the same topic:

     

    How do I render lights and shadows to the ComputerBuffer?

    I tried this code but I get no change at all;

     

                   TBuffer currentb=CurrentBuffer();
    TWorld currentw=CurrentWorld();
    
    SetWorld(ComputerWorld);
    RotateEntity(cube,Vec3(0,EntityRotation(cube).Y+=1,0));
    UpdateWorld(AppSpeed());
    
    SetBuffer(ComputerBuffer);
    RenderWorld();
    
    SetBuffer(ComputerLightBuffer);
    RenderLights(ComputerBuffer);
    
    
    ComputerTexture=GetColorBuffer(ComputerBuffer);
    SetMaterialTexture(mat1,ComputerTexture,0);
    SetBuffer(currentb);
    SetWorld(currentw);
    

     

    I've created a directional light after the creation of the ComputerWorld and ComputerLightBuffer is exaclty the same as ComputerBuffer. What am I doing wrong?

     

    EDIT: Figured it out. I have to get the color from the light buffer instead of the geometry buffer...

     

           TBuffer currentb=CurrentBuffer(); 
           TWorld currentw=CurrentWorld(); 
    
           SetWorld(ComputerWorld); 
           RotateEntity(cube,Vec3(0,EntityRotation(cube).Y+=1,0)); 
           UpdateWorld(AppSpeed()); 
    
           SetBuffer(ComputerBuffer); 
           RenderWorld(); 
    
           SetBuffer(ComputerLightBuffer); 
           RenderLights(ComputerBuffer); 
    
    
           ComputerTexture=GetColorBuffer(ComputerLightBuffer); 
           SetMaterialTexture(mat1,ComputerTexture,0); 
           SetBuffer(currentb); 
           SetWorld(currentw);
    

×
×
  • Create New...