Compare commits

..

365 Commits

Author SHA1 Message Date
kaetemi 440e062fb0 Merge branch 'develop' into feature/opengl3 4 years ago
kaetemi 15880d8d60 Merge remote-tracking branch 'origin/develop' into feature/opengl3 5 years ago
kaetemi 341e6b7173 Merge branch 'feature/post-code-move' into feature/opengl3 5 years ago
kaetemi c065ce5919 Merge branch 'feature/pre-code-move' into feature/opengl3 5 years ago
kaetemi a537e8c8a8 Merge branch 'develop' into feature/opengl3 5 years ago
kaetemi bbecb833b3 Merge with develop
--HG--
branch : opengl3
9 years ago
kaetemi 35d1e1e9d5 Add input lag reduction test
--HG--
branch : opengl3
10 years ago
kaetemi 4fd44d89a9 Design comments
--HG--
branch : opengl3
10 years ago
kaetemi aab0e3b0d4 Use unsynchronized triple buffering for volatile vertex buffers
--HG--
branch : opengl3
10 years ago
kaetemi 25994fd86b Detect in-flight buffers caused by asynchronous frame rendering
--HG--
branch : opengl3
10 years ago
kaetemi 6ba039c329 Add fence functions
--HG--
branch : opengl3
10 years ago
kaetemi 94bd3b66bb Merge with develop
--HG--
branch : opengl3
10 years ago
kaetemi 66b94d93bf Align total ubo size
--HG--
branch : opengl3
10 years ago
kaetemi 22f6ba78ac Add some debugging
--HG--
branch : opengl3
10 years ago
kaetemi 52214f221d Naming conventions adjustment
--HG--
branch : opengl3
10 years ago
kaetemi 4f5f779a92 Correct vec2
--HG--
branch : opengl3
10 years ago
kaetemi 6ea037e48d Add initial uniform buffer code
--HG--
branch : opengl3
10 years ago
kaetemi 660e72e756 Add hash specialization for uniform buffer format
--HG--
branch : opengl3
10 years ago
kaetemi be428c4901 Generate hash of uniform buffer format on the fly
--HG--
branch : opengl3
10 years ago
kaetemi 9e00340a0d Remove some debug
--HG--
branch : opengl3
10 years ago
kaetemi 65a2f9dad7 Move uniform buffer format builder to NL3D
--HG--
branch : opengl3
10 years ago
kaetemi 5ef419bce3 Test uniform buffer format
--HG--
branch : opengl3
10 years ago
kaetemi 8bdb4e577b Add glsl generation code for uniform buffer format
--HG--
branch : opengl3
10 years ago
kaetemi 631d91b40a Add test for uniform buffer format
--HG--
branch : opengl3
10 years ago
kaetemi 642ae4208e Uniform buffer format building
--HG--
branch : opengl3
10 years ago
kaetemi a2f5ed0037 Don't apply fog to alpha channel
--HG--
branch : opengl3
10 years ago
kaetemi 3a2f04bfb5 Apply matrix basis change transparently to projection instead of view
--HG--
branch : opengl3
10 years ago
kaetemi 5b59e6ba95 Add some initial uniform buffer related code
--HG--
branch : opengl3
10 years ago
kaetemi 916683ed2a Always use namespace for driver
--HG--
branch : opengl3
10 years ago
kaetemi 018417437e Adjust builtin shader program hash
--HG--
branch : opengl3
10 years ago
kaetemi 0299519116 Use hashes for shader program lookup
--HG--
branch : opengl3
10 years ago
kaetemi f1f2e6fa1d Merge with develop
--HG--
branch : opengl3
10 years ago
kaetemi ee98cf6709 Merge with develop
--HG--
branch : opengl3
10 years ago
kaetemi 161086bd56 Merge changes from OpenGL driver into OpenGL3 driver
--HG--
branch : opengl3
10 years ago
kaetemi 3db0105185 Merge with develop
--HG--
branch : opengl3
10 years ago
kaetemi 66126429c2 GL3: Temp bugfix
--HG--
branch : opengl3
11 years ago
kaetemi 6a207ffd76 Backed out changeset: 97ebe9c61936
--HG--
branch : opengl3
11 years ago
kaetemi c9e8fb94c8 Backed out changeset: 8fd9b4f9a6b2
--HG--
branch : opengl3
11 years ago
kaetemi 55aae0d138 Without sync but memory intensive, performance gain vs regular stream buffer only minimal
--HG--
branch : opengl3
11 years ago
kaetemi 5bc87eeeed Backed out changeset: 70793b42008e
--HG--
branch : opengl3
11 years ago
kaetemi afea49e83d GL3: Manual syncing
--HG--
branch : opengl3
11 years ago
kaetemi 42936097ce GL3: Add experimental implementation for volatile buffers using pinned memory
--HG--
branch : opengl3
11 years ago
kaetemi aab353672c GL3: Debug
--HG--
branch : opengl3
11 years ago
kaetemi 50dea16ee7 GL3: Disable an assert
--HG--
branch : opengl3
11 years ago
kaetemi f860d46543 Merge with default
--HG--
branch : opengl3
11 years ago
kaetemi 0a9135a511 Add note
--HG--
branch : opengl3
11 years ago
kaetemi 1896876b11 Merge with default
--HG--
branch : opengl3
11 years ago
kaetemi b5b0ec45ca Adjust a memory preference
--HG--
branch : opengl3
11 years ago
kaetemi 85542abbfe GL3: Report correct location
--HG--
branch : opengl3
11 years ago
kaetemi 76cacae628 GL3: Add support for GL_AMD_pinned_memory
--HG--
branch : opengl3
11 years ago
kaetemi 60851a863e GL3: Cleanup
--HG--
branch : opengl3
11 years ago
kaetemi 636b93a7b5 GL3: Cleanup
--HG--
branch : opengl3
11 years ago
kaetemi 0543548272 GL3: Cleanup
--HG--
branch : opengl3
11 years ago
kaetemi 984b899287 GL3: Set slowUnlockVertexBufferHard to false
--HG--
branch : opengl3
11 years ago
kaetemi f3766f9c40 GL3: Implement RAMPreferred
--HG--
branch : opengl3
11 years ago
kaetemi fef2365b5d Merge with default
--HG--
branch : opengl3
11 years ago
kaetemi f799bdb650 GL3: Optimize volatile vertex buffers
--HG--
branch : opengl3
11 years ago
kaetemi 516a56acd8 GL3: Use GL_STREAM_DRAW for volatile buffers
--HG--
branch : opengl3
11 years ago
kaetemi b6ac857074 GL3: Refactor vertex buffers
--HG--
branch : opengl3
11 years ago
kaetemi 46ac4541f9 GL3: Rename
--HG--
branch : opengl3
11 years ago
kaetemi 9b48fb0c5a Change default for 'setStaticMemoryToVRAM'
--HG--
branch : opengl3
11 years ago
kaetemi 835e0846a1 Merge with default
--HG--
branch : opengl3
11 years ago
kaetemi 457f794584 Merge with default
--HG--
branch : opengl3
11 years ago
kaetemi a0796d23de GL3: Don't use expensive dynamic_cast
--HG--
branch : opengl3
11 years ago
kaetemi 96d4a17340 GL3: Render up to 31 lightmaps at once!
--HG--
branch : opengl3
11 years ago
kaetemi 5d542ed91e GL3: Increase number of usable samplers in program from 4 to 32
--HG--
branch : opengl3
11 years ago
kaetemi 393d08532a GL3: Alpha test bugfix
--HG--
branch : opengl3
11 years ago
kaetemi cda664c62a GL3: Bugfix
--HG--
branch : opengl3
11 years ago
kaetemi 181db9adb9 GL3: Initial lightmap shader implementation
--HG--
branch : opengl3
11 years ago
kaetemi 9df1935f5e GL3: Cleanup
--HG--
branch : opengl3
11 years ago
kaetemi a37d7a3127 GL3: Cleanup
--HG--
branch : opengl3
11 years ago
kaetemi 9dbdcd1d4e GL3: Cleanup
--HG--
branch : opengl3
11 years ago
kaetemi b372f203ec GL3: Bugfix
--HG--
branch : opengl3
11 years ago
kaetemi cb3f3b72c5 GL3: Cleanup
--HG--
branch : opengl3
11 years ago
kaetemi 07f663a68e GL3: Cleanup
--HG--
branch : opengl3
11 years ago
kaetemi 5a4dd538f1 GL3: Implement mapTextureStageToUV
--HG--
branch : opengl3
11 years ago
kaetemi 09db5b352c GL3: Bugfix
--HG--
branch : opengl3
11 years ago
kaetemi 007d8877b8 GL3: Remove invalid calls
--HG--
branch : opengl3
11 years ago
kaetemi f347172bbe GL3: Use compatibility instead of core, because core disables s3tc extension...
--HG--
branch : opengl3
11 years ago
kaetemi 44102b2034 GL3: Use glClearBuffer
--HG--
branch : opengl3
11 years ago
kaetemi 7e565518ec GL3: Fix
--HG--
branch : opengl3
11 years ago
kaetemi 07269aea3e Backed out changeset: 455175ba6c2e
--HG--
branch : opengl3
11 years ago
kaetemi ec190696ad GL3: Unlit material color
--HG--
branch : opengl3
11 years ago
kaetemi 4913e7dc94 GL3: Primary and secondary color vertex attributes
--HG--
branch : opengl3
11 years ago
kaetemi 4b4ac31a3d Remove branch unrelated features (must backout this changeset after merging into parent feature branch)
--HG--
branch : opengl3
11 years ago
kaetemi 267e7397c5 GL3: Support specular materials with missing textures
--HG--
branch : opengl3
11 years ago
kaetemi cfe1b2b8da GL3: Don't call virtual getters for accessing internal data, please
--HG--
branch : opengl3
11 years ago
kaetemi 6d946081e3 GL3: Fix typo
--HG--
branch : opengl3
11 years ago
kaetemi 25cb297dcf GL3: Fix for texture formats
--HG--
branch : opengl3
11 years ago
kaetemi d415ff508e Backed out changeset: 96647f9b388a
--HG--
branch : opengl3
11 years ago
kaetemi 725ec35188 GL3: Use core profile texture formats
--HG--
branch : opengl3
11 years ago
kaetemi d421f34c1a GL3: Remove dead code
--HG--
branch : opengl3
11 years ago
kaetemi 9cf5b3305c GL3: Create 3.3 core profile context
--HG--
branch : opengl3
11 years ago
kaetemi 11e871c8ab GL3: Remove dead code
--HG--
branch : opengl3
11 years ago
kaetemi a17fc28955 GL3: Cleanup
--HG--
branch : opengl3
11 years ago
kaetemi f7d0b292f7 GL3: Cleanup
--HG--
branch : opengl3
11 years ago
kaetemi 75d2bf91bf GL3: Even more refactoring
--HG--
branch : opengl3
11 years ago
kaetemi 17b3fa7b55 GL3: More refactoring
--HG--
branch : opengl3
11 years ago
kaetemi 5002eea62a GL3: Further refactor
--HG--
branch : opengl3
11 years ago
kaetemi a13d39e9f4 GL3: Begin refactoring pixel program
--HG--
branch : opengl3
11 years ago
kaetemi 270342a07d GL3: Specular related
--HG--
branch : opengl3
11 years ago
kaetemi 2aa36f413d GL3: Prepare TexGen implementation
--HG--
branch : opengl3
11 years ago
kaetemi 8532f79833 GL3: Remove dead code
--HG--
branch : opengl3
11 years ago
kaetemi 62381dd219 GL3: Cleanup dead code
--HG--
branch : opengl3
11 years ago
kaetemi 1a40e67fee GL3: Remove dead code
--HG--
branch : opengl3
11 years ago
kaetemi 11dc9110c2 GL3: Remove dead code
--HG--
branch : opengl3
11 years ago
kaetemi c0bb40b4a5 GL3: Fix tex coord (fixes landscape near rendering)
--HG--
branch : opengl3
11 years ago
kaetemi c270ec5a58 GL3: Remove dead code
--HG--
branch : opengl3
11 years ago
kaetemi 12cb0ac306 GL3: Fix
--HG--
branch : opengl3
11 years ago
kaetemi 78ec40afa7 GL3: Rewrite generateTexEnv
--HG--
branch : opengl3
11 years ago
kaetemi f62228592e GL3: Cleanup samplers
--HG--
branch : opengl3
11 years ago
kaetemi 7691e22a28 GL3: Fix ambient
--HG--
branch : opengl3
11 years ago
kaetemi 75e650432f GL3: Cleanup and fix lighting state bug in pp
--HG--
branch : opengl3
11 years ago
kaetemi d5d82ce900 GL3: Fix
--HG--
branch : opengl3
11 years ago
kaetemi 443eb54128 GL3: Note
--HG--
branch : opengl3
11 years ago
kaetemi 21eca5af5f GL3: Optimize
--HG--
branch : opengl3
11 years ago
kaetemi 424aa079a2 GL3: Cleanup
--HG--
branch : opengl3
11 years ago
kaetemi b25747b2ef GL3: Optimize VP switching
--HG--
branch : opengl3
11 years ago
kaetemi 5d80073c0f GL3: Refactoring vertex program generation
--HG--
branch : opengl3
11 years ago
kaetemi 7a960ed768 GL3: Cleanup user program state
--HG--
branch : opengl3
11 years ago
kaetemi 3885389b3b GL3: Remove GL_LIGHTING
--HG--
branch : opengl3
11 years ago
kaetemi 641125963e GL3: Replace glActiveTexture
--HG--
branch : opengl3
11 years ago
kaetemi 7ae15eb2b8 GL3: Remove ARB_multitexture
--HG--
branch : opengl3
11 years ago
kaetemi 89c83f86e5 GL3: Remove GL_EXT_blend_color and GL_EXT_secondary_color
--HG--
branch : opengl3
11 years ago
kaetemi 4fe91132ce GL3: Remove GL_ARB_multisample
--HG--
branch : opengl3
11 years ago
kaetemi 5ad62b942a GL3: Remove GL_MAX_TEXTURE_UNITS_ARB
--HG--
branch : opengl3
11 years ago
kaetemi 9c1165dcf9 GL3: Remove GL_MAX_LIGHTS
--HG--
branch : opengl3
11 years ago
kaetemi 8a60e5d4fa GL3: Remove checkForPerPixelLightingSupport
--HG--
branch : opengl3
11 years ago
kaetemi 313de47e53 GL3: Remove GL_ARB_texture_rectangle
--HG--
branch : opengl3
11 years ago
kaetemi 0802330985 GL3: Remove GL_ARB_texture_cube_map
--HG--
branch : opengl3
11 years ago
kaetemi 441d3a66f5 GL3: Remove GL_EXT_separate_specular_color
--HG--
branch : opengl3
11 years ago
kaetemi fce7aab22c GL3: Remove GL_EXT_vertex_weighting
--HG--
branch : opengl3
11 years ago
kaetemi d7c5d30523 GL3: Remove GL_ARB_texture_non_power_of_two
--HG--
branch : opengl3
11 years ago
kaetemi 79141e0a9c GL3: Remove GL_ARB_texture_compression
--HG--
branch : opengl3
11 years ago
kaetemi 3c1b39e103 GL3: Remove unused variable
--HG--
branch : opengl3
11 years ago
kaetemi 3bba0fad6c GL3: Remove GL_EXT_framebuffer_object
--HG--
branch : opengl3
11 years ago
kaetemi 40a6972753 GL3: Remove GL_ATI_texture_env_combine3 and GL_ATIX_texture_env_route
--HG--
branch : opengl3
11 years ago
kaetemi 118d6e0966 GL3: Remove GL_NV_occlusion_query
--HG--
branch : opengl3
11 years ago
kaetemi 2139f39c43 GL3: Remove GL_EXT_texture_env_combine
--HG--
branch : opengl3
11 years ago
kaetemi b978ec5c8e Cleanup extensions
--HG--
branch : opengl3
11 years ago
kaetemi b12c15ab5d Follow existing code style
--HG--
branch : opengl3
11 years ago
kaetemi 99f37eb90c Cleanup style
--HG--
branch : opengl3
11 years ago
kaetemi be050f3927 Cleanup
--HG--
branch : opengl3
11 years ago
kaetemi e01a42e21f Fix shader compile
--HG--
branch : opengl3
11 years ago
kaetemi 082504bc70 Workaround for shader bug
--HG--
branch : opengl3
11 years ago
kaetemi 444d652435 More logging
--HG--
branch : opengl3
11 years ago
kaetemi 41f77780d5 Functions texture2D and textureCube are deprecated
--HG--
branch : opengl3
11 years ago
kaetemi 870df89bcd Remove unnecessary assert
--HG--
branch : opengl3
11 years ago
kaetemi df1e27b82c Fix shader compile on nv driver
--HG--
branch : opengl3
11 years ago
kaetemi cc32c24f23 Revert branch unrelated change
--HG--
branch : opengl3
11 years ago
kaetemi fe967a6a12 Revert branch unrelated change
--HG--
branch : opengl3
11 years ago
kaetemi d7a0816547 Merge with default
--HG--
branch : opengl3
11 years ago
kaetemi 3738aa71ce Fix EOL
--HG--
branch : opengl3
11 years ago
dfighter1985 2ca40f10eb Merging default.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 681a0bc8f3 Don't generate and cache shaders if they are set up from outside of the driver.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 43ad0189c6 Set up the shader programs in setupMaterial call.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 709c54e485 Fixed a GLSL syntax bug that I introduced into the shader generator in December. Specular material will now longer disappear.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 3a84270a84 Textures with DSDT/DUDV format will now be uploaded as RG8. Ryzom will now not crash while entering world.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 fb38a7a0a7 Disable lights when the material isn't lighted.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 2a158e76e1 Lights should now be turned off even when enableLightInternal is called directly. This also fixes the dark background on the character selection screen.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 9c69e1bf84 Material colors ( ambient, diffuse, specular ) should now be used when there's no texture available.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 a119d3e1a0 Use the view matrix instead of modelview to transform the light stuff.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 8f2e75415c Set up the normalmatrix in the driver and feed it to the shaders, instead of calculating it in the shaders.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 9c0e1c2449 Tattos ( and other multitextured stuff ) will now show up again, even if there's only one texture coordinate set.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 7f7a3e159b Reverse directional light direction as it is done in the old OpenGL driver. Also normalize normal.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 90dc025fd8 Fixed: Some uniforms names were wrong after the merge, which led to rendering issues.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 eb9b3e4f0f Implemented light controls.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 1cc71457eb Implemented a basic fog control widget.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 ed885d3df6 Replaced ARB VertexAttribArray stuff with the core calls.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 d37b004372 Removed some more deprecated stuff.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 a9a9768872 Removed ARB fragment shader stuff.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 f768704cbf Removed some ATI stuff.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 6947a58ba1 Removed fixed embm stuff.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 8276cb0140 We shouldn't set up a generated or newly compiled shader program if we already have one ( set up from outside the driver for example ).
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 82a7237e7d Forgot to actually add the driver infos to the list, which caused the driver to hang on deletion.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 c105164eeb Getting rid of z-order assignment warning.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 982b99d8d0 Merged the GPU program stuff from mainline.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 3b16f096cc Merge with rename commit.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 32e814ecb6 Use separate shaders in the OpenGL3 driver.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 b70ce1eb09 Renamed OpenGL3 to opengl3
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 ace1b5386b Check GL_ARB_separate_shader_objects extension on startup, and load related functions.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 cf6d2a88bc Removed some now unused methods.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 afb56ea660 Moved the rendering methods into a new file.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 b0613e334c Removed a now unused file.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 9d3e3a6a73 GL_VERTEX_PROGRAM_TWO_SIDED_ARB isn't used in the GL3 driver.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 7b5aaf7e0f Some cleanup, most of the old OpenGL stuff should be gone.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 5326324b56 Some comments.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 69a4a9f9a5 Two sided rendering, while using dynmat.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 390d1bb156 Don't call newMaterial() every time we load a (sub)material.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 dbd5185de1 Only use the shader combo box for the user shaders.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 586c25f864 When clearing the dynmat, should clear all of them. Also fixes a crash.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 3949c210f6 OpenGL should be fed a clamped color value.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 76204a844d When changing a shader in the editor, reload it in the driver too.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 b775237215 It's now possible to render using the user shaders and dynmat.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 c3c3f154b1 Instead of auto-generating the dynmaterial added a menu item in the material editor that will trigger it if needed.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 8269ec7be5 Wrong direction, wrong lighting!
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 11fe86e552 Forgot to actually pass the direction in the previous commit...
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 72e7d09113 Don't calculate these more than once.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 69c41a31ae These positions and directions were supposed to be in eye coords.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 0453f30582 Added lighting to the specular shader.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 f194704a28 Refactored directional lighting a little. No need to calculate things more than once.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 0ab68ef25f Added point light support.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 9a647a893c Specular shader should compile even when there's no fog added.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 2e4b6bb6ae Don't try to edit stock shaders.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 a9a1d17c4f Added the stock shader names to the material editor, so it will now be able to select them when loading a shape.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 1d71a540ba Apparently QColor::set[color]f takes colors as floats clamped to the [0,1] range.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 c6bb6ec2a9 Renamed a bunch of shader related classes in NL3D to contain the word Usr, since they are user shader related.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 6c58856ed7 Shininess is now loaded from the material as a uniform instead of being hardcoded.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 4ba9d815d4 Colors are now set from the light setup, rather than being hardcoded.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 6f396aa8f7 Added the directional light(s) to the lightmap shader too.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 01ef7fd973 The specular calculation is probably faster this way.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 4ec92d2f06 Simplified the directional light shader generator functions.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 28c4b5b157 Added specular term to the directional lights.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 354d2b8c65 Added ambient term support for directional light.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 43817746ec Renamed light[n]Col to light[n]ColDiff.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 0def5caf54 Added diffuse directional light support to the normal shader.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 3c99323ada Apparently typos and redundantly setting uniforms can totally ruin rendering :D
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 5fbfe7b17f Since now we have fog support, this doesn't need to be disabled anymore.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 8d57eac3d4 Some basic fog.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 c6b714299a Instead of their own bool, store enabled features in the features variable as a flag.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 bbb4762b77 Move shader description generation to it's own method.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 06d7bd9c74 Added alpha test to generated shaders.
--HG--
branch : gsoc2013-dfighter
11 years ago
dfighter1985 d6558b5b0d Fixed some typos with shader generation.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 37c8b096b1 Added OpenGL3 as a driver option to the configuration tool.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 300cd284d1 Generate samplers for Lightmap shader, based on the number of lightmaps. This fixes the weird display of some lightmapped shapes.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 36a30e83a0 Don't try to render if can't set program up.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 1acccdb5ef Uniform index caching.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 16290f7ff9 Merging default.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 882118612d Moved some constants to uniforms.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 77ae38e452 Added a very primitive shader caching scheme.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 931c18cb51 Diffuse texenv should work with the material color, not the diffuse color. Also modulate the texenv result with vertex color if applicable. Also add the shader type as comment in the top of the shader.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 34de0b5569 Removed renderTriangles2 as the normal render loop is used now.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 a1cf2c640b This too.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 35429fea43 Oups forgot this when changing the rendering loop.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 7307d748ea Sometimes shapes have 0 materials?!
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 14aea7acc9 Removed the debug triangle from the material editor plugin.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 eabc209303 Render from the normal loops.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 888812e72d Only validate the shader program after it's set up. Avoids false alarm.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 5bc7ecf799 Specular shader is now on GLSL.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 86482ed82f Fixed some shader compile errors.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 ed23ec247d Render lightmaps with GLSL.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 0ab6322955 More fixed functionality pipeline disabled with conditional build.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 997a231bff Conditionally build some deprecated functions. Also little adjustment to the shader texenv generator.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 c74e279282 Some settings for the normal shaded material.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 e740fd4aeb Don't crash when releasing.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 d67640dab6 Render with GLSL. Long way to go.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 169ee413df Redundant cloud shader code.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 f77bcf6981 Generate cloud shader.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 2c84b164ee Water shader generation.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 750e7b5e8e A little explanation after I successfully decyphered this.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 d64dd4f23f Generate shader for per-pixel without specular.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 6b3b8855ee Generate Per-Pixel Lighting shader.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 2ca79259ce More work on specular shader generation. Hopefully now it's right.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 1414f4d3c1 Little bit of refactoring.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 12df2fd71c Generate specular shader.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 69cc5e48ed Lightmap shader generator.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 f6737c8aa4 UserColor shader should use the normal generator.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 4f8ac17529 Implemented the mapping of TexEnv calls to GLSL. More or less.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 c49265b9db The stringstream used is now part of the generator class.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 7384cdd10a Added offset enum.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 0dcb470a19 Generate the pixel shader ins too.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 46363f1909 Started working on the shader generator.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 d67198580a Implemented uniform querying, setting. Also updated the test triangle.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 3ca6a98aec Made the triangle debug program a bit more complicated, now using interpolated color.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 9dc91a6ed1 Abstract program objects, vertex, and pixel programs can now be created using the driver, so the user can now feed shaders to it.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 41e84066fb Better store vertex and pixel programs separately so we can detach them if needed.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 f5358f712c Rendering the debug triangle with GLSL now works.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 b3ea9ee787 Implemented shader and program object classes.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 ed5741addd Added stubs for GLSL program classes.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 f387256984 Added triangle drawing for debug purposes.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 c7e8ebcf05 Added some more GLSL related calls.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 50bb8c5d60 Made some GLSL related OpenGL functions available.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 10aad932db Removed checks for ARB fragment shader, as it's part of OpenGL as of 3.0+, also fragment shaders cannot be disabled as of the same version.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 dd0a691fb8 This also belongs there.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 90595b5bb6 Removed NV Texture env combine stuff.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 3aae79c38b Removed NV Texture Shader related stuff.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 6fba0c094a Merging default
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 c90f51afbe Look for OpenGL 3.3 not 1.2 on startup.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 82d29b3e23 In OpenGL 3+ we cannot disable HW VBO since it's mandatory, also Vertex Programs are mandatory too, so they must be abailable. No need to check for them!
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 a81db21e0a Removed lots of EXT Vertex Shader related code.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 932f2bdd27 Removed lots of Nvidia shader related code.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 f925666d83 Manage the texture matrices too.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 b1777ff546 Projection matrix is now generated and managed by Nel and only loaded into OpenGL when dirty.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 f34f4d10d3 While I'm at it, I've renamed the VBO parameters too for the same reason.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 15b4be874e Removed the ARB keyword from the VBO managing GL functions, as they are part of the core specification as of OpenGL 3.3
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 31451aa0f6 Removed the ARB word from the names of CVertexArrayRangeARB and CVertexBufferHardARB.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 cfc4565b5d Removed more stuff that's no longer neccessary now that we only work with VBO.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 6360302a2b Use VBO only.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 bb6195f858 Always prefer VBOs as OpenGL core requires the use of VBOs.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 ee2c14670e It's a good idea to actually use the VBO if we spent this time cleaning up the implementations :D
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 44188b58b7 We only have 1 kind of HW VBO left.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 0d98540f2e Ryzom checks for 0 allocated AGP/Video RAM, so lie max. here instead of saying 0.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 adab29e5a6 There's no need for *this* dummy VB either.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 5e69d558ec Since we use HW VBO, we don't need to actually check for it.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 b444f69db3 VertexArrayRange allocation thing is pointless when using ARB VBOs since, the driver takes care about allocating to either system RAM or video RAM.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 e41a15ae30 Allow Ryzom client to use the new driver.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 d06f675c08 Removed more of the vendor specific VBO stuff ( function definitions for example )
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 28c49a0427 These friends and the function are now pointless.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 5c7540d85e Removed vendor specific VBO code.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 8f45e49fa0 GL3 driver can now be instantiated.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 7f0ae42a40 Finally finished cleaning the OpenGL ES stuff.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 e44b663bdb Even more OpenGL ES cleanup.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 2b5eddbe95 More OpenGL ES cleanup.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 879f2f3a85 More GLES stuff removed.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 40da205b59 Removed some GLES related code.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 296083ba61 First batch of renames.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 d5e5775f29 "Forked" the OpenGL driver.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 dddd531249 Moved back the unix event emitter to the OpenGL driver. It was a bad idea to move it out ( this way ) originally.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 1c0d74fc00 Unix build fixes.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 dcf3ba2785 Move unix event emitter out of the driver, to NL3D.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 0c64261e22 The 3dsmax exporter will now use the material file specified in the Nel material.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 f94960dffe Added the Nel material file selection possibility to the Nel material 3dsmax startup script.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 3ff8613205 Merging default.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 7a9ae41fd5 Missing a letter e here
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 ac98c00088 The prototype of the material exporter. It's only called when exporting a mesh, for now.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 80bcf2026a If dynamic material already exists, simply just reinitialize it.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 e99c1e2785 Clear the properties when clearing the scene, and also deactivate the buttons and comboboxes of the material widget.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 b776409cc8 More material properties are converted now.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 6ad18a88f5 Shouldn't reset the material properties, when editing them.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 37fb2cfcda Started work on converting the old material to new one. Some colors are already out. Also made some modifications to the editor so it can deal with it.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 fb3f069a38 Should be able to save QColor based QVariant too.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 c8147b301c Oups. Wrong copypaste of my own code.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 192e9c058a More work on the Variant type. Also modified material editor to use it.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 a113c81db3 Added a Variant type ( for holding variable type values ) to NLMISC
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 9306bd71e6 Added GUI code for multi/sub-material.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 c2296a2a93 It's not a terrible idea to remember the last used directory in the file open dialogs.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 04dcad32e7 Added support for adding basic primitives cube, sphere, cylinder, teapot.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 a2ccb7e796 The main window takes ownership of ViewPortWidget because of setCentralWidget, so no need to delete it here.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 6d31a50f5d I'll give up, I don't know why wheel events are not passed over to this widget as native events. Fortunately they are not needed, since the Nel style 3d mouse listener doesn't use them.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 42bf13dcfd Implemented shape moving/rotating/zooming. Used parts of Dnk's code from object viewer for setting the camera up properly. NOTE: for some reason the ViewPortWidget doesn't receive native mouse wheel events. An investigation is in order.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 66fb3c1284 Shapes can now be loaded and rendered to ViewPortWidget.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 8408ddd552 Added ViewPortWidget.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 96eb64ecbe Shader can now be set for the rendering pass, using the shader combo box in MaterialWidget.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 cc86cdd3ef ShaderEditorWidget will now load/save it's content.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 c9cd9cdd3c Shaders will now show up in the shader combobox of MaterialWidget.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 1f2ff5721e Shaders are now loaded/saved/deleted from the disk.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 00b47d6a50 Implemented the Shader widget, more or less.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 128c2a3270 Changed the Shader widget a little.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 a57bb57c58 Missed these.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 a71e4bc3ed Added some Shader related classes. They are not yet complete.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 6d79a2cf6f Use the color editor for color properties. Also don't crash if property type is not supported by the property browser.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 2e6b1a834f We don't want duplicate property names and labels either.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 9294cdc644 We don't want duplicate passes.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 ea06a2c656 Property values can now be changed.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 9ee24b3b93 Property browser will now show the properties.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 ed267a6587 Probably we don't want the default first pass to be stuck with us if we're loading a material.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 fa3ad050de It's not a bad idea to always have at least 1 pass.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 d96b7e2d66 Added a new class, MaterialSpliter, it holds the Material widget, and the Material properties Qt property tree widget, and acts as a proxy / message router for them.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 c9605dde57 Little bit of refactoring.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 832178a83f Adding / Removing properties will now work.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 94fe455a1a Material widget now retrieves the passes when loading a material.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 067676c049 Changing passes should now show up on the material widget too!
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 02e61b1e1b Implemented the functionality of the Render Passes widget.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 30f8c9f9e1 Added a Nel3D proxy class.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 8c35946010 Material properties widget is now linked to the right button.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 85e885f274 Worked a bit more on dynamic material. Also started to rework the material and pass widgets since I've realized I messed it up. Eg.: passes should have properties, not the material itself.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 26fab0c173 Forgot to add these to CMakeLists.txt
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 32071d9053 Added skeleton for CDynMaterial. This class will be the new material.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 40c95e82ff Changed the shader editor widget into a dialog. Implemented some of the button functions of Shader widget.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 abbc09e19c Added ShaderWidget, and restructured the material related menu items.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 d46944f258 More GUI skeleton work. Added Shader Editor widget.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 e87e265c42 Implemented some of the buttons of the GUI skeleton.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 5aec012c5f Added some more widget skeletons.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 ca52a76e5d Added the skeleton of the OVQT Material Editor plugin.
--HG--
branch : gsoc2013-dfighter
12 years ago
dfighter1985 8fa5067506 Created my GSOC2013 branch.
--HG--
branch : gsoc2013-dfighter
12 years ago

