few changes to working in progress DimScreen and BlastRect
This commit is contained in:
parent
93f81962ac
commit
443bb6bdf2
6 changed files with 68 additions and 2 deletions
8
driver.h
8
driver.h
|
@ -37,6 +37,7 @@ public:
|
|||
_screenHeight = screenH;
|
||||
_screenBPP = screenBPP;
|
||||
_isFullscreen = fullscreen;
|
||||
_dim = false;
|
||||
}
|
||||
|
||||
struct TextObjectHandle {
|
||||
|
@ -77,6 +78,10 @@ public:
|
|||
|
||||
virtual void drawDepthBitmap(int x, int y, int w, int h, char *data) = 0;
|
||||
|
||||
virtual void getSnapshot(int x, int y, int w, int h, char **data, int flags) = 0;
|
||||
virtual void enableDim(int x, int y, int w, int h) = 0;
|
||||
virtual void disableDim(int x, int y, int w, int h) = 0;
|
||||
|
||||
virtual void drawEmergString(int x, int y, const char *text, const Color &fgColor) = 0;
|
||||
virtual void loadEmergFont() = 0;
|
||||
virtual TextObjectHandle *createTextBitmap(uint8 *bitmap, int width, int height, const Color &fgColor) = 0;
|
||||
|
@ -89,6 +94,9 @@ public:
|
|||
protected:
|
||||
int _screenWidth, _screenHeight, _screenBPP;
|
||||
bool _isFullscreen;
|
||||
bool _dim;
|
||||
|
||||
virtual void drawDim() = 0;
|
||||
};
|
||||
|
||||
extern Driver *g_driver;
|
||||
|
|
|
@ -680,3 +680,9 @@ void DriverGL::destroyTextBitmap(TextObjectHandle *handle) {
|
|||
glDeleteTextures(handle->numTex, (GLuint *)handle->texIds);
|
||||
delete[] (GLuint *)handle->texIds;
|
||||
}
|
||||
|
||||
void DriverGL::getSnapshot(int x, int y, int w, int h, char **data, int flags) {
|
||||
}
|
||||
|
||||
void DriverGL::drawDim() {
|
||||
}
|
||||
|
|
|
@ -63,6 +63,10 @@ public:
|
|||
void drawDepthBitmap(int x, int y, int w, int h, char *data);
|
||||
void drawBitmap();
|
||||
|
||||
void getSnapshot(int x, int y, int w, int h, char **data, int flags);
|
||||
void enableDim(int x, int y, int w, int h) { _dim = true; }
|
||||
void disableDim(int x, int y, int w, int h) { _dim = false; }
|
||||
|
||||
void drawEmergString(int x, int y, const char *text, const Color &fgColor);
|
||||
void loadEmergFont();
|
||||
TextObjectHandle *createTextBitmap(uint8 *bitmap, int width, int height, const Color &fgColor);
|
||||
|
@ -72,6 +76,9 @@ public:
|
|||
void prepareSmushFrame(int width, int height, byte *bitmap);
|
||||
void drawSmushFrame(int offsetX, int offsetY);
|
||||
|
||||
protected:
|
||||
void drawDim();
|
||||
|
||||
private:
|
||||
GLuint _emergFont;
|
||||
int _smushNumTex;
|
||||
|
|
|
@ -468,3 +468,9 @@ void DriverTinyGL::destroyTextBitmap(TextObjectHandle *handle) {
|
|||
delete handle->bitmapData;
|
||||
SDL_FreeSurface((SDL_Surface *)handle->surface);
|
||||
}
|
||||
|
||||
void DriverTinyGL::getSnapshot(int x, int y, int w, int h, char **data, int flags) {
|
||||
}
|
||||
|
||||
void DriverTinyGL::drawDim() {
|
||||
}
|
||||
|
|
|
@ -65,6 +65,10 @@ public:
|
|||
void drawDepthBitmap(int x, int y, int w, int h, char *data);
|
||||
void drawBitmap();
|
||||
|
||||
void getSnapshot(int x, int y, int w, int h, char **data, int flags);
|
||||
void enableDim(int x, int y, int w, int h) { _dim = true; }
|
||||
void disableDim(int x, int y, int w, int h) { _dim = false; }
|
||||
|
||||
void drawEmergString(int x, int y, const char *text, const Color &fgColor);
|
||||
void loadEmergFont();
|
||||
TextObjectHandle *createTextBitmap(uint8 *bitmap, int width, int height, const Color &fgColor);
|
||||
|
@ -74,6 +78,9 @@ public:
|
|||
void prepareSmushFrame(int width, int height, byte *bitmap);
|
||||
void drawSmushFrame(int offsetX, int offsetY);
|
||||
|
||||
protected:
|
||||
void drawDim();
|
||||
|
||||
private:
|
||||
ZBuffer *_zb;
|
||||
SDL_Surface *_screen;
|
||||
|
|
36
lua.cpp
36
lua.cpp
|
@ -1540,6 +1540,40 @@ static void PauseMovie() {
|
|||
g_smush->pause(lua_isnil(lua_getparam(1)) != 0);
|
||||
}
|
||||
|
||||
static void BlastRect() {
|
||||
int x1 = check_int(1);
|
||||
int y1 = check_int(2);
|
||||
int x2 = check_int(3);
|
||||
int y2 = check_int(4);
|
||||
lua_Object tableObj = lua_getparam(5);
|
||||
Color color;
|
||||
color._vals[0] = 255;
|
||||
color._vals[1] = 255;
|
||||
color._vals[2] = 255;
|
||||
bool filled = false;
|
||||
|
||||
if (lua_istable(tableObj)){
|
||||
lua_pushobject(tableObj);
|
||||
lua_pushstring("color");
|
||||
lua_Object colorObj = lua_gettable();
|
||||
if (lua_isuserdata(colorObj) && lua_tag(colorObj) == MKID('COLR')) {
|
||||
color = static_cast<Color *>(lua_getuserdata(colorObj));
|
||||
}
|
||||
|
||||
lua_pushobject(tableObj);
|
||||
lua_pushstring("filled");
|
||||
lua_Object objFilled = lua_gettable();
|
||||
if (!lua_isnil(objFilled))
|
||||
filled = true;
|
||||
}
|
||||
|
||||
//g_driver->CreateFilledRectangle(x1, x2, y1, y2, color, filled);
|
||||
}
|
||||
|
||||
static void DimScreen() {
|
||||
warning("DimScreen()");
|
||||
}
|
||||
|
||||
static void GetDiskFreeSpace() {
|
||||
// amount of free space in MB, used for creating saves
|
||||
lua_pushnumber(50);
|
||||
|
@ -1751,7 +1785,6 @@ STUB_FUNC(GetTextSpeed)
|
|||
STUB_FUNC(SetTextSpeed)
|
||||
STUB_FUNC(GetSaveGameData)
|
||||
STUB_FUNC(SubmitSaveGameData)
|
||||
STUB_FUNC(BlastRect)
|
||||
STUB_FUNC(BlastImage)
|
||||
STUB_FUNC(FreeImage)
|
||||
STUB_FUNC(GetImage)
|
||||
|
@ -1782,7 +1815,6 @@ STUB_FUNC(SetActorShadowPlane)
|
|||
STUB_FUNC(ActivateActorShadow)
|
||||
STUB_FUNC(SetShadowColor)
|
||||
STUB_FUNC(DimRegion)
|
||||
STUB_FUNC(DimScreen)
|
||||
STUB_FUNC(ForceRefresh)
|
||||
STUB_FUNC(SetGamma)
|
||||
STUB_FUNC(LightMgrStartup)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue