Quote from: gameus on November 06, 2012, 08:38:42 am
Try this one. I built it under "Release" instead.
https://www.box.com/s/7j0nukeqec8r291pd1ha (It's just the DLL file)
thanks, I forgot that I am using debug...
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Quote from: gameus on November 06, 2012, 08:38:42 am
Try this one. I built it under "Release" instead.
https://www.box.com/s/7j0nukeqec8r291pd1ha (It's just the DLL file)
Quote from: gameus on November 05, 2012, 07:39:22 pm
The Graphics.frame_rate = xx only works up to 60 FPS (If I'm correct. I believe Blizzard was the one who discovered this), but that's most games nowadays. Anyways, nice job on this. I say if you can figure out how to either A) render directly to the RGSS Window or B) get rid of the window, you'll be good to go. Looking forward to the source, I always love peaking at code in hopes to learn something.
EDIT: Also, you can still keep RMXP as the editor and the engine as a separate ruby script. RMXP saves data using Ruby's serialization method. So all you'd need to do is have your engine load up the default classes (which can be found in the help manual) and you can load/save RMXP data.
Quote from: gameus on November 05, 2012, 06:02:01 pm
All it's really doing is calling upon Win32API calls. You'd be better off using you're code in pure Ruby 1.9 rather than using the RGSS engine. I looked through your code, the only RGSS calls you're making deal with the Graphics module and the Input module. Running this in plain Ruby would get rid of the second screen problem and run much faster than the RGSS engine. Even if the rendering is running at 100 FPS, the input you'd be getting from the RGSS engine is still limited to 40 FPS just for the fact that Enterbrain programmed it that way.
Also, might I suggest you leaving the DLL as open source? All it is is just a wrapper to communicate between Ruby and the Irrlicht library. Leaving it open source can bring a lot of good things. Such as improvements from the community. Giving an understanding of how Irrlicht works to other people. Plus, if you ever decide to stop working on the project, it wouldn't be completely dead as there is still opportunity for someone to pick it up.
Quote from: Blizzard on November 05, 2012, 05:19:30 pm
So basically this allows you to run custom Irrlicht stuff within RMXP?
Quote from: Blizzard on October 13, 2012, 06:41:49 pm
Just curious, was it the commented line "//p_Device = InitializeDevice(hWnd);"? xD
/*
* XP 3D dll main
* By: Hansiec
* YOU ARE NOT ALLOWED TO MODIFY THIS EXCEPT FOR SELF-PURPOSES OR BUG FIXING!
* ~~~ You have been warned... (Self purposes meaning no re-distributions at all unless it's for a fix of a bug/improvements)
*/
#pragma comment (lib, "d3dx9.lib")
// Exclude rarely-used stuff from Windows headers
#define WIN32_LEAN_AND_MEAN
// Windows Header Files:
#include <windows.h>
#include <windowsx.h>
// C++ RunTime Header Files
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
// DirectX Header Files
#include <d3d9.h>
#include <d3dx9.h>
#include "dll.h"
#define export extern "C" __declspec(dllexport)
// Variables
HWND hWnd;
int dll_version = 0;
LPDIRECT3DDEVICE9 p_dx_Device;
LPDIRECT3D9 p_dx_Object;
LPDIRECT3DDEVICE9 p_Device;
// Some usefull functions for setup.
export void init(int i){
// Sets the Window handle that you must get from XP.
hWnd = (HWND) i;
// Initialize some Direct 3D variables
p_dx_Object = Direct3DCreate9(D3D_SDK_VERSION);
if (p_dx_Object == NULL)
{
// Only display if we do not have DirectX
MessageBox(hWnd,"DirectX Runtime library not installed!","3DXP Error in: init()",MB_OK);
}
// initialize more variables
D3DPRESENT_PARAMETERS dx_PresParams;
// Device creation
ZeroMemory( &dx_PresParams, sizeof(dx_PresParams) );
dx_PresParams.Windowed = TRUE;
dx_PresParams.SwapEffect = D3DSWAPEFFECT_DISCARD;
dx_PresParams.BackBufferFormat = D3DFMT_UNKNOWN;
p_dx_Object->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &dx_PresParams, &p_dx_Device);
if (FAILED(p_dx_Object->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &dx_PresParams, &p_dx_Device)))
{
if (FAILED(p_dx_Object->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_REF, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &dx_PresParams, &p_dx_Device)))
{
MessageBox(hWnd,"Failed to create even the reference device!","3DXP Error in: init()",MB_OK);
}
}
// finally we set our device.
//p_Device = InitializeDevice(hWnd);
//p_Device = p_dx_Object->AddRef(hWnd);
}
// Returns the owner of the DLL (Just for checks of theft)
export char* get_owner(){
return "Hansiec";
}
// Returns the Direct 3D SDK version
export int get_version(){
return D3D_SDK_VERSION;
}
// Checks the XP3D dll version
export int check_version(int version){
return (int) version >= dll_version;
}
// Renders a frame
export int render(){
HRESULT hr;
struct D3DVERTEX {float x, y, z, rhw; DWORD color;} vertices[3];
vertices[0].x = 50;
vertices[0].y = 50;
vertices[0].z = 0;
vertices[0].rhw = 1.0f;
vertices[0].color = 0x00ff00;
vertices[1].x = 250;
vertices[1].y = 50;
vertices[1].z = 0;
vertices[1].rhw = 1.0f;
vertices[1].color = 0x0000ff;
vertices[2].x = 50;
vertices[2].y = 250;
vertices[2].z = 0;
vertices[2].rhw = 1.0f;
vertices[2].color = 0xff0000;
LPDIRECT3DVERTEXBUFFER9 pVertexObject = NULL;
void *pVertexBuffer = NULL;
if(FAILED(p_dx_Device->CreateVertexBuffer(3*sizeof(D3DVERTEX), 0,
D3DFVF_XYZRHW|D3DFVF_DIFFUSE, D3DPOOL_DEFAULT, &pVertexObject, NULL)))
return(0);
if(FAILED(pVertexObject->Lock(0, 3*sizeof(D3DVERTEX), &pVertexBuffer, 0)))
return(0);
memcpy(pVertexBuffer, vertices, 3*sizeof(D3DVERTEX));
pVertexObject->Unlock();
p_dx_Device->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0);
p_dx_Device->BeginScene();
p_dx_Device->SetStreamSource(0, pVertexObject, 0, sizeof(D3DVERTEX));
p_dx_Device->SetFVF(D3DFVF_XYZRHW|D3DFVF_DIFFUSE);
p_dx_Device->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 1);
p_dx_Device->EndScene();
}
Quote from: Wizered67 on October 07, 2012, 04:33:48 pm
The current plan is that its going to be a hosted server, but I would consider looking into the alternative of host-your-own-server.
Quote from: Wizered67 on October 07, 2012, 02:48:41 am
I finally got around to adding crafting! Big thanks to Ryex for making his Mouse Window API so easy to adapt. I'm using it for pretty much every window imaginable xD
I'm open to suggestions and feedback if anyone has any.
Quote from: Wizered67 on May 17, 2012, 10:51:47 pm
I think it looks really good, but I'm worried that now it's going to be too much like Minecraft with no reason to play this instead. Just a thought.
Quote from: Wizered67 on May 10, 2012, 08:10:51 pm
Actually, the lag was/is caused by the server sending so much data over to the client every time the map changed, and then reloading the entire map. Looking back, this was a really stupid way of doing it. Now I'm trying to get it to work where it only modifies the changed parts of the map, not the entire thing.