9
.gitignore vendored

@ -90,7 +90,6 @@ ylwrap
*.mk
# Visual Studio garbage
.vscode/
*.opensdf
UpgradeLog*.XML
_UpgradeReport_Files
@ -128,9 +127,6 @@ aes_state.txt
# intellij project folder
.idea/
# VSCode project folder
.vscode/
# Python cache
*.pyd
*.pyc
@ -163,9 +159,7 @@ build/*
build-2010/*
build/*
install/*
win-build/
build_*
install_*
nel/tools/build_gamedata/configuration/buildsite.py
# Linux nel compile
@ -248,9 +242,6 @@ external_stlport
nel_tools*
ryzom_tools*
#personal projects
personal/
# Dumps
*.dmp

@ -1,28 +1,27 @@
4eddbaff0c5e5d685db96ee3e8427aa0fd96ac83 ryzomcore/v0.8.0
00d9b6e29e95f56785fbf85abe60afd34674f402 ryzomcore/v0.9.0
79776c337176dd5b02e1a74fe5dfb703b91747aa ryzomcore/v0.9.1
fedf2aa443d09707beed814b0f499c6a5519cc84 ryzomcore/v0.10.0
edaa3624a56420b02ccc64c26059801a389927ee ryzomcore/v0.11.0
e3fe4855f22c3e75722e015dc33c091c340b3ad7 ryzomcore/v0.11.1
9e583b717fd63be0be9fd60b99087abf1691ea49 ryzomcore/v0.11.2
bfe5628e14a024ba7ea32e4b326ae433a07856b9 ryzomcore/v0.11.3
9a6120735daa97c96ac5d85ca35c7f21f607bd87 ryzomcore/v0.12.0
3e17907af67e8d66d80e6b714707bbf912607f2a ryzom-patch-3.0.0
153e0b605c9e0c83ba05b6428c62838b49cc84b2 ryzom-patch-3.0.1
9d41f2994d44b9aad92b83f945f114e4b6bed44a ryzom-patch-3.0.2
4300cc14aad098b1f86ea4c55577b7fa4a4cb5d2 ryzom-patch-3.1.0
d4060f217f4f834cc62a33f2f1ccdf3c28298066 ryzom-patch-3.1.0-hotfix
043aaeb3d8a2a54177581b57bda87a9deaad510e ryzom-patch-3.1.0-april_patch
4036ecf59e83960f03acebc2089eb2ff5eeaed0a ryzom-patch-3.2.0
18403bb9485da3d9742c6f007a16d5619ebfb196 ryzom-patch-3.2.1
822ff8f8917ad66e09e2c21c983282f6f693b9f6 ryzom-patch-3.3.0
00dde390a394fce9da06c2f3264140282158d39f ryzom-patch-3.3.0
dcd4c4d161ef775136e18c7e8f5072b75dede27e ryzom-patch-3.3.1
fc4be8ebec5ca754ef4453bc6a9faef90837c674 ryzom-patch-3.4.0
70eba02e8eab6920586dbabf74e9e8180c729980 ryzom-patch-3.4.0 Steam Fix
3941482843f9cd130cfc16634efc08d34a98ed35 ryzom-patch-3.4.0 Atysmas
ecae9feb4cceb78103e5d7236caccaf450796cdb ryzom-patch-3.5.0
95783afa226f241062134eb62f4323295d29ac84 ryzom-patch-3.5.0.9637
2102fb276eb69d49ed4923042215312a63c47c08 Live-746
8eb94c3549be898fdc4a7c6d791d2477bdc11a18 ryzomcore/v1.0.1
3e92c7104c20d6bc6c2147b4b5fc289e8621d322 ryzomcore/v1.0.0
4eddbaff0c5e5d685db96ee3e8427aa0fd96ac83 v0.8.0
00d9b6e29e95f56785fbf85abe60afd34674f402 v0.9.0
79776c337176dd5b02e1a74fe5dfb703b91747aa v0.9.1
fedf2aa443d09707beed814b0f499c6a5519cc84 v0.10.0
edaa3624a56420b02ccc64c26059801a389927ee v0.11.0
e3fe4855f22c3e75722e015dc33c091c340b3ad7 v0.11.1
9e583b717fd63be0be9fd60b99087abf1691ea49 v0.11.2
bfe5628e14a024ba7ea32e4b326ae433a07856b9 v0.11.3
9a6120735daa97c96ac5d85ca35c7f21f607bd87 v0.12.0
3e92c7104c20d6bc6c2147b4b5fc289e8621d322 v1.0.0
8eb94c3549be898fdc4a7c6d791d2477bdc11a18 v1.0.1
3e17907af67e8d66d80e6b714707bbf912607f2a ryzom/3.0.0
153e0b605c9e0c83ba05b6428c62838b49cc84b2 ryzom/3.0.1
9d41f2994d44b9aad92b83f945f114e4b6bed44a ryzom/3.0.2
4300cc14aad098b1f86ea4c55577b7fa4a4cb5d2 ryzom/3.1.0
d4060f217f4f834cc62a33f2f1ccdf3c28298066 ryzom/3.1.0-hotfix
043aaeb3d8a2a54177581b57bda87a9deaad510e ryzom/3.1.0-april_patch
4036ecf59e83960f03acebc2089eb2ff5eeaed0a ryzom/3.2.0
18403bb9485da3d9742c6f007a16d5619ebfb196 ryzom/3.2.1
822ff8f8917ad66e09e2c21c983282f6f693b9f6 ryzom/3.3.0
00dde390a394fce9da06c2f3264140282158d39f ryzom/3.3.0
dcd4c4d161ef775136e18c7e8f5072b75dede27e ryzom/3.3.1
fc4be8ebec5ca754ef4453bc6a9faef90837c674 ryzom/3.4.0
70eba02e8eab6920586dbabf74e9e8180c729980 ryzom/3.4.0-steam_fix
3941482843f9cd130cfc16634efc08d34a98ed35 ryzom/3.4.0-atysmas
ecae9feb4cceb78103e5d7236caccaf450796cdb ryzom/3.5.0
95783afa226f241062134eb62f4323295d29ac84 ryzom/3.5.0.9637

@ -34,37 +34,11 @@ IF(COMMAND cmake_policy)
ENDIF()
ENDIF()
#-----------------------------------------------------------------------------
# Downloads and install Hunger into HUNTER_ROOT directory.
OPTION(HUNTER_ENABLED "Enable Hunter package manager" OFF)
IF(HUNTER_ENABLED)
INCLUDE("CMakeModules/HunterGate.cmake")
HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.23.321.tar.gz"
SHA1 "5e53cbb0429037ea8e2592bfd92704b8ff3ab492"
FILEPATH "${CMAKE_CURRENT_LIST_DIR}/CMakeModules/HunterConfig.cmake"
)
# default options for hunterized build
SET(WITH_STATIC ON CACHE BOOL "static" FORCE)
SET(WITH_STATIC_DRIVERS ON CACHE BOOL "static drivers" FORCE)
SET(WITH_STATIC_CURL ON CACHE BOOL "static curl" FORCE)
SET(WITH_STATIC_LIBXML2 ON CACHE BOOL "static libxml2" FORCE)
SET(WITH_STATIC_EXTERNAL ON CACHE BOOL "static external" FORCE)
SET(WITH_EXTERNAL OFF CACHE BOOL "external libs" FORCE)
ENDIF()
#-----------------------------------------------------------------------------
INCLUDE(nel)
INCLUDE(ConfigureChecks)
INCLUDE(CheckDepends)
INCLUDE(${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL)
MESSAGE("EXTERNAL ${WITH_EXTERNAL}")
# Force out of source builds.
CHECK_OUT_OF_SOURCE()
@ -86,7 +60,7 @@ SET(YEAR "2001-${CURRENT_YEAR}")
SET(AUTHOR "Winch Gate and The Ryzom Core Community")
SET(RYZOM_VERSION_MAJOR 3)
SET(RYZOM_VERSION_MINOR 6)
SET(RYZOM_VERSION_MINOR 5)
SET(RYZOM_VERSION_PATCH 0)
#-----------------------------------------------------------------------------
@ -128,7 +102,6 @@ SET(RYZOM_CLIENT_CREATE_ACCOUNT_URL "https://open.ryzom.dev/ams/" CACHE STRING
SET(RYZOM_CLIENT_EDIT_ACCOUNT_URL "https://open.ryzom.dev/ams/" CACHE STRING "Ryzom Client Edit Account URL")
SET(RYZOM_CLIENT_FORGET_PASSWORD_URL "https://open.ryzom.dev/ams/" CACHE STRING "Ryzom Client Forget Password URL")
SET(RYZOM_CLIENT_PATCH_URL "https://cdn.ryzom.dev/open/patch/" CACHE STRING "Ryzom Client Patch URL")
SET(RYZOM_CLIENT_APP_NAME "default")
SET(RYZOM_WEBIG_MAIN_URL "https://open.ryzom.dev/" CACHE STRING "Ryzom Client WebIG Main URL")
SET(RYZOM_WEBIG_TRUSTED_DOMAIN "open.ryzom.dev" CACHE STRING "Ryzom Client WebIG Trusted Domain")
@ -137,11 +110,10 @@ SET(RYZOM_WEBIG_TRUSTED_DOMAIN "open.ryzom.dev" CACHE STRING "Ryzom Client
# urls when compiling ryzom live client
IF(WITH_RYZOM_LIVE)
MESSAGE("Using RYZOM_LIVE urls")
SET(RYZOM_CLIENT_CREATE_ACCOUNT_URL "https://me.ryzom.com")
SET(RYZOM_CLIENT_EDIT_ACCOUNT_URL "https://me.ryzom.com")
SET(RYZOM_CLIENT_FORGET_PASSWORD_URL "https://me.ryzom.com/?forget_password=1")
SET(RYZOM_CLIENT_CREATE_ACCOUNT_URL "https://account.ryzom.com/signup/from_client.php")
SET(RYZOM_CLIENT_EDIT_ACCOUNT_URL "https://account.ryzom.com/payment_profile/index.php")
SET(RYZOM_CLIENT_FORGET_PASSWORD_URL "https://account.ryzom.com/payment_profile/lost_secure_password.php")
SET(RYZOM_CLIENT_PATCH_URL "http://dl.ryzom.com/patch_live")
SET(RYZOM_CLIENT_APP_NAME "ryzom_live")
SET(RYZOM_WEBIG_MAIN_URL "https://app.ryzom.com/")
SET(RYZOM_WEBIG_TRUSTED_DOMAIN "app.ryzom.com")
@ -160,28 +132,6 @@ IF(WIN32)
ENDIF()
ENDIF()
IF(HUNTER_ENABLED)
## TODO: hack for freetype hunter package
SET(ON 1)
##
HUNTER_ADD_PACKAGE(ZLIB)
FIND_PACKAGE(ZLIB CONFIG REQUIRED)
SET(ZLIB_LIBRARY ZLIB::zlib)
HUNTER_ADD_PACKAGE(libxml2)
FIND_PACKAGE(libxml2 CONFIG REQUIRED)
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} libxml2::libxml2)
HUNTER_ADD_PACKAGE(OpenSSL)
FIND_PACKAGE(OpenSSL REQUIRED)
# TODO: is OpenSSL::Crypto only needed for WIN32?
SET(OPENSSL_LIBRARIES OpenSSL::SSL OpenSSL::Crypto)
# for precompiled headers, not needed if using TARGET_PRECOMPILE_HEADERS() from cmake 3.16+
SET(ZLIB_INCLUDE_DIR ZLIB_ROOT/include)
SET(LIBXML2_INCLUDE_DIR ${LIBXML2_ROOT}/include/libxml2)
ELSE()
FIND_PACKAGE(ZLIB REQUIRED)
FIND_PACKAGE(LibXml2 REQUIRED)
FIND_PACKAGE(PNG REQUIRED)
@ -192,7 +142,6 @@ FIND_PACKAGE(Jpeg)
IF(WIN32)
SET(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} Crypt32.lib)
ENDIF()
ENDIF() #hunter
IF(WITH_LIBOVR)
FIND_PACKAGE(LibOVR)
@ -226,20 +175,6 @@ IF(WITH_STATIC)
IF(LIBLZMA_LIBRARIES)
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${LIBLZMA_LIBRARIES})
ENDIF()
# under Linux and OS X, recent libxml2 versions are linked against libicu
# FIND_PACKAGE(Icu)
FIND_LIBRARY(ICU_LIBRARY icuuc)
IF(ICU_LIBRARY)
FIND_LIBRARY(ICU_DATA_LIBRARY icudata)
IF(ICU_LIBRARY)
MESSAGE(STATUS "ICU UC was found: ${ICU_LIBRARY}")
ELSE()
MESSAGE(STATUS "ICU UC was NOT found")
ENDIF()
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${ICU_DATA_LIBRARY} ${ICU_LIBRARY})
ENDIF()
ENDIF()
ENDIF()
@ -286,7 +221,6 @@ ENDIF()
INCLUDE(FindHelpers)
#TODO: hunter qt package
IF(WITH_QT5)
FIND_QT5()
ENDIF()
@ -298,7 +232,6 @@ IF(WITH_QT)
FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtXml QtOpenGL REQUIRED)
ENDIF()
#TODO: hunter assimp package
IF(WITH_ASSIMP)
FIND_PACKAGE(assimp REQUIRED)
ENDIF()
@ -308,20 +241,9 @@ IF(WITH_NEL)
FIND_PACKAGE(CppTest)
ENDIF()
IF(HUNTER_ENABLED)
IF(WITH_GUI)
HUNTER_ADD_PACKAGE(luabind)
FIND_PACKAGE(Luabind REQUIRED)
ENDIF()
HUNTER_ADD_PACKAGE(CURL)
FIND_PACKAGE(CURL CONFIG REQUIRED)
# TODO: for nelgui
SET(CURL_LIBRARIES CURL::libcurl libxml2::libxml2)
ELSE()
IF(WITH_GUI)
FIND_PACKAGE(Luabind REQUIRED)
ENDIF()
IF(WITH_GUI)
FIND_PACKAGE(Luabind REQUIRED)
ENDIF()
FIND_PACKAGE(CURL REQUIRED)
@ -372,7 +294,6 @@ IF(WITH_NEL)
ENDIF()
ENDIF()
ENDIF()
ENDIF() #hunter
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/nel/include)
ADD_SUBDIRECTORY(nel)

@ -69,13 +69,7 @@ MACRO(FIND_CORRECT_LUA_VERSION)
ENDIF()
ELSE()
# TODO: find a way to detect Lua version
IF(HUNTER_ENABLED)
HUNTER_ADD_PACKAGE(Lua)
FIND_PACKAGE(Lua CONFIG REQUIRED)
SET(LUA_LIBRARIES Lua::lua_lib)
ELSEIF(WITH_LUA54)
FIND_PACKAGE(Lua54 REQUIRED)
ELSEIF(WITH_LUA53)
IF(WITH_LUA53)
FIND_PACKAGE(Lua53 REQUIRED)
ELSEIF(WITH_LUA52)
FIND_PACKAGE(Lua52 REQUIRED)
@ -95,21 +89,6 @@ ENDIF()
SET(LIBRARY_NAME_RELEASE)
SET(LIBRARY_NAME_DEBUG)
IF(WITH_LUA54)
IF(WITH_STLPORT)
LIST(APPEND LIBRARY_NAME_RELEASE luabind_stlport_lua54)
LIST(APPEND LIBRARY_NAME_DEBUG luabind_stlport_lua54d)
ENDIF()
LIST(APPEND LIBRARY_NAME_RELEASE luabind_lua54)
LIST(APPEND LIBRARY_NAME_DEBUG luabind_lua54d)
ENDIF()
IF(HUNTER_ENABLED)
LIST(APPEND LIBRARY_NAME_RELEASE luabind luabind09)
LIST(APPEND LIBRARY_NAME_DEBUG luabindd luabind09-d)
ENDIF()
IF(WITH_LUA53)
IF(WITH_STLPORT)
LIST(APPEND LIBRARY_NAME_RELEASE luabind_stlport_lua53)

@ -501,17 +501,6 @@ IF(WINSDK_INCLUDE_DIR)
IF(WINSDK_VERSION STREQUAL "7.1" AND (MSVC11 OR MSVC12 OR MSVC14))
ADD_DEFINITIONS(-D_USING_V110_SDK71_)
ENDIF()
IF(NOT DXSDK_DIR)
MESSAGE("Using DirectX from Windows SDK (${WINSDK_LIBRARY_DIRS})")
SET(DXSDK_DIR ${WINSDK_DIR})
FIND_LIBRARY(DXSDK_GUID_LIBRARY dxguid ${WINSDK_LIBRARY_DIRS})
FIND_LIBRARY(DXSDK_DINPUT_LIBRARY dinput8 ${WINSDK_LIBRARY_DIRS})
FIND_LIBRARY(DXSDK_DSOUND_LIBRARY dsound ${WINSDK_LIBRARY_DIRS})
FIND_LIBRARY(DXSDK_XAUDIO_LIBRARY xaudio2 ${WINSDK_LIBRARY_DIRS})
# TODO: FIND_LIBRARY(DXSDK_D3DX9_LIBRARY d3dx9)
FIND_LIBRARY(DXSDK_D3D9_LIBRARY d3d9 ${WINSDK_LIBRARY_DIRS})
ENDIF()
ELSE()
IF(NOT WindowsSDK_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find Windows SDK!")

@ -1,8 +0,0 @@
# This file is parsed by HunterGate command
hunter_config(luabind
VERSION 0.9.1
URL "https://github.com/nimetu/luabind/tarball/2fa4606"
SHA1 "3b4646bab9f0b2362d7b8d71d78e40deaf3cc747"
)

@ -1,537 +0,0 @@
# Copyright (c) 2013-2019, Ruslan Baratov
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# This is a gate file to Hunter package manager.
# Include this file using `include` command and add package you need, example:
#
# cmake_minimum_required(VERSION 3.2)
#
# include("cmake/HunterGate.cmake")
# HunterGate(
# URL "https://github.com/path/to/hunter/archive.tar.gz"
# SHA1 "798501e983f14b28b10cda16afa4de69eee1da1d"
# )
#
# project(MyProject)
#
# hunter_add_package(Foo)
# hunter_add_package(Boo COMPONENTS Bar Baz)
#
# Projects:
# * https://github.com/hunter-packages/gate/
# * https://github.com/ruslo/hunter
option(HUNTER_ENABLED "Enable Hunter package manager support" ON)
if(HUNTER_ENABLED)
if(CMAKE_VERSION VERSION_LESS "3.2")
message(
FATAL_ERROR
"At least CMake version 3.2 required for Hunter dependency management."
" Update CMake or set HUNTER_ENABLED to OFF."
)
endif()
endif()
include(CMakeParseArguments) # cmake_parse_arguments
option(HUNTER_STATUS_PRINT "Print working status" ON)
option(HUNTER_STATUS_DEBUG "Print a lot info" OFF)
option(HUNTER_TLS_VERIFY "Enable/disable TLS certificate checking on downloads" ON)
set(HUNTER_ROOT "" CACHE FILEPATH "Override the HUNTER_ROOT.")
set(HUNTER_ERROR_PAGE "https://hunter.readthedocs.io/en/latest/reference/errors")
function(hunter_gate_status_print)
if(HUNTER_STATUS_PRINT OR HUNTER_STATUS_DEBUG)
foreach(print_message ${ARGV})
message(STATUS "[hunter] ${print_message}")
endforeach()
endif()
endfunction()
function(hunter_gate_status_debug)
if(HUNTER_STATUS_DEBUG)
foreach(print_message ${ARGV})
string(TIMESTAMP timestamp)
message(STATUS "[hunter *** DEBUG *** ${timestamp}] ${print_message}")
endforeach()
endif()
endfunction()
function(hunter_gate_error_page error_page)
message("------------------------------ ERROR ------------------------------")
message(" ${HUNTER_ERROR_PAGE}/${error_page}.html")
message("-------------------------------------------------------------------")
message("")
message(FATAL_ERROR "")
endfunction()
function(hunter_gate_internal_error)
message("")
foreach(print_message ${ARGV})
message("[hunter ** INTERNAL **] ${print_message}")
endforeach()
message("[hunter ** INTERNAL **] [Directory:${CMAKE_CURRENT_LIST_DIR}]")
message("")
hunter_gate_error_page("error.internal")
endfunction()
function(hunter_gate_fatal_error)
cmake_parse_arguments(hunter "" "ERROR_PAGE" "" "${ARGV}")
if("${hunter_ERROR_PAGE}" STREQUAL "")
hunter_gate_internal_error("Expected ERROR_PAGE")
endif()
message("")
foreach(x ${hunter_UNPARSED_ARGUMENTS})
message("[hunter ** FATAL ERROR **] ${x}")
endforeach()
message("[hunter ** FATAL ERROR **] [Directory:${CMAKE_CURRENT_LIST_DIR}]")
message("")
hunter_gate_error_page("${hunter_ERROR_PAGE}")
endfunction()
function(hunter_gate_user_error)
hunter_gate_fatal_error(${ARGV} ERROR_PAGE "error.incorrect.input.data")
endfunction()
function(hunter_gate_self root version sha1 result)
string(COMPARE EQUAL "${root}" "" is_bad)
if(is_bad)
hunter_gate_internal_error("root is empty")
endif()
string(COMPARE EQUAL "${version}" "" is_bad)
if(is_bad)
hunter_gate_internal_error("version is empty")
endif()
string(COMPARE EQUAL "${sha1}" "" is_bad)
if(is_bad)
hunter_gate_internal_error("sha1 is empty")
endif()
string(SUBSTRING "${sha1}" 0 7 archive_id)
if(EXISTS "${root}/cmake/Hunter")
set(hunter_self "${root}")
else()
set(
hunter_self
"${root}/_Base/Download/Hunter/${version}/${archive_id}/Unpacked"
)
endif()
set("${result}" "${hunter_self}" PARENT_SCOPE)
endfunction()
# Set HUNTER_GATE_ROOT cmake variable to suitable value.
function(hunter_gate_detect_root)
# Check CMake variable
if(HUNTER_ROOT)
set(HUNTER_GATE_ROOT "${HUNTER_ROOT}" PARENT_SCOPE)
hunter_gate_status_debug("HUNTER_ROOT detected by cmake variable")
return()
endif()
# Check environment variable
if(DEFINED ENV{HUNTER_ROOT})
set(HUNTER_GATE_ROOT "$ENV{HUNTER_ROOT}" PARENT_SCOPE)
hunter_gate_status_debug("HUNTER_ROOT detected by environment variable")
return()
endif()
# Check HOME environment variable
if(DEFINED ENV{HOME})
set(HUNTER_GATE_ROOT "$ENV{HOME}/.hunter" PARENT_SCOPE)
hunter_gate_status_debug("HUNTER_ROOT set using HOME environment variable")
return()
endif()
# Check SYSTEMDRIVE and USERPROFILE environment variable (windows only)
if(WIN32)
if(DEFINED ENV{SYSTEMDRIVE})
set(HUNTER_GATE_ROOT "$ENV{SYSTEMDRIVE}/.hunter" PARENT_SCOPE)
hunter_gate_status_debug(
"HUNTER_ROOT set using SYSTEMDRIVE environment variable"
)
return()
endif()
if(DEFINED ENV{USERPROFILE})
set(HUNTER_GATE_ROOT "$ENV{USERPROFILE}/.hunter" PARENT_SCOPE)
hunter_gate_status_debug(
"HUNTER_ROOT set using USERPROFILE environment variable"
)
return()
endif()
endif()
hunter_gate_fatal_error(
"Can't detect HUNTER_ROOT"
ERROR_PAGE "error.detect.hunter.root"
)
endfunction()
function(hunter_gate_download dir)
string(
COMPARE
NOTEQUAL
"$ENV{HUNTER_DISABLE_AUTOINSTALL}"
""
disable_autoinstall
)
if(disable_autoinstall AND NOT HUNTER_RUN_INSTALL)
hunter_gate_fatal_error(
"Hunter not found in '${dir}'"
"Set HUNTER_RUN_INSTALL=ON to auto-install it from '${HUNTER_GATE_URL}'"
"Settings:"
" HUNTER_ROOT: ${HUNTER_GATE_ROOT}"
" HUNTER_SHA1: ${HUNTER_GATE_SHA1}"
ERROR_PAGE "error.run.install"
)
endif()
string(COMPARE EQUAL "${dir}" "" is_bad)
if(is_bad)
hunter_gate_internal_error("Empty 'dir' argument")
endif()
string(COMPARE EQUAL "${HUNTER_GATE_SHA1}" "" is_bad)
if(is_bad)
hunter_gate_internal_error("HUNTER_GATE_SHA1 empty")
endif()
string(COMPARE EQUAL "${HUNTER_GATE_URL}" "" is_bad)
if(is_bad)
hunter_gate_internal_error("HUNTER_GATE_URL empty")
endif()
set(done_location "${dir}/DONE")
set(sha1_location "${dir}/SHA1")
set(build_dir "${dir}/Build")
set(cmakelists "${dir}/CMakeLists.txt")
hunter_gate_status_debug("Locking directory: ${dir}")
file(LOCK "${dir}" DIRECTORY GUARD FUNCTION)
hunter_gate_status_debug("Lock done")
if(EXISTS "${done_location}")
# while waiting for lock other instance can do all the job
hunter_gate_status_debug("File '${done_location}' found, skip install")
return()
endif()
file(REMOVE_RECURSE "${build_dir}")
file(REMOVE_RECURSE "${cmakelists}")
file(MAKE_DIRECTORY "${build_dir}") # check directory permissions
# Disabling languages speeds up a little bit, reduces noise in the output
# and avoids path too long windows error
file(
WRITE
"${cmakelists}"
"cmake_minimum_required(VERSION 3.2)\n"
"project(HunterDownload LANGUAGES NONE)\n"
"include(ExternalProject)\n"
"ExternalProject_Add(\n"
" Hunter\n"
" URL\n"
" \"${HUNTER_GATE_URL}\"\n"
" URL_HASH\n"
" SHA1=${HUNTER_GATE_SHA1}\n"
" DOWNLOAD_DIR\n"
" \"${dir}\"\n"
" TLS_VERIFY\n"
" ${HUNTER_TLS_VERIFY}\n"
" SOURCE_DIR\n"
" \"${dir}/Unpacked\"\n"
" CONFIGURE_COMMAND\n"
" \"\"\n"
" BUILD_COMMAND\n"
" \"\"\n"
" INSTALL_COMMAND\n"
" \"\"\n"
")\n"
)
if(HUNTER_STATUS_DEBUG)
set(logging_params "")
else()
set(logging_params OUTPUT_QUIET)
endif()
hunter_gate_status_debug("Run generate")
# Need to add toolchain file too.
# Otherwise on Visual Studio + MDD this will fail with error:
# "Could not find an appropriate version of the Windows 10 SDK installed on this machine"
if(EXISTS "${CMAKE_TOOLCHAIN_FILE}")
get_filename_component(absolute_CMAKE_TOOLCHAIN_FILE "${CMAKE_TOOLCHAIN_FILE}" ABSOLUTE)
set(toolchain_arg "-DCMAKE_TOOLCHAIN_FILE=${absolute_CMAKE_TOOLCHAIN_FILE}")
else()
# 'toolchain_arg' can't be empty
set(toolchain_arg "-DCMAKE_TOOLCHAIN_FILE=")
endif()
string(COMPARE EQUAL "${CMAKE_MAKE_PROGRAM}" "" no_make)
if(no_make)
set(make_arg "")
else()
# Test case: remove Ninja from PATH but set it via CMAKE_MAKE_PROGRAM
set(make_arg "-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}")
endif()
execute_process(
COMMAND
"${CMAKE_COMMAND}"
"-H${dir}"
"-B${build_dir}"
"-G${CMAKE_GENERATOR}"
"${toolchain_arg}"
${make_arg}
WORKING_DIRECTORY "${dir}"
RESULT_VARIABLE download_result
${logging_params}
)
if(NOT download_result EQUAL 0)
hunter_gate_internal_error(
"Configure project failed."
"To reproduce the error run: ${CMAKE_COMMAND} -H${dir} -B${build_dir} -G${CMAKE_GENERATOR} ${toolchain_arg} ${make_arg}"
"In directory ${dir}"
)
endif()
hunter_gate_status_print(
"Initializing Hunter workspace (${HUNTER_GATE_SHA1})"
" ${HUNTER_GATE_URL}"
" -> ${dir}"
)
execute_process(
COMMAND "${CMAKE_COMMAND}" --build "${build_dir}"
WORKING_DIRECTORY "${dir}"
RESULT_VARIABLE download_result
${logging_params}
)
if(NOT download_result EQUAL 0)
hunter_gate_internal_error("Build project failed")
endif()
file(REMOVE_RECURSE "${build_dir}")
file(REMOVE_RECURSE "${cmakelists}")
file(WRITE "${sha1_location}" "${HUNTER_GATE_SHA1}")
file(WRITE "${done_location}" "DONE")
hunter_gate_status_debug("Finished")
endfunction()
# Must be a macro so master file 'cmake/Hunter' can
# apply all variables easily just by 'include' command
# (otherwise PARENT_SCOPE magic needed)
macro(HunterGate)
if(HUNTER_GATE_DONE)
# variable HUNTER_GATE_DONE set explicitly for external project
# (see `hunter_download`)
set_property(GLOBAL PROPERTY HUNTER_GATE_DONE YES)
endif()
# First HunterGate command will init Hunter, others will be ignored
get_property(_hunter_gate_done GLOBAL PROPERTY HUNTER_GATE_DONE SET)
if(NOT HUNTER_ENABLED)
# Empty function to avoid error "unknown function"
function(hunter_add_package)
endfunction()
set(
_hunter_gate_disabled_mode_dir
"${CMAKE_CURRENT_LIST_DIR}/cmake/Hunter/disabled-mode"
)
if(EXISTS "${_hunter_gate_disabled_mode_dir}")
hunter_gate_status_debug(
"Adding \"disabled-mode\" modules: ${_hunter_gate_disabled_mode_dir}"
)
list(APPEND CMAKE_PREFIX_PATH "${_hunter_gate_disabled_mode_dir}")
endif()
elseif(_hunter_gate_done)
hunter_gate_status_debug("Secondary HunterGate (use old settings)")
hunter_gate_self(
"${HUNTER_CACHED_ROOT}"
"${HUNTER_VERSION}"
"${HUNTER_SHA1}"
_hunter_self
)
include("${_hunter_self}/cmake/Hunter")
else()
set(HUNTER_GATE_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}")
string(COMPARE NOTEQUAL "${PROJECT_NAME}" "" _have_project_name)
if(_have_project_name)
hunter_gate_fatal_error(
"Please set HunterGate *before* 'project' command. "
"Detected project: ${PROJECT_NAME}"
ERROR_PAGE "error.huntergate.before.project"
)
endif()
cmake_parse_arguments(
HUNTER_GATE "LOCAL" "URL;SHA1;GLOBAL;FILEPATH" "" ${ARGV}
)
string(COMPARE EQUAL "${HUNTER_GATE_SHA1}" "" _empty_sha1)
string(COMPARE EQUAL "${HUNTER_GATE_URL}" "" _empty_url)
string(
COMPARE
NOTEQUAL
"${HUNTER_GATE_UNPARSED_ARGUMENTS}"
""
_have_unparsed
)
string(COMPARE NOTEQUAL "${HUNTER_GATE_GLOBAL}" "" _have_global)
string(COMPARE NOTEQUAL "${HUNTER_GATE_FILEPATH}" "" _have_filepath)
if(_have_unparsed)
hunter_gate_user_error(
"HunterGate unparsed arguments: ${HUNTER_GATE_UNPARSED_ARGUMENTS}"
)
endif()
if(_empty_sha1)
hunter_gate_user_error("SHA1 suboption of HunterGate is mandatory")
endif()
if(_empty_url)
hunter_gate_user_error("URL suboption of HunterGate is mandatory")
endif()
if(_have_global)
if(HUNTER_GATE_LOCAL)
hunter_gate_user_error("Unexpected LOCAL (already has GLOBAL)")
endif()
if(_have_filepath)
hunter_gate_user_error("Unexpected FILEPATH (already has GLOBAL)")
endif()
endif()
if(HUNTER_GATE_LOCAL)
if(_have_global)
hunter_gate_user_error("Unexpected GLOBAL (already has LOCAL)")
endif()
if(_have_filepath)
hunter_gate_user_error("Unexpected FILEPATH (already has LOCAL)")
endif()
endif()
if(_have_filepath)
if(_have_global)
hunter_gate_user_error("Unexpected GLOBAL (already has FILEPATH)")
endif()
if(HUNTER_GATE_LOCAL)
hunter_gate_user_error("Unexpected LOCAL (already has FILEPATH)")
endif()
endif()
hunter_gate_detect_root() # set HUNTER_GATE_ROOT
# Beautify path, fix probable problems with windows path slashes
get_filename_component(
HUNTER_GATE_ROOT "${HUNTER_GATE_ROOT}" ABSOLUTE
)
hunter_gate_status_debug("HUNTER_ROOT: ${HUNTER_GATE_ROOT}")
if(NOT HUNTER_ALLOW_SPACES_IN_PATH)
string(FIND "${HUNTER_GATE_ROOT}" " " _contain_spaces)
if(NOT _contain_spaces EQUAL -1)
hunter_gate_fatal_error(
"HUNTER_ROOT (${HUNTER_GATE_ROOT}) contains spaces."
"Set HUNTER_ALLOW_SPACES_IN_PATH=ON to skip this error"
"(Use at your own risk!)"
ERROR_PAGE "error.spaces.in.hunter.root"
)
endif()
endif()
string(
REGEX
MATCH
"[0-9]+\\.[0-9]+\\.[0-9]+[-_a-z0-9]*"
HUNTER_GATE_VERSION
"${HUNTER_GATE_URL}"
)
string(COMPARE EQUAL "${HUNTER_GATE_VERSION}" "" _is_empty)
if(_is_empty)
set(HUNTER_GATE_VERSION "unknown")
endif()
hunter_gate_self(
"${HUNTER_GATE_ROOT}"
"${HUNTER_GATE_VERSION}"
"${HUNTER_GATE_SHA1}"
_hunter_self
)
set(_master_location "${_hunter_self}/cmake/Hunter")
if(EXISTS "${HUNTER_GATE_ROOT}/cmake/Hunter")
# Hunter downloaded manually (e.g. by 'git clone')
set(_unused "xxxxxxxxxx")
set(HUNTER_GATE_SHA1 "${_unused}")
set(HUNTER_GATE_VERSION "${_unused}")
else()
get_filename_component(_archive_id_location "${_hunter_self}/.." ABSOLUTE)
set(_done_location "${_archive_id_location}/DONE")
set(_sha1_location "${_archive_id_location}/SHA1")
# Check Hunter already downloaded by HunterGate
if(NOT EXISTS "${_done_location}")
hunter_gate_download("${_archive_id_location}")
endif()
if(NOT EXISTS "${_done_location}")
hunter_gate_internal_error("hunter_gate_download failed")
endif()
if(NOT EXISTS "${_sha1_location}")
hunter_gate_internal_error("${_sha1_location} not found")
endif()
file(READ "${_sha1_location}" _sha1_value)
string(TOLOWER "${_sha1_value}" _sha1_value_lower)
string(TOLOWER "${HUNTER_GATE_SHA1}" _HUNTER_GATE_SHA1_lower)
string(COMPARE EQUAL "${_sha1_value_lower}" "${_HUNTER_GATE_SHA1_lower}" _is_equal)
if(NOT _is_equal)
hunter_gate_internal_error(
"Short SHA1 collision:"
" ${_sha1_value} (from ${_sha1_location})"
" ${HUNTER_GATE_SHA1} (HunterGate)"
)
endif()
if(NOT EXISTS "${_master_location}")
hunter_gate_user_error(
"Master file not found:"
" ${_master_location}"
"try to update Hunter/HunterGate"
)
endif()
endif()
include("${_master_location}")
set_property(GLOBAL PROPERTY HUNTER_GATE_DONE YES)
endif()
endmacro()

@ -121,22 +121,6 @@ MACRO(NL_ADD_RUNTIME_FLAGS name)
ENDMACRO(NL_ADD_RUNTIME_FLAGS)
MACRO(NL_ADD_STATIC_VID_DRIVERS name)
IF(HUNTER_ENABLED)
IF(WIN32)
SET(drv_suffix "_win")
ELSE()
SET(drv_suffix "")
ENDIF()
IF(WIN32 AND WITH_DRIVER_DIRECT3D)
TARGET_LINK_LIBRARIES(${name} nel_drv_direct3d${drv_suffix})
ENDIF()
IF(WITH_DRIVER_OPENGL)
TARGET_LINK_LIBRARIES(${name} nel_drv_opengl${drv_suffix})
ENDIF()
IF(WITH_DRIVER_OPENGLES)
TARGET_LINK_LIBRARIES(${name} nel_drv_opengles${drv_suffix})
ENDIF()
ELSE()
IF(WITH_STATIC_DRIVERS)
IF(WIN32)
IF(WITH_DRIVER_DIRECT3D)
@ -151,6 +135,14 @@ ELSE()
TARGET_LINK_LIBRARIES(${name} nel_drv_opengl)
ENDIF()
ENDIF()
IF(WITH_DRIVER_OPENGL3)
IF(WIN32)
TARGET_LINK_LIBRARIES(${name} nel_drv_opengl3_win)
ELSE(WIN32)
TARGET_LINK_LIBRARIES(${name} nel_drv_opengl3)
ENDIF()
ENDIF()
IF(WITH_DRIVER_OPENGLES)
IF(WIN32)
@ -160,29 +152,9 @@ ELSE()
ENDIF()
ENDIF()
ENDIF()
ENDIF()#hunter
ENDMACRO(NL_ADD_STATIC_VID_DRIVERS)
MACRO(NL_ADD_STATIC_SND_DRIVERS name)
IF(HUNTER_ENABLED)
IF(WIN32)
SET(drv_suffix "_win")
ELSE()
SET(drv_suffix "")
ENDIF()
IF(WIN32 AND WITH_DRIVER_DSOUND)
TARGET_LINK_LIBRARIES(${name} nel_drv_dsound${drv_suffix})
ENDIF()
IF(WIN32 AND WITH_DRIVER_XAUDIO2)
TARGET_LINK_LIBRARIES(${name} nel_drv_xaudio2${drv_suffix})
ENDIF()
IF(WITH_DRIVER_FMOD)
TARGET_LINK_LIBRARIES(${name} nel_drv_fmod${drv_suffix})
ENDIF()
IF(WITH_DRIVER_OPENAL)
TARGET_LINK_LIBRARIES(${name} nel_drv_openal${drv_suffix})
ENDIF()
ELSE()
IF(WITH_STATIC_DRIVERS)
IF(WIN32)
IF(WITH_DRIVER_DSOUND)
@ -211,7 +183,6 @@ ELSE()
ENDIF()
ENDIF()
ENDIF() #hunter
ENDMACRO(NL_ADD_STATIC_SND_DRIVERS)
###
@ -286,8 +257,6 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS)
OPTION(WITH_ASSIMP "Use assimp exporter" OFF)
OPTION(WITH_LIBGSF "Use libgsf for max file library" OFF)
OPTION(WITH_FFMPEG "Use ffmpeg for audio decoder" OFF)
###
# GUI toolkits
###
@ -321,7 +290,7 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS)
OPTION(WITH_SNOWBALLS "Build Snowballs." OFF)
OPTION(WITH_TOOLS "Build Tools" OFF)
OPTION(WITH_RYZOM_LIVE "Use ryzom.com urls" ON)
OPTION(WITH_RYZOM_LIVE "Use ryzom.com urls" OFF)
ENDMACRO(NL_SETUP_DEFAULT_OPTIONS)
MACRO(NL_SETUP_NEL_DEFAULT_OPTIONS)
@ -342,6 +311,7 @@ MACRO(NL_SETUP_NEL_DEFAULT_OPTIONS)
# Drivers Support
###
OPTION(WITH_DRIVER_OPENGL "Build OpenGL Driver (3D)" ON )
OPTION(WITH_DRIVER_OPENGL3 "Build OpenGL3 Driver (3D)" OFF)
OPTION(WITH_DRIVER_OPENGLES "Build OpenGL ES Driver (3D)" OFF)
OPTION(WITH_DRIVER_DIRECT3D "Build Direct3D Driver (3D)" OFF)
OPTION(WITH_DRIVER_OPENAL "Build OpenAL Driver (Sound)" ON )
@ -1232,11 +1202,7 @@ MACRO(SETUP_EXTERNAL)
ENDIF()
IF(WIN32)
IF (HUNTER_ENABLED)
FIND_PACKAGE(External QUIET)
ELSE()
FIND_PACKAGE(External REQUIRED)
ENDIF()
FIND_PACKAGE(External REQUIRED)
# If using custom boost, we need to define the right variables used by official boost CMake module
IF(DEFINED BOOST_DIR)
@ -1279,7 +1245,7 @@ MACRO(SETUP_EXTERNAL)
IF(WIN32)
# Must include DXSDK before WINSDK
FIND_PACKAGE(DirectXSDK)
FIND_PACKAGE(DirectXSDK REQUIRED)
# IF(DXSDK_INCLUDE_DIR)
# INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR})
# ENDIF()
@ -1288,8 +1254,5 @@ MACRO(SETUP_EXTERNAL)
IF(MSVC)
FIND_PACKAGE(MSVC REQUIRED)
FIND_PACKAGE(WindowsSDK REQUIRED)
IF(NOT DXSDK_DIR)
MESSAGE(FATAL_ERROR "DirectX SDK or DirectX files from Windows SDK not found.")
ENDIF()
ENDIF()
ENDMACRO()

@ -1,55 +1,59 @@
jobs:
- job: ubuntu18
- job: ubuntu16
timeoutInMinutes: 120
pool:
vmImage: 'ubuntu-18.04'
vmImage: 'Ubuntu-16.04'
steps:
- script: |
sudo apt update
sudo apt install -y software-properties-common
# sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install cmake build-essential -y
sudo apt install gcc-8 g++-8 -y
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install cmake build-essential -y
sudo apt-get install gcc-8 g++-8 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 60
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 60
sudo apt install bison autoconf automake -y
sudo apt install libpng-dev -y
sudo apt install libjpeg-dev -y
sudo apt install libgif-dev libfreetype6-dev -y
sudo apt install freeglut3-dev -y
sudo apt install liblua5.2-dev libluabind-dev libcpptest-dev -y
sudo apt install libogg-dev libvorbis-dev libopenal-dev -y
sudo apt install libavcodec-dev libavformat-dev libavdevice-dev libswscale-dev libpostproc-dev -y
sudo apt install libmysqlclient-dev -y
sudo apt install libxml2-dev -y
sudo apt install libcurl4-openssl-dev libssl-dev -y
sudo apt install libsquish-dev -y
sudo apt install liblzma-dev -y
sudo apt install libgsf-1-dev -y
sudo apt install qtbase5-dev qttools5-dev qttools5-dev-tools
sudo apt-get install bison autoconf automake -y
sudo apt-get install libpng12-dev -y
sudo apt-get install libjpeg-dev -y
sudo apt-get install libgif-dev libfreetype6-dev -y
sudo apt-get install freeglut3-dev -y
sudo apt-get install liblua5.1-dev libluabind-dev libcpptest-dev -y
sudo apt-get install libogg-dev libvorbis-dev libopenal-dev -y
sudo apt-get install libavcodec-dev libavformat-dev libavdevice-dev libswscale-dev libpostproc-dev -y
sudo apt-get install libmysqlclient-dev -y
sudo apt-get install libxml2-dev -y
sudo apt-get install libcurl4-openssl-dev libssl-dev -y
sudo apt-get install libsquish-dev -y
sudo apt-get install liblzma-dev -y
sudo apt-get install libgsf-1-dev -y
sudo apt-get install qtbase5-dev qttools5-dev qttools5-dev-tools
displayName: 'Dependencies'
- script: |
mkdir build
cmake --version
cd build
cmake -DWITH_STATIC=ON -DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=ON -DWITH_LUA51=OFF -DWITH_LUA52=ON -DWITH_RYZOM=ON -DWITH_RYZOM_SERVER=ON -DWITH_RYZOM_CLIENT=ON -DWITH_RYZOM_TOOLS=ON -DWITH_NEL_TOOLS=ON -DWITH_NELNS=ON -DWITH_NELNS_LOGIN_SYSTEM=ON -DWITH_NELNS_SERVER=ON -DWITH_QT5=ON -DWITH_LIBGSF=ON ..
cmake -DWITH_STATIC=ON -DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=ON -DWITH_LUA51=ON -DWITH_RYZOM=ON -DWITH_RYZOM_SERVER=ON -DWITH_RYZOM_CLIENT=ON -DWITH_RYZOM_TOOLS=ON -DWITH_NEL_TOOLS=ON -DWITH_NELNS=ON -DWITH_NELNS_LOGIN_SYSTEM=ON -DWITH_NELNS_SERVER=ON -DWITH_QT5=ON -DWITH_LIBGSF=ON ..
cat CMakeCache.txt
displayName: 'CMake'
- script: |
cd build
make -j`nproc`
displayName: 'Make'
- job: ubuntu20
- job: ubuntu18
timeoutInMinutes: 120
pool:
vmImage: 'ubuntu-20.04'
vmImage: 'ubuntu-18.04'
steps:
- script: |
sudo apt update
sudo apt install -y software-properties-common
# sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install cmake build-essential -y
sudo apt install gcc-8 g++-8 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 60
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 60
sudo apt install bison autoconf automake -y
sudo apt install libpng-dev -y
sudo apt install libjpeg-dev -y
@ -77,88 +81,3 @@ jobs:
cd build
make -j`nproc`
displayName: 'Make'
- job: windows2019
timeoutInMinutes: 120
pool:
vmImage: 'windows-2019'
steps:
- checkout: self
fetchDepth: 1
- task: Cache@2
inputs:
key: 'hunter-win2019-x64-rel'
path: "c:/.hunter/_Base/Cache"
- task: CmdLine@2
inputs:
script: |
aria2c https://download.microsoft.com/download/A/E/7/AE743F1F-632B-4809-87A9-AA1BB3458E31/DXSDK_Jun10.exe
7z x DXSDK_Jun10.exe -oC:\ -r -y
del DXSDK_Jun10.exe
- task: CMake@1
inputs:
workingDirectory: build.release
cmakeArgs: '-DCMAKE_CONFIGURATION_TYPES=Release -DHUNTER_ENABLED=ON -DHUNTER_CONFIGURATION_TYPES=Release -DFINAL_VERSION=OFF -DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_NEL_TOOLS=OFF -DWITH_RYZOM_TOOLS=OFF -DWITH_RYZOM_SERVER=OFF -DWITH_RYZOM_CLIENT=ON -DWITH_DRIVER_OPENGL=ON -DWITH_DRIVER_OPENAL=ON -DWITH_DRIVER_DIRECT3D=ON -DWITH_DRIVER_XAUDIO2=ON -DDXSDK_DIR=C:/DXSDK ..'
- task: MSBuild@1
inputs:
solution: build.release/ALL_BUILD.vcxproj
maximumCpuCount: true
configuration: release
platform: 'x64'
- job: ubuntu18hunter
timeoutInMinutes: 120
pool:
vmImage: ubuntu-18.04
steps:
- checkout: self
fetchDepth: 0
- script: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libasound2-dev libgl1-mesa-dev libjack-dev libpulse-dev libxrandr-dev libxrender-dev libxxf86vm-dev
displayName: 'Dependencies'
- task: Cache@2
inputs:
key: 'hunter317-ubuntu18-rel"'
path: "$(Pipeline.Workspace)/.hunter/_Base/Cache"
- script: |
mkdir build.release
cmake --version
cd build.release
unset SYSTEM
export MAKEFLAGS=-j`nproc`
cmake -DCMAKE_BUILD_TYPE=Release -DHUNTER_ENABLED=ON -DHUNTER_CONFIGURATION_TYPES=Release -DHUNTER_ROOT="$(Pipeline.Workspace)/.hunter" -DFINAL_VERSION=OFF -DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_NEL_TOOLS=OFF -DWITH_RYZOM_TOOLS=OFF -DWITH_RYZOM_SERVER=OFF -DWITH_RYZOM_CLIENT=ON -DWITH_DRIVER_OPENGL=ON -DWITH_DRIVER_OPENAL=ON ..
displayName: 'CMake, release'
- script: |
cd build.release
make -j`nproc`
displayName: 'Make, release'
#- task: PublishPipelineArtifact@1
# inputs:
# targetPath: build.release/bin
# artifactName: RyzomUbuntu18Release
- job: macOS11
timeoutInMinutes: 120
pool:
vmImage: 'macOS-11'
steps:
- checkout: self
fetchDepth: 0
- task: Cache@2
inputs:
key: 'hunter317-macOS11-rel"'
path: "$(Pipeline.Workspace)/.hunter/_Base/Cache"
- task: CMake@1
inputs:
workingDirectory: build.release
cmakeArgs: '-GXcode -DCMAKE_CONFIGURATION_TYPES=Release -DHUNTER_ENABLED=ON -DHUNTER_STATUS_DEBUG=ON -DHUNTER_CONFIGURATION_TYPES=Release -DHUNTER_ROOT="$(Pipeline.Workspace)/.hunter" -DWITH_LIBXML2_ICONV=OFF -DFINAL_VERSION=OFF -DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_NEL_TOOLS=OFF -DWITH_RYZOM_TOOLS=OFF -DWITH_RYZOM_SERVER=OFF -DWITH_RYZOM_CLIENT=ON -DWITH_DRIVER_OPENGL=ON -DWITH_DRIVER_OPENAL=ON -DWITH_DRIVER_DIRECT3D=OFF -DWITH_DRIVER_XAUDIO2=OFF ..'
- task: Xcode@5
inputs:
actions: 'build'
configuration: Release
sdk: macosx12.0
xcWorkspacePath: 'build.release/RyzomCore.xcodeproj'
scheme: 'ALL_BUILD'
packageApp: false
#- task: PublishPipelineArtifact@1
# inputs:
# targetPath: build.release/bin/
# artifactName: RyzomClientMacOS11Release

@ -37,7 +37,6 @@
#cmakedefine RYZOM_CLIENT_EDIT_ACCOUNT_URL "${RYZOM_CLIENT_EDIT_ACCOUNT_URL}"
#cmakedefine RYZOM_CLIENT_FORGET_PASSWORD_URL "${RYZOM_CLIENT_FORGET_PASSWORD_URL}"
#cmakedefine RYZOM_CLIENT_PATCH_URL "${RYZOM_CLIENT_PATCH_URL}"
#cmakedefine RYZOM_CLIENT_APP_NAME "${RYZOM_CLIENT_APP_NAME}"
#cmakedefine RYZOM_WEBIG_MAIN_URL "${RYZOM_WEBIG_MAIN_URL}"
#cmakedefine RYZOM_WEBIG_TRUSTED_DOMAIN "${RYZOM_WEBIG_TRUSTED_DOMAIN}"

@ -10,25 +10,17 @@ IF(WIN32)
ENDIF()
IF(WITH_3D)
IF(HUNTER_ENABLED)
HUNTER_ADD_PACKAGE(freetype)
FIND_PACKAGE(freetype CONFIG REQUIRED)
SET(FREETYPE_LIBRARIES freetype::freetype)
ELSE()
FIND_PACKAGE(FreeType)
ENDIF() #hunter
FIND_PACKAGE(FreeType)
IF(WITH_NEL_CEGUI)
FIND_PACKAGE(CEGUI)
ENDIF()
ENDIF()
IF(WITH_SOUND AND NOT HUNTER_ENABLED)
IF(WITH_SOUND)
FIND_PACKAGE(Ogg)
FIND_PACKAGE(Vorbis)
IF(WITH_FFMPEG)
FIND_PACKAGE(FFmpeg REQUIRED COMPONENTS AVCODEC AVFORMAT AVUTIL SWRESAMPLE)
ENDIF()
FIND_PACKAGE(FFmpeg COMPONENTS AVCODEC AVFORMAT AVUTIL SWRESAMPLE)
IF(WITH_DRIVER_OPENAL)
FIND_PACKAGE(OpenAL)

@ -1,9 +1,6 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
@ -43,7 +40,7 @@ class CTextureFile;
class CAsyncFileManager3D
{
NLMISC_SAFE_RELEASABLE_SINGLETON_DECL(CAsyncFileManager3D);
NLMISC_SAFE_SINGLETON_DECL(CAsyncFileManager3D);
CAsyncFileManager3D();
public:

@ -1,8 +1,8 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010-2018 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2014-2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
// Copyright (C) 2014 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -181,8 +181,7 @@ public:
CVertexBuffer Vertices;
CMaterial *Material;
CRGBA Color;
std::string Text;
size_t Length;
ucstring Text;
uint32 CacheVersion;

@ -2,7 +2,7 @@
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013-2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
// Copyright (C) 2013-2014 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -262,10 +262,10 @@ public:
virtual NLMISC::IEventEmitter *getEventEmitter() = 0;
/// Copy a string to system clipboard.
virtual bool copyTextToClipboard(const std::string &text) = 0;
virtual bool copyTextToClipboard(const ucstring &text) = 0;
/// Paste a string from system clipboard.
virtual bool pasteTextFromClipboard(std::string &text) = 0;/// Return the depth of the driver after init().
virtual bool pasteTextFromClipboard(ucstring &text) = 0;/// Return the depth of the driver after init().
virtual uint8 getBitPerPixel() = 0;
@ -298,7 +298,7 @@ public:
virtual bool clearZBuffer(float zval=1) = 0;
/// Clear the current target surface stencil buffer. The function ignores the viewport settings but uses the scissor.
virtual bool clearStencilBuffer(float stencilval=0) = 0;
virtual bool clearStencilBuffer(sint stencilval=0) = 0;
/// Set the color mask filter through where the operation done will pass
virtual void setColorMask(bool bRed, bool bGreen, bool bBlue, bool bAlpha) = 0;
@ -580,7 +580,7 @@ public:
bool getStaticMemoryToVRAM() const { return _StaticMemoryToVRAM; }
/* Set to true if static vertex and index buffers must by allocated in VRAM, false in AGP.
* Default is false.
* Default is true.
*/
void setStaticMemoryToVRAM(bool staticMemoryToVRAM);

