ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
January 2019
----- 2024 -----
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
31 participants
300 discussions
Start a n
N
ew thread
[reactos] 03/05: [PSDK] Add PFD_SUPPORT_COMPOSITION definition
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=115aa24a29e9e4d70c9bf…
commit 115aa24a29e9e4d70c9bf4e6f5d66af70fdf8209 Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Wed Dec 12 22:35:14 2018 +0100 Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com> CommitDate: Sat Jan 19 14:23:54 2019 +0100 [PSDK] Add PFD_SUPPORT_COMPOSITION definition --- sdk/include/psdk/wingdi.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/include/psdk/wingdi.h b/sdk/include/psdk/wingdi.h index dd638f1cff..537837813c 100644 --- a/sdk/include/psdk/wingdi.h +++ b/sdk/include/psdk/wingdi.h @@ -310,6 +310,7 @@ extern "C" { #define PFD_SWAP_COPY 0x00000400 #define PFD_SWAP_LAYER_BUFFERS 0x00000800 #define PFD_GENERIC_ACCELERATED 0x00001000 +#define PFD_SUPPORT_COMPOSITION 0x00008000 #define PFD_DEPTH_DONTCARE 0x20000000 #define PFD_DOUBLEBUFFER_DONTCARE 0x40000000 #define PFD_STEREO_DONTCARE 0x80000000
5 years, 9 months
1
0
0
0
[reactos] 02/05: [OPENGL32][MESA] Downgrade Mesa library to version 2.6
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5f2bebf7a5b1a1602b553…
commit 5f2bebf7a5b1a1602b553c43118d745e51c5609c Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Mon Dec 10 18:04:20 2018 +0100 Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com> CommitDate: Sat Jan 19 14:23:54 2019 +0100 [OPENGL32][MESA] Downgrade Mesa library to version 2.6 With this commit, we now use a forked version of MESA which only supports OpenGL 1.1, like the windows implementation does. It exposes : - The same pixel formats - The same set of extensions - Nothing more All of this without taking 10% of your build time. If you need a more modern option, look at the MESA package from Rapps, which is (and must be) maintained outside of this code tree. CORE-7499 --- dll/opengl/mesa/CMakeLists.txt | 93 +- dll/opengl/mesa/accum.c | 373 ++ dll/opengl/mesa/accum.h | 55 + dll/opengl/mesa/all.h | 136 + dll/opengl/mesa/alpha.c | 142 + dll/opengl/mesa/alpha.h | 46 + dll/opengl/mesa/alphabuf.c | 271 ++ dll/opengl/mesa/alphabuf.h | 78 + dll/opengl/mesa/api.c | 2874 +++++++++++ dll/opengl/mesa/api.h | 83 + dll/opengl/mesa/asm-386.S | 1644 +++++++ dll/opengl/mesa/asm-386.h | 99 + dll/opengl/mesa/attrib.c | 624 +++ dll/opengl/mesa/attrib.h | 48 + dll/opengl/mesa/bitmap.c | 221 + dll/opengl/mesa/bitmap.h | 59 + dll/opengl/mesa/blend.c | 547 +++ dll/opengl/mesa/blend.h | 54 + dll/opengl/mesa/clip.c | 1055 ++++ dll/opengl/mesa/clip.h | 98 + dll/opengl/mesa/colortab.c | 287 ++ dll/opengl/mesa/colortab.h | 65 + dll/opengl/mesa/config.h | 167 + dll/opengl/mesa/context.c | 1926 ++++++++ dll/opengl/mesa/context.h | 179 + dll/opengl/mesa/copypix.c | 517 ++ dll/opengl/mesa/copypix.h | 46 + dll/opengl/mesa/dd.h | 557 +++ dll/opengl/mesa/depth.c | 924 ++++ dll/opengl/mesa/depth.h | 101 + dll/opengl/mesa/dlist.c | 3096 ++++++++++++ dll/opengl/mesa/dlist.h | 432 ++ dll/opengl/mesa/drawpix.c | 1207 +++++ dll/opengl/mesa/drawpix.h | 46 + dll/opengl/mesa/drivers/common/CMakeLists.txt | 7 - dll/opengl/mesa/drivers/common/driverfuncs.c | 163 - dll/opengl/mesa/drivers/common/driverfuncs.h | 33 - dll/opengl/mesa/drivers/common/meta.c | 756 --- dll/opengl/mesa/drivers/common/meta.h | 90 - dll/opengl/mesa/enable.c | 652 +++ dll/opengl/mesa/enable.h | 50 + dll/opengl/mesa/eval.c | 2466 ++++++++++ dll/opengl/mesa/eval.h | 108 + dll/opengl/mesa/feedback.c | 428 ++ dll/opengl/mesa/feedback.h | 75 + dll/opengl/mesa/fixed.h | 57 + dll/opengl/mesa/fog.c | 389 ++ dll/opengl/mesa/fog.h | 62 + dll/opengl/mesa/get.c | 3198 ++++++++++++ dll/opengl/mesa/get.h | 49 + dll/opengl/mesa/hash.c | 302 ++ dll/opengl/mesa/hash.h | 63 + dll/opengl/mesa/image.c | 667 +++ dll/opengl/mesa/image.h | 80 + dll/opengl/mesa/light.c | 888 ++++ dll/opengl/mesa/light.h | 93 + dll/opengl/mesa/lines.c | 978 ++++ dll/opengl/mesa/lines.h | 46 + dll/opengl/mesa/linetemp.h | 502 ++ dll/opengl/mesa/logic.c | 726 +++ dll/opengl/mesa/logic.h | 69 + dll/opengl/mesa/macros.h | 277 ++ dll/opengl/mesa/main/CMakeLists.txt | 81 - dll/opengl/mesa/main/accum.c | 481 -- dll/opengl/mesa/main/accum.h | 93 - dll/opengl/mesa/main/api_arrayelt.c | 910 ---- dll/opengl/mesa/main/api_arrayelt.h | 84 - dll/opengl/mesa/main/api_exec.c | 306 -- dll/opengl/mesa/main/api_exec.h | 45 - dll/opengl/mesa/main/api_loopback.c | 1022 ---- dll/opengl/mesa/main/api_loopback.h | 48 - dll/opengl/mesa/main/api_validate.c | 252 - dll/opengl/mesa/main/api_validate.h | 58 - dll/opengl/mesa/main/attrib.c | 1268 ----- dll/opengl/mesa/main/attrib.h | 80 - dll/opengl/mesa/main/bitset.h | 160 - dll/opengl/mesa/main/blend.c | 352 -- dll/opengl/mesa/main/blend.h | 64 - dll/opengl/mesa/main/bufferobj.c | 1312 ----- dll/opengl/mesa/main/bufferobj.h | 155 - dll/opengl/mesa/main/buffers.c | 347 -- dll/opengl/mesa/main/buffers.h | 57 - dll/opengl/mesa/main/clear.c | 223 - dll/opengl/mesa/main/clear.h | 51 - dll/opengl/mesa/main/clip.c | 108 - dll/opengl/mesa/main/clip.h | 47 - dll/opengl/mesa/main/colormac.h | 125 - dll/opengl/mesa/main/compiler.h | 506 -- dll/opengl/mesa/main/config.h | 228 - dll/opengl/mesa/main/context.c | 1321 ----- dll/opengl/mesa/main/context.h | 294 -- dll/opengl/mesa/main/core.h | 55 - dll/opengl/mesa/main/cpuinfo.c | 106 - dll/opengl/mesa/main/cpuinfo.h | 47 - dll/opengl/mesa/main/dd.h | 768 --- dll/opengl/mesa/main/depth.c | 159 - dll/opengl/mesa/main/depth.h | 65 - dll/opengl/mesa/main/dispatch.h | 5833 ---------------------- dll/opengl/mesa/main/dlist.c | 6206 ------------------------ dll/opengl/mesa/main/dlist.h | 104 - dll/opengl/mesa/main/dlopen.c | 113 - dll/opengl/mesa/main/dlopen.h | 42 - dll/opengl/mesa/main/drawpix.c | 260 - dll/opengl/mesa/main/drawpix.h | 50 - dll/opengl/mesa/main/enable.c | 931 ---- dll/opengl/mesa/main/enable.h | 59 - dll/opengl/mesa/main/enums.c | 6399 ------------------------- dll/opengl/mesa/main/enums.h | 62 - dll/opengl/mesa/main/eval.c | 928 ---- dll/opengl/mesa/main/eval.h | 107 - dll/opengl/mesa/main/execmem.c | 149 - dll/opengl/mesa/main/extensions.c | 623 --- dll/opengl/mesa/main/extensions.h | 91 - dll/opengl/mesa/main/feedback.c | 537 --- dll/opengl/mesa/main/feedback.h | 102 - dll/opengl/mesa/main/fog.c | 204 - dll/opengl/mesa/main/fog.h | 69 - dll/opengl/mesa/main/format_pack.c | 1461 ------ dll/opengl/mesa/main/format_pack.h | 97 - dll/opengl/mesa/main/format_unpack.c | 1862 ------- dll/opengl/mesa/main/format_unpack.h | 59 - dll/opengl/mesa/main/formats.c | 1567 ------ dll/opengl/mesa/main/formats.h | 226 - dll/opengl/mesa/main/framebuffer.c | 623 --- dll/opengl/mesa/main/framebuffer.h | 86 - dll/opengl/mesa/main/get.c | 1639 ------- dll/opengl/mesa/main/get.h | 68 - dll/opengl/mesa/main/getstring.c | 153 - dll/opengl/mesa/main/git_sha1.h | 0 dll/opengl/mesa/main/glheader.h | 193 - dll/opengl/mesa/main/hash.c | 562 --- dll/opengl/mesa/main/hash.h | 72 - dll/opengl/mesa/main/hint.c | 108 - dll/opengl/mesa/main/hint.h | 59 - dll/opengl/mesa/main/image.c | 1805 ------- dll/opengl/mesa/main/image.h | 174 - dll/opengl/mesa/main/imports.c | 903 ---- dll/opengl/mesa/main/imports.h | 645 --- dll/opengl/mesa/main/light.c | 1357 ------ dll/opengl/mesa/main/light.h | 144 - dll/opengl/mesa/main/lines.c | 111 - dll/opengl/mesa/main/lines.h | 49 - dll/opengl/mesa/main/macros.h | 683 --- dll/opengl/mesa/main/matrix.c | 711 --- dll/opengl/mesa/main/matrix.h | 113 - dll/opengl/mesa/main/mfeatures.h | 135 - dll/opengl/mesa/main/mm.c | 281 -- dll/opengl/mesa/main/mm.h | 90 - dll/opengl/mesa/main/mtypes.h | 1976 -------- dll/opengl/mesa/main/multisample.c | 56 - dll/opengl/mesa/main/multisample.h | 41 - dll/opengl/mesa/main/pack.c | 4547 ------------------ dll/opengl/mesa/main/pack.h | 143 - dll/opengl/mesa/main/pack_tmp.h | 115 - dll/opengl/mesa/main/pixel.c | 588 --- dll/opengl/mesa/main/pixel.h | 81 - dll/opengl/mesa/main/pixelstore.c | 256 - dll/opengl/mesa/main/pixelstore.h | 52 - dll/opengl/mesa/main/pixeltransfer.c | 299 -- dll/opengl/mesa/main/pixeltransfer.h | 81 - dll/opengl/mesa/main/points.c | 262 - dll/opengl/mesa/main/points.h | 59 - dll/opengl/mesa/main/polygon.c | 299 -- dll/opengl/mesa/main/polygon.h | 67 - dll/opengl/mesa/main/precomp.h | 79 - dll/opengl/mesa/main/rastpos.c | 538 --- dll/opengl/mesa/main/rastpos.h | 60 - dll/opengl/mesa/main/readpix.c | 574 --- dll/opengl/mesa/main/readpix.h | 51 - dll/opengl/mesa/main/renderbuffer.c | 139 - dll/opengl/mesa/main/renderbuffer.h | 64 - dll/opengl/mesa/main/scissor.c | 95 - dll/opengl/mesa/main/scissor.h | 47 - dll/opengl/mesa/main/shared.c | 214 - dll/opengl/mesa/main/shared.h | 40 - dll/opengl/mesa/main/simple_list.h | 210 - dll/opengl/mesa/main/state.c | 303 -- dll/opengl/mesa/main/state.h | 40 - dll/opengl/mesa/main/stencil.c | 249 - dll/opengl/mesa/main/stencil.h | 69 - dll/opengl/mesa/main/texenv.c | 635 --- dll/opengl/mesa/main/texenv.h | 51 - dll/opengl/mesa/main/texformat.c | 361 -- dll/opengl/mesa/main/texformat.h | 39 - dll/opengl/mesa/main/texgen.c | 371 -- dll/opengl/mesa/main/texgen.h | 85 - dll/opengl/mesa/main/texgetimage.c | 557 --- dll/opengl/mesa/main/texgetimage.h | 47 - dll/opengl/mesa/main/teximage.c | 2094 -------- dll/opengl/mesa/main/teximage.h | 205 - dll/opengl/mesa/main/texobj.c | 1073 ----- dll/opengl/mesa/main/texobj.h | 134 - dll/opengl/mesa/main/texpal.c | 210 - dll/opengl/mesa/main/texpal.h | 45 - dll/opengl/mesa/main/texparam.c | 834 ---- dll/opengl/mesa/main/texparam.h | 75 - dll/opengl/mesa/main/texstate.c | 636 --- dll/opengl/mesa/main/texstate.h | 65 - dll/opengl/mesa/main/texstorage.c | 371 -- dll/opengl/mesa/main/texstorage.h | 61 - dll/opengl/mesa/main/texstore.c | 3311 ------------- dll/opengl/mesa/main/texstore.h | 127 - dll/opengl/mesa/main/varray.c | 650 --- dll/opengl/mesa/main/varray.h | 183 - dll/opengl/mesa/main/version.c | 89 - dll/opengl/mesa/main/version.h | 48 - dll/opengl/mesa/main/viewport.c | 174 - dll/opengl/mesa/main/viewport.h | 55 - dll/opengl/mesa/main/vsnprintf.c | 165 - dll/opengl/mesa/main/vtxfmt.c | 115 - dll/opengl/mesa/main/vtxfmt.h | 59 - dll/opengl/mesa/masking.c | 200 + dll/opengl/mesa/masking.h | 85 + dll/opengl/mesa/math/CMakeLists.txt | 15 - dll/opengl/mesa/math/m_clip_tmp.h | 243 - dll/opengl/mesa/math/m_copy_tmp.h | 86 - dll/opengl/mesa/math/m_debug.h | 42 - dll/opengl/mesa/math/m_debug_clip.c | 397 -- dll/opengl/mesa/math/m_debug_norm.c | 377 -- dll/opengl/mesa/math/m_debug_util.h | 320 -- dll/opengl/mesa/math/m_debug_xform.c | 333 -- dll/opengl/mesa/math/m_dotprod_tmp.h | 102 - dll/opengl/mesa/math/m_eval.c | 458 -- dll/opengl/mesa/math/m_eval.h | 103 - dll/opengl/mesa/math/m_matrix.c | 1635 ------- dll/opengl/mesa/math/m_matrix.h | 221 - dll/opengl/mesa/math/m_norm_tmp.h | 390 -- dll/opengl/mesa/math/m_trans_tmp.h | 281 -- dll/opengl/mesa/math/m_translate.c | 747 --- dll/opengl/mesa/math/m_translate.h | 123 - dll/opengl/mesa/math/m_vector.c | 179 - dll/opengl/mesa/math/m_vector.h | 92 - dll/opengl/mesa/math/m_xform.c | 121 - dll/opengl/mesa/math/m_xform.h | 167 - dll/opengl/mesa/math/m_xform_tmp.h | 810 ---- dll/opengl/mesa/math/precomp.h | 14 - dll/opengl/mesa/matrix.c | 1048 ++++ dll/opengl/mesa/matrix.h | 92 + dll/opengl/mesa/misc.c | 495 ++ dll/opengl/mesa/misc.h | 63 + dll/opengl/mesa/mmath.c | 150 + dll/opengl/mesa/mmath.h | 84 + dll/opengl/mesa/pb.c | 449 ++ dll/opengl/mesa/pb.h | 177 + dll/opengl/mesa/pixel.c | 991 ++++ dll/opengl/mesa/pixel.h | 83 + dll/opengl/mesa/pointers.c | 541 +++ dll/opengl/mesa/pointers.h | 45 + dll/opengl/mesa/points.c | 586 +++ dll/opengl/mesa/points.h | 46 + dll/opengl/mesa/polygon.c | 171 + dll/opengl/mesa/polygon.h | 54 + dll/opengl/mesa/quads.c | 101 + dll/opengl/mesa/quads.h | 42 + dll/opengl/mesa/rastpos.c | 225 + dll/opengl/mesa/rastpos.h | 49 + dll/opengl/mesa/readpix.c | 1099 +++++ dll/opengl/mesa/readpix.h | 44 + dll/opengl/mesa/rect.c | 76 + dll/opengl/mesa/rect.h | 43 + dll/opengl/mesa/scissor.c | 132 + dll/opengl/mesa/scissor.h | 52 + dll/opengl/mesa/shade.c | 607 +++ dll/opengl/mesa/shade.h | 68 + dll/opengl/mesa/span.c | 929 ++++ dll/opengl/mesa/span.h | 84 + dll/opengl/mesa/stencil.c | 1022 ++++ dll/opengl/mesa/stencil.h | 89 + dll/opengl/mesa/swrast/CMakeLists.txt | 41 - dll/opengl/mesa/swrast/precomp.h | 40 - dll/opengl/mesa/swrast/s_aaline.c | 479 -- dll/opengl/mesa/swrast/s_aaline.h | 38 - dll/opengl/mesa/swrast/s_aalinetemp.h | 238 - dll/opengl/mesa/swrast/s_aatriangle.c | 285 -- dll/opengl/mesa/swrast/s_aatriangle.h | 38 - dll/opengl/mesa/swrast/s_aatritemp.h | 341 -- dll/opengl/mesa/swrast/s_alpha.c | 153 - dll/opengl/mesa/swrast/s_alpha.h | 39 - dll/opengl/mesa/swrast/s_bitmap.c | 207 - dll/opengl/mesa/swrast/s_blend.c | 673 --- dll/opengl/mesa/swrast/s_blend.h | 45 - dll/opengl/mesa/swrast/s_chan.h | 119 - dll/opengl/mesa/swrast/s_clear.c | 216 - dll/opengl/mesa/swrast/s_context.c | 735 --- dll/opengl/mesa/swrast/s_context.h | 460 -- dll/opengl/mesa/swrast/s_copypix.c | 615 --- dll/opengl/mesa/swrast/s_depth.c | 556 --- dll/opengl/mesa/swrast/s_depth.h | 53 - dll/opengl/mesa/swrast/s_drawpix.c | 520 -- dll/opengl/mesa/swrast/s_feedback.c | 131 - dll/opengl/mesa/swrast/s_feedback.h | 50 - dll/opengl/mesa/swrast/s_fog.c | 237 - dll/opengl/mesa/swrast/s_fog.h | 42 - dll/opengl/mesa/swrast/s_lines.c | 218 - dll/opengl/mesa/swrast/s_lines.h | 41 - dll/opengl/mesa/swrast/s_linetemp.h | 388 -- dll/opengl/mesa/swrast/s_logic.c | 209 - dll/opengl/mesa/swrast/s_logic.h | 40 - dll/opengl/mesa/swrast/s_masking.c | 94 - dll/opengl/mesa/swrast/s_masking.h | 41 - dll/opengl/mesa/swrast/s_points.c | 522 -- dll/opengl/mesa/swrast/s_points.h | 39 - dll/opengl/mesa/swrast/s_renderbuffer.c | 581 --- dll/opengl/mesa/swrast/s_renderbuffer.h | 62 - dll/opengl/mesa/swrast/s_span.c | 1242 ----- dll/opengl/mesa/swrast/s_span.h | 212 - dll/opengl/mesa/swrast/s_stencil.c | 602 --- dll/opengl/mesa/swrast/s_stencil.h | 53 - dll/opengl/mesa/swrast/s_texcombine.c | 625 --- dll/opengl/mesa/swrast/s_texcombine.h | 37 - dll/opengl/mesa/swrast/s_texfetch.c | 622 --- dll/opengl/mesa/swrast/s_texfetch.h | 38 - dll/opengl/mesa/swrast/s_texfetch_tmp.h | 802 ---- dll/opengl/mesa/swrast/s_texfilter.c | 1922 -------- dll/opengl/mesa/swrast/s_texfilter.h | 41 - dll/opengl/mesa/swrast/s_texture.c | 320 -- dll/opengl/mesa/swrast/s_triangle.c | 1028 ---- dll/opengl/mesa/swrast/s_triangle.h | 50 - dll/opengl/mesa/swrast/s_tritemp.h | 926 ---- dll/opengl/mesa/swrast/s_zoom.c | 420 -- dll/opengl/mesa/swrast/s_zoom.h | 56 - dll/opengl/mesa/swrast/swrast.h | 263 - dll/opengl/mesa/swrast_setup/CMakeLists.txt | 7 - dll/opengl/mesa/swrast_setup/ss_context.c | 230 - dll/opengl/mesa/swrast_setup/ss_context.h | 45 - dll/opengl/mesa/swrast_setup/ss_triangle.c | 253 - dll/opengl/mesa/swrast_setup/ss_triangle.h | 38 - dll/opengl/mesa/swrast_setup/ss_tritmp.h | 239 - dll/opengl/mesa/swrast_setup/ss_vb.h | 37 - dll/opengl/mesa/swrast_setup/swrast_setup.h | 55 - dll/opengl/mesa/teximage.c | 1890 ++++++++ dll/opengl/mesa/teximage.h | 166 + dll/opengl/mesa/texobj.c | 597 +++ dll/opengl/mesa/texobj.h | 88 + dll/opengl/mesa/texstate.c | 988 ++++ dll/opengl/mesa/texstate.h | 93 + dll/opengl/mesa/texture.c | 1702 +++++++ dll/opengl/mesa/texture.h | 79 + dll/opengl/mesa/tnl/CMakeLists.txt | 22 - dll/opengl/mesa/tnl/precomp.h | 28 - dll/opengl/mesa/tnl/t_context.c | 176 - dll/opengl/mesa/tnl/t_context.h | 486 -- dll/opengl/mesa/tnl/t_draw.c | 438 -- dll/opengl/mesa/tnl/t_pipeline.c | 205 - dll/opengl/mesa/tnl/t_pipeline.h | 71 - dll/opengl/mesa/tnl/t_rasterpos.c | 437 -- dll/opengl/mesa/tnl/t_vb_cliptmp.h | 320 -- dll/opengl/mesa/tnl/t_vb_fog.c | 265 - dll/opengl/mesa/tnl/t_vb_light.c | 320 -- dll/opengl/mesa/tnl/t_vb_lighttmp.h | 637 --- dll/opengl/mesa/tnl/t_vb_normals.c | 175 - dll/opengl/mesa/tnl/t_vb_points.c | 108 - dll/opengl/mesa/tnl/t_vb_render.c | 337 -- dll/opengl/mesa/tnl/t_vb_rendertmp.h | 433 -- dll/opengl/mesa/tnl/t_vb_texgen.c | 588 --- dll/opengl/mesa/tnl/t_vb_texmat.c | 111 - dll/opengl/mesa/tnl/t_vb_vertex.c | 248 - dll/opengl/mesa/tnl/t_vertex.c | 559 --- dll/opengl/mesa/tnl/t_vertex.h | 184 - dll/opengl/mesa/tnl/t_vertex_generic.c | 1134 ----- dll/opengl/mesa/tnl/t_vertex_sse.c | 678 --- dll/opengl/mesa/tnl/tnl.h | 100 - dll/opengl/mesa/triangle.c | 793 +++ dll/opengl/mesa/triangle.h | 43 + dll/opengl/mesa/tritemp.h | 874 ++++ dll/opengl/mesa/types.h | 1411 ++++++ dll/opengl/mesa/varray.c | 1341 ++++++ dll/opengl/mesa/varray.h | 102 + dll/opengl/mesa/vb.c | 88 + dll/opengl/mesa/vb.h | 158 + dll/opengl/mesa/vbfill.c | 1453 ++++++ dll/opengl/mesa/vbfill.h | 149 + dll/opengl/mesa/vbo/CMakeLists.txt | 22 - dll/opengl/mesa/vbo/precomp.h | 32 - dll/opengl/mesa/vbo/vbo.h | 143 - dll/opengl/mesa/vbo/vbo_attrib.h | 78 - dll/opengl/mesa/vbo/vbo_attrib_tmp.h | 332 -- dll/opengl/mesa/vbo/vbo_context.c | 185 - dll/opengl/mesa/vbo/vbo_context.h | 91 - dll/opengl/mesa/vbo/vbo_exec.c | 133 - dll/opengl/mesa/vbo/vbo_exec.h | 226 - dll/opengl/mesa/vbo/vbo_exec_api.c | 1167 ----- dll/opengl/mesa/vbo/vbo_exec_array.c | 543 --- dll/opengl/mesa/vbo/vbo_exec_draw.c | 387 -- dll/opengl/mesa/vbo/vbo_exec_eval.c | 240 - dll/opengl/mesa/vbo/vbo_noop.c | 349 -- dll/opengl/mesa/vbo/vbo_noop.h | 51 - dll/opengl/mesa/vbo/vbo_rebase.c | 203 - dll/opengl/mesa/vbo/vbo_save.c | 114 - dll/opengl/mesa/vbo/vbo_save.h | 204 - dll/opengl/mesa/vbo/vbo_save_api.c | 1363 ------ dll/opengl/mesa/vbo/vbo_save_draw.c | 256 - dll/opengl/mesa/vbo/vbo_save_loopback.c | 186 - dll/opengl/mesa/vbo/vbo_split.c | 154 - dll/opengl/mesa/vbo/vbo_split.h | 72 - dll/opengl/mesa/vbo/vbo_split_copy.c | 606 --- dll/opengl/mesa/vbo/vbo_split_inplace.c | 279 -- dll/opengl/mesa/vbrender.c | 1310 +++++ dll/opengl/mesa/vbrender.h | 44 + dll/opengl/mesa/vbxform.c | 1263 +++++ dll/opengl/mesa/vbxform.h | 44 + dll/opengl/mesa/x86-64/calling_convention.txt | 50 - dll/opengl/mesa/x86-64/x86-64.c | 129 - dll/opengl/mesa/x86-64/x86-64.h | 31 - dll/opengl/mesa/x86-64/xform4.S | 483 -- dll/opengl/mesa/x86/3dnow.c | 91 - dll/opengl/mesa/x86/3dnow.h | 36 - dll/opengl/mesa/x86/3dnow_normal.S | 852 ---- dll/opengl/mesa/x86/3dnow_xform1.S | 437 -- dll/opengl/mesa/x86/3dnow_xform2.S | 477 -- dll/opengl/mesa/x86/3dnow_xform3.S | 561 --- dll/opengl/mesa/x86/3dnow_xform4.S | 570 --- dll/opengl/mesa/x86/CMakeLists.txt | 34 - dll/opengl/mesa/x86/assyntax.h | 1747 ------- dll/opengl/mesa/x86/clip_args.h | 59 - dll/opengl/mesa/x86/common_x86.c | 317 -- dll/opengl/mesa/x86/common_x86_asm.S | 220 - dll/opengl/mesa/x86/common_x86_asm.h | 53 - dll/opengl/mesa/x86/common_x86_features.h | 67 - dll/opengl/mesa/x86/gen_matypes.c | 239 - dll/opengl/mesa/x86/matypes.h | 162 - dll/opengl/mesa/x86/mmx.h | 49 - dll/opengl/mesa/x86/mmx_blend.S | 338 -- dll/opengl/mesa/x86/mmx_blendtmp.h | 114 - dll/opengl/mesa/x86/norm_args.h | 57 - dll/opengl/mesa/x86/read_rgba_span_x86.S | 686 --- dll/opengl/mesa/x86/read_rgba_span_x86.h | 56 - dll/opengl/mesa/x86/rtasm/x86sse.c | 1203 ----- dll/opengl/mesa/x86/rtasm/x86sse.h | 256 - dll/opengl/mesa/x86/sse.c | 123 - dll/opengl/mesa/x86/sse.h | 36 - dll/opengl/mesa/x86/sse_normal.S | 261 - dll/opengl/mesa/x86/sse_xform1.S | 446 -- dll/opengl/mesa/x86/sse_xform2.S | 466 -- dll/opengl/mesa/x86/sse_xform3.S | 512 -- dll/opengl/mesa/x86/sse_xform4.S | 235 - dll/opengl/mesa/x86/x86_cliptest.S | 407 -- dll/opengl/mesa/x86/x86_xform.c | 124 - dll/opengl/mesa/x86/x86_xform.h | 106 - dll/opengl/mesa/x86/x86_xform2.S | 574 --- dll/opengl/mesa/x86/x86_xform3.S | 644 --- dll/opengl/mesa/x86/x86_xform4.S | 677 --- dll/opengl/mesa/x86/xform_args.h | 51 - dll/opengl/mesa/xform.c | 258 + dll/opengl/mesa/xform.h | 85 + dll/opengl/opengl32/CMakeLists.txt | 14 +- dll/opengl/opengl32/glfuncs.h | 610 +-- dll/opengl/opengl32/swimpl.c | 1792 +++++-- 448 files changed, 56963 insertions(+), 132237 deletions(-) diff --git a/dll/opengl/mesa/CMakeLists.txt b/dll/opengl/mesa/CMakeLists.txt index 004d505e21..20f8d31137 100644 --- a/dll/opengl/mesa/CMakeLists.txt +++ b/dll/opengl/mesa/CMakeLists.txt @@ -1,36 +1,71 @@ include_directories(.) -# our DBG definitions conflict with mesa source code -remove_definitions(-DDBG=1 -DDBG=0) +add_definitions(-DFAST_MATH -DTHREADS) -add_definitions( - -DWIN32 - -D_WINDOWS - -D_DLL - -DFEATURE_GL=1 - -D_GDI32_ # prevent gl* being declared __declspec(dllimport) in MS headers - -DBUILD_GL32 # declare gl* as __declspec(dllexport) in Mesa headers - -D_GLAPI_NO_EXPORTS # prevent _glapi_* from being declared __declspec(dllimport) -) - -if(OPENGL32_USE_TLS) - add_definitions(-DOPENGL32_USE_TLS) +if(ARCH STREQUAL "i386") + list(APPEND ASM_SOURCE asm-386.S) + add_definitions(-DUSE_ASM) endif() -if((ARCH STREQUAL "i386") AND (NOT MSVC)) - add_definitions( - -DUSE_X86_ASM - -DUSE_MMX_ASM - -DUSE_3DNOW_ASM - -DUSE_SSE_ASM) - add_subdirectory(x86) -endif() +add_asm_files(mesa_asm ${ASM_SOURCE}) + +list(APPEND SOURCE + accum.c + alpha.c + alphabuf.c + api.c + attrib.c + bitmap.c + blend.c + clip.c + colortab.c + context.c + copypix.c + depth.c + dlist.c + drawpix.c + enable.c + eval.c + feedback.c + fog.c + get.c + hash.c + image.c + light.c + lines.c + logic.c + masking.c + matrix.c + misc.c + mmath.c + pb.c + pixel.c + pointers.c + points.c + polygon.c + quads.c + rastpos.c + readpix.c + rect.c + scissor.c + shade.c + span.c + stencil.c + teximage.c + texobj.c + texstate.c + texture.c + triangle.c + varray.c + vb.c + vbfill.c + vbrender.c + vbxform.c + xform.c +) + +add_library(mesa STATIC ${SOURCE} ${mesa_asm}) +add_dependencies(mesa psdk) -add_subdirectory(drivers/common) -add_subdirectory(main) -add_subdirectory(math) -add_subdirectory(swrast) -add_subdirectory(swrast_setup) -add_subdirectory(tnl) -add_subdirectory(vbo) + diff --git a/dll/opengl/mesa/accum.c b/dll/opengl/mesa/accum.c new file mode 100644 index 0000000000..1d24902429 --- /dev/null +++ b/dll/opengl/mesa/accum.c @@ -0,0 +1,373 @@ +/* $Id: accum.c,v 1.5 1997/07/24 01:24:28 brianp Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 2.4 + * Copyright (C) 1995-1997 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * $Log: accum.c,v $ + * Revision 1.5 1997/07/24 01:24:28 brianp + * changed precompiled header symbol from PCH to PC_HEADER + * + * Revision 1.4 1997/05/28 03:23:09 brianp + * added precompiled header (PCH) support + * + * Revision 1.3 1997/04/30 01:54:48 brianp + * call gl_warning() if calling gl_Accum w/out accum buffer + * + * Revision 1.2 1996/09/15 14:19:44 brianp + * now use GLframebuffer and GLvisual + * added gl_alloc_accum_buffer() + * + * Revision 1.1 1996/09/13 01:38:16 brianp + * Initial revision + * + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include <limits.h> +#include <stdlib.h> +#include <string.h> +#include "accum.h" +#include "context.h" +#include "dlist.h" +#include "macros.h" +#include "types.h" +#endif + + +void gl_alloc_accum_buffer( GLcontext *ctx ) +{ + GLint n; + + if (ctx->Buffer->Accum) { + free( ctx->Buffer->Accum ); + ctx->Buffer->Accum = NULL; + } + + /* allocate accumulation buffer if not already present */ + n = ctx->Buffer->Width * ctx->Buffer->Height * 4 * sizeof(GLaccum); + ctx->Buffer->Accum = (GLaccum *) malloc( n ); + if (!ctx->Buffer->Accum) { + /* unable to setup accumulation buffer */ + gl_error( ctx, GL_OUT_OF_MEMORY, "glAccum" ); + } +} + + + +void gl_ClearAccum( GLcontext *ctx, + GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) +{ + if (INSIDE_BEGIN_END(ctx)) { + gl_error( ctx, GL_INVALID_OPERATION, "glAccum" ); + return; + } + ctx->Accum.ClearColor[0] = CLAMP( red, -1.0, 1.0 ); + ctx->Accum.ClearColor[1] = CLAMP( green, -1.0, 1.0 ); + ctx->Accum.ClearColor[2] = CLAMP( blue, -1.0, 1.0 ); + ctx->Accum.ClearColor[3] = CLAMP( alpha, -1.0, 1.0 ); +} + + + + +void gl_Accum( GLcontext *ctx, GLenum op, GLfloat value ) +{ + GLuint xpos, ypos, width, height; + GLfloat acc_scale; + + if (INSIDE_BEGIN_END(ctx)) { + gl_error( ctx, GL_INVALID_OPERATION, "glAccum" ); + return; + } + + if (ctx->Visual->AccumBits==0 || !ctx->Buffer->Accum) { + /* No accumulation buffer! */ + gl_warning(ctx, "Calling glAccum() without an accumulation buffer"); + return; + } + + if (sizeof(GLaccum)==1) { + acc_scale = 127.0; + } + else if (sizeof(GLaccum)==2) { + acc_scale = 32767.0; + } + else { + /* sizeof(GLaccum) > 2 (Cray) */ + acc_scale = (float) SHRT_MAX; + } + + /* Determine region to operate upon. */ + if (ctx->Scissor.Enabled) { + xpos = ctx->Scissor.X; + ypos = ctx->Scissor.Y; + width = ctx->Scissor.Width; + height = ctx->Scissor.Height; + } + else { + /* whole window */ + xpos = 0; + ypos = 0; + width = ctx->Buffer->Width; + height = ctx->Buffer->Height; + } + + switch (op) { + case GL_ADD: + { + GLaccum ival, *acc; + GLuint i, j; + + ival = (GLaccum) (value * acc_scale); + for (j=0;j<height;j++) { + acc = ctx->Buffer->Accum + + (ypos * ctx->Buffer->Width + xpos) * 4; + for (i=0;i<width;i++) { + *acc += ival; acc++; /* red */ + *acc += ival; acc++; /* green */ + *acc += ival; acc++; /* blue */ + *acc += ival; acc++; /* alpha */ + } + ypos++; + } + } + break; + case GL_MULT: + { + GLaccum *acc; + GLuint i, j; + + for (j=0;j<height;j++) { + acc = ctx->Buffer->Accum + + (ypos * ctx->Buffer->Width + xpos) * 4; + for (i=0;i<width;i++) { + *acc = (GLaccum) ( (GLfloat) *acc * value ); acc++; /*r*/ + *acc = (GLaccum) ( (GLfloat) *acc * value ); acc++; /*g*/ + *acc = (GLaccum) ( (GLfloat) *acc * value ); acc++; /*g*/ + *acc = (GLaccum) ( (GLfloat) *acc * value ); acc++; /*a*/ + } + ypos++; + } + } + break; + case GL_ACCUM: + { + GLaccum *acc; + GLubyte red[MAX_WIDTH], green[MAX_WIDTH]; + GLubyte blue[MAX_WIDTH], alpha[MAX_WIDTH]; + GLfloat rscale, gscale, bscale, ascale; + GLuint i, j; + + (void) (*ctx->Driver.SetBuffer)( ctx, ctx->Pixel.ReadBuffer ); + + /* Accumulate */ + rscale = value * acc_scale * ctx->Visual->InvRedScale; + gscale = value * acc_scale * ctx->Visual->InvGreenScale; + bscale = value * acc_scale * ctx->Visual->InvBlueScale; + ascale = value * acc_scale * ctx->Visual->InvAlphaScale; + for (j=0;j<height;j++) { + (*ctx->Driver.ReadColorSpan)( ctx, width, xpos, ypos, + red, green, blue, alpha); + acc = ctx->Buffer->Accum + + (ypos * ctx->Buffer->Width + xpos) * 4; + for (i=0;i<width;i++) { + *acc += (GLaccum) ( (GLfloat) red[i] * rscale ); acc++; + *acc += (GLaccum) ( (GLfloat) green[i] * gscale ); acc++; + *acc += (GLaccum) ( (GLfloat) blue[i] * bscale ); acc++; + *acc += (GLaccum) ( (GLfloat) alpha[i] * ascale ); acc++; + } + ypos++; + } + + (void) (*ctx->Driver.SetBuffer)( ctx, ctx->Color.DrawBuffer ); + } + break; + case GL_LOAD: + { + GLaccum *acc; + GLubyte red[MAX_WIDTH], green[MAX_WIDTH]; + GLubyte blue[MAX_WIDTH], alpha[MAX_WIDTH]; + GLfloat rscale, gscale, bscale, ascale; + GLuint i, j; + + (void) (*ctx->Driver.SetBuffer)( ctx, ctx->Pixel.ReadBuffer ); + + /* Load accumulation buffer */ + rscale = value * acc_scale * ctx->Visual->InvRedScale; + gscale = value * acc_scale * ctx->Visual->InvGreenScale; + bscale = value * acc_scale * ctx->Visual->InvBlueScale; + ascale = value * acc_scale * ctx->Visual->InvAlphaScale; + for (j=0;j<height;j++) { + (*ctx->Driver.ReadColorSpan)( ctx, width, xpos, ypos, + red, green, blue, alpha); + acc = ctx->Buffer->Accum + + (ypos * ctx->Buffer->Width + xpos) * 4; + for (i=0;i<width;i++) { + *acc++ = (GLaccum) ( (GLfloat) red[i] * rscale ); + *acc++ = (GLaccum) ( (GLfloat) green[i] * gscale ); + *acc++ = (GLaccum) ( (GLfloat) blue[i] * bscale ); + *acc++ = (GLaccum) ( (GLfloat) alpha[i] * ascale ); + } + ypos++; + } + + (void) (*ctx->Driver.SetBuffer)( ctx, ctx->Color.DrawBuffer ); + } + break; + case GL_RETURN: + { + GLubyte red[MAX_WIDTH], green[MAX_WIDTH]; + GLubyte blue[MAX_WIDTH], alpha[MAX_WIDTH]; + GLaccum *acc; + GLfloat rscale, gscale, bscale, ascale; + GLint rmax, gmax, bmax, amax; + GLuint i, j; + + rscale = value / acc_scale * ctx->Visual->RedScale; + gscale = value / acc_scale * ctx->Visual->GreenScale; + bscale = value / acc_scale * ctx->Visual->BlueScale; + ascale = value / acc_scale * ctx->Visual->AlphaScale; + rmax = (GLint) ctx->Visual->RedScale; + gmax = (GLint) ctx->Visual->GreenScale; + bmax = (GLint) ctx->Visual->BlueScale; + amax = (GLint) ctx->Visual->AlphaScale; + for (j=0;j<height;j++) { + acc = ctx->Buffer->Accum + + (ypos * ctx->Buffer->Width + xpos) * 4; + for (i=0;i<width;i++) { + GLint r, g, b, a; + r = (GLint) ( (GLfloat) (*acc++) * rscale + 0.5F ); + g = (GLint) ( (GLfloat) (*acc++) * gscale + 0.5F ); + b = (GLint) ( (GLfloat) (*acc++) * bscale + 0.5F ); + a = (GLint) ( (GLfloat) (*acc++) * ascale + 0.5F ); + red[i] = CLAMP( r, 0, rmax ); + green[i] = CLAMP( g, 0, gmax ); + blue[i] = CLAMP( b, 0, bmax ); + alpha[i] = CLAMP( a, 0, amax ); + } + (*ctx->Driver.WriteColorSpan)( ctx, width, xpos, ypos, + red, green, blue, alpha, NULL ); + ypos++; + } + } + break; + default: + gl_error( ctx, GL_INVALID_ENUM, "glAccum" ); + } +} + + + + +/* + * Clear the accumulation Buffer-> + */ +void gl_clear_accum_buffer( GLcontext *ctx ) +{ + GLuint buffersize; + GLfloat acc_scale; + + if (ctx->Visual->AccumBits==0) { + /* No accumulation buffer! */ + return; + } + + if (sizeof(GLaccum)==1) { + acc_scale = 127.0; + } + else if (sizeof(GLaccum)==2) { + acc_scale = 32767.0; + } + else { + /* sizeof(GLaccum) > 2 (Cray) */ + acc_scale = (float) SHRT_MAX; + } + + /* number of pixels */ + buffersize = ctx->Buffer->Width * ctx->Buffer->Height; + + if (!ctx->Buffer->Accum) { + /* try to alloc accumulation buffer */ + ctx->Buffer->Accum = (GLaccum *) + malloc( buffersize * 4 * sizeof(GLaccum) ); + } + + if (ctx->Buffer->Accum) { + if (ctx->Scissor.Enabled) { + /* Limit clear to scissor box */ + GLaccum r, g, b, a; + GLint i, j; + GLint width, height; + GLaccum *row; + r = (GLaccum) (ctx->Accum.ClearColor[0] * acc_scale); + g = (GLaccum) (ctx->Accum.ClearColor[1] * acc_scale); + b = (GLaccum) (ctx->Accum.ClearColor[2] * acc_scale); + a = (GLaccum) (ctx->Accum.ClearColor[3] * acc_scale); + /* size of region to clear */ + width = 4 * (ctx->Buffer->Xmax - ctx->Buffer->Xmin + 1); + height = ctx->Buffer->Ymax - ctx->Buffer->Ymin + 1; + /* ptr to first element to clear */ + row = ctx->Buffer->Accum + + 4 * (ctx->Buffer->Ymin * ctx->Buffer->Width + + ctx->Buffer->Xmin); + for (j=0;j<height;j++) { + for (i=0;i<width;i+=4) { + row[i+0] = r; + row[i+1] = g; + row[i+2] = b; + row[i+3] = a; + } + row += 4 * ctx->Buffer->Width; + } + } + else { + /* clear whole buffer */ + if (ctx->Accum.ClearColor[0]==0.0 && + ctx->Accum.ClearColor[1]==0.0 && + ctx->Accum.ClearColor[2]==0.0 && + ctx->Accum.ClearColor[3]==0.0) { + /* Black */ + MEMSET( ctx->Buffer->Accum, 0, buffersize * 4 * sizeof(GLaccum) ); + } + else { + /* Not black */ + GLaccum *acc, r, g, b, a; + GLuint i; + + acc = ctx->Buffer->Accum; + r = (GLaccum) (ctx->Accum.ClearColor[0] * acc_scale); + g = (GLaccum) (ctx->Accum.ClearColor[1] * acc_scale); + b = (GLaccum) (ctx->Accum.ClearColor[2] * acc_scale); + a = (GLaccum) (ctx->Accum.ClearColor[3] * acc_scale); + for (i=0;i<buffersize;i++) { + *acc++ = r; + *acc++ = g; + *acc++ = b; + *acc++ = a; + } + } + } + } +} diff --git a/dll/opengl/mesa/accum.h b/dll/opengl/mesa/accum.h new file mode 100644 index 0000000000..76a603b63e --- /dev/null +++ b/dll/opengl/mesa/accum.h @@ -0,0 +1,55 @@ +/* $Id: accum.h,v 1.2 1996/09/15 14:19:57 brianp Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 2.0 + * Copyright (C) 1995-1996 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * $Log: accum.h,v $ + * Revision 1.2 1996/09/15 14:19:57 brianp + * added gl_alloc_accum_buffer() + * + * Revision 1.1 1996/09/13 01:38:16 brianp + * Initial revision + * + */ + + +#ifndef ACCUM_H +#define ACCUM_H + + +#include "types.h" + + +extern void gl_alloc_accum_buffer( GLcontext *ctx ); + + +extern void gl_Accum( GLcontext* ctx, GLenum op, GLfloat value ); + + +extern void gl_ClearAccum( GLcontext* ctx, GLfloat red, GLfloat green, + GLfloat blue, GLfloat alpha ); + + +extern void gl_clear_accum_buffer( GLcontext* ctx ); + + +#endif diff --git a/dll/opengl/mesa/all.h b/dll/opengl/mesa/all.h new file mode 100644 index 0000000000..8040d3eece --- /dev/null +++ b/dll/opengl/mesa/all.h @@ -0,0 +1,136 @@ +/* $Id: all.h,v 1.6 1997/12/15 03:40:05 brianp Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 2.6 + * Copyright (C) 1995-1997 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * $Log: all.h,v $ + * Revision 1.6 1997/12/15 03:40:05 brianp + * added asm-386.h file + * + * Revision 1.5 1997/11/20 00:23:21 brianp + * added rect.h + * + * Revision 1.4 1997/09/27 00:16:04 brianp + * added colortab.h + * + * Revision 1.3 1997/08/22 01:42:48 brianp + * added api.h and hash.h + * + * Revision 1.2 1997/05/28 03:22:27 brianp + * added a few more headers + * + * Revision 1.1 1997/04/02 03:49:26 brianp + * Initial revision + * + */ + + +/* The purpose of this file is to collect all the header files that Mesa + * uses into a single header so that we can get new compilers that support + * pre-compiled headers to compile much faster. + * All we do is list all the internal headers used by Mesa in this one + * main header file, and most compilers will pre-compile all these headers + * and use them over and over again for each source module. This makes a + * big difference for Win32 support, because the <windows.h> headers take + * a *long* time to compile. + */ + + +#ifndef SRC_ALL_H +#define SRC_ALL_H + + +#ifndef PC_HEADER + This is an error. all.h should be included only if PC_HEADER is defined. +#endif + + +#include <assert.h> +#include <limits.h> +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <float.h> +#include <math.h> +#include "GL/gl.h" +#include "GL/osmesa.h" +#include "accum.h" +#include "alpha.h" +#include "alphabuf.h" +#include "api.h" +#include "asm-386.h" +#include "attrib.h" +#include "bitmap.h" +#include "blend.h" +#include "clip.h" +#include "colortab.h" +#include "context.h" +#include "config.h" +#include "copypix.h" +#include "dd.h" +#include "depth.h" +#include "dlist.h" +#include "drawpix.h" +#include "enable.h" +#include "eval.h" +#include "feedback.h" +#include "fixed.h" +#include "fog.h" +#include "get.h" +#include "hash.h" +#include "image.h" +#include "light.h" +#include "lines.h" +#include "logic.h" +#include "macros.h" +#include "masking.h" +#include "matrix.h" +#include "misc.h" +#include "mmath.h" +#include "pb.h" +#include "pixel.h" +#include "pointers.h" +#include "points.h" +#include "polygon.h" +#include "rastpos.h" +#include "readpix.h" +#include "rect.h" +#include "scissor.h" +#include "shade.h" +#include "span.h" +#include "stencil.h" +#include "teximage.h" +#include "texobj.h" +#include "texstate.h" +#include "texture.h" +#include "triangle.h" +#include "types.h" +#include "varray.h" +#include "vb.h" +#include "vbfill.h" +#include "vbrender.h" +#include "vbxform.h" +#include "winpos.h" +#include "xform.h" + + +#endif /*SRC_ALL_H*/ diff --git a/dll/opengl/mesa/alpha.c b/dll/opengl/mesa/alpha.c new file mode 100644 index 0000000000..c99a6d4450 --- /dev/null +++ b/dll/opengl/mesa/alpha.c @@ -0,0 +1,142 @@ +/* $Id: alpha.c,v 1.5 1997/07/24 01:24:28 brianp Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 2.4 + * Copyright (C) 1995-1997 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * $Log: alpha.c,v $ + * Revision 1.5 1997/07/24 01:24:28 brianp + * changed precompiled header symbol from PCH to PC_HEADER + * + * Revision 1.4 1997/05/28 03:23:09 brianp + * added precompiled header (PCH) support + * + * Revision 1.3 1997/03/13 03:07:53 brianp + * optimized gl_alpha_test() by removing conditional from inside loops + * + * Revision 1.2 1996/09/15 14:15:54 brianp + * now use GLframebuffer and GLvisual + * + * Revision 1.1 1996/09/13 01:38:16 brianp + * Initial revision + * + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include "alpha.h" +#include "context.h" +#include "types.h" +#include "dlist.h" +#include "macros.h" +#endif + + + +void gl_AlphaFunc( GLcontext* ctx, GLenum func, GLclampf ref ) +{ + if (INSIDE_BEGIN_END(ctx)) { + gl_error( ctx, GL_INVALID_OPERATION, "glAlphaFunc" ); + return; + } + switch (func) { + case GL_NEVER: + case GL_LESS: + case GL_EQUAL: + case GL_LEQUAL: + case GL_GREATER: + case GL_NOTEQUAL: + case GL_GEQUAL: + case GL_ALWAYS: + ctx->Color.AlphaFunc = func; + ctx->Color.AlphaRef = CLAMP( ref, 0.0F, 1.0F ); + ctx->Color.AlphaRefUbyte = (GLubyte) (ctx->Color.AlphaRef + * ctx->Visual->AlphaScale); + break; + default: + gl_error( ctx, GL_INVALID_ENUM, "glAlphaFunc(func)" ); + break; + } +} + + + + +/* + * Apply the alpha test to a span of pixels. + * In/Out: mask - current pixel mask. Pixels which fail the alpha test + * will set the corresponding mask flag to 0. + * Return: 0 = all pixels in the span failed the alpha test. + * 1 = one or more pixels passed the alpha test. + */ +GLint gl_alpha_test( GLcontext* ctx, + GLuint n, const GLubyte alpha[], GLubyte mask[] ) +{ + GLuint i; + GLubyte ref = ctx->Color.AlphaRefUbyte; + + /* switch cases ordered from most frequent to less frequent */ + switch (ctx->Color.AlphaFunc) { + case GL_LESS: + for (i=0;i<n;i++) { + mask[i] &= (alpha[i] < ref); + } + return 1; + case GL_LEQUAL: + for (i=0;i<n;i++) { + mask[i] &= (alpha[i] <= ref); + } + return 1; + case GL_GEQUAL: + for (i=0;i<n;i++) { + mask[i] &= (alpha[i] >= ref); + } + return 1; + case GL_GREATER: + for (i=0;i<n;i++) { + mask[i] &= (alpha[i] > ref); + } + return 1; + case GL_NOTEQUAL: + for (i=0;i<n;i++) { + mask[i] &= (alpha[i] != ref); + } + return 1; + case GL_EQUAL: + for (i=0;i<n;i++) { + mask[i] &= (alpha[i] == ref); + } + return 1; + case GL_ALWAYS: + /* do nothing */ + return 1; + case GL_NEVER: + /* caller should check for zero! */ + return 0; + default: + gl_problem( ctx, "Invalid alpha test in gl_alpha_test" ); + return 0; + } + /* Never get here */ + return 1; +} diff --git a/dll/opengl/mesa/alpha.h b/dll/opengl/mesa/alpha.h new file mode 100644 index 0000000000..4e0a55abe4 --- /dev/null +++ b/dll/opengl/mesa/alpha.h @@ -0,0 +1,46 @@ +/* $Id: alpha.h,v 1.1 1996/09/13 01:38:16 brianp Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 2.0 + * Copyright (C) 1995-1996 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * $Log: alpha.h,v $ + * Revision 1.1 1996/09/13 01:38:16 brianp + * Initial revision + * + */ + + +#ifndef ALPHA_H +#define ALPHA_H + + +#include "types.h" + + +extern GLint gl_alpha_test( GLcontext* ctx, + GLuint n, const GLubyte alpha[], GLubyte mask[] ); + + +extern void gl_AlphaFunc( GLcontext* ctx, GLenum func, GLclampf ref ); + + +#endif diff --git a/dll/opengl/mesa/alphabuf.c b/dll/opengl/mesa/alphabuf.c new file mode 100644 index 0000000000..786f187b3a --- /dev/null +++ b/dll/opengl/mesa/alphabuf.c @@ -0,0 +1,271 @@ +/* $Id: alphabuf.c,v 1.5 1997/07/24 01:24:28 brianp Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 2.4 + * Copyright (C) 1995-1997 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * $Log: alphabuf.c,v $ + * Revision 1.5 1997/07/24 01:24:28 brianp + * changed precompiled header symbol from PCH to PC_HEADER + * + * Revision 1.4 1997/05/28 03:23:09 brianp + * added precompiled header (PCH) support + * + * Revision 1.3 1996/10/02 02:51:07 brianp + * in gl_clear_alpha_buffers() check for GL_FRONT_AND_BACK draw mode + * + * Revision 1.2 1996/09/15 14:15:54 brianp + * now use GLframebuffer and GLvisual + * + * Revision 1.1 1996/09/13 01:38:16 brianp + * Initial revision + * + */ + + + +/* + * Software alpha planes. Many frame buffers don't have alpha bits so + * we simulate them in software. + */ + + +#ifdef PC_HEADER +#include "all.h" +#else +#include <stdlib.h> +#include <string.h> +#include "alphabuf.h" +#include "context.h" +#include "macros.h" +#include "types.h" +#endif + + + +#define ALPHA_ADDR(X,Y) (ctx->Buffer->Alpha + (Y) * ctx->Buffer->Width + (X)) + + + +/* + * Allocate a new front and back alpha buffer. + */ +void gl_alloc_alpha_buffers( GLcontext* ctx ) +{ + GLint bytes = ctx->Buffer->Width * ctx->Buffer->Height * sizeof(GLubyte); + + if (ctx->Visual->FrontAlphaEnabled) { + if (ctx->Buffer->FrontAlpha) { + free( ctx->Buffer->FrontAlpha ); + } + ctx->Buffer->FrontAlpha = (GLubyte *) malloc( bytes ); + if (!ctx->Buffer->FrontAlpha) { + /* out of memory */ + gl_error( ctx, GL_OUT_OF_MEMORY, "Couldn't allocate front alpha buffer" ); + } + } + if (ctx->Visual->BackAlphaEnabled) { + if (ctx->Buffer->BackAlpha) { + free( ctx->Buffer->BackAlpha ); + } + ctx->Buffer->BackAlpha = (GLubyte *) malloc( bytes ); + if (!ctx->Buffer->BackAlpha) { + /* out of memory */ + gl_error( ctx, GL_OUT_OF_MEMORY, "Couldn't allocate back alpha buffer" ); + } + } + if (ctx->Color.DrawBuffer==GL_FRONT) { + ctx->Buffer->Alpha = ctx->Buffer->FrontAlpha; + } + if (ctx->Color.DrawBuffer==GL_BACK) { + ctx->Buffer->Alpha = ctx->Buffer->BackAlpha; + } +} + + + +/* + * Clear the front and/or back alpha planes. + */ +void gl_clear_alpha_buffers( GLcontext* ctx ) +{ + GLint buffer; + + /* Loop over front and back buffers */ + for (buffer=0;buffer<2;buffer++) { + + /* Get pointer to front or back buffer */ + GLubyte *abuffer = NULL; + if (buffer==0 + && ( ctx->Color.DrawBuffer==GL_FRONT + || ctx->Color.DrawBuffer==GL_FRONT_AND_BACK) + && ctx->Visual->FrontAlphaEnabled && ctx->Buffer->FrontAlpha) { + abuffer = ctx->Buffer->FrontAlpha; + } + else if (buffer==1 + && ( ctx->Color.DrawBuffer==GL_BACK + || ctx->Color.DrawBuffer==GL_FRONT_AND_BACK) + && ctx->Visual->BackAlphaEnabled && ctx->Buffer->BackAlpha) { + abuffer = ctx->Buffer->BackAlpha; + } + + /* Clear the alpha buffer */ + if (abuffer) { + GLubyte aclear = (GLint) (ctx->Color.ClearColor[3] + * ctx->Visual->AlphaScale); + if (ctx->Scissor.Enabled) { + /* clear scissor region */ + GLint i, j; + for (j=0;j<ctx->Scissor.Height;j++) { + GLubyte *aptr = ALPHA_ADDR(ctx->Buffer->Xmin, + ctx->Buffer->Ymin+j); + for (i=0;i<ctx->Scissor.Width;i++) { + *aptr++ = aclear; + } + } + } + else { + /* clear whole buffer */ + MEMSET( abuffer, aclear, ctx->Buffer->Width*ctx->Buffer->Height ); + } + } + } +} + + + +void gl_write_alpha_span( GLcontext* ctx, GLuint n, GLint x, GLint y, + GLubyte alpha[], GLubyte mask[] ) +{ + GLubyte *aptr = ALPHA_ADDR( x, y ); + GLuint i; + + if (mask) { + for (i=0;i<n;i++) { + if (mask[i]) { + *aptr = alpha[i]; + } + aptr++; + } + } + else { + for (i=0;i<n;i++) { + *aptr++ = alpha[i]; + } + } +} + + +void gl_write_mono_alpha_span( GLcontext* ctx, GLuint n, GLint x, GLint y, + GLubyte alpha, GLubyte mask[] ) +{ + GLubyte *aptr = ALPHA_ADDR( x, y ); + GLuint i; + + if (mask) { + for (i=0;i<n;i++) { + if (mask[i]) { + *aptr = alpha; + } + aptr++; + } + } + else { + for (i=0;i<n;i++) { + *aptr++ = alpha; + } + } +} + + +void gl_write_alpha_pixels( GLcontext* ctx, + GLuint n, const GLint x[], const GLint y[], + const GLubyte alpha[], const GLubyte mask[] ) +{ + GLuint i; + + if (mask) { + for (i=0;i<n;i++) { + if (mask[i]) { + GLubyte *aptr = ALPHA_ADDR( x[i], y[i] ); + *aptr = alpha[i]; + } + } + } + else { + for (i=0;i<n;i++) { + GLubyte *aptr = ALPHA_ADDR( x[i], y[i] ); + *aptr = alpha[i]; + } + } +} + + +void gl_write_mono_alpha_pixels( GLcontext* ctx, + GLuint n, const GLint x[], const GLint y[], + GLubyte alpha, const GLubyte mask[] ) +{ + GLuint i; + + if (mask) { + for (i=0;i<n;i++) { + if (mask[i]) { + GLubyte *aptr = ALPHA_ADDR( x[i], y[i] ); + *aptr = alpha; + } + } + } + else { + for (i=0;i<n;i++) { + GLubyte *aptr = ALPHA_ADDR( x[i], y[i] ); + *aptr = alpha; + } + } +} + + + +void gl_read_alpha_span( GLcontext* ctx, + GLuint n, GLint x, GLint y, GLubyte alpha[] ) +{ + GLubyte *aptr = ALPHA_ADDR( x, y ); + GLuint i; + for (i=0;i<n;i++) { + alpha[i] = *aptr++; + } +} + + +void gl_read_alpha_pixels( GLcontext* ctx, + GLuint n, const GLint x[], const GLint y[], + GLubyte alpha[], const GLubyte mask[] ) +{ + GLuint i; + for (i=0;i<n;i++) { + if (mask[i]) { + GLubyte *aptr = ALPHA_ADDR( x[i], y[i] ); + alpha[i] = *aptr; + } + } +} + + + diff --git a/dll/opengl/mesa/alphabuf.h b/dll/opengl/mesa/alphabuf.h new file mode 100644 index 0000000000..e2f6ef8e0b --- /dev/null +++ b/dll/opengl/mesa/alphabuf.h @@ -0,0 +1,78 @@ +/* $Id: alphabuf.h,v 1.1 1996/09/13 01:38:16 brianp Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 2.0 + * Copyright (C) 1995-1996 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * $Log: alphabuf.h,v $ + * Revision 1.1 1996/09/13 01:38:16 brianp + * Initial revision + * + */ + + + +#ifndef ALPHABUF_H +#define ALPHABUF_H + + +#include "types.h" + + +extern void gl_alloc_alpha_buffers( GLcontext* ctx ); + + +extern void gl_clear_alpha_buffers( GLcontext* ctx ); + + +extern void gl_write_alpha_span( GLcontext* ctx, GLuint n, GLint x, GLint y, + GLubyte alpha[], GLubyte mask[] ); + + +extern void gl_write_mono_alpha_span( GLcontext* ctx, + GLuint n, GLint x, GLint y, + GLubyte alpha, GLubyte mask[] ); + + + +extern void gl_write_alpha_pixels( GLcontext* ctx, + GLuint n, const GLint x[], const GLint y[], + const GLubyte alpha[], + const GLubyte mask[] ); + + +extern void gl_write_mono_alpha_pixels( GLcontext* ctx, + GLuint n, const GLint x[], + const GLint y[], GLubyte alpha, + const GLubyte mask[] ); + + +extern void gl_read_alpha_span( GLcontext* ctx, + GLuint n, GLint x, GLint y, GLubyte alpha[] ); + + +extern void gl_read_alpha_pixels( GLcontext* ctx, + GLuint n, const GLint x[], const GLint y[], + GLubyte alpha[], const GLubyte mask[] ); + + +#endif + diff --git a/dll/opengl/mesa/api.c b/dll/opengl/mesa/api.c new file mode 100644 index 0000000000..b594b23473 --- /dev/null +++ b/dll/opengl/mesa/api.c @@ -0,0 +1,2874 @@ +/* + * Mesa 3-D graphics library + * Version: 2.5 + * Copyright (C) 1995-1997 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifdef PC_HEADER +#include "all.h" +#else +#include <stdio.h> +#include <stdlib.h> +#include "api.h" +#include "bitmap.h" +#include "context.h" + +#include "drawpix.h" + +#include "eval.h" +#include "image.h" +#include "macros.h" +#include "matrix.h" +#include "teximage.h" +#include "types.h" +#include "vb.h" +#endif + +void APIENTRY _mesa_Accum( GLenum op, GLfloat value ) +{ + GET_CONTEXT; + (*CC->API.Accum)(CC, op, value); +} + +void APIENTRY _mesa_AlphaFunc( GLenum func, GLclampf ref ) +{ + GET_CONTEXT; + (*CC->API.AlphaFunc)(CC, func, ref); +} + + +GLboolean APIENTRY _mesa_AreTexturesResident( GLsizei n, const GLuint *textures, + GLboolean *residences ) +{ + GET_CONTEXT; + return (*CC->API.AreTexturesResident)(CC, n, textures, residences); +} + +void APIENTRY _mesa_ArrayElement( GLint i ) +{ + GET_CONTEXT; + (*CC->API.ArrayElement)(CC, i); +} + + +void APIENTRY _mesa_Begin( GLenum mode ) +{ + GET_CONTEXT; + (*CC->API.Begin)( CC, mode ); +} + + +void APIENTRY _mesa_BindTexture( GLenum target, GLuint texture ) +{ + GET_CONTEXT; + (*CC->API.BindTexture)(CC, target, texture); +} + + +void APIENTRY _mesa_Bitmap( GLsizei width, GLsizei height, + GLfloat xorig, GLfloat yorig, + GLfloat xmove, GLfloat ymove, + const GLubyte *bitmap ) +{ + GET_CONTEXT; + if (!CC->CompileFlag) { + /* execute only, try optimized case where no unpacking needed */ + if ( CC->Unpack.LsbFirst==GL_FALSE + && CC->Unpack.Alignment==1 + && CC->Unpack.RowLength==0 + && CC->Unpack.SkipPixels==0 + && CC->Unpack.SkipRows==0) { + /* Special case: no unpacking needed */ + struct gl_image image; + image.Width = width; + image.Height = height; + image.Components = 0; + image.Type = GL_BITMAP; + image.Format = GL_COLOR_INDEX; + image.Data = (GLvoid *) bitmap; + (*CC->Exec.Bitmap)( CC, width, height, xorig, yorig, + xmove, ymove, &image ); + } + else { + struct gl_image *image; + image = gl_unpack_bitmap( CC, width, height, bitmap ); + (*CC->Exec.Bitmap)( CC, width, height, xorig, yorig, + xmove, ymove, image ); + if (image) { + gl_free_image( image ); + } + } + } + else { + /* compile and maybe execute */ + struct gl_image *image; + image = gl_unpack_bitmap( CC, width, height, bitmap ); + (*CC->API.Bitmap)(CC, width, height, xorig, yorig, xmove, ymove, image ); + } +} + + +void APIENTRY _mesa_BlendFunc( GLenum sfactor, GLenum dfactor ) +{ + GET_CONTEXT; + (*CC->API.BlendFunc)(CC, sfactor, dfactor); +} + + +void APIENTRY _mesa_CallList( GLuint list ) +{ + GET_CONTEXT; + (*CC->API.CallList)(CC, list); +} + + +void APIENTRY _mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists ) +{ + GET_CONTEXT; + (*CC->API.CallLists)(CC, n, type, lists); +} + + +void APIENTRY _mesa_Clear( GLbitfield mask ) +{ + GET_CONTEXT; + (*CC->API.Clear)(CC, mask); +} + + +void APIENTRY _mesa_ClearAccum( GLfloat red, GLfloat green, + GLfloat blue, GLfloat alpha ) +{ + GET_CONTEXT; + (*CC->API.ClearAccum)(CC, red, green, blue, alpha); +} + + + +void APIENTRY _mesa_ClearIndex( GLfloat c ) +{ + GET_CONTEXT; + (*CC->API.ClearIndex)(CC, c); +} + + +void APIENTRY _mesa_ClearColor( GLclampf red, + GLclampf green, + GLclampf blue, + GLclampf alpha ) +{ + GET_CONTEXT; + (*CC->API.ClearColor)(CC, red, green, blue, alpha); +} + + +void APIENTRY _mesa_ClearDepth( GLclampd depth ) +{ + GET_CONTEXT; + (*CC->API.ClearDepth)( CC, depth ); +} + + +void APIENTRY _mesa_ClearStencil( GLint s ) +{ + GET_CONTEXT; + (*CC->API.ClearStencil)(CC, s); +} + + +void APIENTRY _mesa_ClipPlane( GLenum plane, const GLdouble *equation ) +{ + GLfloat eq[4]; + GET_CONTEXT; + eq[0] = (GLfloat) equation[0]; + eq[1] = (GLfloat) equation[1]; + eq[2] = (GLfloat) equation[2]; + eq[3] = (GLfloat) equation[3]; + (*CC->API.ClipPlane)(CC, plane, eq ); +} + + +void APIENTRY _mesa_Color3b( GLbyte red, GLbyte green, GLbyte blue ) +{ + GET_CONTEXT; + (*CC->API.Color3f)( CC, BYTE_TO_FLOAT(red), BYTE_TO_FLOAT(green), + BYTE_TO_FLOAT(blue) ); +} + + +void APIENTRY _mesa_Color3d( GLdouble red, GLdouble green, GLdouble blue ) +{ + GET_CONTEXT; + (*CC->API.Color3f)( CC, (GLfloat) red, (GLfloat) green, (GLfloat) blue ); +} + + +void APIENTRY _mesa_Color3f( GLfloat red, GLfloat green, GLfloat blue ) +{ + GET_CONTEXT; + (*CC->API.Color3f)( CC, red, green, blue ); +} + + +void APIENTRY _mesa_Color3i( GLint red, GLint green, GLint blue ) +{ + GET_CONTEXT; + (*CC->API.Color3f)( CC, INT_TO_FLOAT(red), INT_TO_FLOAT(green), + INT_TO_FLOAT(blue) ); +} + + +void APIENTRY _mesa_Color3s( GLshort red, GLshort green, GLshort blue ) +{ + GET_CONTEXT; + (*CC->API.Color3f)( CC, SHORT_TO_FLOAT(red), SHORT_TO_FLOAT(green), + SHORT_TO_FLOAT(blue) ); +} + + +void APIENTRY _mesa_Color3ub( GLubyte red, GLubyte green, GLubyte blue ) +{ + GET_CONTEXT; + (*CC->API.Color4ub)( CC, red, green, blue, 255 ); +} + + +void APIENTRY _mesa_Color3ui( GLuint red, GLuint green, GLuint blue ) +{ + GET_CONTEXT; + (*CC->API.Color3f)( CC, UINT_TO_FLOAT(red), UINT_TO_FLOAT(green), + UINT_TO_FLOAT(blue) ); +} + + +void APIENTRY _mesa_Color3us( GLushort red, GLushort green, GLushort blue ) +{ + GET_CONTEXT; + (*CC->API.Color3f)( CC, USHORT_TO_FLOAT(red), USHORT_TO_FLOAT(green), + USHORT_TO_FLOAT(blue) ); +} + + +void APIENTRY _mesa_Color4b( GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha ) +{ + GET_CONTEXT; + (*CC->API.Color4f)( CC, BYTE_TO_FLOAT(red), BYTE_TO_FLOAT(green), + BYTE_TO_FLOAT(blue), BYTE_TO_FLOAT(alpha) ); +} + + +void APIENTRY _mesa_Color4d( GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha ) +{ + GET_CONTEXT; + (*CC->API.Color4f)( CC, (GLfloat) red, (GLfloat) green, + (GLfloat) blue, (GLfloat) alpha ); +} + + +void APIENTRY _mesa_Color4f( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) +{ + GET_CONTEXT; + (*CC->API.Color4f)( CC, red, green, blue, alpha ); +} + +void APIENTRY _mesa_Color4i( GLint red, GLint green, GLint blue, GLint alpha ) +{ + GET_CONTEXT; + (*CC->API.Color4f)( CC, INT_TO_FLOAT(red), INT_TO_FLOAT(green), + INT_TO_FLOAT(blue), INT_TO_FLOAT(alpha) ); +} + + +void APIENTRY _mesa_Color4s( GLshort red, GLshort green, GLshort blue, GLshort alpha ) +{ + GET_CONTEXT; + (*CC->API.Color4f)( CC, SHORT_TO_FLOAT(red), SHORT_TO_FLOAT(green), + SHORT_TO_FLOAT(blue), SHORT_TO_FLOAT(alpha) ); +} + +void APIENTRY _mesa_Color4ub( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ) +{ + GET_CONTEXT; + (*CC->API.Color4ub)( CC, red, green, blue, alpha ); +} + +void APIENTRY _mesa_Color4ui( GLuint red, GLuint green, GLuint blue, GLuint alpha ) +{ + GET_CONTEXT; + (*CC->API.Color4f)( CC, UINT_TO_FLOAT(red), UINT_TO_FLOAT(green), + UINT_TO_FLOAT(blue), UINT_TO_FLOAT(alpha) ); +} + +void APIENTRY _mesa_Color4us( GLushort red, GLushort green, GLushort blue, GLushort alpha ) +{ + GET_CONTEXT; + (*CC->API.Color4f)( CC, USHORT_TO_FLOAT(red), USHORT_TO_FLOAT(green), + USHORT_TO_FLOAT(blue), USHORT_TO_FLOAT(alpha) ); +} + + +void APIENTRY _mesa_Color3bv( const GLbyte *v ) +{ + GET_CONTEXT; + (*CC->API.Color3f)( CC, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]), + BYTE_TO_FLOAT(v[2]) ); +} + + +void APIENTRY _mesa_Color3dv( const GLdouble *v ) +{ + GET_CONTEXT; + (*CC->API.Color3f)( CC, (GLdouble) v[0], (GLdouble) v[1], (GLdouble) v[2] ); +} + + +void APIENTRY _mesa_Color3fv( const GLfloat *v ) +{ + GET_CONTEXT; + (*CC->API.Color3fv)( CC, v ); +} + + +void APIENTRY _mesa_Color3iv( const GLint *v ) +{ + GET_CONTEXT; + (*CC->API.Color3f)( CC, INT_TO_FLOAT(v[0]), INT_TO_FLOAT(v[1]), + INT_TO_FLOAT(v[2]) ); +} + + +void APIENTRY _mesa_Color3sv( const GLshort *v ) +{ + GET_CONTEXT; + (*CC->API.Color3f)( CC, SHORT_TO_FLOAT(v[0]), SHORT_TO_FLOAT(v[1]), + SHORT_TO_FLOAT(v[2]) ); +} + + +void APIENTRY _mesa_Color3ubv( const GLubyte *v ) +{ + GET_CONTEXT; + (*CC->API.Color4ub)( CC, v[0], v[1], v[2], 255 ); +} + + +void APIENTRY _mesa_Color3uiv( const GLuint *v ) +{ + GET_CONTEXT; + (*CC->API.Color3f)( CC, UINT_TO_FLOAT(v[0]), UINT_TO_FLOAT(v[1]), + UINT_TO_FLOAT(v[2]) ); +} + + +void APIENTRY _mesa_Color3usv( const GLushort *v ) +{ + GET_CONTEXT; + (*CC->API.Color3f)( CC, USHORT_TO_FLOAT(v[0]), USHORT_TO_FLOAT(v[1]), + USHORT_TO_FLOAT(v[2]) ); + +} + + +void APIENTRY _mesa_Color4bv( const GLbyte *v ) +{ + GET_CONTEXT; + (*CC->API.Color4f)( CC, BYTE_TO_FLOAT(v[0]), BYTE_TO_FLOAT(v[1]), + BYTE_TO_FLOAT(v[2]), BYTE_TO_FLOAT(v[3]) ); +} + + +void APIENTRY _mesa_Color4dv( const GLdouble *v ) +{ + GET_CONTEXT; + (*CC->API.Color4f)( CC, (GLdouble) v[0], (GLdouble) v[1], + (GLdouble) v[2], (GLdouble) v[3] ); +} + + +void APIENTRY _mesa_Color4fv( const GLfloat *v ) +{ + GET_CONTEXT; + (*CC->API.Color4f)( CC, v[0], v[1], v[2], v[3] ); +} + + +void APIENTRY _mesa_Color4iv( const GLint *v ) +{ + GET_CONTEXT; + (*CC->API.Color4f)( CC, INT_TO_FLOAT(v[0]), INT_TO_FLOAT(v[1]), + INT_TO_FLOAT(v[2]), INT_TO_FLOAT(v[3]) ); +} + + +void APIENTRY _mesa_Color4sv( const GLshort *v ) +{ + GET_CONTEXT; + (*CC->API.Color4f)( CC, SHORT_TO_FLOAT(v[0]), SHORT_TO_FLOAT(v[1]), + SHORT_TO_FLOAT(v[2]), SHORT_TO_FLOAT(v[3]) ); +} + + +void APIENTRY _mesa_Color4ubv( const GLubyte *v ) +{ + GET_CONTEXT; + (*CC->API.Color4ubv)( CC, v ); +} + + +void APIENTRY _mesa_Color4uiv( const GLuint *v ) +{ + GET_CONTEXT; + (*CC->API.Color4f)( CC, UINT_TO_FLOAT(v[0]), UINT_TO_FLOAT(v[1]), + UINT_TO_FLOAT(v[2]), UINT_TO_FLOAT(v[3]) ); +} + + +void APIENTRY _mesa_Color4usv( const GLushort *v ) +{ + GET_CONTEXT; + (*CC->API.Color4f)( CC, USHORT_TO_FLOAT(v[0]), USHORT_TO_FLOAT(v[1]), + USHORT_TO_FLOAT(v[2]), USHORT_TO_FLOAT(v[3]) ); +} + + +void APIENTRY _mesa_ColorMask( GLboolean red, GLboolean green, + GLboolean blue, GLboolean alpha ) +{ + GET_CONTEXT; + (*CC->API.ColorMask)(CC, red, green, blue, alpha); +} + + +void APIENTRY _mesa_ColorMaterial( GLenum face, GLenum mode ) +{ + GET_CONTEXT; + (*CC->API.ColorMaterial)(CC, face, mode); +} + + +void APIENTRY _mesa_ColorPointer( GLint size, GLenum type, GLsizei stride, + const GLvoid *ptr ) +{ + GET_CONTEXT; + (*CC->API.ColorPointer)(CC, size, type, stride, ptr); +} + + +void APIENTRY _mesa_CopyPixels( GLint x, GLint y, GLsizei width, GLsizei height, + GLenum type ) +{ + GET_CONTEXT; + (*CC->API.CopyPixels)(CC, x, y, width, height, type); +} + + +void APIENTRY _mesa_CopyTexImage1D( GLenum target, GLint level, + GLenum internalformat, + GLint x, GLint y, + GLsizei width, GLint border ) +{ + GET_CONTEXT; + (*CC->API.CopyTexImage1D)( CC, target, level, internalformat, + x, y, width, border ); +} + + +void APIENTRY _mesa_CopyTexImage2D( GLenum target, GLint level, + GLenum internalformat, + GLint x, GLint y, + GLsizei width, GLsizei height, GLint border ) +{ + GET_CONTEXT; + (*CC->API.CopyTexImage2D)( CC, target, level, internalformat, + x, y, width, height, border ); +} + + +void APIENTRY _mesa_CopyTexSubImage1D( GLenum target, GLint level, + GLint xoffset, GLint x, GLint y, + GLsizei width ) +{ + GET_CONTEXT; + (*CC->API.CopyTexSubImage1D)( CC, target, level, xoffset, x, y, width ); +} + + +void APIENTRY _mesa_CopyTexSubImage2D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint x, GLint y, + GLsizei width, GLsizei height ) +{ + GET_CONTEXT; + (*CC->API.CopyTexSubImage2D)( CC, target, level, xoffset, yoffset, + x, y, width, height ); +} + + + +void APIENTRY _mesa_CullFace( GLenum mode ) +{ + GET_CONTEXT; + (*CC->API.CullFace)(CC, mode); +} + + +void APIENTRY _mesa_DepthFunc( GLenum func ) +{ + GET_CONTEXT; + (*CC->API.DepthFunc)( CC, func ); +} + + +void APIENTRY _mesa_DepthMask( GLboolean flag ) +{ + GET_CONTEXT; + (*CC->API.DepthMask)( CC, flag ); +} + + +void APIENTRY _mesa_DepthRange( GLclampd near_val, GLclampd far_val ) +{ + GET_CONTEXT; + (*CC->API.DepthRange)( CC, near_val, far_val ); +} + + +void APIENTRY _mesa_DeleteLists( GLuint list, GLsizei range ) +{ + GET_CONTEXT; + (*CC->API.DeleteLists)(CC, list, range); +} + + +void APIENTRY _mesa_DeleteTextures( GLsizei n, const GLuint *textures) +{ + GET_CONTEXT; + (*CC->API.DeleteTextures)(CC, n, textures); +} + + +void APIENTRY _mesa_Disable( GLenum cap ) +{ + GET_CONTEXT; + (*CC->API.Disable)( CC, cap ); +} + + +void APIENTRY _mesa_DisableClientState( GLenum cap ) +{ + GET_CONTEXT; + (*CC->API.DisableClientState)( CC, cap ); +} + + +void APIENTRY _mesa_DrawArrays( GLenum mode, GLint first, GLsizei count ) +{ + GET_CONTEXT; + (*CC->API.DrawArrays)(CC, mode, first, count); +} + + +void APIENTRY _mesa_DrawBuffer( GLenum mode ) +{ + GET_CONTEXT; + (*CC->API.DrawBuffer)(CC, mode); +} + + +void APIENTRY _mesa_DrawElements( GLenum mode, GLsizei count, + GLenum type, const GLvoid *indices ) +{ + GET_CONTEXT; + (*CC->API.DrawElements)( CC, mode, count, type, indices ); +} + + +void APIENTRY _mesa_DrawPixels( GLsizei width, GLsizei height, + GLenum format, GLenum type, const GLvoid *pixels ) +{ + GET_CONTEXT; + (*CC->API.DrawPixels)( CC, width, height, format, type, pixels ); +} + + +void APIENTRY _mesa_Enable( GLenum cap ) +{ + GET_CONTEXT; + (*CC->API.Enable)( CC, cap ); +} + + +void APIENTRY _mesa_EnableClientState( GLenum cap ) +{ + GET_CONTEXT; + (*CC->API.EnableClientState)( CC, cap ); +} + + +void APIENTRY _mesa_End( void ) +{ + GET_CONTEXT; + (*CC->API.End)( CC ); +} + + +void APIENTRY _mesa_EndList( void ) +{ + GET_CONTEXT; + (*CC->API.EndList)(CC); +} + + + + +void APIENTRY _mesa_EvalCoord1d( GLdouble u ) +{ + GET_CONTEXT; + (*CC->API.EvalCoord1f)( CC, (GLfloat) u ); +} + + +void APIENTRY _mesa_EvalCoord1f( GLfloat u ) +{ + GET_CONTEXT; + (*CC->API.EvalCoord1f)( CC, u ); +} + + +void APIENTRY _mesa_EvalCoord1dv( const GLdouble *u ) +{ + GET_CONTEXT; + (*CC->API.EvalCoord1f)( CC, (GLfloat) *u ); +} + + +void APIENTRY _mesa_EvalCoord1fv( const GLfloat *u ) +{ + GET_CONTEXT; + (*CC->API.EvalCoord1f)( CC, (GLfloat) *u ); +} + + +void APIENTRY _mesa_EvalCoord2d( GLdouble u, GLdouble v ) +{ + GET_CONTEXT; + (*CC->API.EvalCoord2f)( CC, (GLfloat) u, (GLfloat) v ); +} + + +void APIENTRY _mesa_EvalCoord2f( GLfloat u, GLfloat v ) +{ + GET_CONTEXT; + (*CC->API.EvalCoord2f)( CC, u, v ); +} + + +void APIENTRY _mesa_EvalCoord2dv( const GLdouble *u ) +{ + GET_CONTEXT; + (*CC->API.EvalCoord2f)( CC, (GLfloat) u[0], (GLfloat) u[1] ); +} + + +void APIENTRY _mesa_EvalCoord2fv( const GLfloat *u ) +{ + GET_CONTEXT; + (*CC->API.EvalCoord2f)( CC, u[0], u[1] ); +} + + +void APIENTRY _mesa_EvalPoint1( GLint i ) +{ + GET_CONTEXT; + (*CC->API.EvalPoint1)( CC, i ); +} + + +void APIENTRY _mesa_EvalPoint2( GLint i, GLint j ) +{ + GET_CONTEXT; + (*CC->API.EvalPoint2)( CC, i, j ); +} + + +void APIENTRY _mesa_EvalMesh1( GLenum mode, GLint i1, GLint i2 ) +{ + GET_CONTEXT; + (*CC->API.EvalMesh1)( CC, mode, i1, i2 ); +} + + +void APIENTRY _mesa_EdgeFlag( GLboolean flag ) +{ + GET_CONTEXT; + (*CC->API.EdgeFlag)(CC, flag); +} + + +void APIENTRY _mesa_EdgeFlagv( const GLboolean *flag ) +{ + GET_CONTEXT; + (*CC->API.EdgeFlag)(CC, *flag); +} + + +void APIENTRY _mesa_EdgeFlagPointer( GLsizei stride, const GLboolean *ptr ) +{ + GET_CONTEXT; + (*CC->API.EdgeFlagPointer)(CC, stride, ptr); +} + + +void APIENTRY _mesa_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ) +{ + GET_CONTEXT; + (*CC->API.EvalMesh2)( CC, mode, i1, i2, j1, j2 ); +} + + +void APIENTRY _mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ) +{ + GET_CONTEXT; + (*CC->API.FeedbackBuffer)(CC, size, type, buffer); +} + + +void APIENTRY _mesa_Finish( void ) +{ + GET_CONTEXT; + (*CC->API.Finish)(CC); +} + + +void APIENTRY _mesa_Flush( void ) +{ + GET_CONTEXT; + (*CC->API.Flush)(CC); +} + + +void APIENTRY _mesa_Fogf( GLenum pname, GLfloat param ) +{ + GET_CONTEXT; + (*CC->API.Fogfv)(CC, pname, ¶m); +} + + +void APIENTRY _mesa_Fogi( GLenum pname, GLint param ) +{ + GLfloat fparam = (GLfloat) param; + GET_CONTEXT; + (*CC->API.Fogfv)(CC, pname, &fparam); +} + + +void APIENTRY _mesa_Fogfv( GLenum pname, const GLfloat *params ) +{ + GET_CONTEXT; + (*CC->API.Fogfv)(CC, pname, params); +} + + +void APIENTRY _mesa_Fogiv( GLenum pname, const GLint *params ) +{ + GLfloat p[4]; + GET_CONTEXT; + + switch (pname) { + case GL_FOG_MODE: + case GL_FOG_DENSITY: + case GL_FOG_START: + case GL_FOG_END: + case GL_FOG_INDEX: + p[0] = (GLfloat) *params; + break; + case GL_FOG_COLOR: + p[0] = INT_TO_FLOAT( params[0] ); + p[1] = INT_TO_FLOAT( params[1] ); + p[2] = INT_TO_FLOAT( params[2] ); + p[3] = INT_TO_FLOAT( params[3] ); + break; + default: + /* Error will be caught later in gl_Fogfv */ + ; + } + (*CC->API.Fogfv)( CC, pname, p ); +} + + + +void APIENTRY _mesa_FrontFace( GLenum mode ) +{ + GET_CONTEXT; + (*CC->API.FrontFace)(CC, mode); +} + + +void APIENTRY _mesa_Frustum( GLdouble left, GLdouble right, + GLdouble bottom, GLdouble top, + GLdouble nearval, GLdouble farval ) +{ + GET_CONTEXT; + (*CC->API.Frustum)(CC, left, right, bottom, top, nearval, farval); +} + + +GLuint APIENTRY _mesa_GenLists( GLsizei range ) +{ + GET_CONTEXT; + return (*CC->API.GenLists)(CC, range); +} + + +void APIENTRY _mesa_GenTextures( GLsizei n, GLuint *textures ) +{ + GET_CONTEXT; + (*CC->API.GenTextures)(CC, n, textures); +} + + +void APIENTRY _mesa_GetBooleanv( GLenum pname, GLboolean *params ) +{ + GET_CONTEXT; + (*CC->API.GetBooleanv)(CC, pname, params); +} + + +void APIENTRY _mesa_GetClipPlane( GLenum plane, GLdouble *equation ) +{ + GET_CONTEXT; + (*CC->API.GetClipPlane)(CC, plane, equation); +} + +void APIENTRY _mesa_GetDoublev( GLenum pname, GLdouble *params ) +{ + GET_CONTEXT; + (*CC->API.GetDoublev)(CC, pname, params); +} + + +GLenum APIENTRY _mesa_GetError( void ) +{ + GET_CONTEXT; + if (!CC) { + /* No current context */ + return GL_NO_ERROR; + } + return (*CC->API.GetError)(CC); +} + + +void APIENTRY _mesa_GetFloatv( GLenum pname, GLfloat *params ) +{ + GET_CONTEXT; + (*CC->API.GetFloatv)(CC, pname, params); +} + + +void APIENTRY _mesa_GetIntegerv( GLenum pname, GLint *params ) +{ + GET_CONTEXT; + (*CC->API.GetIntegerv)(CC, pname, params); +} + + +void APIENTRY _mesa_GetLightfv( GLenum light, GLenum pname, GLfloat *params ) +{ + GET_CONTEXT; + (*CC->API.GetLightfv)(CC, light, pname, params); +} + + +void APIENTRY _mesa_GetLightiv( GLenum light, GLenum pname, GLint *params ) +{ + GET_CONTEXT; + (*CC->API.GetLightiv)(CC, light, pname, params); +} + + +void APIENTRY _mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v ) +{ + GET_CONTEXT; + (*CC->API.GetMapdv)( CC, target, query, v ); +} + + +void APIENTRY _mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v ) +{ + GET_CONTEXT; + (*CC->API.GetMapfv)( CC, target, query, v ); +} + + +void APIENTRY _mesa_GetMapiv( GLenum target, GLenum query, GLint *v ) +{ + GET_CONTEXT; + (*CC->API.GetMapiv)( CC, target, query, v ); +} + + +void APIENTRY _mesa_GetMaterialfv( GLenum face, GLenum pname, GLfloat *params ) +{ + GET_CONTEXT; + (*CC->API.GetMaterialfv)(CC, face, pname, params); +} + + +void APIENTRY _mesa_GetMaterialiv( GLenum face, GLenum pname, GLint *params ) +{ + GET_CONTEXT; + (*CC->API.GetMaterialiv)(CC, face, pname, params); +} + + +void APIENTRY _mesa_GetPixelMapfv( GLenum map, GLfloat *values ) +{ + GET_CONTEXT; + (*CC->API.GetPixelMapfv)(CC, map, values); +} + + +void APIENTRY _mesa_GetPixelMapuiv( GLenum map, GLuint *values ) +{ + GET_CONTEXT; + (*CC->API.GetPixelMapuiv)(CC, map, values); +} + + +void APIENTRY _mesa_GetPixelMapusv( GLenum map, GLushort *values ) +{ + GET_CONTEXT; + (*CC->API.GetPixelMapusv)(CC, map, values); +} + + +void APIENTRY _mesa_GetPointerv( GLenum pname, GLvoid **params ) +{ + GET_CONTEXT; + (*CC->API.GetPointerv)(CC, pname, params); +} + + +void APIENTRY _mesa_GetPolygonStipple( GLubyte *mask ) +{ + GET_CONTEXT; + (*CC->API.GetPolygonStipple)(CC, mask); +} + + +const GLubyte * APIENTRY _mesa_GetString( GLenum name ) +{ + GET_CONTEXT; + return (*CC->API.GetString)(CC, name); +} + + + +void APIENTRY _mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) +{ + GET_CONTEXT; + (*CC->API.GetTexEnvfv)(CC, target, pname, params); +} + + +void APIENTRY _mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) +{ + GET_CONTEXT; + (*CC->API.GetTexEnviv)(CC, target, pname, params); +} + + +void APIENTRY _mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ) +{ + GET_CONTEXT; + (*CC->API.GetTexGeniv)(CC, coord, pname, params); +} + + +void APIENTRY _mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ) +{ + GET_CONTEXT; + (*CC->API.GetTexGendv)(CC, coord, pname, params); +} + + +void APIENTRY _mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ) +{ + GET_CONTEXT; + (*CC->API.GetTexGenfv)(CC, coord, pname, params); +} + + + +void APIENTRY _mesa_GetTexImage( GLenum target, GLint level, GLenum format, + GLenum type, GLvoid *pixels ) +{ + GET_CONTEXT; + (*CC->API.GetTexImage)(CC, target, level, format, type, pixels); +} + + +void APIENTRY _mesa_GetTexLevelParameterfv( GLenum target, GLint level, + GLenum pname, GLfloat *params ) +{ + GET_CONTEXT; + (*CC->API.GetTexLevelParameterfv)(CC, target, level, pname, params); +} + + +void APIENTRY _mesa_GetTexLevelParameteriv( GLenum target, GLint level, + GLenum pname, GLint *params ) +{ + GET_CONTEXT; + (*CC->API.GetTexLevelParameteriv)(CC, target, level, pname, params); +} + + + + +void APIENTRY _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params) +{ + GET_CONTEXT; + (*CC->API.GetTexParameterfv)(CC, target, pname, params); +} + + +void APIENTRY _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) +{ + GET_CONTEXT; + (*CC->API.GetTexParameteriv)(CC, target, pname, params); +} + + +void APIENTRY _mesa_Hint( GLenum target, GLenum mode ) +{ + GET_CONTEXT; + (*CC->API.Hint)(CC, target, mode); +} + + +void APIENTRY _mesa_Indexd( GLdouble c ) +{ + GET_CONTEXT; + (*CC->API.Indexf)( CC, (GLfloat) c ); +} + + +void APIENTRY _mesa_Indexf( GLfloat c ) +{ + GET_CONTEXT; + (*CC->API.Indexf)( CC, c ); +} + + +void APIENTRY _mesa_Indexi( GLint c ) +{ + GET_CONTEXT; + (*CC->API.Indexi)( CC, c ); +} + + +void APIENTRY _mesa_Indexs( GLshort c ) +{ + GET_CONTEXT; + (*CC->API.Indexi)( CC, (GLint) c ); +} + + +#ifdef GL_VERSION_1_1 +void APIENTRY _mesa_Indexub( GLubyte c ) +{ + GET_CONTEXT; + (*CC->API.Indexi)( CC, (GLint) c ); +} +#endif + + +void APIENTRY _mesa_Indexdv( const GLdouble *c ) +{ + GET_CONTEXT; + (*CC->API.Indexf)( CC, (GLfloat) *c ); +} + + +void APIENTRY _mesa_Indexfv( const GLfloat *c ) +{ + GET_CONTEXT; + (*CC->API.Indexf)( CC, *c ); +} + + +void APIENTRY _mesa_Indexiv( const GLint *c ) +{ + GET_CONTEXT; + (*CC->API.Indexi)( CC, *c ); +} + + +void APIENTRY _mesa_Indexsv( const GLshort *c ) +{ + GET_CONTEXT; + (*CC->API.Indexi)( CC, (GLint) *c ); +} + + +#ifdef GL_VERSION_1_1 +void APIENTRY _mesa_Indexubv( const GLubyte *c ) +{ + GET_CONTEXT; + (*CC->API.Indexi)( CC, (GLint) *c ); +} +#endif + + +void APIENTRY _mesa_IndexMask( GLuint mask ) +{ + GET_CONTEXT; + (*CC->API.IndexMask)(CC, mask); +} + + +void APIENTRY _mesa_IndexPointer( GLenum type, GLsizei stride, const GLvoid *ptr ) +{ + GET_CONTEXT; + (*CC->API.IndexPointer)(CC, type, stride, ptr); +} + + +void APIENTRY _mesa_InterleavedArrays( GLenum format, GLsizei stride, + const GLvoid *pointer ) +{ + GET_CONTEXT; + (*CC->API.InterleavedArrays)( CC, format, stride, pointer ); +} + + +void APIENTRY _mesa_InitNames( void ) +{ + GET_CONTEXT; + (*CC->API.InitNames)(CC); +} + + +GLboolean APIENTRY _mesa_IsList( GLuint list ) +{ + GET_CONTEXT; + return (*CC->API.IsList)(CC, list); +} + + +GLboolean APIENTRY _mesa_IsTexture( GLuint texture ) +{ + GET_CONTEXT; + return (*CC->API.IsTexture)(CC, texture); +} + + +void APIENTRY _mesa_Lightf( GLenum light, GLenum pname, GLfloat param ) +{ + GET_CONTEXT; + (*CC->API.Lightfv)( CC, light, pname, ¶m, 1 ); +} + + + +void APIENTRY _mesa_Lighti( GLenum light, GLenum pname, GLint param ) +{ + GLfloat fparam = (GLfloat) param; + GET_CONTEXT; + (*CC->API.Lightfv)( CC, light, pname, &fparam, 1 ); +} + + + +void APIENTRY _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params ) +{ + GET_CONTEXT; + (*CC->API.Lightfv)( CC, light, pname, params, 4 ); +} + + + +void APIENTRY _mesa_Lightiv( GLenum light, GLenum pname, const GLint *params ) +{ + GLfloat fparam[4]; + GET_CONTEXT; + + switch (pname) { + case GL_AMBIENT: + case GL_DIFFUSE: + case GL_SPECULAR: + fparam[0] = INT_TO_FLOAT( params[0] ); + fparam[1] = INT_TO_FLOAT( params[1] ); + fparam[2] = INT_TO_FLOAT( params[2] ); + fparam[3] = INT_TO_FLOAT( params[3] ); + break; + case GL_POSITION: + fparam[0] = (GLfloat) params[0]; + fparam[1] = (GLfloat) params[1]; + fparam[2] = (GLfloat) params[2]; + fparam[3] = (GLfloat) params[3]; + break; + case GL_SPOT_DIRECTION: + fparam[0] = (GLfloat) params[0]; + fparam[1] = (GLfloat) params[1]; + fparam[2] = (GLfloat) params[2]; + break; + case GL_SPOT_EXPONENT: + case GL_SPOT_CUTOFF: + case GL_CONSTANT_ATTENUATION: + case GL_LINEAR_ATTENUATION: + case GL_QUADRATIC_ATTENUATION: + fparam[0] = (GLfloat) params[0]; + break; + default: + /* error will be caught later in gl_Lightfv */ + ; + } + (*CC->API.Lightfv)( CC, light, pname, fparam, 4 ); +} + + + +void APIENTRY _mesa_LightModelf( GLenum pname, GLfloat param ) +{ + GET_CONTEXT; + (*CC->API.LightModelfv)( CC, pname, ¶m ); +} + + +void APIENTRY _mesa_LightModeli( GLenum pname, GLint param ) +{ + GLfloat fparam[4]; + GET_CONTEXT; + fparam[0] = (GLfloat) param; + (*CC->API.LightModelfv)( CC, pname, fparam ); +} + + +void APIENTRY _mesa_LightModelfv( GLenum pname, const GLfloat *params ) +{ + GET_CONTEXT; + (*CC->API.LightModelfv)( CC, pname, params ); +} + + +void APIENTRY _mesa_LightModeliv( GLenum pname, const GLint *params ) +{ + GLfloat fparam[4]; + GET_CONTEXT; + + switch (pname) { + case GL_LIGHT_MODEL_AMBIENT: + fparam[0] = INT_TO_FLOAT( params[0] ); + fparam[1] = INT_TO_FLOAT( params[1] ); + fparam[2] = INT_TO_FLOAT( params[2] ); + fparam[3] = INT_TO_FLOAT( params[3] ); + break; + case GL_LIGHT_MODEL_LOCAL_VIEWER: + case GL_LIGHT_MODEL_TWO_SIDE: + fparam[0] = (GLfloat) params[0]; + break; + default: + /* Error will be caught later in gl_LightModelfv */ + ; + } + (*CC->API.LightModelfv)( CC, pname, fparam ); +} + + +void APIENTRY _mesa_LineWidth( GLfloat width ) +{ + GET_CONTEXT; + (*CC->API.LineWidth)(CC, width); +} + + +void APIENTRY _mesa_LineStipple( GLint factor, GLushort pattern ) +{ + GET_CONTEXT; + (*CC->API.LineStipple)(CC, factor, pattern); +} + + +void APIENTRY _mesa_ListBase( GLuint base ) +{ + GET_CONTEXT; + (*CC->API.ListBase)(CC, base); +} + + +void APIENTRY _mesa_LoadIdentity( void ) +{ + GET_CONTEXT; + (*CC->API.LoadIdentity)( CC ); +} + + +void APIENTRY _mesa_LoadMatrixd( const GLdouble *m ) +{ + GLfloat fm[16]; + GLuint i; + GET_CONTEXT; + + for (i=0;i<16;i++) { + fm[i] = (GLfloat) m[i]; + } + + (*CC->API.LoadMatrixf)( CC, fm ); +} + + +void APIENTRY _mesa_LoadMatrixf( const GLfloat *m ) +{ + GET_CONTEXT; + (*CC->API.LoadMatrixf)( CC, m ); +} + + +void APIENTRY _mesa_LoadName( GLuint name ) +{ + GET_CONTEXT; + (*CC->API.LoadName)(CC, name); +} + + +void APIENTRY _mesa_LogicOp( GLenum opcode ) +{ + GET_CONTEXT; + (*CC->API.LogicOp)(CC, opcode); +} + + + +void APIENTRY _mesa_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride, + GLint order, const GLdouble *points ) +{ + GLfloat *pnts; + GLboolean retain; + GET_CONTEXT; + + pnts = gl_copy_map_points1d( target, stride, order, points ); + retain = CC->CompileFlag; + (*CC->API.Map1f)( CC, target, u1, u2, stride, order, pnts, retain ); +} + + +void APIENTRY _mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride, + GLint order, const GLfloat *points ) +{ + GLfloat *pnts; + GLboolean retain; + GET_CONTEXT; + + pnts = gl_copy_map_points1f( target, stride, order, points ); + retain = CC->CompileFlag; + (*CC->API.Map1f)( CC, target, u1, u2, stride, order, pnts, retain ); +} + + +void APIENTRY _mesa_Map2d( GLenum target, + GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, + GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, + const GLdouble *points ) +{ + GLfloat *pnts; + GLboolean retain; + GET_CONTEXT; + + pnts = gl_copy_map_points2d( target, ustride, uorder, + vstride, vorder, points ); + retain = CC->CompileFlag; + (*CC->API.Map2f)( CC, target, u1, u2, ustride, uorder, + v1, v2, vstride, vorder, pnts, retain ); +} + + +void APIENTRY _mesa_Map2f( GLenum target, + GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, + GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, + const GLfloat *points ) +{ + GLfloat *pnts; + GLboolean retain; + GET_CONTEXT; + + pnts = gl_copy_map_points2f( target, ustride, uorder, + vstride, vorder, points ); + retain = CC->CompileFlag; + (*CC->API.Map2f)( CC, target, u1, u2, ustride, uorder, + v1, v2, vstride, vorder, pnts, retain ); +} + + +void APIENTRY _mesa_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 ) +{ + GET_CONTEXT; + (*CC->API.MapGrid1f)( CC, un, (GLfloat) u1, (GLfloat) u2 ); +} + + +void APIENTRY _mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 ) +{ + GET_CONTEXT; + (*CC->API.MapGrid1f)( CC, un, u1, u2 ); +} + + +void APIENTRY _mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, + GLint vn, GLdouble v1, GLdouble v2 ) +{ + GET_CONTEXT; + (*CC->API.MapGrid2f)( CC, un, (GLfloat) u1, (GLfloat) u2, + vn, (GLfloat) v1, (GLfloat) v2 ); +} + + +void APIENTRY _mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2, + GLint vn, GLfloat v1, GLfloat v2 ) +{ + GET_CONTEXT; + (*CC->API.MapGrid2f)( CC, un, u1, u2, vn, v1, v2 ); +} + + +void APIENTRY _mesa_Materialf( GLenum face, GLenum pname, GLfloat param ) +{ + GET_CONTEXT; + (*CC->API.Materialfv)( CC, face, pname, ¶m ); +} + + + +void APIENTRY _mesa_Materiali( GLenum face, GLenum pname, GLint param ) +{ + GLfloat fparam[4]; + GET_CONTEXT; + fparam[0] = (GLfloat) param; + (*CC->API.Materialfv)( CC, face, pname, fparam ); +} + + +void APIENTRY _mesa_Materialfv( GLenum face, GLenum pname, const GLfloat *params ) +{ + GET_CONTEXT; + (*CC->API.Materialfv)( CC, face, pname, params ); +} + + +void APIENTRY _mesa_Materialiv( GLenum face, GLenum pname, const GLint *params ) +{ + GLfloat fparam[4]; + GET_CONTEXT; + switch (pname) { + case GL_AMBIENT: + case GL_DIFFUSE: + case GL_SPECULAR: + case GL_EMISSION: + case GL_AMBIENT_AND_DIFFUSE: + fparam[0] = INT_TO_FLOAT( params[0] ); + fparam[1] = INT_TO_FLOAT( params[1] ); + fparam[2] = INT_TO_FLOAT( params[2] ); + fparam[3] = INT_TO_FLOAT( params[3] ); + break; + case GL_SHININESS: + fparam[0] = (GLfloat) params[0]; + break; + case GL_COLOR_INDEXES: + fparam[0] = (GLfloat) params[0]; + fparam[1] = (GLfloat) params[1]; + fparam[2] = (GLfloat) params[2]; + break; + default: + /* Error will be caught later in gl_Materialfv */ + ; + } + (*CC->API.Materialfv)( CC, face, pname, fparam ); +} + + +void APIENTRY _mesa_MatrixMode( GLenum mode ) +{ + GET_CONTEXT; + (*CC->API.MatrixMode)( CC, mode ); +} + + +void APIENTRY _mesa_MultMatrixd( const GLdouble *m ) +{ + GLfloat fm[16]; + GLuint i; + GET_CONTEXT; + + for (i=0;i<16;i++) { + fm[i] = (GLfloat) m[i]; + } + + (*CC->API.MultMatrixf)( CC, fm ); +} + + +void APIENTRY _mesa_MultMatrixf( const GLfloat *m ) +{ + GET_CONTEXT; + (*CC->API.MultMatrixf)( CC, m ); +} + + +void APIENTRY _mesa_NewList( GLuint list, GLenum mode ) +{ + GET_CONTEXT; + (*CC->API.NewList)(CC, list, mode); +} + +void APIENTRY _mesa_Normal3b( GLbyte nx, GLbyte ny, GLbyte nz ) +{ + GET_CONTEXT; + (*CC->API.Normal3f)( CC, BYTE_TO_FLOAT(nx), + BYTE_TO_FLOAT(ny), BYTE_TO_FLOAT(nz) ); +} + + +void APIENTRY _mesa_Normal3d( GLdouble nx, GLdouble ny, GLdouble nz ) +{ + GLfloat fx, fy, fz; + GET_CONTEXT; + if (ABSD(nx)<0.00001) fx = 0.0F; else fx = nx; + if (ABSD(ny)<0.00001) fy = 0.0F; else fy = ny; + if (ABSD(nz)<0.00001) fz = 0.0F; else fz = nz; + (*CC->API.Normal3f)( CC, fx, fy, fz ); +} + + +void APIENTRY _mesa_Normal3f( GLfloat nx, GLfloat ny, GLfloat nz ) +{ + GET_CONTEXT; +#ifdef SHORTCUT + if (CC->CompileFlag) { + (*CC->Save.Normal3f)( CC, nx, ny, nz ); + } + else { + /* Execute */ + CC->Current.Normal[0] = nx; + CC->Current.Normal[1] = ny; + CC->Current.Normal[2] = nz; + CC->VB->MonoNormal = GL_FALSE; + } +#else + (*CC->API.Normal3f)( CC, nx, ny, nz ); +#endif +} + + +void APIENTRY _mesa_Normal3i( GLint nx, GLint ny, GLint nz ) +{ + GET_CONTEXT; + (*CC->API.Normal3f)( CC, INT_TO_FLOAT(nx), + INT_TO_FLOAT(ny), INT_TO_FLOAT(nz) ); +} + + +void APIENTRY _mesa_Normal3s( GLshort nx, GLshort ny, GLshort nz ) +{ + GET_CONTEXT; + (*CC->API.Normal3f)( CC, SHORT_TO_FLOAT(nx), + SHORT_TO_FLOAT(ny), SHORT_TO_FLOAT(nz) ); +} + + +void APIENTRY _mesa_Normal3bv( const GLbyte *v ) +{ + GET_CONTEXT; + (*CC->API.Normal3f)( CC, BYTE_TO_FLOAT(v[0]), + BYTE_TO_FLOAT(v[1]), BYTE_TO_FLOAT(v[2]) ); +} + + +void APIENTRY _mesa_Normal3dv( const GLdouble *v ) +{ + GLfloat fx, fy, fz; + GET_CONTEXT; + if (ABSD(v[0])<0.00001) fx = 0.0F; else fx = v[0]; + if (ABSD(v[1])<0.00001) fy = 0.0F; else fy = v[1]; + if (ABSD(v[2])<0.00001) fz = 0.0F; else fz = v[2]; + (*CC->API.Normal3f)( CC, fx, fy, fz ); +} + + +void APIENTRY _mesa_Normal3fv( const GLfloat *v ) +{ + GET_CONTEXT; +#ifdef SHORTCUT + if (CC->CompileFlag) { + (*CC->Save.Normal3fv)( CC, v ); + } + else { + /* Execute */ + GLfloat *n = CC->Current.Normal; + n[0] = v[0]; + n[1] = v[1]; + n[2] = v[2]; + CC->VB->MonoNormal = GL_FALSE; + } +#else + (*CC->API.Normal3fv)( CC, v ); +#endif +} + + +void APIENTRY _mesa_Normal3iv( const GLint *v ) +{ + GET_CONTEXT; + (*CC->API.Normal3f)( CC, INT_TO_FLOAT(v[0]), + INT_TO_FLOAT(v[1]), INT_TO_FLOAT(v[2]) ); +} + + +void APIENTRY _mesa_Normal3sv( const GLshort *v ) +{ + GET_CONTEXT; + (*CC->API.Normal3f)( CC, SHORT_TO_FLOAT(v[0]), + SHORT_TO_FLOAT(v[1]), SHORT_TO_FLOAT(v[2]) ); +} + + +void APIENTRY _mesa_NormalPointer( GLenum type, GLsizei stride, const GLvoid *ptr ) +{ + GET_CONTEXT; + (*CC->API.NormalPointer)(CC, type, stride, ptr); +} +void APIENTRY _mesa_Ortho( GLdouble left, GLdouble right, + GLdouble bottom, GLdouble top, + GLdouble nearval, GLdouble farval ) +{ + GET_CONTEXT; + (*CC->API.Ortho)(CC, left, right, bottom, top, nearval, farval); +} + + +void APIENTRY _mesa_PassThrough( GLfloat token ) +{ + GET_CONTEXT; + (*CC->API.PassThrough)(CC, token); +} + + +void APIENTRY _mesa_PixelMapfv( GLenum map, GLint mapsize, const GLfloat *values ) +{ + GET_CONTEXT; + (*CC->API.PixelMapfv)( CC, map, mapsize, values ); +} + + +void APIENTRY _mesa_PixelMapuiv( GLenum map, GLint mapsize, const GLuint *values ) +{ + GLfloat fvalues[MAX_PIXEL_MAP_TABLE]; + GLuint i; + GET_CONTEXT; + + if (map==GL_PIXEL_MAP_I_TO_I || map==GL_PIXEL_MAP_S_TO_S) { + for (i=0;i<mapsize;i++) { + fvalues[i] = (GLfloat) values[i]; + } + } + else { + for (i=0;i<mapsize;i++) { + fvalues[i] = UINT_TO_FLOAT( values[i] ); + } + } + (*CC->API.PixelMapfv)( CC, map, mapsize, fvalues ); +} + + + +void APIENTRY _mesa_PixelMapusv( GLenum map, GLint mapsize, const GLushort *values ) +{ + GLfloat fvalues[MAX_PIXEL_MAP_TABLE]; + GLuint i; + GET_CONTEXT; + + if (map==GL_PIXEL_MAP_I_TO_I || map==GL_PIXEL_MAP_S_TO_S) { + for (i=0;i<mapsize;i++) { + fvalues[i] = (GLfloat) values[i]; + } + } + else { + for (i=0;i<mapsize;i++) { + fvalues[i] = USHORT_TO_FLOAT( values[i] ); + } + } + (*CC->API.PixelMapfv)( CC, map, mapsize, fvalues ); +} + + +void APIENTRY _mesa_PixelStoref( GLenum pname, GLfloat param ) +{ + GET_CONTEXT; + (*CC->API.PixelStorei)( CC, pname, (GLint) param ); +} + + +void APIENTRY _mesa_PixelStorei( GLenum pname, GLint param ) +{ + GET_CONTEXT; + (*CC->API.PixelStorei)( CC, pname, param ); +} + + +void APIENTRY _mesa_PixelTransferf( GLenum pname, GLfloat param ) +{ + GET_CONTEXT; + (*CC->API.PixelTransferf)(CC, pname, param); +} + + +void APIENTRY _mesa_PixelTransferi( GLenum pname, GLint param ) +{ + GET_CONTEXT; + (*CC->API.PixelTransferf)(CC, pname, (GLfloat) param); +} + + +void APIENTRY _mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor ) +{ + GET_CONTEXT; + (*CC->API.PixelZoom)(CC, xfactor, yfactor); +} + + +void APIENTRY _mesa_PointSize( GLfloat size ) +{ + GET_CONTEXT; + (*CC->API.PointSize)(CC, size); +} + + +void APIENTRY _mesa_PolygonMode( GLenum face, GLenum mode ) +{ + GET_CONTEXT; + (*CC->API.PolygonMode)(CC, face, mode); +} + + +void APIENTRY _mesa_PolygonOffset( GLfloat factor, GLfloat units ) +{ + GET_CONTEXT; + (*CC->API.PolygonOffset)( CC, factor, units ); +} + +void APIENTRY _mesa_PolygonStipple( const GLubyte *mask ) +{ + GET_CONTEXT; + (*CC->API.PolygonStipple)(CC, mask); +} + + +void APIENTRY _mesa_PopAttrib( void ) +{ + GET_CONTEXT; + (*CC->API.PopAttrib)(CC); +} + + +void APIENTRY _mesa_PopClientAttrib( void ) +{ + GET_CONTEXT; + (*CC->API.PopClientAttrib)(CC); +} + + +void APIENTRY _mesa_PopMatrix( void ) +{ + GET_CONTEXT; + (*CC->API.PopMatrix)( CC ); +} + + +void APIENTRY _mesa_PopName( void ) +{ + GET_CONTEXT; + (*CC->API.PopName)(CC); +} + + +void APIENTRY _mesa_PrioritizeTextures( GLsizei n, const GLuint *textures, + const GLclampf *priorities ) +{ + GET_CONTEXT; + (*CC->API.PrioritizeTextures)(CC, n, textures, priorities); +} + + +void APIENTRY _mesa_PushMatrix( void ) +{ + GET_CONTEXT; + (*CC->API.PushMatrix)( CC ); +} + + +void APIENTRY _mesa_RasterPos2d( GLdouble x, GLdouble y ) +{ + GET_CONTEXT; + (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, 0.0F, 1.0F ); +} + + +void APIENTRY _mesa_RasterPos2f( GLfloat x, GLfloat y ) +{ + GET_CONTEXT; + (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, 0.0F, 1.0F ); +} + + +void APIENTRY _mesa_RasterPos2i( GLint x, GLint y ) +{ + GET_CONTEXT; + (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, 0.0F, 1.0F ); +} + + +void APIENTRY _mesa_RasterPos2s( GLshort x, GLshort y ) +{ + GET_CONTEXT; + (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, 0.0F, 1.0F ); +} + + +void APIENTRY _mesa_RasterPos3d( GLdouble x, GLdouble y, GLdouble z ) +{ + GET_CONTEXT; + (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F ); +} + + +void APIENTRY _mesa_RasterPos3f( GLfloat x, GLfloat y, GLfloat z ) +{ + GET_CONTEXT; + (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F ); +} + + +void APIENTRY _mesa_RasterPos3i( GLint x, GLint y, GLint z ) +{ + GET_CONTEXT; + (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F ); +} + + +void APIENTRY _mesa_RasterPos3s( GLshort x, GLshort y, GLshort z ) +{ + GET_CONTEXT; + (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F ); +} + + +void APIENTRY _mesa_RasterPos4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ) +{ + GET_CONTEXT; + (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, + (GLfloat) z, (GLfloat) w ); +} + + +void APIENTRY _mesa_RasterPos4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) +{ + GET_CONTEXT; + (*CC->API.RasterPos4f)( CC, x, y, z, w ); +} + + +void APIENTRY _mesa_RasterPos4i( GLint x, GLint y, GLint z, GLint w ) +{ + GET_CONTEXT; + (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, + (GLfloat) z, (GLfloat) w ); +} + + +void APIENTRY _mesa_RasterPos4s( GLshort x, GLshort y, GLshort z, GLshort w ) +{ + GET_CONTEXT; + (*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, + (GLfloat) z, (GLfloat) w ); +} + + +void APIENTRY _mesa_RasterPos2dv( const GLdouble *v ) +{ + GET_CONTEXT; + (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F ); +} + + +void APIENTRY _mesa_RasterPos2fv( const GLfloat *v ) +{ + GET_CONTEXT; + (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F ); +} + + +void APIENTRY _mesa_RasterPos2iv( const GLint *v ) +{ + GET_CONTEXT; + (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F ); +} + + +void APIENTRY _mesa_RasterPos2sv( const GLshort *v ) +{ + GET_CONTEXT; + (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F ); +} + + +/*** 3 element vector ***/ + +void APIENTRY _mesa_RasterPos3dv( const GLdouble *v ) +{ + GET_CONTEXT; + (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], + (GLfloat) v[2], 1.0F ); +} + + +void APIENTRY _mesa_RasterPos3fv( const GLfloat *v ) +{ + GET_CONTEXT; + (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], + (GLfloat) v[2], 1.0F ); +} + + +void APIENTRY _mesa_RasterPos3iv( const GLint *v ) +{ + GET_CONTEXT; + (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], + (GLfloat) v[2], 1.0F ); +} + + +void APIENTRY _mesa_RasterPos3sv( const GLshort *v ) +{ + GET_CONTEXT; + (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], + (GLfloat) v[2], 1.0F ); +} + + +void APIENTRY _mesa_RasterPos4dv( const GLdouble *v ) +{ + GET_CONTEXT; + (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], + (GLfloat) v[2], (GLfloat) v[3] ); +} + + +void APIENTRY _mesa_RasterPos4fv( const GLfloat *v ) +{ + GET_CONTEXT; + (*CC->API.RasterPos4f)( CC, v[0], v[1], v[2], v[3] ); +} + + +void APIENTRY _mesa_RasterPos4iv( const GLint *v ) +{ + GET_CONTEXT; + (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], + (GLfloat) v[2], (GLfloat) v[3] ); +} + + +void APIENTRY _mesa_RasterPos4sv( const GLshort *v ) +{ + GET_CONTEXT; + (*CC->API.RasterPos4f)( CC, (GLfloat) v[0], (GLfloat) v[1], + (GLfloat) v[2], (GLfloat) v[3] ); +} + + +void APIENTRY _mesa_ReadBuffer( GLenum mode ) +{ + GET_CONTEXT; + (*CC->API.ReadBuffer)( CC, mode ); +} + + +void APIENTRY _mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, + GLenum format, GLenum type, GLvoid *pixels ) +{ + GET_CONTEXT; + (*CC->API.ReadPixels)( CC, x, y, width, height, format, type, pixels ); +} + + +void APIENTRY _mesa_Rectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 ) +{ + GET_CONTEXT; + (*CC->API.Rectf)( CC, (GLfloat) x1, (GLfloat) y1, + (GLfloat) x2, (GLfloat) y2 ); +} + + +void APIENTRY _mesa_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ) +{ + GET_CONTEXT; + (*CC->API.Rectf)( CC, x1, y1, x2, y2 ); +} + + +void APIENTRY _mesa_Recti( GLint x1, GLint y1, GLint x2, GLint y2 ) +{ + GET_CONTEXT; + (*CC->API.Rectf)( CC, (GLfloat) x1, (GLfloat) y1, + (GLfloat) x2, (GLfloat) y2 ); +} + + +void APIENTRY _mesa_Rects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 ) +{ + GET_CONTEXT; + (*CC->API.Rectf)( CC, (GLfloat) x1, (GLfloat) y1, + (GLfloat) x2, (GLfloat) y2 ); +} + + +void APIENTRY _mesa_Rectdv( const GLdouble *v1, const GLdouble *v2 ) +{ + GET_CONTEXT; + (*CC->API.Rectf)(CC, (GLfloat) v1[0], (GLfloat) v1[1], + (GLfloat) v2[0], (GLfloat) v2[1]); +} + + +void APIENTRY _mesa_Rectfv( const GLfloat *v1, const GLfloat *v2 ) +{ + GET_CONTEXT; + (*CC->API.Rectf)(CC, v1[0], v1[1], v2[0], v2[1]); +} + + +void APIENTRY _mesa_Rectiv( const GLint *v1, const GLint *v2 ) +{ + GET_CONTEXT; + (*CC->API.Rectf)( CC, (GLfloat) v1[0], (GLfloat) v1[1], + (GLfloat) v2[0], (GLfloat) v2[1] ); +} + + +void APIENTRY _mesa_Rectsv( const GLshort *v1, const GLshort *v2 ) +{ + GET_CONTEXT; + (*CC->API.Rectf)(CC, (GLfloat) v1[0], (GLfloat) v1[1], + (GLfloat) v2[0], (GLfloat) v2[1]); +} + + +void APIENTRY _mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height) +{ + GET_CONTEXT; + (*CC->API.Scissor)(CC, x, y, width, height); +} + + +GLboolean APIENTRY _mesa_IsEnabled( GLenum cap ) +{ + GET_CONTEXT; + return (*CC->API.IsEnabled)( CC, cap ); +} + + + +void APIENTRY _mesa_PushAttrib( GLbitfield mask ) +{ + GET_CONTEXT; + (*CC->API.PushAttrib)(CC, mask); +} + + +void APIENTRY _mesa_PushClientAttrib( GLbitfield mask ) +{ + GET_CONTEXT; + (*CC->API.PushClientAttrib)(CC, mask); +} + + +void APIENTRY _mesa_PushName( GLuint name ) +{ + GET_CONTEXT; + (*CC->API.PushName)(CC, name); +} + + +GLint APIENTRY _mesa_RenderMode( GLenum mode ) +{ + GET_CONTEXT; + return (*CC->API.RenderMode)(CC, mode); +} + + +void APIENTRY _mesa_Rotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z ) +{ + GET_CONTEXT; + (*CC->API.Rotatef)( CC, (GLfloat) angle, + (GLfloat) x, (GLfloat) y, (GLfloat) z ); +} + + +void APIENTRY _mesa_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) +{ + GET_CONTEXT; + (*CC->API.Rotatef)( CC, angle, x, y, z ); +} + + +void APIENTRY _mesa_SelectBuffer( GLsizei size, GLuint *buffer ) +{ + GET_CONTEXT; + (*CC->API.SelectBuffer)(CC, size, buffer); +} + + +void APIENTRY _mesa_Scaled( GLdouble x, GLdouble y, GLdouble z ) +{ + GET_CONTEXT; + (*CC->API.Scalef)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z ); +} + + +void APIENTRY _mesa_Scalef( GLfloat x, GLfloat y, GLfloat z ) +{ + GET_CONTEXT; + (*CC->API.Scalef)( CC, x, y, z ); +} + + +void APIENTRY _mesa_ShadeModel( GLenum mode ) +{ + GET_CONTEXT; + (*CC->API.ShadeModel)(CC, mode); +} + + +void APIENTRY _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ) +{ + GET_CONTEXT; + (*CC->API.StencilFunc)(CC, func, ref, mask); +} + + +void APIENTRY _mesa_StencilMask( GLuint mask ) +{ + GET_CONTEXT; + (*CC->API.StencilMask)(CC, mask); +} + + +void APIENTRY _mesa_StencilOp( GLenum fail, GLenum zfail, GLenum zpass ) +{ + GET_CONTEXT; + (*CC->API.StencilOp)(CC, fail, zfail, zpass); +} + + +void APIENTRY _mesa_TexCoord1d( GLdouble s ) +{ + GET_CONTEXT; + (*CC->API.TexCoord4f)( CC, (GLfloat) s, 0.0, 0.0, 1.0 ); +} + + +void APIENTRY _mesa_TexCoord1f( GLfloat s ) +{ + GET_CONTEXT; + (*CC->API.TexCoord4f)( CC, s, 0.0, 0.0, 1.0 ); +} + + +void APIENTRY _mesa_TexCoord1i( GLint s ) +{ + GET_CONTEXT; + (*CC->API.TexCoord4f)( CC, (GLfloat) s, 0.0, 0.0, 1.0 ); +} + + +void APIENTRY _mesa_TexCoord1s( GLshort s ) +{ + GET_CONTEXT; + (*CC->API.TexCoord4f)( CC, (GLfloat) s, 0.0, 0.0, 1.0 ); +} + + +void APIENTRY _mesa_TexCoord2d( GLdouble s, GLdouble t ) +{ + GET_CONTEXT; + (*CC->API.TexCoord2f)( CC, (GLfloat) s, (GLfloat) t ); +} + + +void APIENTRY _mesa_TexCoord2f( GLfloat s, GLfloat t ) +{ + GET_CONTEXT; + (*CC->API.TexCoord2f)( CC, s, t ); +} + + +void APIENTRY _mesa_TexCoord2i( GLint s, GLint t ) +{ + GET_CONTEXT; + (*CC->API.TexCoord2f)( CC, (GLfloat) s, (GLfloat) t ); +} + + +void APIENTRY _mesa_TexCoord2s( GLshort s, GLshort t ) +{ + GET_CONTEXT; + (*CC->API.TexCoord2f)( CC, (GLfloat) s, (GLfloat) t ); +} + + +void APIENTRY _mesa_TexCoord3d( GLdouble s, GLdouble t, GLdouble r ) +{ + GET_CONTEXT; + (*CC->API.TexCoord4f)( CC, (GLfloat) s, (GLfloat) t, (GLfloat) r, 1.0 ); +} + + +void APIENTRY _mesa_TexCoord3f( GLfloat s, GLfloat t, GLfloat r ) +{ + GET_CONTEXT; + (*CC->API.TexCoord4f)( CC, s, t, r, 1.0 ); +} + + +void APIENTRY _mesa_TexCoord3i( GLint s, GLint t, GLint r ) +{ + GET_CONTEXT; + (*CC->API.TexCoord4f)( CC, (GLfloat) s, (GLfloat) t, + (GLfloat) r, 1.0 ); +} + + +void APIENTRY _mesa_TexCoord3s( GLshort s, GLshort t, GLshort r ) +{ + GET_CONTEXT; + (*CC->API.TexCoord4f)( CC, (GLfloat) s, (GLfloat) t, + (GLfloat) r, 1.0 ); +} + + +void APIENTRY _mesa_TexCoord4d( GLdouble s, GLdouble t, GLdouble r, GLdouble q ) +{ + GET_CONTEXT; + (*CC->API.TexCoord4f)( CC, (GLfloat) s, (GLfloat) t, + (GLfloat) r, (GLfloat) q ); +} + + +void APIENTRY _mesa_TexCoord4f( GLfloat s, GLfloat t, GLfloat r, GLfloat q ) +{ + GET_CONTEXT; + (*CC->API.TexCoord4f)( CC, s, t, r, q ); +} + + +void APIENTRY _mesa_TexCoord4i( GLint s, GLint t, GLint r, GLint q ) +{ + GET_CONTEXT; + (*CC->API.TexCoord4f)( CC, (GLfloat) s, (GLfloat) t, + (GLfloat) r, (GLfloat) q ); +} + + +void APIENTRY _mesa_TexCoord4s( GLshort s, GLshort t, GLshort r, GLshort q ) +{ + GET_CONTEXT; + (*CC->API.TexCoord4f)( CC, (GLfloat) s, (GLfloat) t, + (GLfloat) r, (GLfloat) q ); +} + + +void APIENTRY _mesa_TexCoord1dv( const GLdouble *v ) +{ + GET_CONTEXT; + (*CC->API.TexCoord4f)( CC, (GLfloat) *v, 0.0, 0.0, 1.0 ); +} + + +void APIENTRY _mesa_TexCoord1fv( const GLfloat *v ) +{ + GET_CONTEXT; + (*CC->API.TexCoord4f)( CC, *v, 0.0, 0.0, 1.0 ); +} + + +void APIENTRY _mesa_TexCoord1iv( const GLint *v ) +{ + GET_CONTEXT; + (*CC->API.TexCoord4f)( CC, *v, 0.0, 0.0, 1.0 ); +} + + +void APIENTRY _mesa_TexCoord1sv( const GLshort *v ) +{ + GET_CONTEXT; + (*CC->API.TexCoord4f)( CC, (GLfloat) *v, 0.0, 0.0, 1.0 ); +} + + +void APIENTRY _mesa_TexCoord2dv( const GLdouble *v ) +{ + GET_CONTEXT; + (*CC->API.TexCoord2f)( CC, (GLfloat) v[0], (GLfloat) v[1] ); +} + + +void APIENTRY _mesa_TexCoord2fv( const GLfloat *v ) +{ + GET_CONTEXT; + (*CC->API.TexCoord2f)( CC, v[0], v[1] ); +} + + +void APIENTRY _mesa_TexCoord2iv( const GLint *v ) +{ + GET_CONTEXT; + (*CC->API.TexCoord2f)( CC, (GLfloat) v[0], (GLfloat) v[1] ); +} + + +void APIENTRY _mesa_TexCoord2sv( const GLshort *v ) +{ + GET_CONTEXT; + (*CC->API.TexCoord2f)( CC, (GLfloat) v[0], (GLfloat) v[1] ); +} + + +void APIENTRY _mesa_TexCoord3dv( const GLdouble *v ) +{ + GET_CONTEXT; + (*CC->API.TexCoord4f)( CC, (GLfloat) v[0], (GLfloat) v[1], + (GLfloat) v[2], 1.0 ); +} + + +void APIENTRY _mesa_TexCoord3fv( const GLfloat *v ) +{ + GET_CONTEXT; + (*CC->API.TexCoord4f)( CC, v[0], v[1], v[2], 1.0 ); +} + + +void APIENTRY _mesa_TexCoord3iv( const GLint *v ) +{ + GET_CONTEXT; + (*CC->API.TexCoord4f)( CC, (GLfloat) v[0], (GLfloat) v[1], + (GLfloat) v[2], 1.0 ); +} + + +void APIENTRY _mesa_TexCoord3sv( const GLshort *v ) +{ + GET_CONTEXT; + (*CC->API.TexCoord4f)( CC, (GLfloat) v[0], (GLfloat) v[1], + (GLfloat) v[2], 1.0 ); +} + + +void APIENTRY _mesa_TexCoord4dv( const GLdouble *v ) +{ + GET_CONTEXT; + (*CC->API.TexCoord4f)( CC, (GLfloat) v[0], (GLfloat) v[1], + (GLfloat) v[2], (GLfloat) v[3] ); +} + + +void APIENTRY _mesa_TexCoord4fv( const GLfloat *v ) +{ + GET_CONTEXT; + (*CC->API.TexCoord4f)( CC, v[0], v[1], v[2], v[3] ); +} + + +void APIENTRY _mesa_TexCoord4iv( const GLint *v ) +{ + GET_CONTEXT; + (*CC->API.TexCoord4f)( CC, (GLfloat) v[0], (GLfloat) v[1], + (GLfloat) v[2], (GLfloat) v[3] ); +} + + +void APIENTRY _mesa_TexCoord4sv( const GLshort *v ) +{ + GET_CONTEXT; + (*CC->API.TexCoord4f)( CC, (GLfloat) v[0], (GLfloat) v[1], + (GLfloat) v[2], (GLfloat) v[3] ); +} + + +void APIENTRY _mesa_TexCoordPointer( GLint size, GLenum type, GLsizei stride, + const GLvoid *ptr ) +{ + GET_CONTEXT; + (*CC->API.TexCoordPointer)(CC, size, type, stride, ptr); +} + + +void APIENTRY _mesa_TexGend( GLenum coord, GLenum pname, GLdouble param ) +{ + GLfloat p = (GLfloat) param; + GET_CONTEXT; + (*CC->API.TexGenfv)( CC, coord, pname, &p ); +} + + +void APIENTRY _mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ) +{ + GET_CONTEXT; + (*CC->API.TexGenfv)( CC, coord, pname, ¶m ); +} + + +void APIENTRY _mesa_TexGeni( GLenum coord, GLenum pname, GLint param ) +{ + GLfloat p = (GLfloat) param; + GET_CONTEXT; + (*CC->API.TexGenfv)( CC, coord, pname, &p ); +} + + +void APIENTRY _mesa_TexGendv( GLenum coord, GLenum pname, const GLdouble *params ) +{ + GLfloat p[4]; + GET_CONTEXT; + p[0] = params[0]; + p[1] = params[1]; + p[2] = params[2]; + p[3] = params[3]; + (*CC->API.TexGenfv)( CC, coord, pname, p ); +} + + +void APIENTRY _mesa_TexGeniv( GLenum coord, GLenum pname, const GLint *params ) +{ + GLfloat p[4]; + GET_CONTEXT; + p[0] = params[0]; + p[1] = params[1]; + p[2] = params[2]; + p[3] = params[3]; + (*CC->API.TexGenfv)( CC, coord, pname, p ); +} + + +void APIENTRY _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) +{ + GET_CONTEXT; + (*CC->API.TexGenfv)( CC, coord, pname, params ); +} + + + + +void APIENTRY _mesa_TexEnvf( GLenum target, GLenum pname, GLfloat param ) +{ + GET_CONTEXT; + (*CC->API.TexEnvfv)( CC, target, pname, ¶m ); +} + + + +void APIENTRY _mesa_TexEnvi( GLenum target, GLenum pname, GLint param ) +{ + GLfloat p[4]; + GET_CONTEXT; + p[0] = (GLfloat) param; + p[1] = p[2] = p[3] = 0.0; + (*CC->API.TexEnvfv)( CC, target, pname, p ); +} + + + +void APIENTRY _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) +{ + GET_CONTEXT; + (*CC->API.TexEnvfv)( CC, target, pname, param ); +} + + + +void APIENTRY _mesa_TexEnviv( GLenum target, GLenum pname, const GLint *param ) +{ + GLfloat p[4]; + GET_CONTEXT; + p[0] = INT_TO_FLOAT( param[0] ); + p[1] = INT_TO_FLOAT( param[1] ); + p[2] = INT_TO_FLOAT( param[2] ); + p[3] = INT_TO_FLOAT( param[3] ); + (*CC->API.TexEnvfv)( CC, target, pname, p ); +} + + +void APIENTRY _mesa_TexImage1D( GLenum target, GLint level, GLint internalformat, + GLsizei width, GLint border, + GLenum format, GLenum type, const GLvoid *pixels ) +{ + struct gl_image *teximage; + GET_CONTEXT; + teximage = gl_unpack_image( CC, width, 1, format, type, pixels ); + (*CC->API.TexImage1D)( CC, target, level, internalformat, + width, border, format, type, teximage ); +} + + + +void APIENTRY _mesa_TexImage2D( GLenum target, GLint level, GLint internalformat, + GLsizei width, GLsizei height, GLint border, + GLenum format, GLenum type, const GLvoid *pixels ) +{ + struct gl_image *teximage; + + GET_CONTEXT; + + teximage = gl_unpack_image( CC, width, height, format, type, pixels ); + (*CC->API.TexImage2D)( CC, target, level, internalformat, + width, height, border, format, type, teximage ); +} + + +void APIENTRY _mesa_TexParameterf( GLenum target, GLenum pname, GLfloat param ) +{ + GET_CONTEXT; + (*CC->API.TexParameterfv)( CC, target, pname, ¶m ); +} + + +void APIENTRY _mesa_TexParameteri( GLenum target, GLenum pname, GLint param ) +{ + GLfloat fparam[4]; + GET_CONTEXT; + fparam[0] = (GLfloat) param; + fparam[1] = fparam[2] = fparam[3] = 0.0; + (*CC->API.TexParameterfv)( CC, target, pname, fparam ); +} + + +void APIENTRY _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) +{ + GET_CONTEXT; + (*CC->API.TexParameterfv)( CC, target, pname, params ); +} + + +void APIENTRY _mesa_TexParameteriv( GLenum target, GLenum pname, const GLint *params ) +{ + GLfloat p[4]; + GET_CONTEXT; + if (pname==GL_TEXTURE_BORDER_COLOR) { + p[0] = INT_TO_FLOAT( params[0] ); + p[1] = INT_TO_FLOAT( params[1] ); + p[2] = INT_TO_FLOAT( params[2] ); + p[3] = INT_TO_FLOAT( params[3] ); + } + else { + p[0] = (GLfloat) params[0]; + p[1] = (GLfloat) params[1]; + p[2] = (GLfloat) params[2]; + p[3] = (GLfloat) params[3]; + } + (*CC->API.TexParameterfv)( CC, target, pname, p ); +} + + +void APIENTRY _mesa_TexSubImage1D( GLenum target, GLint level, GLint xoffset, + GLsizei width, GLenum format, + GLenum type, const GLvoid *pixels ) +{ + struct gl_image *image; + GET_CONTEXT; + image = gl_unpack_texsubimage( CC, width, 1, format, type, pixels ); + (*CC->API.TexSubImage1D)( CC, target, level, xoffset, width, + format, type, image ); +} + + +void APIENTRY _mesa_TexSubImage2D( GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const GLvoid *pixels ) +{ + struct gl_image *image; + GET_CONTEXT; + image = gl_unpack_texsubimage( CC, width, height, format, type, pixels ); + (*CC->API.TexSubImage2D)( CC, target, level, xoffset, yoffset, + width, height, format, type, image ); +} + + +void APIENTRY _mesa_Translated( GLdouble x, GLdouble y, GLdouble z ) +{ + GET_CONTEXT; + (*CC->API.Translatef)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z ); +} + + +void APIENTRY _mesa_Translatef( GLfloat x, GLfloat y, GLfloat z ) +{ + GET_CONTEXT; + (*CC->API.Translatef)( CC, x, y, z ); +} + + +void APIENTRY _mesa_Vertex2d( GLdouble x, GLdouble y ) +{ + GET_CONTEXT; + (*CC->API.Vertex2f)( CC, (GLfloat) x, (GLfloat) y ); +} + + +void APIENTRY _mesa_Vertex2f( GLfloat x, GLfloat y ) +{ + GET_CONTEXT; + (*CC->API.Vertex2f)( CC, x, y ); +} + + +void APIENTRY _mesa_Vertex2i( GLint x, GLint y ) +{ + GET_CONTEXT; + (*CC->API.Vertex2f)( CC, (GLfloat) x, (GLfloat) y ); +} + + +void APIENTRY _mesa_Vertex2s( GLshort x, GLshort y ) +{ + GET_CONTEXT; + (*CC->API.Vertex2f)( CC, (GLfloat) x, (GLfloat) y ); +} + + +void APIENTRY _mesa_Vertex3d( GLdouble x, GLdouble y, GLdouble z ) +{ + GET_CONTEXT; + (*CC->API.Vertex3f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z ); +} + + +void APIENTRY _mesa_Vertex3f( GLfloat x, GLfloat y, GLfloat z ) +{ + GET_CONTEXT; + (*CC->API.Vertex3f)( CC, x, y, z ); +} + + +void APIENTRY _mesa_Vertex3i( GLint x, GLint y, GLint z ) +{ + GET_CONTEXT; + (*CC->API.Vertex3f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z ); +} + + +void APIENTRY _mesa_Vertex3s( GLshort x, GLshort y, GLshort z ) +{ + GET_CONTEXT; + (*CC->API.Vertex3f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z ); +} + + +void APIENTRY _mesa_Vertex4d( GLdouble x, GLdouble y, GLdouble z, GLdouble w ) +{ + GET_CONTEXT; + (*CC->API.Vertex4f)( CC, (GLfloat) x, (GLfloat) y, + (GLfloat) z, (GLfloat) w ); +} + + +void APIENTRY _mesa_Vertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) +{ + GET_CONTEXT; + (*CC->API.Vertex4f)( CC, x, y, z, w ); +} + + +void APIENTRY _mesa_Vertex4i( GLint x, GLint y, GLint z, GLint w ) +{ + GET_CONTEXT; + (*CC->API.Vertex4f)( CC, (GLfloat) x, (GLfloat) y, + (GLfloat) z, (GLfloat) w ); +} + + +void APIENTRY _mesa_Vertex4s( GLshort x, GLshort y, GLshort z, GLshort w ) +{ + GET_CONTEXT; + (*CC->API.Vertex4f)( CC, (GLfloat) x, (GLfloat) y, + (GLfloat) z, (GLfloat) w ); +} + + +void APIENTRY _mesa_Vertex2dv( const GLdouble *v ) +{ + GET_CONTEXT; + (*CC->API.Vertex2f)( CC, (GLfloat) v[0], (GLfloat) v[1] ); +} + + +void APIENTRY _mesa_Vertex2fv( const GLfloat *v ) +{ + GET_CONTEXT; + (*CC->API.Vertex2f)( CC, v[0], v[1] ); +} + + +void APIENTRY _mesa_Vertex2iv( const GLint *v ) +{ + GET_CONTEXT; + (*CC->API.Vertex2f)( CC, (GLfloat) v[0], (GLfloat) v[1] ); +} + + +void APIENTRY _mesa_Vertex2sv( const GLshort *v ) +{ + GET_CONTEXT; + (*CC->API.Vertex2f)( CC, (GLfloat) v[0], (GLfloat) v[1] ); +} + + +void APIENTRY _mesa_Vertex3dv( const GLdouble *v ) +{ + GET_CONTEXT; + (*CC->API.Vertex3f)( CC, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] ); +} + + +void APIENTRY _mesa_Vertex3fv( const GLfloat *v ) +{ + GET_CONTEXT; + (*CC->API.Vertex3fv)( CC, v ); +} + + +void APIENTRY _mesa_Vertex3iv( const GLint *v ) +{ + GET_CONTEXT; + (*CC->API.Vertex3f)( CC, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] ); +} + + +void APIENTRY _mesa_Vertex3sv( const GLshort *v ) +{ + GET_CONTEXT; + (*CC->API.Vertex3f)( CC, (GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2] ); +} + + +void APIENTRY _mesa_Vertex4dv( const GLdouble *v ) +{ + GET_CONTEXT; + (*CC->API.Vertex4f)( CC, (GLfloat) v[0], (GLfloat) v[1], + (GLfloat) v[2], (GLfloat) v[3] ); +} + + +void APIENTRY _mesa_Vertex4fv( const GLfloat *v ) +{ + GET_CONTEXT; + (*CC->API.Vertex4f)( CC, v[0], v[1], v[2], v[3] ); +} + + +void APIENTRY _mesa_Vertex4iv( const GLint *v ) +{ + GET_CONTEXT; + (*CC->API.Vertex4f)( CC, (GLfloat) v[0], (GLfloat) v[1], + (GLfloat) v[2], (GLfloat) v[3] ); +} + + +void APIENTRY _mesa_Vertex4sv( const GLshort *v ) +{ + GET_CONTEXT; + (*CC->API.Vertex4f)( CC, (GLfloat) v[0], (GLfloat) v[1], + (GLfloat) v[2], (GLfloat) v[3] ); +} + + +void APIENTRY _mesa_VertexPointer( GLint size, GLenum type, GLsizei stride, + const GLvoid *ptr ) +{ + GET_CONTEXT; + (*CC->API.VertexPointer)(CC, size, type, stride, ptr); +} + + +void APIENTRY _mesa_Viewport( GLint x, GLint y, GLsizei width, GLsizei height ) +{ + GET_CONTEXT; + (*CC->API.Viewport)( CC, x, y, width, height ); +} + +/* GL_EXT_paletted_texture */ + +void APIENTRY _mesa_ColorTableEXT( GLenum target, GLenum internalFormat, + GLsizei width, GLenum format, GLenum type, + const GLvoid *table ) +{ + struct gl_image *image; + GET_CONTEXT; + image = gl_unpack_image( CC, width, 1, format, type, table ); + (*CC->API.ColorTable)( CC, target, internalFormat, image ); + if (image->RefCount == 0) + gl_free_image(image); +} + + +void APIENTRY _mesa_ColorSubTableEXT( GLenum target, GLsizei start, GLsizei count, + GLenum format, GLenum type, + const GLvoid *data ) +{ + struct gl_image *image; + GET_CONTEXT; + image = gl_unpack_image( CC, count, 1, format, type, data ); + (*CC->API.ColorSubTable)( CC, target, start, image ); + if (image->RefCount == 0) + gl_free_image(image); +} + +void APIENTRY _mesa_GetColorTableEXT( GLenum target, GLenum format, + GLenum type, GLvoid *table ) +{ + GET_CONTEXT; + (*CC->API.GetColorTable)(CC, target, format, type, table); +} + + +void APIENTRY _mesa_GetColorTableParameterivEXT( GLenum target, GLenum pname, + GLint *params ) +{ + GET_CONTEXT; + (*CC->API.GetColorTableParameteriv)(CC, target, pname, params); +} + + +void APIENTRY _mesa_GetColorTableParameterfvEXT( GLenum target, GLenum pname, + GLfloat *params ) +{ + GLint iparams; + _mesa_GetColorTableParameterivEXT( target, pname, &iparams ); + *params = (GLfloat) iparams; +} +/* End GL_EXT_paletted_texture */ diff --git a/dll/opengl/mesa/api.h b/dll/opengl/mesa/api.h new file mode 100644 index 0000000000..0d0064fa7c --- /dev/null +++ b/dll/opengl/mesa/api.h @@ -0,0 +1,83 @@ +/* $Id: api.h,v 1.4 1998/02/04 00:38:24 brianp Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 2.4 + * Copyright (C) 1995-1997 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +/* + * $Log: api.h,v $ + * Revision 1.4 1998/02/04 00:38:24 brianp + * WIN32 patch from Oleg Letsinsky + * + * Revision 1.3 1998/02/04 00:13:35 brianp + * updated for Cygnus (Stephane Rehel) + * + * Revision 1.2 1997/11/25 03:20:09 brianp + * simple clean-ups for multi-threading (John Stone) + * + * Revision 1.1 1997/08/22 01:42:26 brianp + * Initial revision + * + */ + + +/* + * The original api.c file has been split into two files: api1.c and api2.c + * because some compilers complained that api.c was too big. + * + * This header contains stuff only included by api1.c and api2.c + */ + + +#ifndef API_H +#define API_H + + +/* + * Single/multiple thread context selection. + */ +#ifdef THREADS + +/* Get the context associated with the calling thread */ +#define GET_CONTEXT GLcontext *CC = gl_get_thread_context() + +#else + +/* CC is a global pointer for all threads in the address space */ +#define GET_CONTEXT + +#endif /* THREADS */ + + +/* + * An optimization in a few performance-critical functions. + */ +#define SHORTCUT + + +/* + * Windows 95/NT DLL stuff. + */ +#if !defined(WIN32) && !defined(WINDOWS_NT) && !defined(__CYGWIN32__) +#define APIENTRY +#endif + + +#endif diff --git a/dll/opengl/mesa/asm-386.S b/dll/opengl/mesa/asm-386.S new file mode 100644 index 0000000000..c4979b8616 --- /dev/null +++ b/dll/opengl/mesa/asm-386.S @@ -0,0 +1,1644 @@ +/* $Id: asm-386.S,v 1.8 1997/12/17 00:50:51 brianp Exp $ */ + +/* + * asm-386.S - special (hopefully faster) transformation functions for x86 + * + * by Josh Vanderhoof + * + * This file is in the public domain. + */ + +/* + * $Log: asm-386.S,v $ + * Revision 1.8 1997/12/17 00:50:51 brianp + * applied Josh's patch to fix texture coordinate transformation bugs + * + * Revision 1.7 1997/12/17 00:27:11 brianp + * applied Josh's patch to fix bfris + * + * Revision 1.6 1997/12/01 01:02:41 brianp + * added FreeBSD patches (Daniel J. O'Connor) + * + * Revision 1.5 1997/11/19 23:52:17 brianp + * added missing "cld" instruction in asm_transform_points4_identity() + * + * Revision 1.4 1997/11/11 02:22:41 brianp + * small change per Josh to ensure U/V pairing + * + * Revision 1.3 1997/11/07 03:37:24 brianp + * added missing line from Stephane Rehel + * + * Revision 1.2 1997/11/07 03:30:37 brianp + * added Josh's 11-5-97 patches + * + * Revision 1.1 1997/10/30 06:00:33 brianp + * Initial revision + */ + +#include <asm.inc> + +#define S(x) dword ptr [esi + 4*x] +#define D(x) dword ptr [edi + 4*x] +#define M(x, y) dword ptr [edx + 16*x + 4*y] + +.code + +/* + * void asm_transform_points3_general( GLuint n, GLfloat d[][4], + * GLfloat m[16], GLfloat s[][4] ); + */ +PUBLIC _asm_transform_points3_general +_asm_transform_points3_general: +.align 4 + push esi + push edi + + mov ecx, [esp + 12] /* ecx = n */ + mov edi, [esp + 16] /* edi = d */ + mov edx, [esp + 20] /* edx = m */ + mov esi, [esp + 24] /* esi = s */ + + test ecx, ecx + jz _asm_transform_points3_general_end + +.align 4 +_asm_transform_points3_general_loop: + fld S(0) + fmul M(0, 0) + fld S(0) + fmul M(0, 1) + fld S(0) + fmul M(0, 2) + fld S(0) + fmul M(0, 3) + + fld S(1) + fmul M(1, 0) + fld S(1) + fmul M(1, 1) + fld S(1) + fmul M(1, 2) + fld S(1) + fmul M(1, 3) + + /* + * The FPU stack should now look like this: + * + * st(7) = S(0) * M(0, 0) + * st(6) = S(0) * M(0, 1) + * st(5) = S(0) * M(0, 2) + * st(4) = S(0) * M(0, 3) + * st(3) = S(1) * M(1, 0) + * st(2) = S(1) * M(1, 1) + * st(1) = S(1) * M(1, 2) + * st(0) = S(1) * M(1, 3) + */ + + fxch st(3) /* 3 1 2 0 4 5 6 7 */ + faddp st(7), st /* 1 2 0 4 5 6 7 */ + fxch st(1) /* 2 1 0 4 5 6 7 */ + faddp st(5), st /* 1 0 4 5 6 7 */ + faddp st(3), st /* 0 4 5 6 7 */ + faddp st(1), st /* 4 5 6 7 */ + + /* + * st(3) = S(0) * M(0, 0) + S(1) * M(1, 0) + * st(2) = S(0) * M(0, 1) + S(1) * M(1, 1) + * st(1) = S(0) * M(0, 2) + S(1) * M(1, 2) + * st(0) = S(0) * M(0, 3) + S(1) * M(1, 3) + */ + + fld S(2) + fmul M(2, 0) + fld S(2) + fmul M(2, 1) + fld S(2) + fmul M(2, 2) + fld S(2) + fmul M(2, 3) + + /* + * st(7) = S(0) * M(0, 0) + S(1) * M(1, 0) + * st(6) = S(0) * M(0, 1) + S(1) * M(1, 1) + * st(5) = S(0) * M(0, 2) + S(1) * M(1, 2) + * st(4) = S(0) * M(0, 3) + S(1) * M(1, 3) + * st(3) = S(2) * M(2, 0) + * st(2) = S(2) * M(2, 1) + * st(1) = S(2) * M(2, 2) + * st(0) = S(2) * M(2, 3) + */ + + fxch st(3) /* 3 1 2 0 4 5 6 7 */ + faddp st(7), st /* 1 2 0 4 5 6 7 */ + fxch st(1) /* 2 1 0 4 5 6 7 */ + faddp st(5), st /* 1 0 4 5 6 7 */ + faddp st(3), st /* 0 4 5 6 7 */ + faddp st(1), st /* 4 5 6 7 */ + + /* + * st(3) = S(0) * M(0, 0) + S(1) * M(1, 0) + S(2) * M(2, 0) + * st(2) = S(0) * M(0, 1) + S(1) * M(1, 1) + S(2) * M(2, 1) + * st(1) = S(0) * M(0, 2) + S(1) * M(1, 2) + S(2) * M(2, 2) + * st(0) = S(0) * M(0, 3) + S(1) * M(1, 3) + S(2) * M(2, 3) + */ + + fxch st(3) /* 3 1 2 0 */ + fadd M(3, 0) + fxch st(2) /* 2 1 3 0 */ + fadd M(3, 1) + fxch st(1) /* 1 2 3 0 */ + fadd M(3, 2) + fxch st(3) /* 0 2 3 1 */ + fadd M(3, 3) + + /* + * st(3) = S(0) * M(0, 2) + S(1) * M(1, 2) + S(2) * M(2, 2) + M(3, 2) + * st(2) = S(0) * M(0, 0) + S(1) * M(1, 0) + S(2) * M(2, 0) + M(3, 0) + * st(1) = S(0) * M(0, 1) + S(1) * M(1, 1) + S(2) * M(2, 1) + M(3, 1) + * st(0) = S(0) * M(0, 3) + S(1) * M(1, 3) + S(2) * M(2, 3) + M(3, 3) + */ + + fxch st(3) /* 3 1 2 0 */ + fstp D(2) /* 1 2 0 */ + fxch st(1) /* 2 1 0 */ + fstp D(0) /* 1 0 */ + lea esi, S(4) + fstp D(1) /* 0 */ + dec ecx + fstp D(3) /* */ + + lea edi, D(4) + + jnz _asm_transform_points3_general_loop + +_asm_transform_points3_general_end: + pop edi + pop esi + ret + + +/* + * void asm_transform_points3_identity( GLuint n, GLfloat d[][4], + * GLfloat s[][4] ); + */ +PUBLIC _asm_transform_points3_identity +_asm_transform_points3_identity: +.align 4 + push esi + push edi + mov ecx, [esp + 12] /* ecx = n */ + mov edi, [esp + 16] /* edi = d */ + mov esi, [esp + 20] /* esi = s */ + push ebx + push ebp + + test ecx, ecx + jz _asm_transform_points3_identity_end + + mov ebp, HEX(3f800000) + +.align 4 +_asm_transform_points3_identity_loop: + mov eax, S(0) + mov edx, S(1) + mov ebx, S(2) + lea esi, S(4) + mov D(0), eax + mov D(1), edx + mov D(2), ebx + mov D(3), ebp + dec ecx + lea edi, D(4) + jnz _asm_transform_points3_identity_loop + +_asm_transform_points3_identity_end: + pop ebp + pop ebx + pop edi + pop esi + ret + + +/* + * void asm_transform_points3_2d( GLuint n, GLfloat d[][4], GLfloat m[16], + * GLfloat s[][4] ); + */ +PUBLIC _asm_transform_points3_2d +_asm_transform_points3_2d: +.align 4 + push esi + push edi + mov ecx, [esp + 12] /* ecx = n */ + mov edi, [esp + 16] /* edi = d */ + mov edx, [esp + 20] /* edx = m */ + mov esi, [esp + 24] /* esi = s */ + push ebp + + mov ebp, HEX(3f800000) + + test cl, DEC(1) + jz _asm_transform_points3_2d_step + + dec ecx + + fld S(0) + fmul M(0, 0) + fld S(0) + fmul M(0, 1) + fld S(1) + fmul M(1, 0) + fld S(1) + fmul M(1, 1) + + /* + * st(3) = S(0) * M(0, 0) + * st(2) = S(0) * M(0, 1) + * st(1) = S(1) * M(1, 0) + * st(0) = S(1) * M(1, 1) + */ + + fxch st(1) /* 1 0 2 3 */ + fadd M(3, 0) + fxch st(1) /* 0 1 2 3 */ + fadd M(3, 1) + fxch st(1) /* 1 0 2 3 */ + faddp st(3), st /* 0 2 3 */ + faddp st(1), st /* 2 3 */ + fstp D(1) /* 3 */ + fstp D(0) /* */ + mov eax, S(2) + lea esi, S(4) + mov D(3), ebp + mov D(2), eax + lea edi, D(4) + +_asm_transform_points3_2d_step: + test ecx, ecx + jz _asm_transform_points3_2d_end + +.align 4 +_asm_transform_points3_2d_loop: + fld S(0) + fmul M(0, 0) + fld S(0) + fmul M(0, 1) + fld S(4) + fmul M(0, 0) + fld S(4) + fmul M(0, 1) + fld S(1) + fmul M(1, 0) + fld S(1) + fmul M(1, 1) + fld S(5) + fmul M(1, 0) + fld S(5) + fmul M(1, 1) + + /* + * st(7) = S(0) * M(0, 0) + * st(6) = S(0) * M(0, 1) + * st(5) = S(4) * M(0, 0) + * st(4) = S(4) * M(0, 1) + * st(3) = S(1) * M(1, 0) + * st(2) = S(1) * M(1, 1) + * st(1) = S(5) * M(1, 0) + * st(0) = S(5) * M(1, 1) + */ + + fxch st(7) /* 7 1 2 3 4 5 6 0 */ + fadd M(3, 0) ... 187598 lines suppressed ...
5 years, 9 months
1
0
0
0
[reactos] 01/05: [SDK] Provide .const macro for gas
by Jérôme Gardou
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=905bcf617f62428966280…
commit 905bcf617f62428966280729c5cc64f9e9023009 Author: Jérôme Gardou <jerome.gardou(a)reactos.org> AuthorDate: Sat Jan 19 11:19:00 2019 +0100 Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com> CommitDate: Sat Jan 19 14:23:54 2019 +0100 [SDK] Provide .const macro for gas --- sdk/include/asm/asm.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk/include/asm/asm.inc b/sdk/include/asm/asm.inc index e94a078445..f8bc9126e1 100644 --- a/sdk/include/asm/asm.inc +++ b/sdk/include/asm/asm.inc @@ -313,6 +313,10 @@ ENDM .text .endm +.macro .const + .section .rdata +.endm + /* check
http://msdn.microsoft.com/en-us/library/9c9k076y%28VS.80%29.aspx
and
http://msdn.microsoft.com/en-us/library/ms679352%28VS.85%29.aspx
*/ .macro FPO cdwLocals, cdwParams, cbProlog, cbRegs, fUseBP, cbFrame
5 years, 9 months
1
0
0
0
[reactos] 01/01: [NTOS] Turn broken assert into DPRINT
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3410b25fdeb06991fe8b5…
commit 3410b25fdeb06991fe8b56cc601d49cb943fe1ad Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Sat Jan 19 13:38:24 2019 +0100 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Sat Jan 19 13:38:24 2019 +0100 [NTOS] Turn broken assert into DPRINT --- ntoskrnl/mm/ARM3/sysldr.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/ntoskrnl/mm/ARM3/sysldr.c b/ntoskrnl/mm/ARM3/sysldr.c index 107f3fcf40..ffab764ae2 100644 --- a/ntoskrnl/mm/ARM3/sysldr.c +++ b/ntoskrnl/mm/ARM3/sysldr.c @@ -2389,7 +2389,7 @@ MiWriteProtectSystemImage( PMMPTE FirstPte, LastPte; /* Check if the registry setting is on or not */ - if (!MmEnforceWriteProtection) + if (MmEnforceWriteProtection) { /* Ignore section protection */ return; @@ -2479,8 +2479,17 @@ MiWriteProtectSystemImage( } /* Image should end with the last section */ - NT_ASSERT(ALIGN_UP_POINTER_BY(SectionEnd, PAGE_SIZE) == - Add2Ptr(ImageBase, NtHeaders->OptionalHeader.SizeOfImage)); + if (ALIGN_UP_POINTER_BY(SectionEnd, PAGE_SIZE) != + Add2Ptr(ImageBase, NtHeaders->OptionalHeader.SizeOfImage)) + { + DPRINT1("ImageBase 0x%p ImageSize 0x%lx Section %u VA 0x%lx Raw 0x%lx virt 0x%lx\n", + ImageBase, + NtHeaders->OptionalHeader.SizeOfImage, + i, + Section->VirtualAddress, + Section->SizeOfRawData, + Section->Misc.VirtualSize); + } } VOID
5 years, 9 months
1
0
0
0
[reactos] 01/01: [NTOS:Mm] Rewrite MiWriteProtectSystemImage (#749)
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=65dbfc286818e18095b7c…
commit 65dbfc286818e18095b7cc0c85f63cde6b3e629d Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Fri Jan 18 22:11:43 2019 +0100 Commit: GitHub <noreply(a)github.com> CommitDate: Fri Jan 18 22:11:43 2019 +0100 [NTOS:Mm] Rewrite MiWriteProtectSystemImage (#749) * The previous version was overcomplicated and broken and therefore disabled. * The new version also enforces NX protection on x64. * Now that protecting works, also protect the boot loaded images. --- ntoskrnl/include/internal/amd64/mm.h | 3 +- ntoskrnl/include/internal/arm/mm.h | 1 + ntoskrnl/include/internal/i386/mm.h | 2 + ntoskrnl/include/ntoskrnl.h | 8 + ntoskrnl/mm/ARM3/miarm.h | 42 ++++- ntoskrnl/mm/ARM3/sysldr.c | 294 +++++++++++------------------------ ntoskrnl/mm/mminit.c | 14 ++ 7 files changed, 162 insertions(+), 202 deletions(-) diff --git a/ntoskrnl/include/internal/amd64/mm.h b/ntoskrnl/include/internal/amd64/mm.h index 8f881a12c2..fbdd92eb3d 100644 --- a/ntoskrnl/include/internal/amd64/mm.h +++ b/ntoskrnl/include/internal/amd64/mm.h @@ -3,7 +3,8 @@ */ #pragma once -#define _MI_PAGING_LEVELS 4 +#define _MI_PAGING_LEVELS 4 +#define _MI_HAS_NO_EXECUTE 1 /* Memory layout base addresses (This is based on Vista!) */ #define MI_USER_PROBE_ADDRESS (PVOID)0x000007FFFFFF0000ULL diff --git a/ntoskrnl/include/internal/arm/mm.h b/ntoskrnl/include/internal/arm/mm.h index 0e2e79d15c..d5bd2c5066 100644 --- a/ntoskrnl/include/internal/arm/mm.h +++ b/ntoskrnl/include/internal/arm/mm.h @@ -4,6 +4,7 @@ #pragma once #define _MI_PAGING_LEVELS 2 +#define _MI_HAS_NO_EXECUTE 1 /* Memory layout base addresses */ #define MI_USER_PROBE_ADDRESS (PVOID)0x7FFF0000 diff --git a/ntoskrnl/include/internal/i386/mm.h b/ntoskrnl/include/internal/i386/mm.h index a77b92b9e3..63bce80582 100644 --- a/ntoskrnl/include/internal/i386/mm.h +++ b/ntoskrnl/include/internal/i386/mm.h @@ -5,8 +5,10 @@ #ifdef _PAE_ #define _MI_PAGING_LEVELS 3 +#define _MI_HAS_NO_EXECUTE 1 #else #define _MI_PAGING_LEVELS 2 +#define _MI_NO_EXECUTE 0 #endif /* Memory layout base addresses */ diff --git a/ntoskrnl/include/ntoskrnl.h b/ntoskrnl/include/ntoskrnl.h index 51516c6bd7..35a243e2a2 100644 --- a/ntoskrnl/include/ntoskrnl.h +++ b/ntoskrnl/include/ntoskrnl.h @@ -94,6 +94,14 @@ #define ExRaiseStatus RtlRaiseStatus +/* Also defined in fltkernel.h, but we don't want the entire header */ +#ifndef Add2Ptr +#define Add2Ptr(P,I) ((PVOID)((PUCHAR)(P) + (I))) +#endif +#ifndef PtrOffset +#define PtrOffset(B,O) ((ULONG)((ULONG_PTR)(O) - (ULONG_PTR)(B))) +#endif + // // Switch for enabling global page support // diff --git a/ntoskrnl/mm/ARM3/miarm.h b/ntoskrnl/mm/ARM3/miarm.h index 27ff0718ba..b0fa87c4de 100644 --- a/ntoskrnl/mm/ARM3/miarm.h +++ b/ntoskrnl/mm/ARM3/miarm.h @@ -83,7 +83,7 @@ C_ASSERT(SYSTEM_PD_SIZE == PAGE_SIZE); // while on certain architectures such as ARM, it is enabling the cache which // requires a flag. // -#if defined(_M_IX86) || defined(_M_AMD64) +#if defined(_M_IX86) // // Access Flags // @@ -109,6 +109,34 @@ C_ASSERT(SYSTEM_PD_SIZE == PAGE_SIZE); #define PTE_ENABLE_CACHE 0 #define PTE_DISABLE_CACHE 0x10 #define PTE_WRITECOMBINED_CACHE 0x10 +#define PTE_PROTECT_MASK 0x612 +#elif defined(_M_AMD64) +// +// Access Flags +// +#define PTE_READONLY 0x8000000000000000ULL +#define PTE_EXECUTE 0x0000000000000000ULL +#define PTE_EXECUTE_READ PTE_EXECUTE /* EXECUTE implies READ on x64 */ +#define PTE_READWRITE 0x8000000000000002ULL +#define PTE_WRITECOPY 0x8000000000000200ULL +#define PTE_EXECUTE_READWRITE 0x0000000000000002ULL +#define PTE_EXECUTE_WRITECOPY 0x0000000000000200ULL +#define PTE_PROTOTYPE 0x0000000000000400ULL + +// +// State Flags +// +#define PTE_VALID 0x0000000000000001ULL +#define PTE_ACCESSED 0x0000000000000020ULL +#define PTE_DIRTY 0x0000000000000040ULL + +// +// Cache flags +// +#define PTE_ENABLE_CACHE 0x0000000000000000ULL +#define PTE_DISABLE_CACHE 0x0000000000000010ULL +#define PTE_WRITECOMBINED_CACHE 0x0000000000000010ULL +#define PTE_PROTECT_MASK 0x8000000000000612ULL #elif defined(_M_ARM) #define PTE_READONLY 0x200 #define PTE_EXECUTE 0 // Not worrying about NX yet @@ -118,16 +146,23 @@ C_ASSERT(SYSTEM_PD_SIZE == PAGE_SIZE); #define PTE_EXECUTE_READWRITE 0 // Not worrying about NX yet #define PTE_EXECUTE_WRITECOPY 0 // Not worrying about NX yet #define PTE_PROTOTYPE 0x400 // Using the Shared bit + // // Cache flags // #define PTE_ENABLE_CACHE 0 #define PTE_DISABLE_CACHE 0x10 #define PTE_WRITECOMBINED_CACHE 0x10 +#define PTE_PROTECT_MASK 0x610 #else #error Define these please! #endif +// +// Mask for image section page protection +// +#define IMAGE_SCN_PROTECTION_MASK (IMAGE_SCN_MEM_WRITE | IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_EXECUTE) + extern const ULONG_PTR MmProtectToPteMask[32]; extern const ULONG MmProtectToValue[32]; @@ -2263,6 +2298,11 @@ MiMakePdeExistAndMakeValid( IN KIRQL OldIrql ); +VOID +NTAPI +MiWriteProtectSystemImage( + _In_ PVOID ImageBase); + // // MiRemoveZeroPage will use inline code to zero out the page manually if only // free pages are available. In some scenarios, we don't/can't run that piece of diff --git a/ntoskrnl/mm/ARM3/sysldr.c b/ntoskrnl/mm/ARM3/sysldr.c index 15b267d146..107f3fcf40 100644 --- a/ntoskrnl/mm/ARM3/sysldr.c +++ b/ntoskrnl/mm/ARM3/sysldr.c @@ -2341,252 +2341,146 @@ MiUseLargeDriverPage(IN ULONG NumberOfPtes, return FALSE; } -ULONG +VOID NTAPI -MiComputeDriverProtection(IN BOOLEAN SessionSpace, - IN ULONG SectionProtection) +MiSetSystemCodeProtection( + _In_ PMMPTE FirstPte, + _In_ PMMPTE LastPte, + _In_ ULONG Protection) { - ULONG Protection = MM_ZERO_ACCESS; + PMMPTE PointerPte; + MMPTE TempPte; - /* Check if the caller gave anything */ - if (SectionProtection) + /* Loop the PTEs */ + for (PointerPte = FirstPte; PointerPte <= LastPte; PointerPte++) { - /* Always turn on execute access */ - SectionProtection |= IMAGE_SCN_MEM_EXECUTE; + /* Read the PTE */ + TempPte = *PointerPte; - /* Check if the registry setting is on or not */ - if (!MmEnforceWriteProtection) - { - /* Turn on write access too */ - SectionProtection |= (IMAGE_SCN_MEM_WRITE | IMAGE_SCN_MEM_EXECUTE); - } - } + /* Make sure it's valid */ + ASSERT(TempPte.u.Hard.Valid == 1); - /* Convert to internal PTE flags */ - if (SectionProtection & IMAGE_SCN_MEM_EXECUTE) Protection |= MM_EXECUTE; - if (SectionProtection & IMAGE_SCN_MEM_READ) Protection |= MM_READONLY; + /* Update the protection */ + TempPte.u.Hard.Write = BooleanFlagOn(Protection, IMAGE_SCN_MEM_WRITE); +#if _MI_HAS_NO_EXECUTE + TempPte.u.Hard.NoExecute = !BooleanFlagOn(Protection, IMAGE_SCN_MEM_EXECUTE); +#endif - /* Check for write access */ - if (SectionProtection & IMAGE_SCN_MEM_WRITE) - { - /* Session space is not supported */ - if (SessionSpace) - { - DPRINT1("Session drivers not supported\n"); - ASSERT(SessionSpace == FALSE); - } - else - { - /* Convert to internal PTE flag */ - Protection = (Protection & MM_EXECUTE) ? MM_EXECUTE_READWRITE : MM_READWRITE; - } + MI_UPDATE_VALID_PTE(PointerPte, TempPte); } - /* If there's no access at all by now, convert to internal no access flag */ - if (Protection == MM_ZERO_ACCESS) Protection = MM_NOACCESS; - - /* Return the computed PTE protection */ - return Protection; -} + /* Flush it all */ + KeFlushEntireTb(TRUE, TRUE); -VOID -NTAPI -MiSetSystemCodeProtection(IN PMMPTE FirstPte, - IN PMMPTE LastPte, - IN ULONG ProtectionMask) -{ - /* I'm afraid to introduce regressions at the moment... */ return; } VOID NTAPI -MiWriteProtectSystemImage(IN PVOID ImageBase) +MiWriteProtectSystemImage( + _In_ PVOID ImageBase) { PIMAGE_NT_HEADERS NtHeaders; - PIMAGE_SECTION_HEADER Section; - PFN_NUMBER DriverPages; - ULONG CurrentProtection, SectionProtection, CombinedProtection = 0, ProtectionMask; - ULONG Sections, Size; - ULONG_PTR BaseAddress, CurrentAddress; - PMMPTE PointerPte, StartPte, LastPte, CurrentPte, ComboPte = NULL; - ULONG CurrentMask, CombinedMask = 0; - PAGED_CODE(); - - /* No need to write protect physical memory-backed drivers (large pages) */ - if (MI_IS_PHYSICAL_ADDRESS(ImageBase)) return; - - /* Get the image headers */ - NtHeaders = RtlImageNtHeader(ImageBase); - if (!NtHeaders) return; + PIMAGE_SECTION_HEADER SectionHeaders, Section; + ULONG i; + PVOID SectionBase, SectionEnd; + ULONG SectionSize; + ULONG Protection; + PMMPTE FirstPte, LastPte; - /* Check if this is a session driver or not */ - if (!MI_IS_SESSION_ADDRESS(ImageBase)) - { - /* Don't touch NT4 drivers */ - if (NtHeaders->OptionalHeader.MajorOperatingSystemVersion < 5) return; - if (NtHeaders->OptionalHeader.MajorImageVersion < 5) return; - } - else + /* Check if the registry setting is on or not */ + if (!MmEnforceWriteProtection) { - /* Not supported */ - UNIMPLEMENTED_DBGBREAK("Session drivers not supported\n"); + /* Ignore section protection */ + return; } - /* These are the only protection masks we care about */ - ProtectionMask = IMAGE_SCN_MEM_WRITE | IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_EXECUTE; + /* Large page mapped images are not supported */ + NT_ASSERT(!MI_IS_PHYSICAL_ADDRESS(ImageBase)); - /* Calculate the number of pages this driver is occupying */ - DriverPages = BYTES_TO_PAGES(NtHeaders->OptionalHeader.SizeOfImage); + /* Session images are not yet supported */ + NT_ASSERT(!MI_IS_SESSION_ADDRESS(ImageBase)); - /* Get the number of sections and the first section header */ - Sections = NtHeaders->FileHeader.NumberOfSections; - ASSERT(Sections != 0); - Section = IMAGE_FIRST_SECTION(NtHeaders); + /* Get the NT headers */ + NtHeaders = RtlImageNtHeader(ImageBase); + if (NtHeaders == NULL) + { + DPRINT1("Failed to get NT headers for image @ %p\n", ImageBase); + return; + } - /* Loop all the sections */ - CurrentAddress = (ULONG_PTR)ImageBase; - while (Sections) + /* Don't touch NT4 drivers */ + if ((NtHeaders->OptionalHeader.MajorOperatingSystemVersion < 5) || + (NtHeaders->OptionalHeader.MajorSubsystemVersion < 5)) { - /* Get the section size */ - Size = max(Section->SizeOfRawData, Section->Misc.VirtualSize); + DPRINT1("Skipping NT 4 driver @ %p\n", ImageBase); + return; + } - /* Get its virtual address */ - BaseAddress = (ULONG_PTR)ImageBase + Section->VirtualAddress; - if (BaseAddress < CurrentAddress) - { - /* Windows doesn't like these */ - DPRINT1("Badly linked image!\n"); - return; - } + /* Get the section headers */ + SectionHeaders = IMAGE_FIRST_SECTION(NtHeaders); - /* Remember the current address */ - CurrentAddress = BaseAddress + Size - 1; + /* Get the base address of the first section */ + SectionBase = Add2Ptr(ImageBase, SectionHeaders[0].VirtualAddress); - /* Next */ - Sections--; - Section++; + /* Start protecting the image header as R/O */ + FirstPte = MiAddressToPte(ImageBase); + LastPte = MiAddressToPte(SectionBase) - 1; + Protection = IMAGE_SCN_MEM_READ; + if (LastPte >= FirstPte) + { + MiSetSystemCodeProtection(FirstPte, LastPte, IMAGE_SCN_MEM_READ); } - /* Get the number of sections and the first section header */ - Sections = NtHeaders->FileHeader.NumberOfSections; - ASSERT(Sections != 0); - Section = IMAGE_FIRST_SECTION(NtHeaders); - - /* Set the address at the end to initialize the loop */ - CurrentAddress = (ULONG_PTR)Section + Sections - 1; - CurrentProtection = IMAGE_SCN_MEM_WRITE | IMAGE_SCN_MEM_READ; - - /* Set the PTE points for the image, and loop its sections */ - StartPte = MiAddressToPte(ImageBase); - LastPte = StartPte + DriverPages; - while (Sections) + /* Loop the sections */ + for (i = 0; i < NtHeaders->FileHeader.NumberOfSections; i++) { - /* Get the section size */ - Size = max(Section->SizeOfRawData, Section->Misc.VirtualSize); + /* Get the section base address and size */ + Section = &SectionHeaders[i]; + SectionBase = Add2Ptr(ImageBase, Section->VirtualAddress); + SectionSize = max(Section->SizeOfRawData, Section->Misc.VirtualSize); - /* Get its virtual address and PTE */ - BaseAddress = (ULONG_PTR)ImageBase + Section->VirtualAddress; - PointerPte = MiAddressToPte(BaseAddress); + /* Get the first PTE of this section */ + FirstPte = MiAddressToPte(SectionBase); - /* Check if we were already protecting a run, and found a new run */ - if ((ComboPte) && (PointerPte > ComboPte)) + /* Check for overlap with the previous range */ + if (FirstPte == LastPte) { - /* Compute protection */ - CombinedMask = MiComputeDriverProtection(FALSE, CombinedProtection); - - /* Set it */ - MiSetSystemCodeProtection(ComboPte, ComboPte, CombinedMask); - - /* Check for overlap */ - if (ComboPte == StartPte) StartPte++; + /* Combine the old and new protection by ORing them */ + Protection |= (Section->Characteristics & IMAGE_SCN_PROTECTION_MASK); - /* One done, reset variables */ - ComboPte = NULL; - CombinedProtection = 0; - } - - /* Break out when needed */ - if (PointerPte >= LastPte) break; + /* Update the protection for this PTE */ + MiSetSystemCodeProtection(FirstPte, FirstPte, Protection); - /* Get the requested protection from the image header */ - SectionProtection = Section->Characteristics & ProtectionMask; - if (SectionProtection == CurrentProtection) - { - /* Same protection, so merge the request */ - CurrentAddress = BaseAddress + Size - 1; - - /* Next */ - Sections--; - Section++; - continue; + /* Skip this PTE */ + FirstPte++; } - /* This is now a new section, so close up the old one */ - CurrentPte = MiAddressToPte(CurrentAddress); - - /* Check for overlap */ - if (CurrentPte == PointerPte) - { - /* Skip the last PTE, since it overlaps with us */ - CurrentPte--; - - /* And set the PTE we will merge with */ - ASSERT((ComboPte == NULL) || (ComboPte == PointerPte)); - ComboPte = PointerPte; + /* There can not be gaps! */ + NT_ASSERT(FirstPte == (LastPte + 1)); - /* Get the most flexible protection by merging both */ - CombinedMask |= (SectionProtection | CurrentProtection); - } + /* Get the end of the section and the last PTE */ + SectionEnd = Add2Ptr(SectionBase, SectionSize - 1); + NT_ASSERT(SectionEnd < Add2Ptr(ImageBase, NtHeaders->OptionalHeader.SizeOfImage)); + LastPte = MiAddressToPte(SectionEnd); - /* Loop any PTEs left */ - if (CurrentPte >= StartPte) + /* If there are no more pages (after an overlap), skip this section */ + if (LastPte < FirstPte) { - /* Sanity check */ - ASSERT(StartPte < LastPte); - - /* Make sure we don't overflow past the last PTE in the driver */ - if (CurrentPte >= LastPte) CurrentPte = LastPte - 1; - ASSERT(CurrentPte >= StartPte); - - /* Compute the protection and set it */ - CurrentMask = MiComputeDriverProtection(FALSE, CurrentProtection); - MiSetSystemCodeProtection(StartPte, CurrentPte, CurrentMask); + NT_ASSERT(FirstPte == (LastPte + 1)); + continue; } - /* Set new state */ - StartPte = PointerPte; - CurrentAddress = BaseAddress + Size - 1; - CurrentProtection = SectionProtection; + /* Get the section protection */ + Protection = (Section->Characteristics & IMAGE_SCN_PROTECTION_MASK); - /* Next */ - Sections--; - Section++; - } - - /* Is there a leftover section to merge? */ - if (ComboPte) - { - /* Compute and set the protection */ - CombinedMask = MiComputeDriverProtection(FALSE, CombinedProtection); - MiSetSystemCodeProtection(ComboPte, ComboPte, CombinedMask); - - /* Handle overlap */ - if (ComboPte == StartPte) StartPte++; + /* Update the protection for this section */ + MiSetSystemCodeProtection(FirstPte, LastPte, Protection); } - /* Finally, handle the last section */ - CurrentPte = MiAddressToPte(CurrentAddress); - if ((StartPte < LastPte) && (CurrentPte >= StartPte)) - { - /* Handle overlap */ - if (CurrentPte >= LastPte) CurrentPte = LastPte - 1; - ASSERT(CurrentPte >= StartPte); - - /* Compute and set the protection */ - CurrentMask = MiComputeDriverProtection(FALSE, CurrentProtection); - MiSetSystemCodeProtection(StartPte, CurrentPte, CurrentMask); - } + /* Image should end with the last section */ + NT_ASSERT(ALIGN_UP_POINTER_BY(SectionEnd, PAGE_SIZE) == + Add2Ptr(ImageBase, NtHeaders->OptionalHeader.SizeOfImage)); } VOID diff --git a/ntoskrnl/mm/mminit.c b/ntoskrnl/mm/mminit.c index 4f328ab65c..7c0bbd4efd 100644 --- a/ntoskrnl/mm/mminit.c +++ b/ntoskrnl/mm/mminit.c @@ -203,6 +203,8 @@ MmInitSystem(IN ULONG Phase, PMMPTE PointerPte; MMPTE TempPte = ValidKernelPte; PFN_NUMBER PageFrameNumber; + PLIST_ENTRY ListEntry; + PLDR_DATA_TABLE_ENTRY DataTableEntry; /* Initialize the kernel address space */ ASSERT(Phase == 1); @@ -271,6 +273,18 @@ MmInitSystem(IN ULONG Phase, /* Initialize the balance set manager */ MmInitBsmThread(); + /* Loop the boot loaded images */ + for (ListEntry = PsLoadedModuleList.Flink; + ListEntry != &PsLoadedModuleList; + ListEntry = ListEntry->Flink) + { + /* Get the data table entry */ + DataTableEntry = CONTAINING_RECORD(ListEntry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks); + + /* Set up the image protection */ + MiWriteProtectSystemImage(DataTableEntry->DllBase); + } + return TRUE; }
5 years, 9 months
1
0
0
0
[reactos] 01/01: [USER32_APITEST] Improve GetMessageTime tests more (#1254)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4b924a8685c8ce9005797…
commit 4b924a8685c8ce9005797b85b7aaa3998b3d472c Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Fri Jan 18 12:11:53 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Fri Jan 18 12:11:53 2019 +0900 [USER32_APITEST] Improve GetMessageTime tests more (#1254) Compare GetMessageTime and GetTickCount values. CORE-15565 --- modules/rostests/apitests/user32/GetMessageTime.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/modules/rostests/apitests/user32/GetMessageTime.c b/modules/rostests/apitests/user32/GetMessageTime.c index 76a1aff415..de41755a37 100644 --- a/modules/rostests/apitests/user32/GetMessageTime.c +++ b/modules/rostests/apitests/user32/GetMessageTime.c @@ -1,7 +1,7 @@ /* * PROJECT: ReactOS api tests * LICENSE: GPL - See COPYING in the top level directory - * PURPOSE: Test for GetMessageTime + * PURPOSE: Test for GetMessageTime and GetTickCount * PROGRAMMERS: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> */ #include "precomp.h" @@ -46,7 +46,9 @@ WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) if (s_nCount != 0) { ok(GetMessageTime() - s_nMsgTime >= TIMER_INTERVAL / 2, - "message time is wrong\n"); + "GetMessageTime() is wrong, compared to previous one\n"); + ok(GetTickCount() - (DWORD)GetMessageTime() < TIMER_INTERVAL / 2, + "GetMessageTime() is wrong, compared to GetTickCount()\n"); } s_nMsgTime = GetMessageTime(); ok(s_nMsgTime != 0, "message time was zero.\n"); @@ -65,19 +67,28 @@ WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_MOUSEMOVE: trace("WM_MOUSEMOVE\n"); ok_int(s_nCount, 5); - ok(GetMessageTime() - s_nMsgTime < TIMER_INTERVAL, "message time is wrong.\n"); + ok(GetMessageTime() - s_nMsgTime < TIMER_INTERVAL, + "GetMessageTime() is wrong, compared to previous one\n"); + ok(GetTickCount() - (DWORD)GetMessageTime() < TIMER_INTERVAL / 2, + "GetMessageTime() is wrong, compared to GetTickCount()\n"); s_bReach_WM_MOUSEMOVE = TRUE; break; case WM_LBUTTONDOWN: trace("WM_LBUTTONDOWN\n"); ok_int(s_nCount, 5); - ok(GetMessageTime() - s_nMsgTime < TIMER_INTERVAL, "message time is wrong.\n"); + ok(GetMessageTime() - s_nMsgTime < TIMER_INTERVAL, + "GetMessageTime() is wrong, compared to previous one\n"); + ok(GetTickCount() - (DWORD)GetMessageTime() < TIMER_INTERVAL / 2, + "GetMessageTime() is wrong, compared to GetTickCount()\n"); s_bReach_WM_LBUTTONDOWN = TRUE; break; case WM_LBUTTONUP: trace("WM_LBUTTONUP\n"); ok_int(s_nCount, 5); - ok(GetMessageTime() - s_nMsgTime < TIMER_INTERVAL, "message time is wrong.\n"); + ok(GetMessageTime() - s_nMsgTime < TIMER_INTERVAL, + "GetMessageTime() is wrong, compared to previous one\n"); + ok(GetTickCount() - (DWORD)GetMessageTime() < TIMER_INTERVAL / 2, + "GetMessageTime() is wrong, compared to GetTickCount()\n"); s_bReach_WM_LBUTTONUP = TRUE; break; case WM_DESTROY:
5 years, 9 months
1
0
0
0
[reactos] 01/01: [NTOS:INBV] Update the boot screen's rotation bar's image (#1256)
by Yaroslav Kibysh
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0d86ab6a187060a8d4c1a…
commit 0d86ab6a187060a8d4c1a3a38d23c5a04e9075dc Author: Yaroslav Kibysh <yanet.prod(a)gmail.com> AuthorDate: Thu Jan 17 21:45:40 2019 +0200 Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org> CommitDate: Thu Jan 17 20:45:40 2019 +0100 [NTOS:INBV] Update the boot screen's rotation bar's image (#1256) Make it smoother than what it currently is. --- ntoskrnl/inbv/logo/line.bmp | Bin 2038 -> 2038 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/ntoskrnl/inbv/logo/line.bmp b/ntoskrnl/inbv/logo/line.bmp index d080cad7bb..2f47157068 100644 Binary files a/ntoskrnl/inbv/logo/line.bmp and b/ntoskrnl/inbv/logo/line.bmp differ
5 years, 9 months
1
0
0
0
[reactos] 01/01: [USER32_APITEST] Improve GetMessageTime tests
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b490084d384a7b8d430e0…
commit b490084d384a7b8d430e0eec891f3f4cea5ae0b9 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Thu Jan 17 09:31:35 2019 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Thu Jan 17 09:31:35 2019 +0900 [USER32_APITEST] Improve GetMessageTime tests --- modules/rostests/apitests/user32/CMakeLists.txt | 2 +- .../user32/{MessageTime.c => GetMessageTime.c} | 64 +++++++++++++++++++--- modules/rostests/apitests/user32/testlist.c | 4 +- 3 files changed, 59 insertions(+), 11 deletions(-) diff --git a/modules/rostests/apitests/user32/CMakeLists.txt b/modules/rostests/apitests/user32/CMakeLists.txt index 6ff84272f5..cdd36cc0c2 100644 --- a/modules/rostests/apitests/user32/CMakeLists.txt +++ b/modules/rostests/apitests/user32/CMakeLists.txt @@ -15,6 +15,7 @@ list(APPEND SOURCE GetDCEx.c GetIconInfo.c GetKeyState.c + GetMessageTime.c GetPeekMessage.c GetSystemMetrics.c GetUserObjectInformation.c @@ -22,7 +23,6 @@ list(APPEND SOURCE InitializeLpkHooks.c LoadImage.c LookupIconIdFromDirectoryEx.c - MessageTime.c NextDlgItem.c PrivateExtractIcons.c RealGetWindowClass.c diff --git a/modules/rostests/apitests/user32/MessageTime.c b/modules/rostests/apitests/user32/GetMessageTime.c similarity index 52% rename from modules/rostests/apitests/user32/MessageTime.c rename to modules/rostests/apitests/user32/GetMessageTime.c index ba3a600db1..76a1aff415 100644 --- a/modules/rostests/apitests/user32/MessageTime.c +++ b/modules/rostests/apitests/user32/GetMessageTime.c @@ -1,29 +1,48 @@ /* * PROJECT: ReactOS api tests * LICENSE: GPL - See COPYING in the top level directory - * PURPOSE: Test for message times + * PURPOSE: Test for GetMessageTime * PROGRAMMERS: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> */ - #include "precomp.h" #define TIMER_ID 999 #define TIMER_INTERVAL 500 /* 500 milliseconds */ +#define MOUSE_LOCATION_X(x) ((DWORD)(x) * 0xFFFF / GetSystemMetrics(SM_CXSCREEN)) +#define MOUSE_LOCATION_Y(y) ((DWORD)(y) * 0xFFFF / GetSystemMetrics(SM_CYSCREEN)) + +#define WIN_X 50 +#define WIN_Y 50 +#define WIN_CX 100 +#define WIN_CY 100 + static INT s_nCount = 0; static LONG s_nMsgTime = 0; static LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { + static BOOL s_bReach_WM_MOUSEMOVE; + static BOOL s_bReach_WM_LBUTTONDOWN; + static BOOL s_bReach_WM_LBUTTONUP; switch (uMsg) { case WM_CREATE: s_nCount = 0; s_nMsgTime = GetMessageTime(); SetTimer(hwnd, TIMER_ID, TIMER_INTERVAL, NULL); + s_bReach_WM_MOUSEMOVE = FALSE; + s_bReach_WM_LBUTTONDOWN = FALSE; + s_bReach_WM_LBUTTONUP = FALSE; break; case WM_TIMER: + if (s_nCount == 5) + { + KillTimer(hwnd, TIMER_ID); + DestroyWindow(hwnd); + break; + } if (s_nCount != 0) { ok(GetMessageTime() - s_nMsgTime >= TIMER_INTERVAL / 2, @@ -32,13 +51,39 @@ WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) s_nMsgTime = GetMessageTime(); ok(s_nMsgTime != 0, "message time was zero.\n"); s_nCount++; - if (s_nCount >= 5) + if (s_nCount == 5) { - KillTimer(hwnd, TIMER_ID); - DestroyWindow(hwnd); + mouse_event(MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE, + MOUSE_LOCATION_X(WIN_X + WIN_CX / 2), + MOUSE_LOCATION_Y(WIN_Y + WIN_CY / 2), + 0, 0); + mouse_event(MOUSEEVENTF_MOVE, 1, 1, 0, 0); + mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0); + mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); } break; + case WM_MOUSEMOVE: + trace("WM_MOUSEMOVE\n"); + ok_int(s_nCount, 5); + ok(GetMessageTime() - s_nMsgTime < TIMER_INTERVAL, "message time is wrong.\n"); + s_bReach_WM_MOUSEMOVE = TRUE; + break; + case WM_LBUTTONDOWN: + trace("WM_LBUTTONDOWN\n"); + ok_int(s_nCount, 5); + ok(GetMessageTime() - s_nMsgTime < TIMER_INTERVAL, "message time is wrong.\n"); + s_bReach_WM_LBUTTONDOWN = TRUE; + break; + case WM_LBUTTONUP: + trace("WM_LBUTTONUP\n"); + ok_int(s_nCount, 5); + ok(GetMessageTime() - s_nMsgTime < TIMER_INTERVAL, "message time is wrong.\n"); + s_bReach_WM_LBUTTONUP = TRUE; + break; case WM_DESTROY: + ok_int(s_bReach_WM_MOUSEMOVE, TRUE); + ok_int(s_bReach_WM_LBUTTONDOWN, TRUE); + ok_int(s_bReach_WM_LBUTTONUP, TRUE); PostQuitMessage(0); break; default: @@ -47,7 +92,7 @@ WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return 0; } -START_TEST(MessageTime) +START_TEST(GetMessageTime) { static const WCHAR s_szName[] = L"MessageTimeTestWindow"; WNDCLASSW wc; @@ -56,6 +101,10 @@ START_TEST(MessageTime) MSG msg; BOOL bRet; + mouse_event(MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE, + MOUSE_LOCATION_X(1), MOUSE_LOCATION_Y(1), + 0, 0); + ZeroMemory(&wc, sizeof(wc)); wc.lpfnWndProc = WindowProc; wc.hInstance = GetModuleHandleW(NULL); @@ -68,8 +117,7 @@ START_TEST(MessageTime) hwnd = CreateWindowW(s_szName, s_szName, WS_OVERLAPPEDWINDOW, - CW_USEDEFAULT, 0, - CW_USEDEFAULT, 0, + WIN_X, WIN_Y, WIN_CX, WIN_CY, NULL, NULL, GetModuleHandleW(NULL), NULL); ok(hwnd != NULL, "CreateWindowW\n"); diff --git a/modules/rostests/apitests/user32/testlist.c b/modules/rostests/apitests/user32/testlist.c index d7f06b134c..0fe6488a9e 100644 --- a/modules/rostests/apitests/user32/testlist.c +++ b/modules/rostests/apitests/user32/testlist.c @@ -17,6 +17,7 @@ extern void func_EnumDisplaySettings(void); extern void func_GetDCEx(void); extern void func_GetIconInfo(void); extern void func_GetKeyState(void); +extern void func_GetMessageTime(void); extern void func_GetPeekMessage(void); extern void func_GetSystemMetrics(void); extern void func_GetUserObjectInformation(void); @@ -24,7 +25,6 @@ extern void func_GetWindowPlacement(void); extern void func_InitializeLpkHooks(void); extern void func_LoadImage(void); extern void func_LookupIconIdFromDirectoryEx(void); -extern void func_MessageTime(void); extern void func_NextDlgItem(void); extern void func_PrivateExtractIcons(void); extern void func_RealGetWindowClass(void); @@ -62,6 +62,7 @@ const struct test winetest_testlist[] = { "GetDCEx", func_GetDCEx }, { "GetIconInfo", func_GetIconInfo }, { "GetKeyState", func_GetKeyState }, + { "GetMessageTime", func_GetMessageTime }, { "GetPeekMessage", func_GetPeekMessage }, { "GetSystemMetrics", func_GetSystemMetrics }, { "GetUserObjectInformation", func_GetUserObjectInformation }, @@ -69,7 +70,6 @@ const struct test winetest_testlist[] = { "InitializeLpkHooks", func_InitializeLpkHooks }, { "LoadImage", func_LoadImage }, { "LookupIconIdFromDirectoryEx", func_LookupIconIdFromDirectoryEx }, - { "MessageTime", func_MessageTime }, { "NextDlgItem", func_NextDlgItem }, { "PrivateExtractIcons", func_PrivateExtractIcons }, { "RealGetWindowClass", func_RealGetWindowClass },
5 years, 9 months
1
0
0
0
[reactos] 02/02: [WIN32SS][NTUSER] Fix PostTimeMessage message time
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=87bfbb3ec7a22d809f911…
commit 87bfbb3ec7a22d809f9116b848ea090c5c6fe104 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed Jan 16 21:12:59 2019 +0900 Commit: Giannis Adamopoulos <gadamopoulos(a)reactos.org> CommitDate: Wed Jan 16 22:59:36 2019 +0200 [WIN32SS][NTUSER] Fix PostTimeMessage message time --- win32ss/user/ntuser/timer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/win32ss/user/ntuser/timer.c b/win32ss/user/ntuser/timer.c index 49ee063fe1..fc348eeba1 100644 --- a/win32ss/user/ntuser/timer.c +++ b/win32ss/user/ntuser/timer.c @@ -399,6 +399,7 @@ PostTimerMessages(PWND Window) PTHREADINFO pti; BOOL Hit = FALSE; PTIMER pTmr; + LARGE_INTEGER TickCount; pti = PsGetCurrentThreadWin32Thread(); @@ -411,10 +412,13 @@ PostTimerMessages(PWND Window) (pTmr->pti == pti) && ((pTmr->pWnd == Window) || (Window == NULL)) ) { + KeQueryTickCount(&TickCount); + Msg.hwnd = (pTmr->pWnd) ? pTmr->pWnd->head.h : 0; Msg.message = (pTmr->flags & TMRF_SYSTEM) ? WM_SYSTIMER : WM_TIMER; Msg.wParam = (WPARAM) pTmr->nID; Msg.lParam = (LPARAM) pTmr->pfn; + Msg.time = MsqCalculateMessageTime(&TickCount); // Fix all wine win:test_GetMessagePos WM_TIMER tests. See CORE-10867. Msg.pt = gpsi->ptCursor;
5 years, 9 months
1
0
0
0
[reactos] 01/02: [USER32_APITEST] Add tests for GetMessageTime
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=249d55f4a05cd6ffd8764…
commit 249d55f4a05cd6ffd87641ddb6dc52b948834285 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed Jan 16 15:37:14 2019 +0200 Commit: Giannis Adamopoulos <gadamopoulos(a)reactos.org> CommitDate: Wed Jan 16 22:59:35 2019 +0200 [USER32_APITEST] Add tests for GetMessageTime --- modules/rostests/apitests/user32/CMakeLists.txt | 1 + modules/rostests/apitests/user32/MessageTime.c | 97 +++++++++++++++++++++++++ modules/rostests/apitests/user32/testlist.c | 2 + 3 files changed, 100 insertions(+) diff --git a/modules/rostests/apitests/user32/CMakeLists.txt b/modules/rostests/apitests/user32/CMakeLists.txt index 87a257ec81..6ff84272f5 100644 --- a/modules/rostests/apitests/user32/CMakeLists.txt +++ b/modules/rostests/apitests/user32/CMakeLists.txt @@ -22,6 +22,7 @@ list(APPEND SOURCE InitializeLpkHooks.c LoadImage.c LookupIconIdFromDirectoryEx.c + MessageTime.c NextDlgItem.c PrivateExtractIcons.c RealGetWindowClass.c diff --git a/modules/rostests/apitests/user32/MessageTime.c b/modules/rostests/apitests/user32/MessageTime.c new file mode 100644 index 0000000000..ba3a600db1 --- /dev/null +++ b/modules/rostests/apitests/user32/MessageTime.c @@ -0,0 +1,97 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: GPL - See COPYING in the top level directory + * PURPOSE: Test for message times + * PROGRAMMERS: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> + */ + +#include "precomp.h" + +#define TIMER_ID 999 +#define TIMER_INTERVAL 500 /* 500 milliseconds */ + +static INT s_nCount = 0; +static LONG s_nMsgTime = 0; + +static LRESULT CALLBACK +WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + switch (uMsg) + { + case WM_CREATE: + s_nCount = 0; + s_nMsgTime = GetMessageTime(); + SetTimer(hwnd, TIMER_ID, TIMER_INTERVAL, NULL); + break; + case WM_TIMER: + if (s_nCount != 0) + { + ok(GetMessageTime() - s_nMsgTime >= TIMER_INTERVAL / 2, + "message time is wrong\n"); + } + s_nMsgTime = GetMessageTime(); + ok(s_nMsgTime != 0, "message time was zero.\n"); + s_nCount++; + if (s_nCount >= 5) + { + KillTimer(hwnd, TIMER_ID); + DestroyWindow(hwnd); + } + break; + case WM_DESTROY: + PostQuitMessage(0); + break; + default: + return DefWindowProcW(hwnd, uMsg, wParam, lParam); + } + return 0; +} + +START_TEST(MessageTime) +{ + static const WCHAR s_szName[] = L"MessageTimeTestWindow"; + WNDCLASSW wc; + ATOM atom; + HWND hwnd; + MSG msg; + BOOL bRet; + + ZeroMemory(&wc, sizeof(wc)); + wc.lpfnWndProc = WindowProc; + wc.hInstance = GetModuleHandleW(NULL); + wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); + wc.hCursor = LoadCursor(NULL, IDC_ARROW); + wc.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1); + wc.lpszClassName = s_szName; + atom = RegisterClassW(&wc); + ok(atom != 0, "RegisterClassW\n"); + + hwnd = CreateWindowW(s_szName, s_szName, + WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, 0, + CW_USEDEFAULT, 0, + NULL, NULL, GetModuleHandleW(NULL), NULL); + ok(hwnd != NULL, "CreateWindowW\n"); + + if (hwnd) + { + ShowWindow(hwnd, SW_SHOWNORMAL); + UpdateWindow(hwnd); + + while (GetMessageW(&msg, NULL, 0, 0)) + { + TranslateMessage(&msg); + DispatchMessageW(&msg); + } + } + else + { + skip("hwnd was NULL.\n"); + } + + bRet = UnregisterClassW(s_szName, GetModuleHandleW(NULL)); + ok_int(bRet, 1); + + ok_int(s_nCount, 5); + ok(s_nMsgTime != 0, "message time was zero.\n"); +} diff --git a/modules/rostests/apitests/user32/testlist.c b/modules/rostests/apitests/user32/testlist.c index c72a48ff81..d7f06b134c 100644 --- a/modules/rostests/apitests/user32/testlist.c +++ b/modules/rostests/apitests/user32/testlist.c @@ -24,6 +24,7 @@ extern void func_GetWindowPlacement(void); extern void func_InitializeLpkHooks(void); extern void func_LoadImage(void); extern void func_LookupIconIdFromDirectoryEx(void); +extern void func_MessageTime(void); extern void func_NextDlgItem(void); extern void func_PrivateExtractIcons(void); extern void func_RealGetWindowClass(void); @@ -68,6 +69,7 @@ const struct test winetest_testlist[] = { "InitializeLpkHooks", func_InitializeLpkHooks }, { "LoadImage", func_LoadImage }, { "LookupIconIdFromDirectoryEx", func_LookupIconIdFromDirectoryEx }, + { "MessageTime", func_MessageTime }, { "NextDlgItem", func_NextDlgItem }, { "PrivateExtractIcons", func_PrivateExtractIcons }, { "RealGetWindowClass", func_RealGetWindowClass },
5 years, 9 months
1
0
0
0
← Newer
1
...
15
16
17
18
19
20
21
...
30
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Results per page:
10
25
50
100
200