0

stub smooth-lighting mode (does nothing special, for now)

This commit is contained in:
Aaron Griffith
2011-10-11 19:59:33 -04:00
parent e7e0f526ea
commit 3a090f77f5
4 changed files with 77 additions and 1 deletions

View File

@@ -0,0 +1,68 @@
/*
* This file is part of the Minecraft Overviewer.
*
* Minecraft Overviewer is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* Minecraft Overviewer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with the Overviewer. If not, see <http://www.gnu.org/licenses/>.
*/
#include "overviewer.h"
#include <math.h>
static int
rendermode_smooth_lighting_start(void *data, RenderState *state, PyObject *options) {
RenderModeNight* self;
/* first, chain up */
int ret = rendermode_lighting.start(data, state, options);
if (ret != 0)
return ret;
return 0;
}
static void
rendermode_smooth_lighting_finish(void *data, RenderState *state) {
/* nothing special to do */
rendermode_lighting.finish(data, state);
}
static int
rendermode_smooth_lighting_occluded(void *data, RenderState *state, int x, int y, int z) {
/* no special occlusion here */
return rendermode_lighting.occluded(data, state, x, y, z);
}
static int
rendermode_smooth_lighting_hidden(void *data, RenderState *state, int x, int y, int z) {
/* no special hiding here */
return rendermode_lighting.hidden(data, state, x, y, z);
}
static void
rendermode_smooth_lighting_draw(void *data, RenderState *state, PyObject *src, PyObject *mask, PyObject *mask_light) {
/* nothing special to do */
rendermode_lighting.draw(data, state, src, mask, mask_light);
}
RenderModeInterface rendermode_smooth_lighting = {
"smooth-lighting", "Smooth Lighting",
"like \"lighting\", except smooth",
NULL,
&rendermode_lighting,
sizeof(RenderModeSmoothLighting),
rendermode_smooth_lighting_start,
rendermode_smooth_lighting_finish,
rendermode_smooth_lighting_occluded,
rendermode_smooth_lighting_hidden,
rendermode_smooth_lighting_draw,
};

View File

@@ -26,6 +26,7 @@ static RenderModeInterface *render_modes[] = {
&rendermode_normal,
&rendermode_lighting,
&rendermode_night,
&rendermode_smooth_lighting,
&rendermode_spawn,
&rendermode_cave,
&rendermode_mineral,

View File

@@ -190,6 +190,13 @@ typedef struct {
} RenderModeNight;
extern RenderModeInterface rendermode_night;
/* SMOOTH LIGHTING */
typedef struct {
/* inherits from lighting */
RenderModeLighting parent;
} RenderModeSmoothLighting;
extern RenderModeInterface rendermode_smooth_lighting;
/* SPAWN */
typedef struct {
/* inherits from overlay */