@ -4,7 +4,7 @@
// This source file has been modified by the following contributors:
// Copyright (C) 2010 Matt RAYKOWSKI (sfb) <matt.raykowski@gmail.com>
// Copyright (C) 2010 Robert TIMM (rti) <mail@rtti.de>
// Copyright (C) 2013-2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
// Copyright (C) 2013-2014 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -558,10 +558,10 @@ public:
// @}
// Copy a string to system clipboard.
virtual bool copyTextToClipboard(const std::string &text);
virtual bool copyTextToClipboard(const ucstring &text);
// Paste a string from system clipboard.
virtual bool pasteTextFromClipboard(std::string &text);
virtual bool pasteTextFromClipboard(ucstring &text);
virtual uint64 getSwapBufferCounter();

@ -33,10 +33,12 @@
# define NL3D_D3D_DLL_NAME "libnel_drv_direct3d_win"
#elif defined (NL_OS_WINDOWS)
# define NL3D_GL_DLL_NAME "nel_drv_opengl_win"
# define NL3D_GL3_DLL_NAME "nel_drv_opengl3_win"
# define NL3D_GLES_DLL_NAME "nel_drv_opengles_win"
# define NL3D_D3D_DLL_NAME "nel_drv_direct3d_win"
#elif defined (NL_OS_UNIX)
# define NL3D_GL_DLL_NAME "nel_drv_opengl"
# define NL3D_GL3_DLL_NAME "nel_drv_opengl3"
# define NL3D_GLES_DLL_NAME "nel_drv_opengles"
#else
# error "Unknown system"
@ -77,6 +79,32 @@ struct EDruOpenglDriverCantCreateDriver : public EDru
EDruOpenglDriverCantCreateDriver() : EDru( NL3D_GL_DLL_NAME " can't create driver" ) {}
};
// OpenGL 3
struct EDruOpengl3DriverNotFound : public EDru
{
EDruOpengl3DriverNotFound() : EDru( NL3D_GL3_DLL_NAME " not found" ) {}
};
struct EDruOpengl3DriverCorrupted : public EDru
{
EDruOpengl3DriverCorrupted() : EDru( "Can't get NL3D_createIDriverInstance from " NL3D_GL3_DLL_NAME " (Bad dll?)" ) {}
};
struct EDruOpengl3DriverOldVersion : public EDru
{
EDruOpengl3DriverOldVersion() : EDru( NL3D_GL3_DLL_NAME " is a too old version. Ask for a more recent file" ) {}
};
struct EDruOpengl3DriverUnknownVersion : public EDru
{
EDruOpengl3DriverUnknownVersion() : EDru( NL3D_GL3_DLL_NAME " is more recent than the application" ) {}
};
struct EDruOpengl3DriverCantCreateDriver : public EDru
{
EDruOpengl3DriverCantCreateDriver() : EDru( NL3D_GL3_DLL_NAME " can't create driver" ) {}
};
// OpenGL ES
struct EDruOpenglEsDriverNotFound : public EDru
{
@ -139,6 +167,9 @@ public:
/// Portable Function which create a GL Driver (using gl dll...).
static IDriver *createGlDriver();
/// Portable Function which create a GL3 Driver (using gl dll...).
static IDriver *createGl3Driver() throw(EDru);
/// Portable Function which create a GL ES Driver (using gl dll...).
static IDriver *createGlEsDriver();

@ -1,8 +1,5 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010-2018 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -36,7 +33,7 @@ typedef struct FT_FaceRec_* FT_Face;
#include "nel/misc/types_nl.h"
#include <string>
#include <vector>
namespace NL3D {
@ -67,17 +64,17 @@ public:
* \param height height of the generated bitmap, this value is set by this function
* \param pitch pitch of the generated bitmap (+ or - the number of bytes per row), this value is set by this function
*/
uint8 *getBitmap (u32char c, uint32 size, bool embolden, bool oblique, uint32 &width, uint32 &height, uint32 &pitch, sint32 &left, sint32 &top, sint32 &advx, uint32 &glyphIndex);
uint8 *getBitmap (ucchar c, uint32 size, bool embolden, bool oblique, uint32 &width, uint32 &height, uint32 &pitch, sint32 &left, sint32 &top, sint32 &advx, uint32 &glyphIndex);
/** returns the width and height of a character using a specific size and
*
* \warning this function is not very fast (but faster than getBitmap()) because it has to load the char before.
*/
void getSizes (u32char c, uint32 size, uint32 &width, uint32 &height);
void getSizes (ucchar c, uint32 size, uint32 &width, uint32 &height);
void getKerning (u32char left, u32char right, sint32 &kernx);
void getKerning (ucchar left, ucchar right, sint32 &kernx);
uint32 getCharIndex (u32char c);
uint32 getCharIndex (ucchar c);
uint32 getUID() { return _UID; }
@ -88,7 +85,6 @@ private:
static uint32 _FontGeneratorCounterUID;
uint32 _UID;
std::string _FontFileName;
std::vector<std::string> _FontFileNames;
#ifndef NL_DONT_USE_EXTERNAL_CODE
const char *getFT2Error(FT_Error fte);
@ -96,7 +92,7 @@ private:
static FT_Library _Library;
static uint _LibraryInit;
std::vector<FT_Face> _Faces;
FT_Face _Face;
#else // NL_DONT_USE_EXTERNAL_CODE
#endif // NL_DONT_USE_EXTERNAL_CODE

@ -1,8 +1,5 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010-2018 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -22,7 +19,6 @@
#include "nel/misc/types_nl.h"
#include "nel/misc/smart_ptr.h"
#include "nel/misc/utf_string_view.h"
#include "nel/3d/texture.h"
#include "nel/3d/material.h"
#include "nel/3d/texture_font.h"
@ -115,7 +111,6 @@ public:
* \param output computed string
* \param keep800x600Ratio true if you want that CFontManager look at Driver window size, and resize fontSize so it keeps same size...
*/
/*
void computeString (const std::string& s,
CFontGenerator *fontGen,
const NLMISC::CRGBA &color,
@ -125,12 +120,11 @@ public:
IDriver *driver,
CComputedString& output,
bool keep800x600Ratio= true);
*/
/**
* Same as computeString but works with a unicode string (ucstring)
*/
void computeString (NLMISC::CUtfStringView sv,
void computeString (const ucstring &s,
CFontGenerator *fontGen,
const NLMISC::CRGBA &color,
uint32 fontSize,
@ -143,21 +137,7 @@ public:
/**
* Same as computeString but do not make vertex buffers and primitives
*/
void computeStringInfo (NLMISC::CUtfStringView sv,
size_t len,
CFontGenerator *fontGen,
const NLMISC::CRGBA &color,
uint32 fontSize,
bool embolden,
bool oblique,
IDriver *driver,
CComputedString &output,
bool keep800x600Ratio= true);
/**
* Same as computeString but do not make vertex buffers and primitives
*/
void computeStringInfo (NLMISC::CUtfStringView sv,
void computeStringInfo (const ucstring &s,
CFontGenerator *fontGen,
const NLMISC::CRGBA &color,
uint32 fontSize,

@ -1,9 +1,6 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the

@ -837,7 +837,7 @@ private:
void restoreOriginalSkinVertices();
// apply Skin to all vertices from _OriginalSkin* to _VBuffer.
void applySkin(void *dstVb, CSkeletonModel *skeleton);
void applySkin(CSkeletonModel *skeleton);
void flagSkinVerticesForMatrixBlock(uint8 *skinFlags, CMatrixBlock &mb);

@ -38,7 +38,7 @@ public:
/// Constructor
CPixelProgram();
/// Destructor
virtual ~CPixelProgram ();
virtual ~CPixelProgram();
};
} // NL3D

@ -35,6 +35,8 @@
namespace NL3D {
static const uint32 IDRV_PROGRAM_MAXSAMPLERS = 32;
// List typedef.
class IDriver;
class IProgramDrvInfos;
@ -114,9 +116,204 @@ struct CProgramIndex
ModelViewProjection,
ModelViewProjectionInverse,
ModelViewProjectionTranspose,
ModelViewProjectionInverseTranspose,
Fog,
ModelViewProjectionInverseTranspose,
NormalMatrix,
ViewMatrix,
Fog,
FogParams,
FogColor,
Color,
//DiffuseColor,
AlphaRef,
Constant0,
Constant1,
Constant2,
Constant3,
Constant4,
Constant5,
Constant6,
Constant7,
Constant8,
Constant9,
Constant10,
Constant11,
Constant12,
Constant13,
Constant14,
Constant15,
Constant16,
Constant17,
Constant18,
Constant19,
Constant20,
Constant21,
Constant22,
Constant23,
Constant24,
Constant25,
Constant26,
Constant27,
Constant28,
Constant29,
Constant30,
Constant31,
Sampler0,
Sampler1,
Sampler2,
Sampler3,
Sampler4,
Sampler5,
Sampler6,
Sampler7,
Sampler8,
Sampler9,
Sampler10,
Sampler11,
Sampler12,
Sampler13,
Sampler14,
Sampler15,
Sampler16,
Sampler17,
Sampler18,
Sampler19,
Sampler20,
Sampler21,
Sampler22,
Sampler23,
Sampler24,
Sampler25,
Sampler26,
Sampler27,
Sampler28,
Sampler29,
Sampler30,
Sampler31,
TexMatrix0,
TexMatrix1,
TexMatrix2,
TexMatrix3,
TexGen0ObjectPlaneS,
TexGen0ObjectPlaneT,
TexGen0ObjectPlaneP,
TexGen0ObjectPlaneQ,
TexGen1ObjectPlaneS,
TexGen1ObjectPlaneT,
TexGen1ObjectPlaneP,
TexGen1ObjectPlaneQ,
TexGen2ObjectPlaneS,
TexGen2ObjectPlaneT,
TexGen2ObjectPlaneP,
TexGen2ObjectPlaneQ,
TexGen3ObjectPlaneS,
TexGen3ObjectPlaneT,
TexGen3ObjectPlaneP,
TexGen3ObjectPlaneQ,
TexGen0EyePlaneS,
TexGen0EyePlaneT,
TexGen0EyePlaneP,
TexGen0EyePlaneQ,
TexGen1EyePlaneS,
TexGen1EyePlaneT,
TexGen1EyePlaneP,
TexGen1EyePlaneQ,
TexGen2EyePlaneS,
TexGen2EyePlaneT,
TexGen2EyePlaneP,
TexGen2EyePlaneQ,
TexGen3EyePlaneS,
TexGen3EyePlaneT,
TexGen3EyePlaneP,
TexGen3EyePlaneQ,
SelfIllumination,
Light0DirOrPos,
Light1DirOrPos,
Light2DirOrPos,
Light3DirOrPos,
Light4DirOrPos,
Light5DirOrPos,
Light6DirOrPos,
Light7DirOrPos,
Light0ColAmb,
Light1ColAmb,
Light2ColAmb,
Light3ColAmb,
Light4ColAmb,
Light5ColAmb,
Light6ColAmb,
Light7ColAmb,
Light0ColDiff,
Light1ColDiff,
Light2ColDiff,
Light3ColDiff,
Light4ColDiff,
Light5ColDiff,
Light6ColDiff,
Light7ColDiff,
Light0ColSpec,
Light1ColSpec,
Light2ColSpec,
Light3ColSpec,
Light4ColSpec,
Light5ColSpec,
Light6ColSpec,
Light7ColSpec,
Light0Shininess,
Light1Shininess,
Light2Shininess,
Light3Shininess,
Light4Shininess,
Light5Shininess,
Light6Shininess,
Light7Shininess,
Light0ConstAttn,
Light1ConstAttn,
Light2ConstAttn,
Light3ConstAttn,
Light4ConstAttn,
Light5ConstAttn,
Light6ConstAttn,
Light7ConstAttn,
Light0LinAttn,
Light1LinAttn,
Light2LinAttn,
Light3LinAttn,
Light4LinAttn,
Light5LinAttn,
Light6LinAttn,
Light7LinAttn,
Light0QuadAttn,
Light1QuadAttn,
Light2QuadAttn,
Light3QuadAttn,
Light4QuadAttn,
Light5QuadAttn,
Light6QuadAttn,
Light7QuadAttn,
NUM_UNIFORMS
};
@ -242,15 +439,15 @@ public:
protected:
/// The progam source
std::vector<NLMISC::CSmartPtr<CSource> > m_Sources;
std::vector<NLMISC::CSmartPtr<CSource> > m_Sources;
/// The source used for compilation
NLMISC::CSmartPtr<CSource> m_Source;
CProgramIndex m_Index;
NLMISC::CSmartPtr<CSource> m_Source;
CProgramIndex m_Index;
public:
/// The driver information. For the driver implementation only.
NLMISC::CRefPtr<IProgramDrvInfos> m_DrvInfo;
NLMISC::CRefPtr<IProgramDrvInfos> m_DrvInfo;
}; /* class IProgram */

@ -1,8 +1,8 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010-2018 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2014-2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
// Copyright (C) 2014 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -134,7 +134,7 @@ public:
uint32 textPush (const char *format, ...);
/// computes an ucstring and adds the result to the cache (return the index)
uint32 textPush (NLMISC::CUtfStringView sv);
uint32 textPush (const ucstring &str);
/// remove a string from the cache
void erase (uint32 index);
@ -262,12 +262,12 @@ public:
}
/// Directly print a string
void printAt (float x, float z, NLMISC::CUtfStringView sv)
void printAt (float x, float z, const ucstring &ucstr)
{
nlassert(_FontGen);
// compute the string just one time
_FontManager->computeString (sv, _FontGen, _Color, _FontSize, _Embolden, _Oblique, _Driver, _TempString, _Keep800x600Ratio);
_FontManager->computeString (ucstr, _FontGen, _Color, _FontSize, _Embolden, _Oblique, _Driver, _TempString, _Keep800x600Ratio);
// draw shaded
if (_Shaded)
@ -372,19 +372,14 @@ public:
* \param an ucstring
* \param the computed string
*/
void computeString (NLMISC::CUtfStringView sv, CComputedString& output)
void computeString (const ucstring& s, CComputedString& output)
{
_FontManager->computeString (sv, _FontGen, _Color, _FontSize, _Embolden, _Oblique, _Driver, output, _Keep800x600Ratio);
}
void computeStringInfo (NLMISC::CUtfStringView sv, CComputedString& output)
{
_FontManager->computeStringInfo (sv, _FontGen, _Color, _FontSize, _Embolden, _Oblique, _Driver, output, _Keep800x600Ratio);
_FontManager->computeString (s, _FontGen, _Color, _FontSize, _Embolden, _Oblique, _Driver, output, _Keep800x600Ratio);
}
void computeStringInfo (NLMISC::CUtfStringView sv, CComputedString& output, size_t len)
void computeStringInfo (const ucstring& s, CComputedString& output)
{
_FontManager->computeStringInfo (sv, len, _FontGen, _Color, _FontSize, _Embolden, _Oblique, _Driver, output, _Keep800x600Ratio);
_FontManager->computeStringInfo (s, _FontGen, _Color, _FontSize, _Embolden, _Oblique, _Driver, output, _Keep800x600Ratio);
}
/// Debug : write to the disk the texture cache

@ -1,8 +1,8 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010-2018 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2014-2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
// Copyright (C) 2014 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -97,14 +97,13 @@ public:
*/
// @{
uint32 textPush(const char *format, ...) ;
uint32 textPush(NLMISC::CUtfStringView sv) ;
uint32 textPush(const ucstring &str) ;
void setStringColor(uint32 i, CRGBA newCol);
void setStringSelection(uint32 i, uint32 selectStart, uint32 selectSize);
void resetStringSelection(uint32 i);
void erase(uint32 i) ;
virtual CStringInfo getStringInfo (uint32 i);
virtual CStringInfo getStringInfo (NLMISC::CUtfStringView sv);
virtual CStringInfo getStringInfo (NLMISC::CUtfStringView sv, size_t len);
virtual CStringInfo getStringInfo (const ucstring &ucstr);
void clear() ;
void printAt(float x, float y, uint32 i) ;
@ -112,10 +111,10 @@ public:
void printClipAtUnProjected(URenderStringBuffer &renderBuffer, class NL3D::CFrustum &frustum, const NLMISC::CMatrix &scaleMatrix, float x, float y, float depth, uint32 i, float xmin, float ymin, float xmax, float ymax);
void printClipAtOld (float x, float y, uint32 i, float xmin, float ymin, float xmax, float ymax);
void printAt(float x, float y, NLMISC::CUtfStringView sv) ;
void printAt(float x, float y, const ucstring &ucstr) ;
void printfAt(float x, float y, const char * format, ...) ;
void render3D(const CMatrix &mat, NLMISC::CUtfStringView sv) ;
void render3D(const CMatrix &mat, const ucstring &ucstr) ;
void render3D(const CMatrix &mat, const char *format, ...) ;
float getLastXBound() const ;

@ -1,9 +1,6 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2019 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the

@ -1,8 +1,5 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010-2021 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -38,43 +35,12 @@ class CTextureFont : public ITexture
public:
struct SLetterKey
{
u32char Char;
sint Size;
bool Embolden;
bool Oblique;
CFontGenerator *FontGenerator;
SLetterKey() : Char(0), Size(0), Embolden(false), Oblique(false), FontGenerator(NULL)
{
}
// Does not use FontGenerator in return value
inline uint64 getVal() const
{
return Char // 32 bits
| (uint64(Size & 0xFFFF) << 32) // 16 bits
| (uint64(Embolden) << (32+16)) // 1 bit
| (uint64(Oblique) << (32+16+1)); // 1 bit
}
bool operator<(const SLetterKey &rhs) const
{
uint64 a = getVal();
uint64 b = rhs.getVal();
return (a < b) || ((a == b) && (FontGenerator < rhs.FontGenerator));
}
};
// Holds info for glyphs rendered on atlas
struct SGlyphInfo : SLetterKey
struct SGlyphInfo
{
// font atlas info
uint32 CacheVersion;
uint32 GlyphIndex;
// atlas region with padding
uint32 X, Y, W, H;
@ -85,17 +51,30 @@ public:
// UV coords for rendered glyph without padding
float U0, V0, U1, V1;
uint32 GlyphIndex;
sint Size;
bool Embolden;
bool Oblique;
CFontGenerator *FontGenerator;
SGlyphInfo()
: CacheVersion(0), GlyphIndex(0),
: CacheVersion(0),
U0(0.f), V0(0.f), U1(0.f), V1(0.f),
X(0), Y(0), W(0), H(0), CharWidth(0), CharHeight(0)
X(0), Y(0), W(0), H(0), CharWidth(0), CharHeight(0),
GlyphIndex(0), Size(0), Embolden(false), Oblique(false), FontGenerator(NULL)
{
}
};
// Holds info for glyphs displayed on screen
struct SLetterInfo : SLetterKey
struct SLetterInfo
{
ucchar Char;
sint Size;
bool Embolden;
bool Oblique;
CFontGenerator *FontGenerator;
uint32 GlyphIndex;
uint32 CharWidth; // Displayed glyph height
uint32 CharHeight; // Displayed glyph height
@ -106,12 +85,29 @@ public:
SGlyphInfo* glyph;
SLetterInfo()
: GlyphIndex(0), CharWidth(0), CharHeight(0), Top(0), Left(0), AdvX(0),
: Char(0), Size(0), Embolden(false), Oblique(false), FontGenerator(NULL),
GlyphIndex(0), CharWidth(0), CharHeight(0), Top(0), Left(0), AdvX(0),
glyph(NULL)
{
}
};
struct SLetterKey
{
ucchar Char;
sint Size;
bool Embolden;
bool Oblique;
CFontGenerator *FontGenerator;
// Does not use FontGenerator in return value
uint32 getVal();
SLetterKey():Char(0), FontGenerator(NULL), Size(0), Embolden(false), Oblique(false)
{
}
};
public:
/**
@ -152,7 +148,7 @@ private:
// Keep track of available space in main texture
std::vector<NLMISC::CRect> _AtlasNodes;
std::map<SLetterKey, SLetterInfo> _Letters;
std::vector <SLetterInfo> _Letters;
// lookup letter from letter cache or create new
SLetterInfo* findLetter(SLetterKey& k, bool insert);
@ -166,7 +162,7 @@ private:
uint _GlyphSizeStep;
// rendered glyph cache
std::map<SLetterKey, SGlyphInfo> _GlyphCache;
std::list<SGlyphInfo> _GlyphCache;
SGlyphInfo* findLetterGlyph(SLetterInfo *letter, bool insert);
// render letter glyph into glyph cache

@ -4,7 +4,7 @@
// This source file has been modified by the following contributors:
// Copyright (C) 2010 Matt RAYKOWSKI (sfb) <matt.raykowski@gmail.com>
// Copyright (C) 2010 Robert TIMM (rti) <mail@rtti.de>
// Copyright (C) 2013-2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
// Copyright (C) 2013-2014 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -145,7 +145,7 @@ public:
enum TStencilFunc { never = 0, less, lessequal, equal, notequal, greaterequal, greater, always};
// Existing drivers
enum TDriver { Direct3d = 0, OpenGl, OpenGlEs };
enum TDriver { Direct3d = 0, OpenGl, OpenGlEs, OpenGl3 };
public:
/// The EventServer of this driver. Init after setDisplay()!!
@ -835,10 +835,10 @@ public:
/// \name Clipboard management
// @{
// Copy a string to system clipboard.
virtual bool copyTextToClipboard(const std::string &text) =0;
virtual bool copyTextToClipboard(const ucstring &text) =0;
// Paste a string from system clipboard.
virtual bool pasteTextFromClipboard(std::string &text) =0;
virtual bool pasteTextFromClipboard(ucstring &text) =0;
// @}
public:

@ -1,8 +1,8 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010-2018 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2014-2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
// Copyright (C) 2014 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -24,7 +24,7 @@
#include "nel/misc/rgba.h"
#include "nel/misc/ucstring.h"
#include "nel/misc/matrix.h"
#include "nel/misc/utf_string_view.h"
namespace NL3D {
@ -104,11 +104,8 @@ public:
*/
float StringLine;
/// The length in characters
size_t StringLength;
CStringInfo() { StringWidth = StringHeight = StringLine = 0; StringLength = 0; }
CStringInfo(float w, float h, float l, size_t len) { StringWidth = w; StringHeight = h; StringLine = l; StringLength = len; }
CStringInfo() {StringWidth= StringHeight= StringLine= 0;}
CStringInfo(float w, float h, float l) {StringWidth= w; StringHeight= h; StringLine = l;}
/**
* Get the string's origin
@ -251,7 +248,7 @@ public:
* \param an ucstring
* \return the index where computed string has been inserted
*/
virtual uint32 textPush (NLMISC::CUtfStringView sv) = 0;
virtual uint32 textPush (const ucstring &str) = 0;
/**
* set the color of a string.
*/
@ -277,12 +274,7 @@ public:
* Get a string information from the ucstring
* The returned string info is in pixel size per default.
*/
virtual CStringInfo getStringInfo (NLMISC::CUtfStringView sv) = 0;
/**
* Get a string information from the ucstring
* The returned string info is in pixel size per default.
*/
virtual CStringInfo getStringInfo (NLMISC::CUtfStringView sv, size_t len) = 0;
virtual CStringInfo getStringInfo (const ucstring &ucstr) = 0;
/**
* empty the map
*/
@ -307,7 +299,7 @@ public:
/**
* compute and print a ucstring at the location (2D method) x/y E [0,1]
*/
virtual void printAt (float x, float y, NLMISC::CUtfStringView sv) = 0;
virtual void printAt (float x, float y, const ucstring &ucstr) = 0;
/**
* compute and print a string at the location (2D method) x/y E [0,1]
*/
@ -317,7 +309,7 @@ public:
* compute and render a ucstring at the location (3D method)
* render3D() use UDriver Matrix context for Frustum/ViewMatrix, but use its own modelmatrix (mat).
*/
virtual void render3D (const NLMISC::CMatrix &mat, NLMISC::CUtfStringView sv) = 0;
virtual void render3D (const NLMISC::CMatrix &mat, const ucstring &ucstr) = 0;
/**
* compute and render a string at the location (3D method)
* render3D() use UDriver Matrix context for Frustum/ViewMatrix, but use its own modelmatrix (mat).

@ -0,0 +1,121 @@
/*
Copyright (C) 2015 Jan Boon <jan.boon@kaetemi.be>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef NL_UNIFORM_BUFFER_H
#define NL_UNIFORM_BUFFER_H
#include <nel/misc/types_nl.h>
#include <nel/misc/smart_ptr.h>
#include <nel/misc/vector.h>
#include <nel/misc/vector_2f.h>
#include <nel/misc/vector_h.h>
#include <nel/misc/matrix.h>
#include <nel/3d/uniform_buffer_format.h>
#define NL3D_UNIFORM_BUFFER_DEBUG 1
namespace NLMISC {
class CMatrix;
}
namespace NL3D {
class CUniformBuffer;
class IUBDrvInfos;
typedef std::list<IUBDrvInfos*> TUBDrvInfoPtrList;
typedef TUBDrvInfoPtrList::iterator ItUBDrvInfoPtrList;
/*
**** IMPORTANT ********************
**** IF YOU MODIFY THE STRUCTURE OF THIS CLASS, PLEASE INCREMENT IDriver::InterfaceVersion TO INVALIDATE OLD DRIVER DLL
***********************************
*/
#if NL3D_UNIFORM_BUFFER_DEBUG
#define NL3D_UNIFORM_BUFFER_ASSERT_LOCKED(ub) nlassert(ub->Locked)
#else
#define NL3D_UNIFORM_BUFFER_ASSERT_LOCKED(ub) /* ub->Locked doesn't exist when NL3D_UNIFORM_BUFFER_DEBUG is 0 */
#endif
// Uniform buffer
class CUniformBuffer : public NLMISC::CRefCount
{
public:
CUniformBuffer();
~CUniformBuffer();
void *lock();
void unlock();
inline void set(sint offset, float f) { NL3D_UNIFORM_BUFFER_ASSERT_LOCKED(this); reinterpret_cast<float &>(m_HostMemory[offset]) = f; }
inline void set(sint offset, float f0, float f1) { NL3D_UNIFORM_BUFFER_ASSERT_LOCKED(this); float *f = reinterpret_cast<float *>(&m_HostMemory[offset]); f[0] = f0; f[1] = f1; }
inline void set(sint offset, float f0, float f1, float f2) { NL3D_UNIFORM_BUFFER_ASSERT_LOCKED(this); float *f = reinterpret_cast<float *>(&m_HostMemory[offset]); f[0] = f0; f[1] = f1; f[2] = f2; }
inline void set(sint offset, float f0, float f1, float f2, float f3) { NL3D_UNIFORM_BUFFER_ASSERT_LOCKED(this); float *f = reinterpret_cast<float *>(&m_HostMemory[offset]); f[0] = f0; f[1] = f1; f[2] = f2; f[3] = f3; }
inline void set(sint offset, NLMISC::CVector2f vec2) { NL3D_UNIFORM_BUFFER_ASSERT_LOCKED(this); reinterpret_cast<NLMISC::CVector2f &>(m_HostMemory[offset]) = vec2; }
inline void set(sint offset, NLMISC::CVector vec3) { NL3D_UNIFORM_BUFFER_ASSERT_LOCKED(this); reinterpret_cast<NLMISC::CVector &>(m_HostMemory[offset]) = vec3; }
inline void set(sint offset, NLMISC::CVectorH vec4) { NL3D_UNIFORM_BUFFER_ASSERT_LOCKED(this); reinterpret_cast<NLMISC::CVectorH &>(m_HostMemory[offset]) = vec4; }
inline void set(sint offset, NLMISC::CMatrix mat4) { NL3D_UNIFORM_BUFFER_ASSERT_LOCKED(this); float *f = reinterpret_cast<float *>(&m_HostMemory[offset]); mat4.get(f); }
private:
std::vector<char> m_HostMemory;
public:
CUniformBufferFormat Format;
public: // Driver-only
NLMISC::CRefPtr<IUBDrvInfos> DrvInfos;
bool Touched;
#if NL3D_UNIFORM_BUFFER_DEBUG
sint Locked;
#endif
};
// TODO: Investigate if more efficient or not to do like vertex_buffer and call into driver for locking (what are best practices for updating uniform buffers?)
class IUBDrvInfos : public NLMISC::CRefCount
{
protected:
IDriver *m_Driver;
private:
ItUBDrvInfoPtrList m_DriverIterator;
public:
NLMISC::CRefPtr<CUniformBuffer> UniformBufferPtr;
IUBDrvInfos(IDriver *drv, ItUBDrvInfoPtrList it, CUniformBuffer *ub) { m_Driver = drv; m_DriverIterator = it; UniformBufferPtr = ub; }
virtual ~IUBDrvInfos();
};
} /* namespace NL3D */
#endif /* #ifndef NL_UNIFORM_BUFFER_H */
/* end of file */

@ -0,0 +1,145 @@
/*
Copyright (C) 2015 Jan Boon <jan.boon@kaetemi.be>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef NL_UNIFORM_BUFFER_FORMAT_H
#define NL_UNIFORM_BUFFER_FORMAT_H
#include <nel/misc/types_nl.h>
#include <nel/misc/string_mapper.h>
namespace NL3D {
/*
**** IMPORTANT ********************
**** IF YOU MODIFY THE STRUCTURE OF THIS CLASS, PLEASE INCREMENT IDriver::InterfaceVersion TO INVALIDATE OLD DRIVER DLL
***********************************
*/
// Uniform buffer format generation following glsl std140 rules
class CUniformBufferFormat
{
public:
CUniformBufferFormat() : m_Hash(0) { }
// When changing, update
// - s_TypeAlignment
// - s_TypeSize
// - NL3D::NLDRIVERGL3::s_TypeKeyword
enum TType
{
Float, // float
FloatVec2, // CVector2f
FloatVec3, // CVector
FloatVec4, // CVectorH
SInt, // sint32
SIntVec2,
SIntVec3,
SIntVec4,
UInt, // uint32
UIntVec2,
UIntVec3,
UIntVec4,
Bool,
BoolVec2,
BoolVec3,
BoolVec4,
FloatMat2,
FloatMat3,
FloatMat4, // CMatrix
FloatMat2x3,
FloatMat2x4,
FloatMat3x2,
FloatMat3x4,
FloatMat4x2,
FloatMat4x3,
};
struct CEntry
{
NLMISC::TStringId Name;
TType Type;
sint Offset;
sint Count;
inline sint stride() const
{
return Count == 1
? s_TypeSize[Type]
: ((s_TypeSize[Type] + 15) & ~0xF);
}
inline sint size() const
{
return stride() * Count;
}
inline sint offset(int i) const
{
return Offset + (stride() * i);
}
};
// Push a variable. Returns the byte offset in uniform buffer
// Note: Does not check for duplicate names. However, names must be unique
sint push(const std::string &name, TType type, sint count = 1);
inline const CEntry &get(sint i) const { return m_Entries[i]; }
inline size_t count() const { return m_Entries.size(); } // Return number of entries
inline void clear() { m_Entries.clear(); m_Hash = 0; }
inline sint size() const { return m_Entries.size() ? (((m_Entries.back().Offset + m_Entries.back().size()) + 15) & ~0xF) : 0; } // Return size of format in bytes
inline size_t hash() const { return m_Hash; }
// Get the offset by entry id (counted from 0 in the order of addition to the format) and index of array
inline sint offset(sint entry, sint index = 0) const { m_Entries[entry].offset(index); }
private:
static const sint s_TypeAlignment[];
static const sint s_TypeSize[];
typedef std::vector<CEntry> TEntries;
TEntries m_Entries;
size_t m_Hash;
};
void testUniformBufferFormat(CUniformBufferFormat &ubf);
} /* namespace NL3D */
namespace std {
template <>
struct hash<NL3D::CUniformBufferFormat>
{
size_t operator()(const NL3D::CUniformBufferFormat & v) const { return v.hash(); }
};
} /* namespace std */
#endif /* #ifndef NL_UNIFORM_BUFFER_FORMAT_H */
/* end of file */

@ -1202,7 +1202,6 @@ inline void CVertexBuffer::lock (CVertexBufferRead &accessor, uint first, uint l
if (last == 0)
last = _NbVerts;
// Can read it ?
nlassertex (_Location==RAMResident, ("Try to read a write only vertex buffer"));
_LockedBuffer = DrvInfos->lock (first*_VertexSize, last*_VertexSize, true);
}
else

@ -36,7 +36,7 @@ public:
CVertexProgram(const char *nelvp);
/// Destructor
virtual ~CVertexProgram ();
virtual ~CVertexProgram();
};

