Uh, Updates?
This commit is contained in:
@@ -149,7 +149,7 @@ static gxChannel *allocSoundChannel( int n ){
|
||||
for( int k=0;k<soundChannels.size();++k ){
|
||||
chan=soundChannels[next_chan];
|
||||
if( !chan ){
|
||||
chan=soundChannels[next_chan]=d_new SoundChannel();
|
||||
chan=soundChannels[next_chan]=new SoundChannel();
|
||||
channels.push_back(chan);
|
||||
}else if( chan->isPlaying() ){
|
||||
chan=0;
|
||||
@@ -162,7 +162,7 @@ static gxChannel *allocSoundChannel( int n ){
|
||||
next_chan=soundChannels.size();
|
||||
soundChannels.resize(soundChannels.size()*2);
|
||||
for( int k=next_chan;k<soundChannels.size();++k ) soundChannels[k]=0;
|
||||
chan=soundChannels[next_chan++]=d_new SoundChannel();
|
||||
chan=soundChannels[next_chan++]=new SoundChannel();
|
||||
channels.push_back( chan );
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ runtime(r){
|
||||
soundChannels.resize( 4096 );
|
||||
for( int k=0;k<4096;++k ) soundChannels[k]=0;
|
||||
|
||||
cdChannel=d_new CDChannel();
|
||||
cdChannel=new CDChannel();
|
||||
channels.push_back( cdChannel );
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ gxSound *gxAudio::loadSound( const string &f,bool use3d ){
|
||||
FSOUND_SAMPLE *sample=FSOUND_Sample_Load( FSOUND_FREE,f.c_str(),flags,0,0 );
|
||||
if( !sample ) return 0;
|
||||
|
||||
gxSound *sound=d_new gxSound( this,sample );
|
||||
gxSound *sound=new gxSound( this,sample );
|
||||
sound_set.insert( sound );
|
||||
return sound;
|
||||
}
|
||||
@@ -268,11 +268,11 @@ gxChannel *gxAudio::playFile( const string &t,bool use_3d ){
|
||||
f.find( ".asf" )!=string::npos ){
|
||||
FSOUND_STREAM *stream=FSOUND_Stream_Open( f.c_str(),use_3d,0,0 );
|
||||
if( !stream ) return 0;
|
||||
chan=d_new StreamChannel( stream );
|
||||
chan=new StreamChannel( stream );
|
||||
}else{
|
||||
FMUSIC_MODULE *module=FMUSIC_LoadSong( f.c_str() );
|
||||
if( !module ) return 0;
|
||||
chan=d_new MusicChannel( module );
|
||||
chan=new MusicChannel( module );
|
||||
}
|
||||
channels.push_back( chan );
|
||||
songs[f]=chan;
|
||||
|
||||
@@ -528,11 +528,11 @@ bool gxCanvas::collide(int x1, int y1, const gxCanvas *i2, int x2, int y2, bool
|
||||
if (solid) return true;
|
||||
|
||||
if (!cm_mask) {
|
||||
cm_mask = d_new unsigned[cm_pitch*clip_rect.bottom];
|
||||
cm_mask = new unsigned[cm_pitch*clip_rect.bottom];
|
||||
updateBitMask(clip_rect);
|
||||
}
|
||||
if (!i2->cm_mask) {
|
||||
i2->cm_mask = d_new unsigned[i2->cm_pitch*i2->clip_rect.bottom];
|
||||
i2->cm_mask = new unsigned[i2->cm_pitch*i2->clip_rect.bottom];
|
||||
i2->updateBitMask(i2->clip_rect);
|
||||
}
|
||||
|
||||
@@ -616,7 +616,7 @@ bool gxCanvas::rect_collide(int x1, int y1, int x2, int y2, int w2, int h2, bool
|
||||
ir.bottom = r1.bottom < r2.bottom ? r1.bottom : r2.bottom;
|
||||
|
||||
if (!cm_mask) {
|
||||
cm_mask = d_new unsigned[cm_pitch*clip_rect.bottom];
|
||||
cm_mask = new unsigned[cm_pitch*clip_rect.bottom];
|
||||
updateBitMask(clip_rect);
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ gxDir *gxFileSystem::openDir( const std::string &name,int flags ){
|
||||
WIN32_FIND_DATA f;
|
||||
HANDLE h=FindFirstFile( t.c_str(),&f );
|
||||
if( h!=INVALID_HANDLE_VALUE ){
|
||||
gxDir *d=d_new gxDir( h,f );
|
||||
gxDir *d=new gxDir( h,f );
|
||||
dir_set.insert( d );
|
||||
return d;
|
||||
}
|
||||
|
||||
+12
-12
@@ -10,8 +10,8 @@ gxGraphics::gxGraphics(gxRuntime *rt, IDirectDraw7 *dd, IDirectDrawSurface7 *fs,
|
||||
|
||||
dirDraw->QueryInterface(IID_IDirectDraw, (void**)&ds_dirDraw);
|
||||
|
||||
front_canvas = d_new gxCanvas(this, fs, 0);
|
||||
back_canvas = d_new gxCanvas(this, bs, 0);
|
||||
front_canvas = new gxCanvas(this, fs, 0);
|
||||
back_canvas = new gxCanvas(this, bs, 0);
|
||||
|
||||
front_canvas->cls();
|
||||
back_canvas->cls();
|
||||
@@ -170,7 +170,7 @@ gxMovie *gxGraphics::openMovie(const string &file, int flags) {
|
||||
delete path;
|
||||
|
||||
if (n == S_OK) {
|
||||
gxMovie *movie = d_new gxMovie(this, iam_stream);
|
||||
gxMovie *movie = new gxMovie(this, iam_stream);
|
||||
movie_set.insert(movie);
|
||||
return movie;
|
||||
}
|
||||
@@ -192,7 +192,7 @@ void gxGraphics::closeMovie(gxMovie *m) {
|
||||
gxCanvas *gxGraphics::createCanvas(int w, int h, int flags) {
|
||||
ddSurf *s = ddUtil::createSurface(w, h, flags, this);
|
||||
if (!s) return 0;
|
||||
gxCanvas *c = d_new gxCanvas(this, s, flags);
|
||||
gxCanvas *c = new gxCanvas(this, s, flags);
|
||||
canvas_set.insert(c);
|
||||
c->cls();
|
||||
return c;
|
||||
@@ -201,7 +201,7 @@ gxCanvas *gxGraphics::createCanvas(int w, int h, int flags) {
|
||||
gxCanvas *gxGraphics::loadCanvas(const string &f, int flags) {
|
||||
ddSurf *s = ddUtil::loadSurface(f, flags, this);
|
||||
if (!s) return 0;
|
||||
gxCanvas *c = d_new gxCanvas(this, s, flags);
|
||||
gxCanvas *c = new gxCanvas(this, s, flags);
|
||||
canvas_set.insert(c);
|
||||
return c;
|
||||
}
|
||||
@@ -275,9 +275,9 @@ gxFont *gxGraphics::loadFont(const string &f, int height, int flags) {
|
||||
|
||||
int first = tm.tmFirstChar, last = tm.tmLastChar;
|
||||
int sz = last - first + 1;
|
||||
int *offs = d_new int[sz];
|
||||
int *widths = d_new int[sz];
|
||||
int *as = d_new int[sz];
|
||||
int *offs = new int[sz];
|
||||
int *widths = new int[sz];
|
||||
int *as = new int[sz];
|
||||
|
||||
//calc size of canvas to hold font.
|
||||
int x = 0, y = 0, max_x = 0;
|
||||
@@ -333,7 +333,7 @@ gxFont *gxGraphics::loadFont(const string &f, int height, int flags) {
|
||||
delete[] as;
|
||||
|
||||
c->backup();
|
||||
gxFont *font = d_new gxFont(this, c, tm.tmMaxCharWidth, height, first, last + 1, tm.tmDefaultChar, offs, widths);
|
||||
gxFont *font = new gxFont(this, c, tm.tmMaxCharWidth, height, first, last + 1, tm.tmDefaultChar, offs, widths);
|
||||
font_set.insert(font);
|
||||
|
||||
//restore font smoothing
|
||||
@@ -545,7 +545,7 @@ gxScene *gxGraphics::createScene(int flags) {
|
||||
string ts = "ZBuffer Bit Depth:" + itoa(zbuffFmt.dwZBufferBitDepth);
|
||||
gx_runtime->debugLog(ts.c_str());
|
||||
#endif
|
||||
gxScene *scene = d_new gxScene(this, back_canvas);
|
||||
gxScene *scene = new gxScene(this, back_canvas);
|
||||
scene_set.insert(scene);
|
||||
|
||||
dummy_mesh = createMesh(8, 12, 0);
|
||||
@@ -596,8 +596,8 @@ gxMesh *gxGraphics::createMesh(int max_verts, int max_tris, int flags) {
|
||||
|
||||
IDirect3DVertexBuffer7 *buff;
|
||||
if (dir3d->CreateVertexBuffer(&desc, &buff, 0) < 0) return 0;
|
||||
WORD *indices = d_new WORD[max_tris * 3];
|
||||
gxMesh *mesh = d_new gxMesh(this, buff, indices, max_verts, max_tris);
|
||||
WORD *indices = new WORD[max_tris * 3];
|
||||
gxMesh *mesh = new gxMesh(this, buff, indices, max_verts, max_tris);
|
||||
mesh_set.insert(mesh);
|
||||
return mesh;
|
||||
}
|
||||
|
||||
@@ -145,14 +145,14 @@ static Keyboard *createKeyboard(gxInput *input) {
|
||||
dword.diph.dwHow = DIPH_DEVICE;
|
||||
dword.dwData = 32;
|
||||
if (dev->SetProperty(DIPROP_BUFFERSIZE, &dword.diph) >= 0) {
|
||||
return d_new Keyboard(input, dev);
|
||||
return new Keyboard(input, dev);
|
||||
} else {
|
||||
// input->runtime->debugInfo( "keyboard: SetProperty failed" );
|
||||
}
|
||||
} else {
|
||||
// input->runtime->debugInfo( "keyboard: SetDataFormat failed" );
|
||||
}
|
||||
return d_new Keyboard(input, dev);
|
||||
return new Keyboard(input, dev);
|
||||
|
||||
} else {
|
||||
input->runtime->debugInfo("keyboard: SetCooperativeLevel failed");
|
||||
@@ -170,11 +170,11 @@ static Mouse *createMouse(gxInput *input) {
|
||||
if (dev->SetCooperativeLevel(input->runtime->hwnd, DISCL_FOREGROUND | DISCL_EXCLUSIVE) >= 0) {
|
||||
|
||||
if (dev->SetDataFormat(&c_dfDIMouse) >= 0) {
|
||||
return d_new Mouse(input, dev);
|
||||
return new Mouse(input, dev);
|
||||
} else {
|
||||
// input->runtime->debugInfo( "mouse: SetDataFormat failed" );
|
||||
}
|
||||
return d_new Mouse(input, dev);
|
||||
return new Mouse(input, dev);
|
||||
|
||||
} else {
|
||||
input->runtime->debugInfo("mouse: SetCooperativeLevel failed");
|
||||
@@ -192,7 +192,7 @@ static Joystick *createJoystick(gxInput *input, LPCDIDEVICEINSTANCE devinst) {
|
||||
if (dev->SetCooperativeLevel(input->runtime->hwnd, DISCL_FOREGROUND | DISCL_EXCLUSIVE) >= 0) {
|
||||
if (dev->SetDataFormat(&c_dfDIJoystick) >= 0) {
|
||||
int t = ((devinst->dwDevType >> 8) & 0xff) == DI8DEVCLASS_GAMECTRL ? 1 : 2;
|
||||
return d_new Joystick(input, dev, t);
|
||||
return new Joystick(input, dev, t);
|
||||
}
|
||||
}
|
||||
dev->Release();
|
||||
|
||||
@@ -77,7 +77,7 @@ void gxMesh::backup(){
|
||||
|
||||
dxVertex *verts;
|
||||
if( vertex_buff->Lock( DDLOCK_READONLY|DDLOCK_WAIT,(void**)&verts,0 )>=0 ){
|
||||
backup_verts=d_new dxVertex[ max_verts ];
|
||||
backup_verts=new dxVertex[ max_verts ];
|
||||
memcpy( backup_verts,verts,sizeof(dxVertex)*max_verts );
|
||||
vertex_buff->Unlock();
|
||||
}
|
||||
|
||||
+11
-11
@@ -95,7 +95,7 @@ gxRuntime *gxRuntime::openRuntime(HINSTANCE hinst, const string &cmd_line, Debug
|
||||
|
||||
UpdateWindow(hwnd);
|
||||
|
||||
runtime = d_new gxRuntime(hinst, cmd_line, hwnd);
|
||||
runtime = new gxRuntime(hinst, cmd_line, hwnd);
|
||||
return runtime;
|
||||
}
|
||||
|
||||
@@ -676,7 +676,7 @@ gxAudio *gxRuntime::openAudio(int flags) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
audio = d_new gxAudio(this);
|
||||
audio = new gxAudio(this);
|
||||
return audio;
|
||||
}
|
||||
|
||||
@@ -694,7 +694,7 @@ gxInput *gxRuntime::openInput(int flags) {
|
||||
LPDIRECTINPUT8 di;
|
||||
if (DirectInput8Create(hinst, DIRECTINPUT_VERSION, IID_IDirectInput8, (void**)&di, NULL) >= 0) {
|
||||
//if (DirectInput8Create(hinst, DIRECTINPUT_VERSION, (void**)&di, NULL) >= 0) {
|
||||
input = d_new gxInput(this, di);
|
||||
input = new gxInput(this, di);
|
||||
acquireInput();
|
||||
} else {
|
||||
debugInfo("Create DirectInput failed");
|
||||
@@ -807,7 +807,7 @@ gxGraphics *gxRuntime::openWindowedGraphics(int w, int h, int d, bool d3d) {
|
||||
primSurf = ps;
|
||||
mod_cnt = 0;
|
||||
fs->AddRef();
|
||||
return d_new gxGraphics(this, dd, fs, fs, d3d);
|
||||
return new gxGraphics(this, dd, fs, fs, d3d);
|
||||
}
|
||||
fs->Release();
|
||||
}
|
||||
@@ -846,7 +846,7 @@ gxGraphics *gxRuntime::openExclusiveGraphics(int w, int h, int d, bool d3d) {
|
||||
DDSCAPS2 caps = { sizeof caps };
|
||||
caps.dwCaps = DDSCAPS_BACKBUFFER;
|
||||
if (ps->GetAttachedSurface(&caps, &bs) >= 0) {
|
||||
return d_new gxGraphics(this, dd, ps, bs, d3d);
|
||||
return new gxGraphics(this, dd, ps, bs, d3d);
|
||||
}
|
||||
ps->Release();
|
||||
}
|
||||
@@ -960,7 +960,7 @@ bool gxRuntime::graphicsLost() {
|
||||
gxFileSystem *gxRuntime::openFileSystem(int flags) {
|
||||
if (fileSystem) return 0;
|
||||
|
||||
fileSystem = d_new gxFileSystem();
|
||||
fileSystem = new gxFileSystem();
|
||||
return fileSystem;
|
||||
}
|
||||
|
||||
@@ -977,7 +977,7 @@ void gxRuntime::closeFileSystem(gxFileSystem *f) {
|
||||
static HRESULT WINAPI enumMode(DDSURFACEDESC2 *desc, void *context) {
|
||||
int dp = desc->ddpfPixelFormat.dwRGBBitCount;
|
||||
if (dp == 16 || dp == 24 || dp == 32) {
|
||||
gxRuntime::GfxMode *m = d_new gxRuntime::GfxMode;
|
||||
gxRuntime::GfxMode *m = new gxRuntime::GfxMode;
|
||||
m->desc = *desc;
|
||||
gxRuntime::GfxDriver *d = (gxRuntime::GfxDriver*)context;
|
||||
d->modes.push_back(m);
|
||||
@@ -1009,9 +1009,9 @@ static BOOL WINAPI enumDriver(GUID FAR *guid, LPSTR desc, LPSTR name, LPVOID con
|
||||
dd->GetDisplayMode(&desktop_desc);
|
||||
}
|
||||
|
||||
gxRuntime::GfxDriver *d = d_new gxRuntime::GfxDriver;
|
||||
gxRuntime::GfxDriver *d = new gxRuntime::GfxDriver;
|
||||
|
||||
d->guid = guid ? d_new GUID(*guid) : 0;
|
||||
d->guid = guid ? new GUID(*guid) : 0;
|
||||
d->name = desc;//string( name )+" "+string( desc );
|
||||
|
||||
memset(&d->d3d_desc, 0, sizeof(d->d3d_desc));
|
||||
@@ -1097,7 +1097,7 @@ void gxRuntime::windowedModeInfo(int *c) {
|
||||
}
|
||||
|
||||
gxTimer *gxRuntime::createTimer(int hertz) {
|
||||
gxTimer *t = d_new gxTimer(this, hertz);
|
||||
gxTimer *t = new gxTimer(this, hertz);
|
||||
timers.insert(t);
|
||||
return t;
|
||||
}
|
||||
@@ -1164,7 +1164,7 @@ int gxRuntime::callDll(const std::string &dll, const std::string &func, const vo
|
||||
if (lib_it == libs.end()) {
|
||||
HINSTANCE h = LoadLibrary(dll.c_str());
|
||||
if (!h) return 0;
|
||||
gxDll *t = d_new gxDll;
|
||||
gxDll *t = new gxDll;
|
||||
t->hinst = h;
|
||||
lib_it = libs.insert(make_pair(dll, t)).first;
|
||||
}
|
||||
|
||||
@@ -605,7 +605,7 @@ void gxScene::end(){
|
||||
}
|
||||
|
||||
gxLight *gxScene::createLight( int flags ){
|
||||
gxLight *l=d_new gxLight( this,flags );
|
||||
gxLight *l=new gxLight( this,flags );
|
||||
_allLights.insert(l);
|
||||
return l;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user