| 1 |
/* |
| 2 |
Copyright (c) 2005-2022 Intel Corporation |
| 3 |
|
| 4 |
Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 |
you may not use this file except in compliance with the License. |
| 6 |
You may obtain a copy of the License at |
| 7 |
|
| 8 |
http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
|
| 10 |
Unless required by applicable law or agreed to in writing, software |
| 11 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 12 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 |
See the License for the specific language governing permissions and |
| 14 |
limitations under the License. |
| 15 |
*/ |
| 16 |
|
| 17 |
/* |
| 18 |
The original source for this example is |
| 19 |
Copyright (c) 1994-2008 John E. Stone |
| 20 |
All rights reserved. |
| 21 |
|
| 22 |
Redistribution and use in source and binary forms, with or without |
| 23 |
modification, are permitted provided that the following conditions |
| 24 |
are met: |
| 25 |
1. Redistributions of source code must retain the above copyright |
| 26 |
notice, this list of conditions and the following disclaimer. |
| 27 |
2. Redistributions in binary form must reproduce the above copyright |
| 28 |
notice, this list of conditions and the following disclaimer in the |
| 29 |
documentation and/or other materials provided with the distribution. |
| 30 |
3. The name of the author may not be used to endorse or promote products |
| 31 |
derived from this software without specific prior written permission. |
| 32 |
|
| 33 |
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS |
| 34 |
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 35 |
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 36 |
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY |
| 37 |
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 38 |
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 39 |
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 40 |
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 41 |
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 42 |
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 43 |
SUCH DAMAGE. |
| 44 |
*/ |
| 45 |
|
| 46 |
/* |
| 47 |
* render.cpp - This file contains the main program and driver for the raytracer. |
| 48 |
*/ |
| 49 |
|
| 50 |
#include "machine.hpp" |
| 51 |
#include "types.hpp" |
| 52 |
#include "macros.hpp" |
| 53 |
#include "tgafile.hpp" |
| 54 |
#include "trace.hpp" |
| 55 |
#include "render.hpp" |
| 56 |
#include "util.hpp" |
| 57 |
#include "light.hpp" |
| 58 |
#include "global.hpp" |
| 59 |
#include "ui.hpp" |
| 60 |
#include "tachyon_video.hpp" |
| 61 |
#include "objbound.hpp" |
| 62 |
#include "grid.hpp" |
| 63 |
|
| 64 |
/* how many pieces to divide each scanline into */ |
| 65 |
#define NUMHORZDIV 1 |
| 66 |
|
| 67 |
void renderscene(scenedef scene) { |
| 68 |
//char msgtxt[2048]; |
| 69 |
//void * outfile; |
| 70 |
/* Grid based accerlation scheme */ |
| 71 |
if (scene.boundmode == RT_BOUNDING_ENABLED) |
| 72 |
engrid_scene(&rootobj); /* grid */ |
| 73 |
/* Not used now |
| 74 |
if (scene.verbosemode) { |
| 75 |
sprintf(msgtxt, "Opening %s for output.", scene.outfilename); |
| 76 |
rt_ui_message(MSG_0, msgtxt); |
| 77 |
} |
| 78 |
|
| 79 |
createtgafile(scene.outfilename, |
| 80 |
(unsigned short) scene.hres, |
| 81 |
(unsigned short) scene.vres); |
| 82 |
outfile = opentgafile(scene.outfilename); |
| 83 |
*/ |
| 84 |
|
| 85 |
trace_region(scene, nullptr /*outfile*/, 0, 0, scene.hres, scene.vres); |
| 86 |
//fclose((FILE *)outfile); |
| 87 |
} /* end of renderscene() */ |