@ -2,7 +2,7 @@
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2014-2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
// Copyright (C) 2014 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -22,7 +22,6 @@
#include "nel/misc/types_nl.h"
#include "nel/georges/u_form.h"
#include "form_dfn.h"
#include "form_elm.h"
#include "header.h"
@ -125,10 +124,6 @@ private:
// The form filename
std::string _Filename;
// The dfn
NLMISC::CSmartPtr<CFormDfn> _Dfn;
};
} // NLGEORGES

@ -2,7 +2,7 @@
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2014-2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
// Copyright (C) 2014 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -282,10 +282,6 @@ public:
{
Element = NULL;
}
~CFormElmStructElm()
{
nlassert(!Element);
}
std::string Name;
CFormElm* Element;
@ -404,10 +400,6 @@ public:
{
Element = NULL;
}
~CElement ()
{
nlassert(!Element);
}
std::string Name;
CFormElm* Element;
@ -639,7 +631,7 @@ inline bool CFormElm::convertValue (bool &result, const std::string &value) cons
}
else
{
std::string temp = NLMISC::toLowerAscii(value);
std::string temp = NLMISC::toLower(value);
if (strcmp (temp.c_str (), "true") == 0)
{
result = true;

@ -3,7 +3,6 @@
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013-2014 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -70,7 +69,7 @@ namespace NLGUI
static CAHManager* getInstance()
{
if (_GlobalInstance == NULL && !s_Deleted)
if (_GlobalInstance == NULL)
_GlobalInstance = new CAHManager;
return _GlobalInstance;
}
@ -135,19 +134,6 @@ namespace NLGUI
static CAHManager *_GlobalInstance;
static bool editorMode;
class CDeleter
{
public:
~CDeleter()
{
delete _GlobalInstance;
_GlobalInstance = NULL;
s_Deleted = true;
}
};
static CDeleter s_Deleter;
static bool s_Deleted;
};
/// Ah name must all be lower case

@ -1,83 +0,0 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2019 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef CL_CSS_BACKGROUND_H
#define CL_CSS_BACKGROUND_H
#include "nel/misc/types_nl.h"
#include "nel/misc/rgba.h"
#include "nel/gui/css_types.h"
#include "nel/gui/css_length.h"
namespace NLGUI
{
/**
* \brief CSS background info
* \date 2021-07-02 11:36 GMT
* \author Meelis Mägi (Nimetu)
*/
class CSSBackground
{
public:
CSSBackground()
:color(NLMISC::CRGBA::Transparent),
repeatX(CSS_VALUE_REPEAT), repeatY(CSS_VALUE_REPEAT), attachment(CSS_VALUE_SCROLL),
xAnchor(CSS_VALUE_LEFT), yAnchor(CSS_VALUE_TOP),
clip(CSS_VALUE_BORDER_BOX), origin(CSS_VALUE_PADDING_BOX), size(CSS_VALUE_AUTO)
{}
void setImage(const std::string &value);
void setPosition(const std::string &value);
void setSize(const std::string &value);
void setRepeat(const std::string &value);
void setOrigin(const std::string &value);
void setClip(const std::string &value);
void setAttachment(const std::string &value);
void setColor(const std::string &value);
public:
// TODO: only final layer has color
NLMISC::CRGBA color;
std::string image;
CSSValueType repeatX;
CSSValueType repeatY;
CSSValueType attachment;
CSSValueType xAnchor;
CSSValueType yAnchor;
CSSLength xPosition;
CSSLength yPosition;
CSSValueType clip;
CSSValueType origin;
CSSValueType size;
CSSLength width;
CSSLength height;
private:
void positionFromOne(const std::vector<std::string> &parts);
void positionFromTwo(const std::vector<std::string> &parts);
void positionFromThree(const std::vector<std::string> &parts);
void positionFromFour(const std::vector<std::string> &parts);
};
}//namespace
#endif // CL_CSS_BACKGROUND_H

@ -1,193 +0,0 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2019 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef NL_CSS_BACKGROUND_RENDERER_H
#define NL_CSS_BACKGROUND_RENDERER_H
#include "nel/misc/types_nl.h"
#include "nel/misc/rgba.h"
#include "nel/misc/geom_ext.h"
#include "nel/gui/css_types.h"
#include "nel/gui/css_background.h"
namespace NLGUI
{
class CInterfaceElement;
/**
* \brief Border renderer for GUI classes
* \date 2021-06-29 15:17 GMT
* \author Meelis Mägi (Nimetu)
*/
class CSSBackgroundRenderer
{
public:
// alpha value from parent
uint8 CurrentAlpha;
// TODO: should be moved to CSSBackground
sint32 TextureId;
public:
CSSBackgroundRenderer();
~CSSBackgroundRenderer();
// return true if no background is set
bool isEmpty() const
{
return m_Background.image.empty() && m_Background.color.A == 0;
}
void setModulateGlobalColor(bool m) { m_ModulateGlobalColor = m; }
void updateCoords();
void invalidateCoords() { m_Dirty = true; }
void invalidateContent() { m_Dirty = true; };
void clear();
void setBackground(const CSSBackground &bg);
// helper function to change background image
void setImage(const std::string &bgtex);
void setImageRepeat(bool b);
void setImageCover(bool b);
// helper function to change background color
void setColor(const NLMISC::CRGBA &color)
{
m_Dirty = true;
m_Background.color = color;
}
NLMISC::CRGBA getColor() const
{
return m_Background.color;
}
// override painting area to be at least the size of viewport (ie, <html> background)
void setFillViewport(bool b) {
m_Dirty = true;
m_FillViewport = b;
}
void setViewport(CInterfaceElement *root)
{
m_Dirty = true;
m_Viewport = root;
}
void setBorderArea(sint32 x, sint32 y, sint32 w, sint32 h)
{
m_Dirty = true;
m_BorderX = x;
m_BorderY = y;
m_BorderW = w;
m_BorderH = h;
}
void setPaddingArea(sint32 x, sint32 y, sint32 w, sint32 h)
{
m_Dirty = true;
m_PaddingX = x;
m_PaddingY = y;
m_PaddingW = w;
m_PaddingH = h;
}
void setContentArea(sint32 x, sint32 y, sint32 w, sint32 h)
{
m_Dirty = true;
m_ContentX = x;
m_ContentY = y;
m_ContentW = w;
m_ContentH = h;
}
// sizes for em, rem units
void setFontSize(float rootFontSize, float fontSize)
{
m_Dirty = true;
m_RootFontSize = rootFontSize;
m_FontSize = fontSize;
}
void draw();
private:
sint32 m_BorderX, m_BorderY, m_BorderW, m_BorderH;
sint32 m_PaddingX, m_PaddingY, m_PaddingW, m_PaddingH;
sint32 m_ContentX, m_ContentY, m_ContentW, m_ContentH;
// font size for 'rem'
float m_RootFontSize;
// font size for 'em'
float m_FontSize;
// viewport element for vw,wh,vmin,vmax
CInterfaceElement* m_Viewport;
struct SDrawQueue
{
sint32 TextureId;
NLMISC::CQuadUV Quad;
NLMISC::CRGBA Color;
};
std::vector<SDrawQueue> m_DrawQueue;
const sint8 m_RenderLayer;
bool m_ModulateGlobalColor;
// if true, painting area returns area at least the size of viewport (ie, <html> background)
bool m_FillViewport;
// if true, then updateCoords() is called from draw()
bool m_Dirty;
CSSBackground m_Background;
// get clip area based on background-clip
void getPaintingArea(const CSSBackground &bg, sint32 &areaX, sint32 &areaY, sint32 &areaW, sint32 &areaH) const;
// get positioning area based on background-origin
void getPositioningArea(const CSSBackground &bg, sint32 &areaX, sint32 &areaY, sint32 &areaW, sint32 &areaH) const;
// calculate image size based on background-size
void calculateSize(const CSSBackground &bg, sint32 &texW, sint32 &texH) const;
// calculate image position based on background-position
void calculatePosition(const CSSBackground &bg, sint32 &texX, sint32 &texY, sint32 &texW, sint32 &texH) const;
// calculate image tile position, size, count, and spacing based on background-repeat
void calculateTiles(const CSSBackground &bg, sint32 &texX, sint32 &texY, sint32 &texW, sint32 &texH, sint32 &tilesX, sint32 &tilesY, sint32 &spacingX, sint32 &spacingY) const;
// position, size, and count for first tile to cover an area
void getImageTile(sint32 &tilePos, sint32 &tileSize, sint32 &spacing, sint32 &tiles, sint32 areaPos, sint32 areaSize, CSSValueType repeat) const;
// push background color to draw queue
void buildColorQuads(const CSSBackground &bg);
// push background image to draw quque
void buildImageQuads(const CSSBackground &bg, sint32 textureId);
}; // CSSBackgroundRenderer
}//namespace
#endif // NL_CSS_BACKGROUND_RENDERER_H

@ -1,72 +0,0 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2019 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef CL_CSS_BORDER_H
#define CL_CSS_BORDER_H
#include "nel/misc/types_nl.h"
#include "nel/misc/rgba.h"
#include "nel/gui/css_types.h"
#include "nel/gui/css_length.h"
namespace NLGUI
{
/**
* \brief CSS border info
* \date 2021-07-23 09:51 GMT
* \author Meelis Mägi (Nimetu)
*/
class CSSBorder
{
public:
CSSBorder()
{
reset();
}
CSSBorder(uint width, CSSLineStyle style, NLMISC::CRGBA color)
{
set(width, style, color);
}
void reset()
{
set(CSS_LINE_WIDTH_MEDIUM, CSS_LINE_STYLE_NONE, NLMISC::CRGBA::Transparent);
}
void set(uint width, CSSLineStyle style, NLMISC::CRGBA color)
{
Width.setFloatValue(width, "px");
Style = style;
Color = color;
}
bool empty() const
{
return Style == CSS_LINE_STYLE_NONE || Style == CSS_LINE_STYLE_HIDDEN
|| Width.getFloat() == 0;
}
CSSLength Width;
CSSLineStyle Style;
NLMISC::CRGBA Color;
};
}//namespace
#endif // CL_CSS_BORDER_H

@ -1,5 +1,5 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2019 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -23,12 +23,9 @@
#include "nel/misc/rgba.h"
#include "nel/misc/geom_ext.h"
#include "nel/gui/css_types.h"
#include "nel/gui/css_border.h"
namespace NLGUI
{
class CInterfaceElement;
/**
* \brief Border renderer for GUI classes
* \date 2019-09-03 10:50 GMT
@ -37,76 +34,29 @@ namespace NLGUI
class CSSBorderRenderer
{
private:
enum EBorderSide
{
BORDER_TOP_LEFT = 0,
BORDER_TOP_RIGHT,
BORDER_BOTTOM_LEFT,
BORDER_BOTTOM_RIGHT,
BORDER_LEFT_TOP,
BORDER_RIGHT_TOP,
BORDER_LEFT_BOTTOM,
BORDER_RIGHT_BOTTOM,
BORDER_TOP,
BORDER_RIGHT,
BORDER_BOTTOM,
BORDER_LEFT,
BORDER_INVALID
};
// parent element screen coordinates
sint32 m_XReal, m_YReal;
sint32 m_WReal, m_HReal;
sint32 _XReal, _YReal;
sint32 _WReal, _HReal;
struct SDrawBorder
{
NLMISC::CQuadUV Quad;
NLMISC::CRGBA Color;
};
std::vector<SDrawBorder> m_DrawBorders;
NLMISC::CQuadUV _QuadT;
NLMISC::CQuadUV _QuadR;
NLMISC::CQuadUV _QuadB;
NLMISC::CQuadUV _QuadL;
sint8 m_RenderLayer;
bool m_ModulateGlobalColor;
uint8 _RenderLayer;
bool _ModulateGlobalColor;
// if true, then updateCoords() is called from draw()
bool m_Dirty;
// UI scale, used to calculate number of segments to draw for circle
float m_Scale;
CSSRect<CSSBorder> m_Border;
CSSRect<sint32> m_Computed;
// font size for 'rem'
float m_RootFontSize;
// font size for 'em'
float m_FontSize;
// if true, then CSSLength values are recomputed
bool m_MustComputeValues;
// viewport element for vw,wh,vmin,vmax
CInterfaceElement* m_Viewport;
// update CSSLength values
void computeValues();
void getAdjacentBorders(EBorderSide side, EBorderSide &adjBorderL, EBorderSide &adjBorderR) const;
void getAdjacentBorderWidth(EBorderSide side, sint32 &adjWidthL, sint32 &adjWidthR) const;
// dot
void buildDotCornerStart(EBorderSide side, SDrawBorder shape, float x1, float y1, float radius);
void buildDotCornerEnd(EBorderSide side, SDrawBorder shape, float x1, float y1, float radius);
void buildDotCorner(SDrawBorder shape, float x, float y, float r, const NLMISC::CLine &line);
// draw circle, angle is CCW between 0..1 (3'o'clock being 0deg).
void buildDotSegments(SDrawBorder shape, float x, float y, float radius, float fromAngle=0.f, float toAngle=1.f);
// dash
void makeBorderQuad(EBorderSide side, SDrawBorder &shape, float x, float y, float width, float thickness) const;
void makeCornerQuad(EBorderSide side, SDrawBorder &shape) const;
void buildDashedBorder(EBorderSide side);
void buildSolidBorder(EBorderSide side);
bool hasInnerShape(CSSLineStyle style) const;
bool _Dirty;
// if true, then at least one border is set
bool _Border;
bool _BorderTop, _BorderRight, _BorderBottom, _BorderLeft;
public:
uint32 TopWidth, RightWidth, BottomWidth, LeftWidth;
NLMISC::CRGBA TopColor, RightColor, BottomColor, LeftColor;
CSSLineStyle TopStyle, RightStyle, BottomStyle, LeftStyle;
// alpha value from parent
uint8 CurrentAlpha;
@ -118,67 +68,21 @@ namespace NLGUI
void setRect(sint32 x, sint32 y, sint32 w, sint32 h);
void setBorder(const CSSRect<CSSBorder> &b) { m_Dirty = true; m_Border = b; }
void setWidth(uint32 top, uint32 right, uint32 bottom, uint32 left);
void setStyle(CSSLineStyle top, CSSLineStyle right, CSSLineStyle bottom, CSSLineStyle left);
void setColor(const NLMISC::CRGBA &top, const NLMISC::CRGBA &right, const NLMISC::CRGBA &bottom, const NLMISC::CRGBA &left);
void updateCoords();
void invalidateCoords() { m_Dirty = true; }
void invalidateContent() { m_Dirty = true; }
bool isEmpty() const {
return (m_Border.Top.Width.getFloat() +
m_Border.Right.Width.getFloat() +
m_Border.Bottom.Width.getFloat() +
m_Border.Left.Width.getFloat()) == 0;
}
uint32 getTopWidth() { if (m_MustComputeValues) computeValues(); return m_Computed.Top; }
uint32 getRightWidth() { if (m_MustComputeValues) computeValues(); return m_Computed.Right; }
uint32 getBottomWidth() { if (m_MustComputeValues) computeValues(); return m_Computed.Bottom; }
uint32 getLeftWidth() { if (m_MustComputeValues) computeValues(); return m_Computed.Left; }
uint32 getLeftRightWidth() { if (m_MustComputeValues) computeValues(); return m_Computed.Left + m_Computed.Right; }
uint32 getTopBottomWidth() { if (m_MustComputeValues) computeValues(); return m_Computed.Top + m_Computed.Bottom; }
NLMISC::CRGBA getTopColor() const { return m_Border.Top.Color; }
NLMISC::CRGBA getRightColor() const { return m_Border.Right.Color; }
NLMISC::CRGBA getBottomColor() const { return m_Border.Bottom.Color; }
NLMISC::CRGBA getLeftColor() const { return m_Border.Left.Color; }
void setWidth(uint width)
{
m_Dirty = true;
m_MustComputeValues = true;
m_Border.Top.Width.setFloatValue(width, "px");
m_Border.Right.Width.setFloatValue(width, "px");
m_Border.Bottom.Width.setFloatValue(width, "px");
m_Border.Left.Width.setFloatValue(width, "px");
}
void setColor(const NLMISC::CRGBA &color)
{
m_Dirty = true;
m_Border.Top.Color = color;
m_Border.Right.Color = color;
m_Border.Bottom.Color = color;
m_Border.Left.Color = color;
}
// sizes for em, rem units
void setFontSize(float rootFontSize, float fontSize)
{
m_Dirty = true;
m_MustComputeValues = true;
m_RootFontSize = rootFontSize;
m_FontSize = fontSize;
}
void setViewport(CInterfaceElement *root)
{
m_Dirty = true;
m_MustComputeValues = true;
m_Viewport = root;
}
void invalidateCoords() { _Dirty = _Border = true; }
void invalidateContent() { _Dirty = _Border = true; };
uint32 getTopWidth() const;
uint32 getRightWidth() const;
uint32 getBottomWidth() const;
uint32 getLeftWidth() const;
uint32 getLeftRightWidth() const;
uint32 getTopBottomWidth() const;
void draw();
}; // CSSBorderRenderer

@ -1,76 +0,0 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2021 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef CL_CSS_LENGTH_H
#define CL_CSS_LENGTH_H
#include "nel/misc/types_nl.h"
#include "nel/gui/css_types.h"
namespace NLGUI
{
/**
* \brief CSS types used in GUI classes
* \date 2021-07-02 11:36 GMT
* \author Meelis Mägi (Nimetu)
*/
class CSSLength
{
public:
enum Kind {
Auto, Relative, Fixed
};
CSSLength(float value = 0, CSSUnitType unit = CSS_UNIT_NONE, Kind kind = Auto)
: m_Value(value), m_Unit(unit), m_Kind(Auto)
{}
void setAuto() { m_Kind = Auto; }
bool parseValue(const std::string &value, bool allowPercent = true, bool allowNegative = false);
void setFloatValue(float f, const std::string &unit);
float getValue() const;
float getFloat() const { return m_Value; }
bool isPercent() const { return m_Unit == CSS_UNIT_PERCENT; }
bool isAuto() const { return m_Kind == Auto; }
bool isRelative() const { return m_Kind == Relative; }
// % uses relValue
// em uses emSize
// rem uses remSize
// vw,vh,vi,vb,vmin,vmax uses vwSize/vhSize
float calculate(uint32 relValue, uint32 emSize, uint32 remSize, uint32 vwSize, uint32 whSize) const;
CSSUnitType getUnit() const { return m_Unit; }
std::string toString() const;
private:
void setUnit(const std::string &unit);
float m_Value;
CSSUnitType m_Unit;
Kind m_Kind;
};
}//namespace
#endif // CL_CSS_LENGTH_H

@ -1,8 +1,5 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2021 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -41,7 +38,7 @@ namespace NLGUI
private:
// stylesheet currently parsed
std::string _Style;
ucstring _Style;
// keep track of current position in _Style
size_t _Position;
@ -73,49 +70,49 @@ namespace NLGUI
void preprocess();
// parse selectors + combinators
std::vector<CCssSelector> parse_selector(const std::string &sel, std::string &pseudoElement, std::string::size_type &pos) const;
std::vector<CCssSelector> parse_selector(const ucstring &sel, std::string &pseudoElement) const;
// parse selector and style
void parseRule(const std::string &selectorString, const std::string &styleString);
void parseRule(const ucstring &selectorString, const ucstring &styleString);
inline bool is_eof() const
{
return _Position >= _Style.size();
}
inline bool is_whitespace(char ch) const
inline bool is_whitespace(ucchar ch) const
{
return (ch == ' ' || ch == '\t' || ch == '\n');
return (ch == (ucchar)' ' || ch == (ucchar)'\t' || ch == (ucchar)'\n');
}
inline bool is_hex(char ch) const
inline bool is_hex(ucchar ch) const
{
return ((ch >= '0' && ch <= '9') ||
(ch >= 'a' && ch <= 'f') ||
(ch >= 'A' && ch <= 'F'));
return ((ch >= (ucchar)'0' && ch <= (ucchar)'9') ||
(ch >= (ucchar)'a' && ch <= (ucchar)'f') ||
(ch >= (ucchar)'A' && ch <= (ucchar)'F'));
}
inline bool maybe_escape() const
{
// escaping newline (\n) only allowed inside strings
return (_Style.size() - _Position) >= 1 && _Style[_Position] == '\\' && _Style[_Position+1] != '\n';
return (_Style.size() - _Position) >= 1 && _Style[_Position] == (ucchar)'\\' && _Style[_Position+1] != '\n';
}
inline bool is_quote(char ch) const
inline bool is_quote(ucchar ch) const
{
return ch== '"' || ch == '\'';
return ch== (ucchar)'"' || ch == (ucchar)'\'';
}
inline bool is_block_open(char ch) const
inline bool is_block_open(ucchar ch) const
{
return ch == (char)'{' || ch == (char)'[' || ch == (char)'(';
return ch == (ucchar)'{' || ch == (ucchar)'[' || ch == (ucchar)'(';
}
inline bool is_block_close(char ch, char open) const
inline bool is_block_close(ucchar ch, ucchar open) const
{
return ((open == '{' && ch == (char)'}') ||
(open == '[' && ch == (char)']') ||
(open == '(' && ch == (char)')'));
return ((open == '{' && ch == (ucchar)'}') ||
(open == '[' && ch == (ucchar)']') ||
(open == '(' && ch == (ucchar)')'));
}
inline bool is_comment_open() const
@ -123,25 +120,25 @@ namespace NLGUI
if (_Position+1 > _Style.size())
return false;
return _Style[_Position] == (char)'/' && _Style[_Position+1] == (char)'*';
return _Style[_Position] == (ucchar)'/' && _Style[_Position+1] == (ucchar)'*';
}
inline bool is_nonascii(char ch) const
inline bool is_nonascii(ucchar ch) const
{
return ch >= 0x80 /*&& ch <= 255*/;
}
inline bool is_alpha(char ch) const
inline bool is_alpha(ucchar ch) const
{
return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z');
}
inline bool is_digit(char ch) const
inline bool is_digit(ucchar ch) const
{
return ch >= '0' && ch <= '9';
}
inline bool is_nmchar(char ch) const
inline bool is_nmchar(ucchar ch) const
{
// checking escape here does not check if next char is '\n' or not
return ch == '_' || ch == '-' || is_alpha(ch) || is_digit(ch) || is_nonascii(ch) || ch == '\\'/*is_escape(ch)*/;

@ -1,5 +1,5 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2021 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -96,8 +96,6 @@ namespace NLGUI
// match An+B rule to child index (1 based)
bool matchNth(sint childNr, sint a, sint b) const;
// match :lang(xx)
bool matchLang(const CHtmlElement &elm, const std::string &pseudo) const;
// parse nth-child string to 'a' and 'b' components
// :nth-child(odd)

@ -1,5 +1,5 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2021 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -21,9 +21,6 @@
#include "nel/misc/rgba.h"
#include "nel/gui/css_selector.h"
#include "nel/gui/css_types.h"
#include "nel/gui/css_length.h"
#include "nel/gui/css_background.h"
#include "nel/gui/css_border.h"
namespace NLGUI
{
@ -63,15 +60,18 @@ namespace NLGUI
Underlined=false;
StrikeThrough=false;
GlobalColor=false;
GlobalColorText=false;
DisplayBlock=false;
Width=-1;
Height=-1;
MaxWidth=-1;
MaxHeight=-1;
// border style
BorderTopWidth = BorderRightWidth = BorderBottomWidth = BorderLeftWidth = CSS_LINE_WIDTH_MEDIUM;
BorderTopStyle = BorderRightStyle = BorderBottomStyle = BorderLeftStyle = CSS_LINE_STYLE_NONE;
BorderTopColor = BorderRightColor = BorderBottomColor = BorderLeftColor = NLMISC::CRGBA::Transparent;
// background
BackgroundColor=NLMISC::CRGBA::Black;
BackgroundColorOver=NLMISC::CRGBA::Black;
MarginTop = MarginRight = MarginBottom = MarginLeft = 0;
PaddingTop = PaddingRight = PaddingBottom = PaddingLeft = 0;
}
@ -94,7 +94,6 @@ namespace NLGUI
NLMISC::CRGBA TextColor;
STextShadow TextShadow;
bool GlobalColor;
bool GlobalColorText;
bool Underlined;
bool StrikeThrough;
bool DisplayBlock;
@ -102,10 +101,11 @@ namespace NLGUI
sint32 Height;
sint32 MaxWidth;
sint32 MaxHeight;
CSSRect<CSSBorder> Border;
CSSBackground Background;
uint32 BorderTopWidth, BorderRightWidth, BorderBottomWidth, BorderLeftWidth;
CSSLineStyle BorderTopStyle, BorderRightStyle, BorderBottomStyle, BorderLeftStyle;
NLMISC::CRGBA BorderTopColor, BorderRightColor, BorderBottomColor, BorderLeftColor;
NLMISC::CRGBA BackgroundColor;
NLMISC::CRGBA BackgroundColorOver;
uint32 MarginTop, MarginRight, MarginBottom, MarginLeft;
uint32 PaddingTop, PaddingRight, PaddingBottom, PaddingLeft;
std::string WhiteSpace;
@ -177,24 +177,16 @@ namespace NLGUI
// parse 'padding' into 'padding-top', 'padding-left', etc
void expandPaddingShorthand(const std::string &value, TStyle &style) const;
void expandMarginShorthand(const std::string &value, TStyle &style) const;
// expand shorthand rule, ie "border", into longhand names, ie "border-top-width"
// if shorthand is present in style, then its removed
void expandShorthand(const std::string &prop, const std::string &value, TStyle &style) const;
// parse string value into corresponding value
void applyBorderWidth(const std::string &value, CSSLength *dest, const CSSLength &currentWidth) const;
void applyBorderWidth(const std::string &value, uint32 *dest, const uint32 currentWidth, const uint32 fontSize) const;
void applyBorderColor(const std::string &value, NLMISC::CRGBA *dest, const NLMISC::CRGBA &currentColor, const NLMISC::CRGBA &textColor) const;
void applyLineStyle(const std::string &value, CSSLineStyle *dest, const CSSLineStyle &currentStyle) const;
void applyPaddingWidth(const std::string &value, uint32 *dest, const uint32 currentPadding, uint32 fontSize) const;
void applyMarginWidth(const std::string &value, uint32 *dest, const uint32 current, uint32 fontSize) const;
// parse and replace var(--name, fallback) function
// return false if property should be ignored
bool cssFuncVar(std::string &func, const TStyle &styleRules, const std::set<std::string> &seenProperties) const;
// return false if property was not defined
bool lookupPropertyValue(const std::string &name, std::string &value, const TStyle &styleRules) const;
public:
void reset();
@ -217,22 +209,15 @@ namespace NLGUI
_StyleStack.push_back(Current);
Current.GlobalColor = false;
// inherit GlobalColorText
Current.DisplayBlock = false;
Current.Width=-1;
Current.Height=-1;
Current.MaxWidth=-1;
Current.MaxHeight=-1;
Current.Border.Top.reset();
Current.Border.Right.reset();
Current.Border.Bottom.reset();
Current.Border.Left.reset();
Current.Background = CSSBackground();
Current.BackgroundColorOver = NLMISC::CRGBA::Transparent;
Current.MarginTop = Current.MarginRight = Current.MarginBottom = Current.MarginLeft = 0;
Current.BorderTopWidth = Current.BorderRightWidth = Current.BorderBottomWidth = Current.BorderLeftWidth = CSS_LINE_WIDTH_MEDIUM;
Current.BorderTopStyle = Current.BorderRightStyle = Current.BorderBottomStyle = Current.BorderLeftStyle = CSS_LINE_STYLE_NONE;
Current.BorderTopColor = Current.BorderRightColor = Current.BorderBottomColor = Current.BorderLeftColor = Current.TextColor;
Current.PaddingTop = Current.PaddingRight = Current.PaddingBottom = Current.PaddingLeft = 0;
Current.StyleRules.clear();

@ -1,5 +1,5 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2019 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -30,12 +30,7 @@ namespace NLGUI
enum CSSLineStyle {
CSS_LINE_STYLE_NONE = 0,
CSS_LINE_STYLE_HIDDEN,
CSS_LINE_STYLE_DOTTED,
CSS_LINE_STYLE_DASHED,
CSS_LINE_STYLE_SOLID,
CSS_LINE_STYLE_DOUBLE,
CSS_LINE_STYLE_GROOVE,
CSS_LINE_STYLE_RIDGE,
CSS_LINE_STYLE_INSET,
CSS_LINE_STYLE_OUTSET
};
@ -47,53 +42,6 @@ namespace NLGUI
CSS_LINE_WIDTH_THICK = 5
};
enum CSSUnitType {
CSS_UNIT_NONE = 0,
CSS_UNIT_EM,
CSS_UNIT_REM,
CSS_UNIT_PERCENT,
CSS_UNIT_PX,
CSS_UNIT_PT,
CSS_UNIT_VW,
CSS_UNIT_VH,
CSS_UNIT_VI,
CSS_UNIT_VB,
CSS_UNIT_VMIN,
CSS_UNIT_VMAX
};
enum CSSValueType {
CSS_VALUE_NONE = 0,
CSS_VALUE_REPEAT,
CSS_VALUE_SPACE,
CSS_VALUE_ROUND,
CSS_VALUE_NOREPEAT,
CSS_VALUE_FIXED,
CSS_VALUE_LOCAL,
CSS_VALUE_SCROLL,
CSS_VALUE_LEFT,
CSS_VALUE_CENTER,
CSS_VALUE_RIGHT,
CSS_VALUE_TOP,
CSS_VALUE_BOTTOM,
CSS_VALUE_BORDER_BOX,
CSS_VALUE_PADDING_BOX,
CSS_VALUE_CONTENT_BOX,
CSS_VALUE_LENGTH,
CSS_VALUE_AUTO,
CSS_VALUE_COVER,
CSS_VALUE_CONTAIN
};
template<typename T>
struct CSSRect
{
T Top;
T Right;
T Bottom;
T Left;
};
}//namespace
#endif // CL_CSS_TYPES_H

@ -1,9 +1,8 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2015 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013-2014 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -86,12 +85,9 @@ namespace NLGUI
/// Get the ContextHelp for this control. Default is to return _ContextHelp
virtual void getContextHelp(std::string &help) const {help= _ContextHelp;}
#ifdef RYZOM_LUA_UCSTRING
virtual void getContextHelpAsUtf16(ucstring &help) const {help.fromUtf8(_ContextHelp);} // Compatibility
#endif
virtual void getContextHelp(ucstring &help) const {help= _ContextHelp;}
/// Get the ContextHelp for this control, with tooltip specific code. Default behaviour is identical to getContextHelp.
virtual void getContextHelpToolTip(std::string &help) const { getContextHelp(help); }
virtual void getContextHelpToolTip(ucstring &help) const { getContextHelp(help); }
// Get the name of the context help window. Default to "context_help"
virtual std::string getContextHelpWindowName() const;
/// Get the ContextHelp ActionHandler. If "", noop
@ -127,12 +123,8 @@ namespace NLGUI
void setToolTipPosRef(THotSpot pos) { _ToolTipPosRef = pos;}
/// replace the default contextHelp
std::string getDefaultContextHelp() const {return _ContextHelp;}
void setDefaultContextHelp(const std::string &help) {_ContextHelp= help;}
#ifdef RYZOM_LUA_UCSTRING
ucstring getDefaultContextHelpAsUtf16() const {return ucstring::makeFromUtf8(_ContextHelp);} // Compatibility
void setDefaultContextHelpAsUtf16(const ucstring &help) {_ContextHelp= help.toUtf8();} // Compatibility
#endif
ucstring getDefaultContextHelp() const {return _ContextHelp;}
void setDefaultContextHelp(const ucstring &help) {_ContextHelp= help;}
void setOnContextHelp(const std::string &help) {_OnContextHelp= help;}
void setOnContextHelpAHParams(const std::string &p) {_OnContextHelpParams= p;}
@ -162,18 +154,12 @@ namespace NLGUI
// called when keyboard capture has been lost
virtual void onKeyboardCaptureLost() {}
#ifdef RYZOM_LUA_UCSTRING
// 'tooltip' property expects string to be ucstring or latin1 which is not possible from html page
int luaSetTooltipUtf8(CLuaState &ls); // Compatibility
#endif
int luaSetTooltipUtf8(CLuaState &ls);
REFLECT_EXPORT_START(CCtrlBase, CViewBase)
#ifdef RYZOM_LUA_UCSTRING
REFLECT_UCSTRING("tooltip", getDefaultContextHelpAsUtf16, setDefaultContextHelpAsUtf16); // Compatibility
REFLECT_LUA_METHOD("setTooltipUtf8", luaSetTooltipUtf8); // Compatibility
#else
REFLECT_STRING("tooltip", getDefaultContextHelp, setDefaultContextHelp);
#endif
REFLECT_UCSTRING("tooltip", getDefaultContextHelp, setDefaultContextHelp);
REFLECT_LUA_METHOD("setTooltipUtf8", luaSetTooltipUtf8);
REFLECT_EXPORT_END
// special for mouse over : return true and fill the name of the cursor to display
@ -185,7 +171,7 @@ namespace NLGUI
protected:
// This is the ContextHelp filled by default in parse()
std::string _ContextHelp;
ucstring _ContextHelp;
CStringShared _OnContextHelp;
CStringShared _OnContextHelpParams;
CStringShared _ToolTipSpecialParent;

@ -1,9 +1,8 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2019 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -178,7 +177,6 @@ namespace NLGUI
bool _MouseDown : 1;
bool _CallingAH : 1;
bool _Cancelable : 1; // true if the slider may be cancelled when pressed on the mouse right button
bool _Keyboard : 1;
bool _Frozen : 1;
bool _Scale : 1;

@ -1,9 +1,8 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2019 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013-2014 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -97,14 +96,8 @@ namespace NLGUI
bool getTextModulateGlobalColorOver() const {return _TextModulateGlobalColorOver;}
void setTextModulateGlobalColorOver(bool v) {_TextModulateGlobalColorOver= v;}
// Set text (noop if text id)
void setText (const std::string &text);
std::string getText () const;
#ifdef RYZOM_LUA_UCSTRING
void setTextAsUtf16 (const ucstring &text); // Compatibility
ucstring getTextAsUtf16 () const; // Compatibility
#endif
void setLocalize (bool localize);
bool isLocalized () const;
void setText (const ucstring &text);
ucstring getText () const;
void setHardText (const std::string &text);
std::string getHardText () const;
@ -134,33 +127,16 @@ namespace NLGUI
void setTexturePushed(const std::string &l, const std::string &m, const std::string &r);
void setTextureOver(const std::string &l, const std::string &m, const std::string &r);
// lua
void setTextureLua (const std::string &name);
void setTexturePushedLua (const std::string &name);
void setTextureOverLua (const std::string &name);
// return texture _l.tga
std::string getTexture () const;
std::string getTexturePushed () const;
std::string getTextureOver() const;
int luaGetViewText(CLuaState &ls);
REFLECT_EXPORT_START(CCtrlTextButton, CCtrlBaseButton)
#ifdef RYZOM_LUA_UCSTRING
REFLECT_UCSTRING("uc_hardtext", getTextAsUtf16, setTextAsUtf16); // Compatibility
#endif
REFLECT_BOOL("localize", isLocalized, setLocalize);
REFLECT_UCSTRING("uc_hardtext", getText, setText);
REFLECT_STRING("hardtext", getHardText, setHardText);
REFLECT_STRING("text", getText, setText);
REFLECT_SINT32("text_x", getTextX, setTextX)
REFLECT_SINT32("wmargin", getWMargin, setWMargin)
REFLECT_SINT32("wmin", getWMin, setWMin)
REFLECT_SINT32("hmin", getHMin, setHMin)
REFLECT_LUA_METHOD("getViewText", luaGetViewText)
REFLECT_STRING("texture", getTexture, setTextureLua);
REFLECT_STRING("texture_pushed", getTexturePushed, setTexturePushedLua);
REFLECT_STRING("texture_over", getTextureOver, setTextureOverLua);
REFLECT_EXPORT_END
void onRemoved();

@ -1,9 +1,9 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2019 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2015-2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
// Copyright (C) 2015 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -60,19 +60,13 @@ namespace NLGUI
// Combo Texts
void resetTexts();
void addText(const std::string &text);
void setText(uint i, const std::string &text);
void insertText(uint i, const std::string &text);
const std::string &getText(uint i) const;
#ifdef RYZOM_LUA_UCSTRING
ucstring getTextAsUtf16(uint i) const; // Compatibility
#endif
void addText(const ucstring &text);
void setText(uint i, const ucstring &text);
void insertText(uint i, const ucstring &text);
const ucstring &getText(uint i) const;
uint getTextId(uint i) const;
uint getTextPos(uint nId) const;
const std::string &getTexture(uint i) const;
#ifdef RYZOM_LUA_UCSTRING
ucstring getTextureAsUtf16(uint i) const; // Compatibility
#endif
const ucstring &getTexture(uint i) const;
void setGrayed(uint i, bool g);
bool getGrayed(uint i) const;
void removeText(uint nPos);
@ -93,15 +87,11 @@ namespace NLGUI
std::string getSelectionText() const;
// view text
void setViewText(const std::string & text);
std::string getViewText() const;
#ifdef RYZOM_LUA_UCSTRING
void setViewTextAsUtf16(const ucstring &text) { setViewText(text.toUtf8()); } // Compatibility
ucstring getViewTextAsUtf16() const; // Compatibility
#endif
void setViewText(const ucstring & text);
ucstring getViewText() const;
CViewText *getViewText();
void setTexture(uint i, const std::string &texture);
void setTexture(uint i, const ucstring &texture);
sint32 evalContentWidth() const;
@ -132,11 +122,7 @@ namespace NLGUI
REFLECT_LUA_METHOD("resetTexts", luaResetTexts)
REFLECT_SINT32 ("selectionNb", getSelectionNb, setSelectionNb)
REFLECT_STRING ("selection_text", getSelectionText, setSelectionText)
#ifdef RYZOM_LUA_UCSTRING
REFLECT_UCSTRING ("view_text", getViewTextAsUtf16, setViewTextAsUtf16) // Compatibility
#else
REFLECT_STRING ("view_text", getViewText, setViewText)
#endif
REFLECT_UCSTRING ("view_text", getViewText, setViewText)
REFLECT_EXPORT_END
@ -151,8 +137,8 @@ namespace NLGUI
// sint32
CInterfaceProperty _Selection;
sint32 _NotLinkedToDBSelection;
std::vector<std::pair<uint, std::string> > _Texts;
std::vector<std::string> _Textures;
std::vector<std::pair<uint, ucstring> > _Texts;
std::vector<ucstring> _Textures;
std::vector<bool> _Grayed;
// Action Handler called on combo click
@ -169,7 +155,7 @@ namespace NLGUI
CCtrlBaseButton *_SelectButton;
bool _IsExternViewText;
std::string _ExternViewText;
ucstring _ExternViewText;
private:

@ -3,7 +3,6 @@
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -58,7 +57,7 @@ namespace NLGUI
CInterfaceProperty _NumberMax;
sint32 _Cache;
sint32 _CacheMax;
std::string _EmptyText;
ucstring _EmptyText;
void buildTextFromCache();
};

@ -1,9 +1,8 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2020 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -61,7 +60,7 @@ public:
keydown = 0, // a key has been press down. The key value is stored as a TKey
keyup, // a key has been released. The key value is stored as a TKey
keychar, // a key has been stroke. The key is a ucchar
keystring, // a string has been sent. The string is a utf-8 string
keystring, // a string has been sent. The string is a ucstring
unknown, // uninitialized event
};
CEventDescriptorKey() : _KeyEvent(unknown), _CtrlState(false), _ShiftState(false), _AltState(false), _Char(0)
@ -83,13 +82,13 @@ public:
return _Key;
}
// return the char that has been pressed. The key event type MUST be 'keychar', else => assert
u32char getChar() const
ucchar getChar() const
{
nlassert(_KeyEvent == keychar);
return _Char;
}
// return the string that has been sent. The key event type MUST be 'keystring', else => assert
std::string getString() const
ucstring getString() const
{
nlassert(_KeyEvent == keystring);
return _String;
@ -142,9 +141,9 @@ private:
union
{
NLMISC::TKey _Key;
u32char _Char;
ucchar _Char;
};
std::string _String;
ucstring _String;
};
// ----------------------------------------------------------------------------

@ -3,7 +3,6 @@
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -249,14 +248,12 @@ namespace NLGUI
// Get the header color draw. NB: depends if grayed, and if active.
NLMISC::CRGBA getDrawnHeaderColor () const;
#ifdef RYZOM_LUA_UCSTRING
ucstring getUCTitleOpened () const; // Compatibility
void setUCTitleOpened (const ucstring &title); // Compatibility
ucstring getUCTitleClosed () const; // Compatibility
void setUCTitleClosed (const ucstring &title); // Compatibility
ucstring getUCTitle () const; // Compatibility
void setUCTitle (const ucstring &title); // Compatibility
#endif
ucstring getUCTitleOpened () const;
void setUCTitleOpened (const ucstring &title);
ucstring getUCTitleClosed () const;
void setUCTitleClosed (const ucstring &title);
ucstring getUCTitle () const;
void setUCTitle (const ucstring &title);
void setPopable(bool popable) { _Popable = popable; }
bool isPopable() const { return _Popable; }
@ -290,13 +287,9 @@ namespace NLGUI
REFLECT_STRING("title", getTitle, setTitle);
REFLECT_STRING("title_opened", getTitleOpened, setTitleOpened);
REFLECT_STRING("title_closed", getTitleClosed, setTitleClosed);
#ifdef RYZOM_LUA_UCSTRING
REFLECT_UCSTRING("uc_title_opened", getUCTitleOpened, setUCTitleOpened); // Compatibility
REFLECT_UCSTRING("uc_title_closed", getUCTitleClosed, setUCTitleClosed); // Compatibility
REFLECT_UCSTRING("uc_title", getUCTitle, setUCTitle); // Compatibility
#endif
REFLECT_UCSTRING("uc_title_opened", getUCTitleOpened, setUCTitleOpened);
REFLECT_UCSTRING("uc_title_closed", getUCTitleClosed, setUCTitleClosed);
REFLECT_UCSTRING("uc_title", getUCTitle, setUCTitle);
REFLECT_STRING("title_color", getTitleColorAsString, setTitleColorAsString);
REFLECT_SINT32("pop_min_h", getPopupMinH, setPopupMinH);
REFLECT_SINT32("pop_max_h", getPopupMaxH, setPopupMaxH);
@ -309,8 +302,6 @@ namespace NLGUI
REFLECT_BOOL("lockable", isLockable, setLockable);
REFLECT_BOOL("locked", isLocked, setLocked);
REFLECT_BOOL("localize", isLocalize, setLocalize);
REFLECT_BOOL("header_active", getHeaderActive, setHeaderActive);
REFLECT_BOOL("right_button_enabled", getRightButtonEnabled, setRightButtonEnabled);
REFLECT_EXPORT_END
@ -373,7 +364,7 @@ namespace NLGUI
bool isActiveSavable() const { return _ActiveSavable; }
bool isLocalize() const { return _Localize; }
void setLocalize(bool localize);
void setLocalize(bool localize) { _Localize = localize; }
void setPopupX(sint32 x) { _PopupX = x; }
void setPopupY(sint32 y) { _PopupY = y; }
@ -486,8 +477,8 @@ namespace NLGUI
float _CurrentRolloverAlphaContainer;
float _CurrentRolloverAlphaContent;
sint32 _LayerSetup;
std::string _TitleTextOpened;
std::string _TitleTextClosed;
ucstring _TitleTextOpened;
ucstring _TitleTextClosed;
CViewText *_TitleOpened;
CViewText *_TitleClosed;
sint32 _TitleDeltaMaxW;
@ -645,9 +636,6 @@ namespace NLGUI
TTileClass convertTitleClass(const char *ptr);
void setTitledOpenedViewText();
void setTitledClosedViewText();
static COptionsContainerMove *getMoveOptions();
COptionsLayer *getContainerOptions(sint32 ls=-1); // Depends if overload by OptionsName or default used

@ -1,5 +1,5 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2014 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>

@ -1,9 +1,8 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2017 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013-2014 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -64,29 +63,26 @@ namespace NLGUI
virtual bool handleEvent (const NLGUI::CEventDescriptor& eventDesc);
/// Accessors
std::string getInputString() const;
std::string getPrompt() const;
const ::u32string &getInputStringRef() const { return _InputString; }
const ::u32string &getPromptRef() const { return _Prompt; }
ucstring getInputString() const { return _InputString; }
const ucstring &getInputStringRef() const { return _InputString; }
const ucstring &getPrompt() const { return _Prompt; }
/** Set the prompt
* NB : line returns are encoded as '\n', not '\r\n'
*/
void setPrompt(const std::string &s);
void setInputString(const std::string &str);
void setInputStringRef(const ::u32string &str);
void setPrompt(const ucstring &s) { _Prompt = s; }
void setInputString(const ucstring &str);
void setInputStringRef(const ucstring &str) {_InputString = str; };
void setInputStringAsInt(sint32 val);
sint32 getInputStringAsInt() const;
void setInputStringAsInt64(sint64 val);
sint64 getInputStringAsInt64() const;
void setInputStringAsFloat(float val);
float getInputStringAsFloat() const;
#ifdef RYZOM_LUA_UCSTRING
void setInputStringAsUtf16(const ucstring &str); // Compatibility
ucstring getInputStringAsUtf16() const; // Compatibility
void setInputStringAsUtf32(const ::u32string &str) { setInputStringRef(str); } // Compatibility
::u32string getInputStringAsUtf32() const { return _InputString; } // Compatibility
#endif
void setInputStringAsStdString(const std::string &str);
std::string getInputStringAsStdString() const;
void setInputStringAsUtf8(const std::string &str);
std::string getInputStringAsUtf8() const;
void setColor(NLMISC::CRGBA col);
@ -101,7 +97,7 @@ namespace NLGUI
static CGroupEditBox *getMenuFather() { return _MenuFather; }
void setCommand(const std::string &command, bool execute);
void setCommand(const ucstring &command, bool execute);
// Stop parent from blinking
void stopParentBlink() { if (_Parent) _Parent->disableBlink(); }
@ -125,7 +121,7 @@ namespace NLGUI
sint32 getMaxHistoric() const {return _MaxHistoric;}
sint32 getCurrentHistoricIndex () const {return _CurrentHistoricIndex;}
void setCurrentHistoricIndex (sint32 index) {_CurrentHistoricIndex=index;}
const ::u32string &getHistoric(uint32 index) const {return _Historic[index];}
const ucstring &getHistoric(uint32 index) const {return _Historic[index];}
uint32 getNumHistoric() const {return (uint32)_Historic.size ();}
// Get on change action handler
@ -143,7 +139,7 @@ namespace NLGUI
// Paste the selection into buffer
void paste();
// Write the string into buffer
void writeString(const std::string &str, bool replace = true, bool atEnd = true);
void writeString(const ucstring &str, bool replace = true, bool atEnd = true);
// Expand the expression (true if there was a '/' at the start of the line)
bool expand();
@ -174,7 +170,7 @@ namespace NLGUI
virtual void onKeyboardCaptureLost();
// set the input string as "default". will be reseted at first click (used for user information)
void setDefaultInputString(const std::string &str);
void setDefaultInputString(const ucstring &str);
// For Interger and PositiveInteger, can specify min and max values
void setIntegerMinValue(sint32 minValue) {_IntegerMinValue=minValue;}
@ -193,10 +189,8 @@ namespace NLGUI
REFLECT_LUA_METHOD("setSelectionAll", luaSetSelectionAll);
REFLECT_LUA_METHOD("setFocusOnText", luaSetFocusOnText);
REFLECT_LUA_METHOD("cancelFocusOnText", luaCancelFocusOnText);
REFLECT_STRING("input_string", getInputString, setInputString);
#ifdef RYZOM_LUA_UCSTRING
REFLECT_UCSTRING("uc_input_string", getInputStringAsUtf16, setInputStringAsUtf16); // Compatibility
#endif
REFLECT_STRING("input_string", getInputStringAsStdString, setInputStringAsStdString);
REFLECT_UCSTRING("uc_input_string", getInputString, setInputString);
REFLECT_EXPORT_END
/** Restore the original value of the edit box.
@ -221,7 +215,6 @@ namespace NLGUI
float _BlinkTime;
sint32 _CursorPos;
uint32 _MaxNumChar;
uint32 _MaxNumBytes;
uint32 _MaxNumReturn;
uint32 _MaxFloatPrec; // used in setInputStringAsFloat() only
sint32 _MaxCharsSize;
@ -235,17 +228,17 @@ namespace NLGUI
NLMISC::CRGBA _BackSelectColor;
// Text info
::u32string _Prompt;
::u32string _InputString;
ucstring _Prompt;
ucstring _InputString;
CViewText *_ViewText;
// undo / redo
::u32string _StartInputString; // value of the input string when focus was acuired first
::u32string _ModifiedInputString;
ucstring _StartInputString; // value of the input string when focus was acuired first
ucstring _ModifiedInputString;
// Historic info
typedef std::deque<::u32string> THistoric;
typedef std::deque<ucstring> THistoric;
THistoric _Historic;
uint32 _MaxHistoric;
sint32 _CurrentHistoricIndex;
@ -282,7 +275,7 @@ namespace NLGUI
bool _CanRedo : 1;
bool _CanUndo : 1;
std::vector<u32char> _NegativeFilter;
std::vector<char> _NegativeFilter;
sint _CursorTexID;
sint32 _CursorWidth;
@ -305,13 +298,13 @@ namespace NLGUI
void handleEventString(const NLGUI::CEventDescriptorKey &event);
void setup();
void triggerOnChangeAH();
void appendStringFromClipboard(const std::string &str);
void appendStringFromClipboard(const ucstring &str);
std::string getSelection();
ucstring getSelection();
static CGroupEditBox *_MenuFather;
static bool isValidAlphaNumSpace(u32char c)
static bool isValidAlphaNumSpace(ucchar c)
{
if (c > 255) return false;
char ac = (char) c;
@ -321,7 +314,7 @@ namespace NLGUI
ac==' ';
}
static bool isValidAlphaNum(u32char c)
static bool isValidAlphaNum(ucchar c)
{
if (c > 255) return false;
char ac = (char) c;
@ -330,7 +323,7 @@ namespace NLGUI
(ac >= 'A' && ac <= 'Z');
}
static bool isValidAlpha(u32char c)
static bool isValidAlpha(ucchar c)
{
if (c > 255) return false;
char ac = (char) c;
@ -338,13 +331,13 @@ namespace NLGUI
(ac >= 'A' && ac <= 'Z');
}
static bool isValidPlayerNameChar(u32char c)
static bool isValidPlayerNameChar(ucchar c)
{
// valid player name (with possible shard prefix / suffix format
return isValidAlpha(c) || c=='.' || c=='(' || c==')';
}
static bool isValidFilenameChar(u32char c)
static bool isValidFilenameChar(ucchar c)
{
if (c == '\\' ||
c == '/' ||
@ -358,12 +351,12 @@ namespace NLGUI
return true;
}
//
bool isFiltered(u32char c)
bool isFiltered(ucchar c)
{
ptrdiff_t length = _NegativeFilter.size();
for (ptrdiff_t k = 0; k < length; ++k)
uint length = (uint)_NegativeFilter.size();
for (uint k = 0; k < length; ++k)
{
if (_NegativeFilter[k] == c) return true;
if ((ucchar) _NegativeFilter[k] == c) return true;
}
return false;
}

@ -1,9 +1,8 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2021 Winch Gate Property Limited
// Copyright (C) 2010-2019 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2019-2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -28,16 +27,13 @@
#include "nel/gui/ctrl_button.h"
#include "nel/gui/group_table.h"
#include "nel/gui/html_element.h"
#include "nel/gui/html_parser.h"
#include "nel/gui/css_style.h"
#include "nel/gui/css_background_renderer.h"
// forward declaration
typedef void CURLM;
namespace NLGUI
{
class CViewLink;
class CCtrlButton;
class CCtrlTextButton;
class CCtrlScroll;
@ -48,20 +44,6 @@ namespace NLGUI
extern std::string CurrentCookie;
class ICurlDownloadCB
{
public:
ICurlDownloadCB(const std::string &url)
: url(url)
{}
virtual ~ICurlDownloadCB() {};
virtual void finish() = 0;
std::string url;
};
// HTML group
/**
* Widget to have a resizable scrolltext and its scrollbar
@ -133,9 +115,6 @@ namespace NLGUI
// Browse error
void browseError (const char *msg);
// Error message with html content
void browseErrorHtml(const std::string &html);
bool isBrowsing();
// Update coords
@ -148,9 +127,9 @@ namespace NLGUI
void endParagraph();
// add image download (used by view_bitmap.cpp to load web images)
ICurlDownloadCB *addImageDownload(const std::string &url, CViewBase *img, const CStyleParams &style = CStyleParams(), const TImageType type = NormalImage, const std::string &placeholder = "web_del.tga");
ICurlDownloadCB *addTextureDownload(const std::string &url, sint32 &texId, CViewBase *view);
void removeImageDownload(ICurlDownloadCB *handle, CViewBase *img);
void addImageDownload(const std::string &url, CViewBase *img, const CStyleParams &style = CStyleParams(), const TImageType type = NormalImage, const std::string &placeholder = "web_del.tga");
// remove image from download list if present
void removeImageDownload(CViewBase *img);
std::string localImageName(const std::string &url);
// Timeout
@ -158,15 +137,37 @@ namespace NLGUI
float getTimeout() const {return (float)_TimeoutValue;}
// Some constants
NLMISC::CRGBA BgColor;
NLMISC::CRGBA ErrorColor;
NLMISC::CRGBA LinkColor;
NLMISC::CRGBA TextColor;
NLMISC::CRGBA H1Color;
NLMISC::CRGBA H2Color;
NLMISC::CRGBA H3Color;
NLMISC::CRGBA H4Color;
NLMISC::CRGBA H5Color;
NLMISC::CRGBA H6Color;
bool ErrorColorGlobalColor;
bool LinkColorGlobalColor;
bool TextColorGlobalColor;
bool H1ColorGlobalColor;
bool H2ColorGlobalColor;
bool H3ColorGlobalColor;
bool H4ColorGlobalColor;
bool H5ColorGlobalColor;
bool H6ColorGlobalColor;
uint TextFontSize;
uint H1FontSize;
uint H2FontSize;
uint H3FontSize;
uint H4FontSize;
uint H5FontSize;
uint H6FontSize;
uint TDBeginSpace;
uint PBeginSpace;
uint LIBeginSpace;
uint ULBeginSpace;
uint LIIndent;
uint ULIndent;
float LineSpaceFontFactor;
std::string DefaultButtonGroup;
@ -180,8 +181,8 @@ namespace NLGUI
std::string DefaultRadioButtonBitmapNormal;
std::string DefaultRadioButtonBitmapPushed;
std::string DefaultRadioButtonBitmapOver;
// TODO: remove from interface xml and code
std::string DefaultBackgroundBitmapView;
std::string CurrentLinkTitle;
struct TFormField {
public:
@ -319,22 +320,16 @@ namespace NLGUI
void clearContext();
// Translate a char
bool translateChar(u32char &output, u32char input, u32char lastChar) const;
// return true if text has same style
bool isSameStyle(CViewLink *text, const CStyleParams &style) const;
// add text link using template
void newTextButton(const std::string &text, const std::string &tpl);
void newTextLink(const std::string &text);
bool translateChar(ucchar &output, ucchar input, ucchar lastChar) const;
// Add a string in the current paragraph
void addString(const std::string &str);
void addString(const ucstring &str);
// Add an image in the current paragraph
void addImage(const std::string &id, const std::string &img, bool reloadImg=false, const CStyleParams &style = CStyleParams());
// Add a text area in the current paragraph
CInterfaceGroup *addTextArea (const std::string &templateName, const char *name, uint rows, uint cols, bool multiLine, const std::string &content, uint maxlength);
CInterfaceGroup *addTextArea (const std::string &templateName, const char *name, uint rows, uint cols, bool multiLine, const ucstring &content, uint maxlength);
// Add a combo box in the current paragraph
CDBGroupComboBox *addComboBox(const std::string &templateName, const char *name);
@ -345,9 +340,6 @@ namespace NLGUI
const std::string &overBitmap, const char *actionHandler, const char *actionHandlerParams, const std::string &tooltip,
const CStyleParams &style = CStyleParams());
// Set the background color
void setupBackground(CSSBackgroundRenderer *bg);
// Set the background color
void setBackgroundColor (const NLMISC::CRGBA &bgcolor);
@ -358,9 +350,9 @@ namespace NLGUI
void flushString();
// Set the title
void setTitle (const ucstring &title);
void setTitle (const std::string &title);
std::string getTitle() const;
void setContainerTitle (const std::string &title);
// Lookup a url in local file system
bool lookupLocalFile (std::string &result, const char *url, bool isUrl);
@ -383,16 +375,7 @@ namespace NLGUI
// true if renderer is waiting for css files to finish downloading (link rel=stylesheet)
bool _WaitingForStylesheet;
// list of css file urls that are queued up for download
std::vector<CHtmlParser::StyleLink> _StylesheetQueue;
// <style> and downloaded <link rel=stylesheet> elements
std::vector<std::string> _HtmlStyles;
// background from <html> or <body> element
CSSBackgroundRenderer m_HtmlBackground;
CSSBackgroundRenderer m_BodyBackground;
// active table.tr background color from css or from bgcolor attribute
std::vector<NLMISC::CRGBA> m_TableRowBackgroundColor;
std::vector<std::string> _StylesheetQueue;
// Valid base href was found
bool _IgnoreBaseUrlTag;
@ -409,10 +392,10 @@ namespace NLGUI
bool _TrustedDomain;
// Title prefix
std::string _TitlePrefix;
ucstring _TitlePrefix;
// Title string
std::string _TitleString;
ucstring _TitleString;
// Need to browse next update coords..
bool _BrowseNextTime;
@ -661,7 +644,7 @@ namespace NLGUI
std::string Name;
// Variable value
std::string Value;
ucstring Value;
// Text area group
CInterfaceGroup *TextArea;
@ -762,7 +745,9 @@ namespace NLGUI
bool _Localize;
// Current node is a text area
bool _TextArea;
std::string _TextAreaTemplate;
ucstring _TextAreaContent;
std::string _TextAreaName;
uint _TextAreaRow;
uint _TextAreaCols;
@ -770,7 +755,7 @@ namespace NLGUI
// current mode is in select option
bool _SelectOption;
std::string _SelectOptionStr;
ucstring _SelectOptionStr;
// Current node is a object
std::string _ObjectType;
@ -780,7 +765,7 @@ namespace NLGUI
std::string _TextAreaScript;
// Get last char
u32char getLastChar() const;
ucchar getLastChar() const;
// Current link view
class CViewLink *_CurrentViewLink;
@ -841,110 +826,49 @@ namespace NLGUI
void spliceFragment(std::list<CHtmlElement>::iterator src);
// decode all HTML entities
static std::string decodeHTMLEntities(const std::string &str);
class CDataDownload : public ICurlDownloadCB
{
public:
CDataDownload(const std::string &u, const std::string &d)
: ICurlDownloadCB(u), data(NULL), fp(NULL), dest(d), redirects(0), ConnectionTimeout(60)
{}
virtual ~CDataDownload();
public:
CCurlWWWData *data;
std::string dest;
std::string tmpdest;
uint32 redirects;
FILE *fp;
uint32 ConnectionTimeout;
};
static ucstring decodeHTMLEntities(const ucstring &str);
class StylesheetDownloadCB : public CDataDownload
struct CDataImageDownload
{
public:
StylesheetDownloadCB(const std::string &url, const std::string &dest, CGroupHTML *parent)
: CDataDownload(url, dest), Parent(parent)
{}
virtual void finish() NL_OVERRIDE;
private:
CGroupHTML *Parent;
};
class ImageDownloadCB : public CDataDownload
{
public:
struct SImageInfo
{
SImageInfo(CViewBase *img, const CStyleParams &style, TImageType type)
: Image(img), Style(style), Type(type)
{}
CViewBase *Image;
CStyleParams Style;
TImageType Type;
};
ImageDownloadCB(const std::string &url, const std::string &dest, CViewBase *img, const CStyleParams &style, TImageType type, CGroupHTML *parent)
: CDataDownload(url, dest), Parent(parent)
CDataImageDownload(CViewBase *img, CStyleParams style, TImageType type): Image(img), Style(style), Type(type)
{
addImage(img, style, type);
}
virtual void finish() NL_OVERRIDE;
void addImage(CViewBase *img, const CStyleParams &style, TImageType type);
void removeImage(CViewBase *img);
private:
std::vector<SImageInfo> Images;
CGroupHTML *Parent;
public:
CViewBase * Image;
CStyleParams Style;
TImageType Type;
};
class TextureDownloadCB : public CDataDownload
struct CDataDownload
{
public:
TextureDownloadCB(const std::string &url, const std::string &dest, sint32 texId, CViewBase *view)
: CDataDownload(url, dest)
CDataDownload(const std::string &u, const std::string &d, TDataType t, CViewBase *i, const std::string &s, const std::string &m, const CStyleParams &style = CStyleParams(), const TImageType imagetype = NormalImage)
: data(NULL), fp(NULL), url(u), dest(d), type(t), luaScript(s), md5sum(m), redirects(0), ConnectionTimeout(60)
{
addTexture(texId, view);
if (t == ImgType) imgs.push_back(CDataImageDownload(i, style, imagetype));
}
~CDataDownload();
virtual void finish() NL_OVERRIDE;
void addTexture(sint32 texId, CViewBase *view) {
TextureIds.push_back(std::make_pair(texId, view));
}
private:
std::vector<std::pair<sint32, CViewBase *> > TextureIds;
};
class BnpDownloadCB : public CDataDownload
{
public:
BnpDownloadCB(const std::string &url, const std::string &dest, const std::string md5sum, const std::string lua, CGroupHTML *parent)
: CDataDownload(url, dest), Parent(parent), m_md5sum(md5sum), m_lua(lua)
{}
virtual void finish() NL_OVERRIDE;
private:
CGroupHTML *Parent;
std::string m_md5sum;
std::string m_lua;
CCurlWWWData *data;
std::string url;
std::string dest;
std::string luaScript;
std::string md5sum;
TDataType type;
uint32 redirects;
FILE *fp;
std::vector<CDataImageDownload> imgs;
uint32 ConnectionTimeout;
};
std::list<CDataDownload*> Curls;
std::list<CDataDownload> Curls;
CURLM *MultiCurl;
int RunningCurls;
bool startCurlDownload(CDataDownload *download);
void finishCurlDownload(CDataDownload *download);
bool startCurlDownload(CDataDownload &download);
void finishCurlDownload(const CDataDownload &download);
void pumpCurlQueue();
void initImageDownload();
@ -965,17 +889,16 @@ namespace NLGUI
std::string localBnpName(const std::string &url);
// add css file from <link href=".." rel="stylesheet"> to download queue
void addStylesheetDownload(std::vector<CHtmlParser::StyleLink> links);
void addStylesheetDownload(std::vector<std::string> links);
// stop all curl downalods (html and data)
void releaseDownloads();
void releaseDataDownloads();
void checkDownloads();
// _CurlWWW download finished
void htmlDownloadFinished(bool success, const std::string &error);
// images, stylesheets, etc finished downloading
void dataDownloadFinished(bool success, const std::string &error, CDataDownload *data);
void dataDownloadFinished(bool success, const std::string &error, CDataDownload &data);
// HtmlType download finished
void htmlDownloadFinished(const std::string &content, const std::string &type, long code);
@ -992,6 +915,9 @@ namespace NLGUI
// :before, :after rendering
void renderPseudoElement(const std::string &pseudo, const CHtmlElement &elm);
// apply background from current style (for html, body)
void applyBackground(const CHtmlElement &elm);
void insertFormImageButton(const std::string &name,
const std::string &tooltip,
const std::string &src,
@ -1071,9 +997,11 @@ namespace NLGUI
void htmlTD(const CHtmlElement &elm);
void htmlTDend(const CHtmlElement &elm);
void htmlTEXTAREA(const CHtmlElement &elm);
void htmlTEXTAREAend(const CHtmlElement &elm);
void htmlTH(const CHtmlElement &elm);
void htmlTHend(const CHtmlElement &elm);
void htmlTITLE(const CHtmlElement &elm);
void htmlTITLEend(const CHtmlElement &elm);
void htmlTR(const CHtmlElement &elm);
void htmlTRend(const CHtmlElement &elm);
//void htmlU(const CHtmlElement &elm);

@ -3,7 +3,6 @@
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -68,13 +67,13 @@ namespace NLGUI
* \param line : text to be added
* \param color : text color
*/
void addTextChild (const std::string& line,const NLMISC::CRGBA &textColor, bool multiLine = true);
void addTextChild (const ucstring& line,const NLMISC::CRGBA &textColor, bool multiLine = true);
/**
* add a text child element to the group, using the text template
* \param line : text to be added
*/
void addTextChild (const std::string& line, bool multiLine = true);
void addTextChild (const ucstring& line, bool multiLine = true);
/// Same as adding a text child but the text will be taken from the string manager
void addTextChildID (uint32 id, bool multiLine = true);

@ -3,7 +3,7 @@
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2014-2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
// Copyright (C) 2014 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -122,12 +122,12 @@ namespace NLGUI
// retrieve the index of a line from its id (-1 if not found)
sint getLineFromId(const std::string &id);
CViewTextMenu* addLine (const std::string &name, const std::string &ah,
CViewTextMenu* addLine (const ucstring &name, const std::string &ah,
const std::string &params, const std::string &id="",
const std::string &cond = std::string(), const std::string &texture="",
bool checkable = false, bool checked = false, bool formatted = false
);
CViewTextMenu* addLineAtIndex(uint index, const std::string &name, const std::string &ah,
CViewTextMenu* addLineAtIndex(uint index, const ucstring &name, const std::string &ah,
const std::string &params, const std::string &id="",
const std::string &cond = std::string(), const std::string &texture="",
bool checkable = false, bool checked = false, bool formatted = false
@ -332,7 +332,12 @@ namespace NLGUI
virtual void setActive (bool state);
virtual bool isWindowUnder (sint32 x, sint32 y);
// add line with a string, for backward compatibility
void addLine (const std::string &name, const std::string &ah, const std::string &params,
const std::string &id = std::string(),
const std::string &cond = std::string(), const std::string &texture="",
bool checkable = false, bool checked = false);
uint getNumLine() const;
void deleteLine(uint index);
const std::string getActionHandler(uint lineIndex) const;
@ -345,12 +350,12 @@ namespace NLGUI
void setRightClickHandler(uint lineIndex, const std::string &ah = "");
void setRightClickHandlerParam(uint lineIndex, const std::string &params = "");
void addLine (const std::string &name, const std::string &ah = "", const std::string &params = "",
void addLine (const ucstring &name, const std::string &ah = "", const std::string &params = "",
const std::string &id = std::string(),
const std::string &cond = std::string(), const std::string &texture="",
bool checkable = false, bool checked = false
);
void addLineAtIndex (uint index, const std::string &name, const std::string &ah = "", const std::string &params = "",
void addLineAtIndex (uint index, const ucstring &name, const std::string &ah = "", const std::string &params = "",
const std::string &id = std::string(),
const std::string &cond = std::string(), const std::string &texture="",
bool checkable = false, bool checked = false

@ -1,9 +1,8 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2021 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -55,8 +54,6 @@ namespace NLGUI
Right
};
enum TTextAlign { AlignLeft = 0, AlignCenter, AlignRight, AlignJustify };
///constructor
CGroupParagraph(const TCtorParam &param);
@ -87,21 +84,19 @@ namespace NLGUI
* \param line : text to be added
* \param color : text color
*/
void addTextChild (const std::string& line,const NLMISC::CRGBA &textColor, bool multiLine = true);
void addTextChild (const ucstring& line,const NLMISC::CRGBA &textColor, bool multiLine = true);
/**
* add a text child element to the group, using the text template
* \param line : text to be added
*/
void addTextChild (const std::string& line, bool multiLine = true);
void addTextChild (const ucstring& line, bool multiLine = true);
/// Same as adding a text child but the text will be taken from the string manager
void addTextChildID (uint32 id, bool multiLine = true);
// the same, but with id taken from the database
void addTextChildID (const std::string &dbPath, bool multiLine = true);
void setTextAlign(const TTextAlign align) { _TextAlign = align; }
protected:
void delChild (CViewBase* child);
@ -275,9 +270,6 @@ namespace NLGUI
// (the element drawn are stored in _views, _contrlos or _childrengroups of cinterfacegroup
std::vector<CElementInfo> _Elements;
// Horizontal align for elements
TTextAlign _TextAlign;
// Last parent width
sint32 _LastW;

@ -1,5 +1,5 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2015 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>

@ -1,5 +1,5 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2019 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
@ -31,7 +31,6 @@
namespace NLGUI
{
class CSSBorderRenderer;
class CSSBackgroundRenderer;
/**
* This group is used to simulate HTML cells.
@ -95,10 +94,22 @@ namespace NLGUI
// Memorize max width
sint32 WidthMax;
// The cell color
NLMISC::CRGBA BgColor;
CSSBorderRenderer* Border;
CSSBackgroundRenderer *Background;
uint32 PaddingTop, PaddingRight, PaddingBottom, PaddingLeft;
// Texture
CViewRenderer::CTextureId _TextureId;
bool _TextureTiled;
bool _TextureScaled;
// cached absolute coords for background texture
sint32 _TextureXReal;
sint32 _TextureYReal;
sint32 _TextureWReal;
sint32 _TextureHReal;
// Alignment
TAlign Align;
TVAlign VAlign;
@ -110,7 +121,6 @@ namespace NLGUI
// The cell is nowrap
bool NoWrap;
// deprecated background image
void setTexture(const std::string & TxName);
void setTextureTile(bool tiled);
void setTextureScale(bool scaled);
@ -124,6 +134,8 @@ namespace NLGUI
static bool getDebugUICell(){ return DebugUICell; }
private:
void updateTextureCoords();
void setEnclosedGroupDefaultParams();
static bool DebugUICell;
};
@ -152,18 +164,18 @@ namespace NLGUI
sint32 ForceWidthMin;
CSSBorderRenderer* Border;
CSSBackgroundRenderer *Background;
// Cell has 1px solid border when <table> has 'border' attribute with width > 0
bool CellBorder;
sint32 CellPadding;
sint32 CellSpacing;
// The table color
NLMISC::CRGBA BgColor;
uint8 CurrentAlpha;
bool ContinuousUpdate;
// deprecated background image
void setTexture(const std::string & TxName);
void setTextureTile(bool tiled);
void setTextureScale(bool scaled);
@ -189,6 +201,18 @@ namespace NLGUI
virtual bool parse (xmlNodePtr cur, CInterfaceGroup * parentGroup);
// Texture
CViewRenderer::CTextureId _TextureId;
bool _TextureTiled;
bool _TextureScaled;
// cached absolute coords for background texture
sint32 _TextureXReal;
sint32 _TextureYReal;
sint32 _TextureWReal;
sint32 _TextureHReal;
void updateTextureCoords();
// Content validated
bool _ContentValidated;

@ -1,9 +1,8 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2017 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -61,7 +60,7 @@ namespace NLGUI
bool Show; // If false, the node is not displayed (true default, Root ignored)
sint32 YDecal;
// Text
std::string Text; // Internationalized displayed text
ucstring Text; // Internationalized displayed text
sint32 FontSize; // If -1 (default), then take the groupTree one
NLMISC::CRGBA Color;
// Template
@ -113,12 +112,8 @@ namespace NLGUI
std::string getBitmap() const { return Bitmap; }
void setOpened(bool opened) { Opened = opened; }
bool getOpened() const { return Opened; }
void setText(const std::string &text) { Text = text; }
const std::string& getText() const { return Text; }
#ifdef RYZOM_LUA_UCSTRING
void setTextAsUtf16(const ucstring &text) { Text = text.toUtf8(); } // Compatibility
ucstring getTextAsUtf16() const { return ucstring::makeFromUtf8(Text); } // Compatibility
#endif
void setText(const ucstring &text) { Text = text; }
const ucstring& getText() const { return Text; }
sint32 getFontSize() const { return FontSize; }
void setFontSize(sint32 value) { FontSize = value; }
sint32 getYDecal() const { return YDecal; }
@ -186,11 +181,7 @@ namespace NLGUI
REFLECT_STRING("AHParamsClose", getAHParamsClose, setAHParamsClose);
REFLECT_BOOL("Opened", getOpened, setOpened);
REFLECT_BOOL("Show", getShow, setShow);
#ifdef RYZOM_LUA_UCSTRING
REFLECT_UCSTRING("Text", getTextAsUtf16, setTextAsUtf16); // Compatibility
#else
REFLECT_STRING_REF("Text", getText, setText);
#endif
REFLECT_UCSTRING_REF("Text", getText, setText);
// lua
REFLECT_LUA_METHOD("getNumChildren", luaGetNumChildren);
REFLECT_LUA_METHOD("getChild", luaGetChild);

@ -1,5 +1,5 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2021 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -75,18 +75,6 @@ namespace NLGUI
// update Children index/parent/next/prevSibling pointers
void reindexChilds();
// escape text tag or attribute value
std::string htmlEscape(const std::string &val) const;
// serialize element attributes as string
std::string serializeAttributes(bool escape = true) const;
// serialize child elements as html string
std::string serializeChilds(bool escape = true) const;
// serialize itself and children as html string
std::string serialize(bool escape = true) const;
// debug
std::string toString(bool tree = false, uint depth = 0) const;
@ -96,9 +84,6 @@ namespace NLGUI
TStyle getPseudo(const std::string &key) const;
void setPseudo(const std::string &key, const TStyle &style);
// return lang property for css :lang() pseudo class
std::string getInheritedLanguage() const;
private:
// pseudo elements like ":before" and ":after"
std::map<std::string, TStyle> _Pseudo;

@ -1,5 +1,5 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2021 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -19,9 +19,6 @@
#include "nel/misc/types_nl.h"
// Forward declarations for libxml2
typedef struct _xmlNode xmlNode;
namespace NLGUI
{
class CHtmlElement;
@ -34,23 +31,14 @@ namespace NLGUI
class CHtmlParser
{
public:
// <link rel=stylesheet>
struct StyleLink
{
uint Index;
std::string Url;
StyleLink(uint i, const std::string &url) : Index(i), Url(url)
{ }
};
bool parseHtml(std::string htmlString) const;
// parse html string into DOM, extract <style> and <link stylesheet> urls
void getDOM(std::string htmlString, CHtmlElement &parent, std::vector<std::string> &styles, std::vector<StyleLink> &links) const;
// parse html string into DOM, extract <style> tags into styleString, <link stylesheet> urls into links
void getDOM(std::string htmlString, CHtmlElement &parent, std::string &styleString, std::vector<std::string> &links) const;
private:
// iterate over libxml html tree, build DOM
void parseNode(xmlNode *a_node, CHtmlElement &parent, std::vector<std::string> &styles, std::vector<StyleLink> &links) const;
// iterate over libxml html tree, build DOM, and join all <style> tags together
void parseNode(xmlNode *a_node, CHtmlElement &parent, std::string &styleString, std::vector<std::string> &links) const;
// read <style> tag and add its content to styleString
void parseStyle(xmlNode *a_node, std::string &styleString) const;

@ -1,5 +1,5 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2017 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as

@ -1,5 +1,5 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2017 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2018 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>

@ -1,9 +1,8 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2018 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013-2014 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2019 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as

@ -3,7 +3,6 @@
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -60,15 +59,16 @@ namespace NLGUI
bool getBool() const;
sint64 getInteger() const;
double getDouble() const;
const std::string &getString() const;
std::string getString() const;
NLMISC::CRGBA getRGBA() const;
const ucstring &getUCString() const;
CInterfaceExprUserType *getUserType() const;
// set
void setBool(bool value) { clean(); _Type = Boolean; _BoolValue = value; }
void setInteger(sint64 value) { clean(); _Type = Integer; _IntegerValue = value; }
void setDouble(double value) { clean(); _Type = Double; _DoubleValue = value; }
void setString(const std::string &value) { clean(); _Type = String; _StringValue = value; }
void setString(const char *value) { clean(); _Type = String; _StringValue = value; }
void setUCString(const ucstring &value) { clean(); _Type = String; _StringValue = value; }
void setRGBA(NLMISC::CRGBA value) { clean(); _Type = RGBA; _RGBAValue = (uint32)(value.R+(value.G<<8)+(value.B<<16)+(value.A<<24)); }
void setUserType(CInterfaceExprUserType *value);
// reset this object to initial state (no type)
@ -99,7 +99,7 @@ namespace NLGUI
CInterfaceExprUserType *_UserTypeValue;
uint32 _RGBAValue;
};
std::string _StringValue; // well, can't fit in union, unless we do some horrible hack..
ucstring _StringValue; // well, can't fit in union, unless we do some horrible hack..
private:
const char *evalBoolean(const char *expr);
const char *evalNumber(const char *expr);

@ -3,7 +3,6 @@
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013-2014 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2019 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as

@ -1,5 +1,5 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2019 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013-2015 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
@ -184,7 +184,7 @@ namespace NLGUI
// ***************************************************************************
// Read a CSS length value, return true if one of supported units '%, rem, em, px, pt'
// On failure: 'value' and 'unit' values are undefined
bool getCssLength (float &value, std::string &unit, const std::string &str, bool neg = false);
bool getCssLength (float &value, std::string &unit, const std::string &str);
// Read a width HTML parameter. "100" or "100%". Returns true if percent (0 ~ 1) else false
bool getPercentage (sint32 &width, float &percent, const char *str);

@ -2,8 +2,8 @@
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
// Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2013-2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as

@ -2,7 +2,7 @@
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013-2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
// Copyright (C) 2013 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as

@ -3,7 +3,6 @@
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -87,12 +86,10 @@ namespace NLGUI
// ucstring
#ifdef RYZOM_LUA_UCSTRING
static bool pop(CLuaState &ls, ucstring &dest);
static void push(CLuaState &ls, const ucstring &value);
static bool isUCStringOnStack(CLuaState &ls, sint index);
static bool getUCStringOnStack(CLuaState &ls, sint index, ucstring &dest);
#endif
// RGBA
@ -111,9 +108,7 @@ namespace NLGUI
static void check(CLuaState &ls, bool ok, const std::string &failReason);
static void checkArgType(CLuaState &ls, const char *funcName, uint index, int argType);
static void checkArgTypeRGBA(CLuaState &ls, const char *funcName, uint index);
#ifdef RYZOM_LUA_UCSTRING
static void checkArgTypeUCString(CLuaState &ls, const char *funcName, uint index);
#endif
/** throw a lua expection (inside a C function called from lua) with the given reason, and the current call stack
* The various check... function call this function when their test fails
*/
@ -159,12 +154,10 @@ namespace NLGUI
static uint32 getLocalTime();
static double getPreciseLocalTime();
static std::string findReplaceAll(const std::string &str, const std::string &search, const std::string &replace);
#ifdef RYZOM_LUA_UCSTRING
static ucstring findReplaceAll(const ucstring &str, const ucstring &search, const ucstring &replace);
static ucstring findReplaceAll(const ucstring &str, const std::string &search, const std::string &replace);
static ucstring findReplaceAll(const ucstring &str, const std::string &search, const ucstring &replace);
static ucstring findReplaceAll(const ucstring &str, const ucstring &search, const std::string &replace);
#endif
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -190,10 +183,8 @@ namespace NLGUI
static int runExpr(CLuaState &ls); // params: "expr". return: any of: nil,bool,string,number, RGBA, UCString
static int runFct(CLuaState &ls); // params: "expr", param1, param2.... return: any of: nil,bool,string,number, RGBA, UCString
static int runCommand(CLuaState &ls); // params: "command name", param1, param2 ... return true or false
#ifdef RYZOM_LUA_UCSTRING
static int isUCString(CLuaState &ls);
static int concatUCString(CLuaState &ls); // workaround for + operator that don't work in luabind for ucstrings ...
#endif
static int concatString(CLuaState &ls); // speedup concatenation of several strings
static int tableToString(CLuaState &ls); // concat element of a table to build a string
static int getPathContent(CLuaState &ls);

@ -3,7 +3,6 @@
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2019-2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -42,13 +41,9 @@ namespace NLGUI
UInt32,
Float,
String,
#ifdef RYZOM_LUA_UCSTRING
UCString,
#endif
StringRef,
#ifdef RYZOM_LUA_UCSTRING
UCStringRef,
#endif
RGBA,
LuaMethod
}; // other types will be added when needed
@ -83,13 +78,9 @@ namespace NLGUI
TGetUInt32 GetUInt32;
TGetFloat GetFloat;
TGetString GetString;
#ifdef RYZOM_LUA_UCSTRING
TGetUCString GetUCString;
#endif
TGetStringRef GetStringRef;
#ifdef RYZOM_LUA_UCSTRING
TGetUCStringRef GetUCStringRef;
#endif
TGetRGBA GetRGBA;
TLuaMethod GetLuaMethod; // lua method can only be obtained, not written ...
} GetMethod;
@ -100,9 +91,7 @@ namespace NLGUI
TSetUInt32 SetUInt32;
TSetFloat SetFloat;
TSetString SetString;
#ifdef RYZOM_LUA_UCSTRING
TSetUCString SetUCString;
#endif
TSetRGBA SetRGBA;
} SetMethod;
// name of the property
@ -308,7 +297,6 @@ namespace NLGUI
props.push_back(prop); \
}
#ifdef RYZOM_LUA_UCSTRING
// export a unicode string value, by giving the name of the get and the set method
#define REFLECT_UCSTRING(exportName, getMethod, setMethod) \
{ \
@ -319,7 +307,6 @@ namespace NLGUI
prop.SetMethod.SetUCString = (CReflectedProperty::TSetUCString) static_cast<TSetUCStringa>(&A::setMethod); \
props.push_back(prop); \
}
#endif
// export a string value, by giving the name of the get and the set method
#define REFLECT_STRING_REF(exportName, getMethod, setMethod) \
@ -332,7 +319,6 @@ namespace NLGUI
props.push_back(prop); \
}
#ifdef RYZOM_LUA_UCSTRING
// export a unicode string value, by giving the name of the get and the set method
#define REFLECT_UCSTRING_REF(exportName, getMethod, setMethod) \
{ \
@ -343,7 +329,7 @@ namespace NLGUI
prop.SetMethod.SetUCString = (CReflectedProperty::TSetUCString) static_cast<TSetUCStringa>(&A::setMethod); \
props.push_back(prop); \
}
#endif
// export a color value, by giving the name of the get and the set method
#define REFLECT_RGBA(exportName, getMethod, setMethod) \

@ -3,7 +3,6 @@
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -22,9 +21,11 @@
#define STRING_CASE_H
#include "nel/misc/types_nl.h"
#include "nel/misc/ucstring.h"
namespace NLGUI
{
enum TCaseMode
{
CaseNormal = 0, // Nothing done
@ -36,7 +37,10 @@ namespace NLGUI
CaseCount
};
void setCase( std::string &str, TCaseMode mode );
void setCase( ucstring &str, TCaseMode mode );
}
#endif

@ -1,5 +1,5 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2016 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as

@ -1,5 +1,5 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2019 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
@ -28,7 +28,6 @@
namespace NLGUI
{
class ICurlDownloadCB;
/**
* class implementing a bitmap view
@ -62,7 +61,7 @@ namespace NLGUI
_TxtHeight = -1;
// Support for https://.. textures
_HtmlDownload = NULL;
_HtmlDownload = false;
}
/// Destructor
@ -142,9 +141,7 @@ namespace NLGUI
bool _Flip : 1;
bool _Tile : 1;
bool _InheritGCAlpha : 1;
// pointer to active curl download object
ICurlDownloadCB *_HtmlDownload;
bool _HtmlDownload : 1;
// For single texture

@ -1,5 +1,5 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2017 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>

@ -3,7 +3,6 @@
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -56,16 +55,13 @@ namespace NLGUI
bool getStringMode() const {return _StringMode;}
// Set cursor string
void setString (const std::string &str);
void setString (const ucstring &str);
// TEMP PATCH
void setCursor (const std::string &name)
{
if (_TxDefault != name)
{
_TxDefault = name;
_TxIdDefault = -2;
}
_TxDefault = name;
_TxIdDefault = -2;
}
// TEMP PATCH
@ -130,14 +126,14 @@ namespace NLGUI
bool _ForceStringMode;
CInterfaceGroup *_StringCursor;
CInterfaceGroup *_StringCursorHardware;
std::string _ContextString;
ucstring _ContextString;
// draw current cursor with the given texture, or, if in hardware mode, change the hardware cursor shape
void drawCursor(sint32 texId, NLMISC::CRGBA col, uint8 rot);
private:
// set the string into frame for software or hardware version
void setString(const std::string &str, CInterfaceGroup *target);
void setString (const ucstring &str, CInterfaceGroup *target);
static bool hwMouse;

@ -1,5 +1,5 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2020 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013-2014 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
@ -252,19 +252,6 @@ namespace NLGUI
*/
bool loadTextures (const std::string &textureFileName, const std::string &uvFileName, bool uploadDXTC);
/*
* newTextureId : Return new placeholder texture id.
* You should call deleteTexture when the texture is not used anymore.
*/
sint32 newTextureId (const std::string &name);
/*
* reloadTexture : Replace existing global texture with new.
* If previous was texture atlas and still used by 2+ textures,
* then create new global texture.
*/
void reloadTexture (sint32 texId, const std::string &name, bool uploadDXTC=true, bool bReleasable=true);
/*
* createTexture : create a texture for the interface, possibly from an externally created texture
* If no external texture is given, then 'sGlobalTextureName' is the filename of the big texture
@ -325,9 +312,6 @@ namespace NLGUI
/**
* get a texture file pointer from a string name. O(logN)
*
* FIXME: only works with textures in atlas loaded with loadTextures()
*
* \param id : the id of the texture
* \return a texture file pointer. -1 if not found or if sName is empty()
*/
@ -460,13 +444,9 @@ namespace NLGUI
SGlobalTexture ()
{
FromGlobaleTexture = true;
Scale = 1.f;
}
uint32 Width, Height;
uint32 DefaultWidth, DefaultHeight;
// used by texture atlas to unscale individual texture
// getTextureSizeFromId() calls to return 1x size for GUI.
float Scale;
NL3D::UTexture *Texture;
std::string Name;
bool FromGlobaleTexture;
@ -495,9 +475,6 @@ namespace NLGUI
// \name Texture management
// ***************************************************************************
bool loadTextureFromString(SGlobalTexture *gt, const std::string &data);
bool loadTextureFromFile(SGlobalTexture *gt, const std::string &filename);
// SImage accessors
SImage *getSImage(sint32 textureId)
{

@ -1,9 +1,9 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2019 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013-2014 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2014-2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
// Copyright (C) 2014 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -84,12 +84,7 @@ namespace NLGUI
/// Set
void setText(const std::string &text);
void setTextLocalized(const std::string &text, bool localized);
#ifdef RYZOM_LUA_UCSTRING
void setTextAsUtf16 (const ucstring &text); // Compatibility
#endif
void setLocalized(bool localized);
void setText (const ucstring &text);
void setFontName (const std::string &name);
void setFontSize (sint nFontSize, bool coef = true);
void setEmbolden (bool nEmbolden);
@ -100,10 +95,7 @@ namespace NLGUI
void setShadowColor (const NLMISC::CRGBA &color);
void setShadowOffset (sint x, sint y);
void setLineMaxW (sint nMaxW, bool invalidate=true);
void setOverflowText(const std::string &text) { _OverflowText = text; }
#ifdef RYZOM_LUA_UCSTRING
void setOverflowTextAsUtf16(const ucstring &text) { _OverflowText = text.toUtf8(); } // Compatibility
#endif
void setOverflowText(const ucstring &text) { _OverflowText = text; }
void setMultiLine (bool bMultiLine);
void setMultiLineSpace (sint nMultiLineSpace);
void setMultiLineMaxWOnly (bool state);
@ -119,13 +111,9 @@ namespace NLGUI
void enableStringSelection(uint start, uint end);
void disableStringSelection();
/// Get displayed text
std::string getText() const { return _Text; }
#ifdef RYZOM_LUA_UCSTRING
ucstring getTextAsUtf16() const; // Compatibility
ucstring getHardTextAsUtf16() const; // Compatibility
#endif
bool isLocalized() const { return _Localized; }
/// Get
ucstring getText() const { return _Text; }
sint getFontSize() const;
std::string getFontName() const { return _FontName; }
bool getEmbolden() { return _Embolden; }
@ -136,9 +124,7 @@ namespace NLGUI
NLMISC::CRGBA getShadowColor() { return _ShadowColor; }
void getShadowOffset(sint &x, sint &y) { x = _ShadowX; y = _ShadowY; }
sint getLineMaxW() const { return _LineMaxW; }
#ifdef RYZOM_LUA_UCSTRING
ucstring getOverflowTextAsUtf16() const { return _OverflowText; } // Compatibility
#endif
ucstring getOverflowText() const { return _OverflowText; }
bool getMultiLine() const { return _MultiLine; }
sint getMultiLineSpace() const { return _MultiLineSpace; }
bool getMultiLineMaxWOnly() const { return _MultiLineMaxWOnly; }
@ -188,12 +174,8 @@ namespace NLGUI
/// From a line number, get the character at which it ends (not including any '\n' ), or -1 if invalid
void getLineEndIndex(uint line, sint &index, bool &endOfPreviousLine) const;
/// If localized, return localization key (ie "uiLanguage"), else return displayed text.
std::string getHardText() const { return _HardText.empty() ? _Text : _HardText; }
void setHardText (const std::string &ht); //< Localizes strings starting with "ui"
#ifdef RYZOM_LUA_UCSTRING
void setHardTextAsUtf16(const ucstring &ht); // Compatibility
#endif
std::string getHardText() const { std::string result; _Text.toString (result); return result; }
void setHardText (const std::string &ht);
std::string getColorAsString() const;
void setColorAsString(const std::string &ht);
@ -206,15 +188,9 @@ namespace NLGUI
/** Setup a Text with Format Tags. Text is store without color/format tags, and special array is allocated for Format association
*/
void setTextFormatTaged(const std::string &text);
#ifdef RYZOM_LUA_UCSTRING
void setTextFormatTagedAsUtf16(const ucstring &text); // Compatibility
#endif
void setTextFormatTaged(const ucstring &text);
void setSingleLineTextFormatTaged(const std::string &text);
#ifdef RYZOM_LUA_UCSTRING
void setSingleLineTextFormatTagedAsUtf16(const ucstring &text); // Compatibility
#endif
void setSingleLineTextFormatTaged(const ucstring &text);
// Remove end space
void removeEndSpaces();
@ -240,17 +216,10 @@ namespace NLGUI
int luaSetLineMaxW(CLuaState &ls);
REFLECT_EXPORT_START(CViewText, CViewBase)
REFLECT_BOOL("localize", isLocalized, setLocalized);
REFLECT_STRING("hardtext", getHardText, setHardText); // Same as text, but localize is implicitly set true
REFLECT_STRING("text", getText, setText);
REFLECT_STRING("text_format", getText, setTextFormatTaged);
REFLECT_STRING("text_single_line_format", getText, setSingleLineTextFormatTaged);
#ifdef RYZOM_LUA_UCSTRING
// REFLECT_UCSTRING("uc_text", getTextAsUtf16, setTextAsUtf16); // Deprecate uc_ functions
REFLECT_UCSTRING("uc_hardtext", getHardTextAsUtf16, setHardTextAsUtf16); // Compatibility
REFLECT_UCSTRING("uc_hardtext_format", getTextAsUtf16, setTextFormatTagedAsUtf16); // Compatibility
REFLECT_UCSTRING("uc_hardtext_single_line_format", getTextAsUtf16, setSingleLineTextFormatTagedAsUtf16); // Compatibility
#endif
REFLECT_STRING("hardtext", getHardText, setHardText);
REFLECT_UCSTRING("uc_hardtext", getText, setText);
REFLECT_UCSTRING("uc_hardtext_format", getText, setTextFormatTaged);
REFLECT_UCSTRING("uc_hardtext_single_line_format", getText, setSingleLineTextFormatTaged);
REFLECT_STRING ("color", getColorAsString, setColorAsString);
REFLECT_RGBA ("color_rgba", getColorRGBA, setColorRGBA);
REFLECT_SINT32 ("alpha", getAlpha, setAlpha);
@ -259,6 +228,7 @@ namespace NLGUI
REFLECT_LUA_METHOD("setLineMaxW", luaSetLineMaxW);
REFLECT_EXPORT_END
virtual void serial(NLMISC::IStream &f);
// Sets the parent element
@ -266,12 +236,9 @@ namespace NLGUI
void setParentElm( CInterfaceElement *parent ){ _ParentElm = parent; }
protected:
std::string _HardtextFormat;
/// Text to display.
std::string _HardTextFormat;
std::string _HardText;
std::string _Text;
mutable sint _TextLength;
bool _Localized;
ucstring _Text;
/// index of the computed String associated to this text control
uint _Index;
/// info on the computed String associated to this text control
@ -283,13 +250,11 @@ namespace NLGUI
bool _FontSizeCoef;
bool _Embolden;
bool _Oblique;
// width of the font in pixel.
// width of the font in pixel. Just a Hint for tabing format (computed with '_')
float _FontWidth;
// width of tabs
float _TabWidth;
// strings to use when computing font size
std::string _FontSizingChars;
std::string _FontSizingFallback;
ucstring _FontSizingChars;
ucstring _FontSizingFallback;
// height of the font in pixel.
// use getFontHeight
float _FontHeight;
@ -313,7 +278,7 @@ namespace NLGUI
sint32 _LineMaxW;
/// For single line, true if the text is clamped (ie displayed with "...")
bool _SingleLineTextClamped;
std::string _OverflowText;
ucstring _OverflowText;
/// Multiple lines handling
bool _MultiLine;
@ -374,7 +339,7 @@ namespace NLGUI
public:
// default ctor
CWord(uint numSpaces = 0) : Index(0), NumSpaces(numSpaces) {}
std::string Text;
ucstring Text;
uint Index; // index of the info for this word
NL3D::UTextContext::CStringInfo Info;
uint NumSpaces; // number of spaces before this word
@ -382,7 +347,7 @@ namespace NLGUI
CFormatInfo Format;
public:
// build from a string, using the current text context
void build(const std::string &text, NL3D::UTextContext &textContext, uint numSpaces= 0);
void build(const ucstring &text, NL3D::UTextContext &textContext, uint numSpaces= 0);
};
typedef std::vector<CWord> TWordVect;
@ -395,7 +360,7 @@ namespace NLGUI
// Clear the line & remove text contexts
void clear(NL3D::UTextContext &textContext);
// Add a new word (and its context) in the line + a number of spaces to append at the end of the line
void addWord(const std::string &word, uint numSpaces, const CFormatInfo &wordFormat, float fontWidth, NL3D::UTextContext &textContext);
void addWord(const ucstring &word, uint numSpaces, const CFormatInfo &wordFormat, float fontWidth, NL3D::UTextContext &textContext);
void addWord(const CWord &word, float fontWidth);
uint getNumWords() const { return (uint)_Words.size(); }
CWord &getWord(uint index) { return _Words[index]; }
@ -469,17 +434,15 @@ namespace NLGUI
void setup ();
void setupDefault ();
void setTextLocalized(const std::string &text);
void setStringSelectionSkipingSpace(uint stringId, const std::string &text, sint charStart, sint charEnd);
void setStringSelectionSkipingSpace(uint stringId, const ucstring &text, sint charStart, sint charEnd);
// void pushString(const ucstring &str, bool deleteSpaceAtStart = false); // OLD
// void pushString(const ucstring &str, bool deleteSpaceAtStart = false);
/// \from CInterfaceElement
void onInvalidateContent();
// may append a new line, and append a word to the last line (no spaces)
void flushWordInLine(std::string &ucCurrentWord, bool &linePushed, const CFormatInfo &wordFormat);
void flushWordInLine(ucstring &ucCurrentWord, bool &linePushed, const CFormatInfo &wordFormat);
// Clear all the lines and free their datas
void clearLines();
// Update in the case of a multiline text
@ -493,7 +456,7 @@ namespace NLGUI
void addDontClipWordLine(std::vector<CWord> &currLine);
// FormatTag build.
static void buildFormatTagText(const std::string &text, std::string &textBuild, std::vector<CFormatTag> &formatTags, std::vector<std::string> &tooltips);
static void buildFormatTagText(const ucstring &text, ucstring &textBuild, std::vector<CFormatTag> &formatTags, std::vector<ucstring> &tooltips);
// FormatTag parsing.
bool isFormatTagChange(uint textIndex, uint ctIndex) const;
void getFormatTagChange(uint textIndex, uint &ctIndex, CFormatInfo &wordFormat) const;

@ -3,7 +3,6 @@
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -46,7 +45,7 @@ namespace NLGUI
{
public:
virtual ~IViewTextFormatter(){}
virtual std::string formatString( const std::string &inputString, const std::string &paramString ) = 0;
virtual ucstring formatString( const ucstring &inputString, const ucstring &paramString ) = 0;
};
CViewTextFormated (const TCtorParam &param) : CViewText(param)
@ -56,15 +55,15 @@ namespace NLGUI
xmlNodePtr serialize( xmlNodePtr parentNode, const char *type ) const;
virtual bool parse(xmlNodePtr cur, CInterfaceGroup * parentGroup);
virtual void checkCoords();
const std::string &getFormatString() const { return _FormatString; }
void setFormatString(const std::string &format);
const ucstring &getFormatString() const { return _FormatString; }
void setFormatString(const ucstring &format);
static std::string formatString(const std::string &inputString, const std::string &paramString);
static ucstring formatString(const ucstring &inputString, const ucstring &paramString);
static void setFormatter( IViewTextFormatter *formatter ){ textFormatter = formatter; }
private:
std::string _FormatString;
ucstring _FormatString;
static IViewTextFormatter *textFormatter;
};

@ -3,7 +3,6 @@
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -39,7 +38,7 @@ namespace NLGUI
public:
virtual ~IOnReceiveTextId() {}
// the deriver may change the input text
virtual void onReceiveTextId(std::string &str) =0;
virtual void onReceiveTextId(ucstring &str) =0;
};
// ***************************************************************************
@ -59,8 +58,8 @@ namespace NLGUI
{
public:
virtual ~IViewTextProvider(){}
virtual bool getString(uint32 stringId, std::string &result) = 0;
virtual bool getDynString(uint32 dynStringId, std::string &result) = 0;
virtual bool getString( uint32 stringId, ucstring &result ) = 0;
virtual bool getDynString( uint32 dynStringId, ucstring &result ) = 0;
};
CViewTextID(const TCtorParam &param) : CViewText(param)
@ -145,7 +144,7 @@ namespace NLGUI
// If true, setTextFormatted() is used instead of setText()
bool _IsTextFormatTaged;
// Optional utf-8 string modifier
// Optional ucstring modifier
IOnReceiveTextId *_StringModifier;
std::string _DBPath;
static IViewTextProvider* getTextProvider(){ return textProvider; }

@ -3,7 +3,6 @@
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -50,10 +49,10 @@ namespace NLGUI
xmlNodePtr serialize( xmlNodePtr parentNode, const char *type ) const;
virtual bool parse(xmlNodePtr cur, CInterfaceGroup * parentGroup);
virtual void checkCoords();
const std::string &getFormatString() const { return _FormatString; }
void setFormatString(const std::string &format);
const ucstring &getFormatString() const { return _FormatString; }
void setFormatString(const ucstring &format);
private:
std::string _FormatString;
ucstring _FormatString;
};
}

@ -1,9 +1,9 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010-2020 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
// Copyright (C) 2013-2014 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2013-2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -333,8 +333,8 @@ namespace NLGUI
void updateTooltipCoords(CCtrlBase *newCtrl);
/// for ContextHelp action handler only: set the result name
void setContextHelpText( const std::string &text ){ _ContextHelpText = text; }
std::string& getContextHelpText(){ return _ContextHelpText; }
void setContextHelpText( const ucstring &text ){ _ContextHelpText = text; }
ucstring& getContextHelpText(){ return _ContextHelpText; }
/// force disable the context help
void disableContextHelp();
@ -626,7 +626,7 @@ namespace NLGUI
SInterfaceTimes interfaceTimes;
std::string _ContextHelpText;
ucstring _ContextHelpText;
bool _ContextHelpActive;
bool inGame;

@ -1,5 +1,5 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010-2020 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as

@ -1,5 +1,5 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010-2015 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2016 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>

@ -96,7 +96,6 @@ public:
_Property = 0;
_oldProperty = 0;
_Type = UNKNOWN;
m_Nullable = false;
_Changed = false;
_LastChangeGC = 0;
}
@ -236,9 +235,6 @@ private:
/// property type
EPropType _Type;
/// nullable
bool m_Nullable;
/// true if this value has changed
bool _Changed;

@ -1,10 +1,10 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010-2020 Winch Gate Property Limited
// Copyright (C) 2010-2018 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2010 Matt RAYKOWSKI (sfb) <matt.raykowski@gmail.com>
// Copyright (C) 2010 Robert TIMM (rti) <mail@rtti.de>
// Copyright (C) 2015-2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
// Copyright (C) 2015-2019 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -227,62 +227,18 @@ inline double isValidDouble (double v)
* \param str a string to transform to lower case
*/
std::string toLower ( const char *str ); // UTF-8
std::string toLower ( const std::string &str ); // UTF-8
void toLower ( char *str ); // Ascii only
std::string toLower ( const char *str );
std::string toLower ( const std::string &str );
void toLower ( char *str );
char toLower ( const char ch ); // convert only one character
/** Convert a string in upper case.
* \param a string to transform to upper case
*/
std::string toUpper ( const char *str ); // UTF-8
std::string toUpper ( const std::string &str); // UTF-8
void toUpper ( char *str); // Ascii only
std::string toUpper ( const std::string &str);
void toUpper ( char *str);
/** Convert a single character in UTF-8 to upper or lowercase.
* \param res Character is appended in UTF-8 into this string.
* \param src Character is sourced from this UTF-8 string.
* \param i Index in `str`, incremented by the number of bytes read.
*/
void appendToLower(std::string &res, const char *str, ptrdiff_t &i);
void appendToLower(std::string &res, const std::string &str, ptrdiff_t &i);
void appendToUpper(std::string &res, const char *str, ptrdiff_t &i);
void appendToUpper(std::string &res, const std::string &str, ptrdiff_t &i);
void appendToTitle(std::string &res, const char *str, ptrdiff_t &i);
void appendToTitle(std::string &res, const std::string &str, ptrdiff_t &i);
/** UTF-8 case insensitive compare */
int compareCaseInsensitive(const char *a, const char *b);
int compareCaseInsensitive(const char *a, size_t lenA, const char *b, size_t lenB);
inline int compareCaseInsensitive(const std::string &a, const std::string &b) { return compareCaseInsensitive(&a[0], a.size(), &b[0], b.size()); }
inline bool ltCaseInsensitive(const std::string &a, const std::string &b) { return compareCaseInsensitive(&a[0], a.size(), &b[0], b.size()) < 0; }
std::string toCaseInsensitive(const char *str); // UTF-8, case-insensitive toLower
std::string toCaseInsensitive(const std::string &str); // UTF-8, case-insensitive toLower
/** ASCII to lowercase. Useful for internal identifiers.
* Characters outside of the 7-bit ASCII space, and control characters, are replaced.
*/
std::string toLowerAscii(const std::string &str, char replacement);
void toLowerAscii(char *str, char replacement);
/** ASCII to uppercase. Useful for internal identifiers.
* Characters outside of the 7-bit ASCII space, and control characters, are replaced.
*/
std::string toUpperAscii(const std::string &str, char replacement);
void toUpperAscii(char *str, char replacement);
/** ASCII to lowercase. Useful for internal identifiers.
* Characters outside of the 7-bit ASCII space are not affected.
*/
std::string toLowerAscii(const std::string &str);
void toLowerAscii(char *str);
/** ASCII to uppercase. Useful for internal identifiers.
* Characters outside of the 7-bit ASCII space are not affected.
*/
std::string toUpperAscii(const std::string &str);
void toUpperAscii(char *str);
/**
* Convert to an hexadecimal std::string

@ -2,7 +2,7 @@
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2015-2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
// Copyright (C) 2015 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -380,7 +380,7 @@ extern bool _assertex_stop_1(bool &ignoreNextTime);
#define nlassume(exp) do { } while (0)
#endif
#ifdef NL_NO_ASSERT
#ifdef NL_NO_DEBUG
# define nlassert(exp) nlassume(exp)
# define nlassertonce(exp) nlassume(exp)
# define nlassertex(exp, str) nlassume(exp)

@ -1,83 +0,0 @@
// NeL - MMORPG Framework <https://wiki.ryzom.dev/>
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef NLMISC_DEEP_PTR_H
#define NLMISC_DEEP_PTR_H
#include <nel/misc/types_nl.h>
namespace NLMISC {
/// Pointer template with deep copy and move semantics
template<class T>
class CDeepPtr
{
public:
NL_FORCE_INLINE CDeepPtr() : m(NULL) { } //< Null
NL_FORCE_INLINE ~CDeepPtr() { delete m; }
NL_FORCE_INLINE CDeepPtr(const CDeepPtr &p) : m(p.m ? new T(*p) : NULL) { } //< Copy operator
NL_FORCE_INLINE CDeepPtr &operator=(const CDeepPtr &p) { if (p.m) { if (!m) m = new T(*p); else *m = *p; } else { delete m; m = NULL; } return *this; } //< Copy operator
#ifdef NL_CPP14
NL_FORCE_INLINE CDeepPtr(CDeepPtr &&p) noexcept : m(p.m) { p.m = NULL; } //< Move operator
NL_FORCE_INLINE CDeepPtr &operator=(CDeepPtr &&p) noexcept { delete m; m = p.m; p.m = NULL; return *this; } //< Move operator
#endif
NL_FORCE_INLINE CDeepPtr(T *p) : m(p) { } //< Initializer
NL_FORCE_INLINE CDeepPtr &operator=(T *p) { delete m; m = p; return *this; } //< Initializer
NL_FORCE_INLINE bool operator==(const CDeepPtr &p) const { return /* (m == p.m) || */ (m && p.m && *m == *p); }
NL_FORCE_INLINE bool operator!=(const CDeepPtr &p) const { return !(*this == p); }
NL_FORCE_INLINE bool operator==(const T *p) const { return (m == p) || (m && p && *m == *p); }
NL_FORCE_INLINE bool operator!=(const T *p) const { return !(*this == p); }
NL_FORCE_INLINE bool operator==(const T &p) const { return (m == &p) || (m && *m == p); }
NL_FORCE_INLINE bool operator!=(const T &p) const { return !(*this == p); }
NL_FORCE_INLINE bool operator==(long int p) const { return (*this == (const T *)(ptrdiff_t)p); } //< == NULL
NL_FORCE_INLINE bool operator!=(long int p) const { return (*this != (const T *)(ptrdiff_t)p); } //< != NULL
NL_FORCE_INLINE bool operator==(int p) const { return (*this == (const T *)(ptrdiff_t)p); } //< == 0
NL_FORCE_INLINE bool operator!=(int p) const { return (*this != (const T *)(ptrdiff_t)p); } //< != 0
#ifdef NL_CPP14
NL_FORCE_INLINE bool operator==(nullptr_t p) const { return (*this == (const T *)(ptrdiff_t)p); } //< == nullptr
NL_FORCE_INLINE bool operator!=(nullptr_t p) const { return (*this != (const T *)(ptrdiff_t)p); } //< != nullptr
#endif
NL_FORCE_INLINE T &operator*() { return *m; }
NL_FORCE_INLINE const T &operator*() const { return *m; }
NL_FORCE_INLINE T *operator->() { return m; }
NL_FORCE_INLINE const T *operator->() const { return m; }
NL_FORCE_INLINE operator bool() const { return m; }
NL_FORCE_INLINE bool operator!() const { return !m; }
NL_FORCE_INLINE T *ptr() { return m; }
NL_FORCE_INLINE const T *ptr() const { return m; }
private:
T *m;
};
} /* namespace NLMISC */
#endif /* #ifndef NLMISC_DEEP_PTR_H */
/* end of file */

@ -1,9 +1,6 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
@ -51,8 +48,8 @@ public:
/// From IEventEmitter. This call submitEvents on all the emitters
virtual void submitEvents(CEventServer &server, bool allWindows);
virtual bool copyTextToClipboard(const std::string &text);
virtual bool pasteTextFromClipboard(std::string &text);
virtual bool copyTextToClipboard(const ucstring &text);
virtual bool pasteTextFromClipboard(ucstring &text);
private:
typedef std::vector<std::pair<IEventEmitter *, bool> > TEmitterCont;

@ -1,9 +1,6 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
@ -323,11 +320,11 @@ public:
class CEventChar : public CEventKey
{
public:
CEventChar (u32char c, TKeyButton button, IEventEmitter* emitter) : CEventKey (button, emitter, EventCharId), _Raw(true)
CEventChar (ucchar c, TKeyButton button, IEventEmitter* emitter) : CEventKey (button, emitter, EventCharId), _Raw(true)
{
Char=c;
}
u32char Char;
ucchar Char;
virtual CEvent *clone() const {return new CEventChar(*this);}
void setRaw( bool raw ) { _Raw = raw; }
@ -344,11 +341,11 @@ private:
class CEventString : public CEventKey
{
public:
CEventString (const std::string &str, IEventEmitter* emitter) : CEventKey (noKeyButton, emitter, EventStringId)
CEventString (const ucstring &str, IEventEmitter* emitter) : CEventKey (noKeyButton, emitter, EventStringId)
{
String = str;
}
std::string String;
ucstring String;
virtual CEvent *clone() const {return new CEventString(*this);}
};

@ -1,9 +1,6 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010-2019 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
@ -61,8 +58,12 @@ public:
static CFactory &instance()
{
// Singleton instance pointer.
static CFactory instance;
return instance;
static CFactory *instance = NULL;
if (!instance)
{
instance = new CFactory();
}
return *instance;
}
/** Register a factorable object in the factory.
@ -184,8 +185,12 @@ public:
/// Get the singleton instance reference.
static CFactoryIndirect &instance()
{
static CFactoryIndirect instance;
return instance;
static CFactoryIndirect *instance = NULL;
if (!instance)
{
instance = new CFactoryIndirect();
}
return *instance;
}
void registerClass(const KeyType &key, IFactoryIndirectRegister<BaseFactoryClass> *factoryRegister)

@ -1,8 +1,5 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010-2019 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as

@ -2,7 +2,7 @@
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2014-2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
// Copyright (C) 2014 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -107,7 +107,6 @@ private:
uint _NumBlockPerChunk;
//
uint _NumAlloc;
uint8 *_SpareMem;
};
} // NLMISC

@ -3,7 +3,6 @@
//
// This source file has been modified by the following contributors:
// Copyright (C) 2012 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
// Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
@ -100,7 +99,7 @@ public:
/// Return a vector with all language available. The vector contains the name of the language.
/// The index in the vector is used in \c load() function
static const std::vector<std::string> &getLanguageNames();
static const std::vector<ucstring> &getLanguageNames();
/** Return a vector with all language code available.
* Code are ISO 639-2 compliant.
@ -123,7 +122,7 @@ public:
static void loadFromFilename (const std::string &filename, bool reload);
/// Returns the name of the language in the language name (English, Francais, ...)
static std::string getCurrentLanguageName ();
static ucstring getCurrentLanguageName ();
/// Returns the code of the language ("fr", "en", ...)
static std::string getCurrentLanguageCode ();
@ -135,10 +134,7 @@ public:
static bool setSystemLanguageCode (const std::string &languageCode);
/// Find a string in the selected language and return his association.
static const ucstring &getAsUtf16 (const std::string &label);
/// Find a string in the selected language and return his association.
static const std::string &get (const std::string &label);
static const ucstring &get (const std::string &label);
// Test if a string has a translation in the selected language.
// NB : The empty string is considered to have a translation
@ -223,28 +219,24 @@ public:
private:
typedef std::map<std::string, std::string> StrMapContainer;
typedef std::map<std::string, ucstring> StrMapContainer16;
typedef std::map<std::string, ucstring> StrMapContainer;
static ILoadProxy *_LoadProxy;
static StrMapContainer _StrMap;
static StrMapContainer16 _StrMap16;
static bool _StrMapLoaded;
// the alternative language that will be used if the sentence is not found in the original language
static StrMapContainer _StrMapFallback;
static StrMapContainer16 _StrMapFallback16;
static std::vector<std::string> _LanguageCodes;
static std::vector<std::string> _LanguageNames;
static std::vector<ucstring> _LanguageNames;
static std::string _SystemLanguageCode;
static bool _LanguagesNamesLoaded;
static std::string _SelectedLanguageCode;
static const ucstring _NotTranslatedValue16;
static const std::string _NotTranslatedValue;
static const ucstring _NotTranslatedValue;
/** Structure to hold contextual info during
* read of preprocessed file
@ -264,7 +256,7 @@ private:
/// Init _LanguageCodes and _LanguageNames
static void initLanguages();
static bool loadFileIntoMap(const std::string &filename, StrMapContainer &dest, StrMapContainer16 &dest16);
static bool loadFileIntoMap(const std::string &filename, StrMapContainer &dest);
/// The internal read function, it does the real job of readTextFile
static void _readTextFile(const std::string &filename,

@ -167,6 +167,10 @@ public:
* \param i : column index.
* \param j : line index.
*/
void setFlags();
void setCoefficient(float coeff, sint i, sint j)
{
M[ (j<<2) + i] = coeff;
@ -361,6 +365,9 @@ public:
/// Plane (line vector) multiplication.
friend CPlane operator*(const CPlane &p, const CMatrix &m);
void frustum(float left, float right, float bottom, float top, float znear, float zfar );
void ortho(float left, float right, float bottom, float top, float znear, float zfar );
private:
float M[16];

@ -1,5 +1,5 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010-2020 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2014-2015 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
@ -731,18 +731,11 @@ struct CFile
static bool createDirectoryTree(const std::string &dirname);
/** Try to set the file access to read/write if not already set.
* On linux/macOS also set +x on directory.
* return true if the file doesn't exist or if the file already have RW access.
* \return true if RW access is granted
*/
static bool setRWAccess(const std::string &filename);
/** Try to set +x bit on linux/macOS to make file executable. no-op on Windows
* On Windows, always returns true, even if file does not exist.
* \return true if file exists and +x was set, false if operation failed.
*/
static bool setExecutable(const std::string &filename);
/** Delete a file if possible (change the write access if possible)
* \return true if the delete occurs.
*/

@ -1,5 +1,5 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010-2019 Winch Gate Property Limited
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2013 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>

@ -2,7 +2,7 @@
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2019-2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
// Copyright (C) 2019 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as

@ -2,7 +2,7 @@
// Copyright (C) 2010 Winch Gate Property Limited
//
// This source file has been modified by the following contributors:
// Copyright (C) 2012-2019 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
// Copyright (C) 2012 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save